public SynchronizationType objectSynchronization(ObjectSynchronizationType value) { getObjectSynchronization().add(value); return this; }
/** * Create an instance of {@link SynchronizationType } * */ public SynchronizationType createSynchronizationType() { return new SynchronizationType(); }
/** * Creates a new {@code SynchronizationType} instance by deeply copying a given {@code SynchronizationType} instance. * * * @param o * The instance to copy. * @throws NullPointerException * if {@code o} is {@code null}. */ public SynchronizationType(final SynchronizationType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 super(); if (o == null) { throw new NullPointerException("Cannot create a copy of 'SynchronizationType' from 'null'."); } // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectSynchronizationSorterType this.objectSynchronizationSorter = ((o.objectSynchronizationSorter == null)?null:((o.getObjectSynchronizationSorter() == null)?null:o.getObjectSynchronizationSorter().clone())); // 'ObjectSynchronization' collection. if (o.objectSynchronization!= null) { copyObjectSynchronization(o.getObjectSynchronization(), this.getObjectSynchronization()); } }
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { ObjectSynchronizationSorterType theObjectSynchronizationSorter; theObjectSynchronizationSorter = this.getObjectSynchronizationSorter(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "objectSynchronizationSorter", theObjectSynchronizationSorter), currentHashCode, theObjectSynchronizationSorter); } { List<ObjectSynchronizationType> theObjectSynchronization; theObjectSynchronization = (((this.objectSynchronization!= null)&&(!this.objectSynchronization.isEmpty()))?this.getObjectSynchronization():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "objectSynchronization", theObjectSynchronization), currentHashCode, theObjectSynchronization); } return currentHashCode; }
private <F extends FocusType> ObjectSynchronizationDiscriminatorType determineObjectSynchronizationDiscriminatorType(SynchronizationContext<F> syncCtx, Task task, OperationResult subResult) throws SchemaException, ExpressionEvaluationException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException { SynchronizationType synchronizationType = syncCtx.getResource().asObjectable().getSynchronization(); if (synchronizationType == null) { return null; } ObjectSynchronizationSorterType divider = synchronizationType.getObjectSynchronizationSorter(); if (divider == null) { return null; } return evaluateSynchronizationDivision(divider, syncCtx, task, subResult); }
public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); }
public int hashCode() { final HashCodeStrategy strategy = DomAwareHashCodeStrategy.INSTANCE; return this.hashCode(null, strategy); }
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof SynchronizationType)) { return false; } if (this == object) { return true; } final SynchronizationType that = ((SynchronizationType) object); { ObjectSynchronizationSorterType lhsObjectSynchronizationSorter; lhsObjectSynchronizationSorter = this.getObjectSynchronizationSorter(); ObjectSynchronizationSorterType rhsObjectSynchronizationSorter; rhsObjectSynchronizationSorter = that.getObjectSynchronizationSorter(); if (!strategy.equals(LocatorUtils.property(thisLocator, "objectSynchronizationSorter", lhsObjectSynchronizationSorter), LocatorUtils.property(thatLocator, "objectSynchronizationSorter", rhsObjectSynchronizationSorter), lhsObjectSynchronizationSorter, rhsObjectSynchronizationSorter)) { return false; } } { List<ObjectSynchronizationType> lhsObjectSynchronization; lhsObjectSynchronization = (((this.objectSynchronization!= null)&&(!this.objectSynchronization.isEmpty()))?this.getObjectSynchronization():null); List<ObjectSynchronizationType> rhsObjectSynchronization; rhsObjectSynchronization = (((that.objectSynchronization!= null)&&(!that.objectSynchronization.isEmpty()))?that.getObjectSynchronization():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "objectSynchronization", lhsObjectSynchronization), LocatorUtils.property(thatLocator, "objectSynchronization", rhsObjectSynchronization), lhsObjectSynchronization, rhsObjectSynchronization)) { return false; } } return true; }
@NotNull static List<ObjectTypeRecord> extractFrom(SynchronizationType synchronization) { List<ObjectTypeRecord> rv = new ArrayList<>(); if (synchronization != null) { for (ObjectSynchronizationType objectSynchronization : synchronization.getObjectSynchronization()) { rv.add(new ObjectTypeRecord(objectSynchronization)); } } return rv; }
/** * Creates and returns a deep copy of this object. * * * @return * A deep copy of this object. */ @Override public SynchronizationType clone() { try { { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 final SynchronizationType clone = ((SynchronizationType) super.clone()); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectSynchronizationSorterType clone.objectSynchronizationSorter = ((this.objectSynchronizationSorter == null)?null:((this.getObjectSynchronizationSorter() == null)?null:this.getObjectSynchronizationSorter().clone())); // 'ObjectSynchronization' collection. if (this.objectSynchronization!= null) { clone.objectSynchronization = null; copyObjectSynchronization(this.getObjectSynchronization(), clone.getObjectSynchronization()); } return clone; } } catch (CloneNotSupportedException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError(e); } }
/** * Create an instance of {@link SynchronizationType } * */ public SynchronizationType createSynchronizationType() { return new SynchronizationType(); }
public static boolean isSynchronizationOpportunistic(ResourceType resourceType) { SynchronizationType synchronization = resourceType.getSynchronization(); if (synchronization == null) { return false; } if (synchronization.getObjectSynchronization().isEmpty()) { return false; } ObjectSynchronizationType objectSynchronizationType = synchronization.getObjectSynchronization().iterator().next(); if (objectSynchronizationType.isEnabled() != null && !objectSynchronizationType.isEnabled()) { return false; } Boolean isOpportunistic = objectSynchronizationType.isOpportunistic(); return isOpportunistic == null || isOpportunistic; }
/** * Create an instance of {@link SynchronizationType } * */ public SynchronizationType createSynchronizationType() { return new SynchronizationType(); }
@Nullable public static ObjectSynchronizationType findObjectSynchronization(@Nullable ResourceType resource, @Nullable ShadowKindType kind, @Nullable String intent) { if (resource == null || resource.getSynchronization() == null) { return null; } for (ObjectSynchronizationType def : resource.getSynchronization().getObjectSynchronization()) { if (fillDefault(kind).equals(fillDefault(def.getKind())) && fillDefault(intent).equals(fillDefault(def.getIntent()))) { return def; } } return null; }
public SynchronizationType beginSynchronization() { SynchronizationType value = new SynchronizationType(); synchronization(value); return value; }
return null; List<ObjectSynchronizationType> objectSynchronizations = synchronization.getObjectSynchronization(); if (objectSynchronizations.isEmpty()) { return null;
checkSynchronizationDuplicateObjectTypes(ctx, synchronization); int i = 1; for (ObjectSynchronizationType objectSync : resource.getSynchronization().getObjectSynchronization()) { checkObjectSynchronization(ctx, ItemPath.create(ResourceType.F_SYNCHRONIZATION, SynchronizationType.F_OBJECT_SYNCHRONIZATION, i), objectSync); i++;
private SynchronizationContext<UserType> createSynchronizationContext(File account, String correlationFilter, File resource, Task task, OperationResult result) throws SchemaException, IOException { ShadowType shadow = parseObjectType(account, ShadowType.class); ConditionalSearchFilterType query = PrismTestUtil.parseAtomicValue(new File(correlationFilter), ConditionalSearchFilterType.COMPLEX_TYPE); ResourceType resourceType = parseObjectType(resource, ResourceType.class); resourceType.getSynchronization().getObjectSynchronization().get(0).getCorrelation().clear(); resourceType.getSynchronization().getObjectSynchronization().get(0).getCorrelation().add(query); ObjectSynchronizationType objectSynchronizationType = resourceType.getSynchronization().getObjectSynchronization().get(0); PrismObject<SystemConfigurationType> systemConfiguration = systemObjectCache.getSystemConfiguration(result); assertNotNull("Unexpected null system configuration", systemConfiguration); SynchronizationContext<UserType> syncCtx = new SynchronizationContext<>(shadow.asPrismObject(), shadow.asPrismObject(), resourceType.asPrismObject(), null, task, result); syncCtx.setSystemConfiguration(systemConfiguration); syncCtx.setObjectSynchronization(objectSynchronizationType); syncCtx.setFocusClass(UserType.class); return syncCtx; }
resource = getObject(ResourceType.class, resourceOid, null, task, result).asObjectable(); if (resource.getSynchronization() == null || resource.getSynchronization().getObjectSynchronization().isEmpty()) { OperationResult subresult = result.createSubresult(IMPORT_ACCOUNTS_FROM_RESOURCE+".check"); subresult.recordWarning("No synchronization settings in "+resource+", import will probably do nothing"); LOGGER.warn("No synchronization settings in "+resource+", import will probably do nothing"); } else { ObjectSynchronizationType syncType = resource.getSynchronization().getObjectSynchronization().iterator().next(); if (syncType.isEnabled() != null && !syncType.isEnabled()) { OperationResult subresult = result.createSubresult(IMPORT_ACCOUNTS_FROM_RESOURCE+".check");
@SuppressWarnings("unchecked") @Test public void testEvaluateExpression() throws Exception { PrismObject<ShadowType> account = PrismTestUtil.parseObject(new File(TEST_FOLDER, "account.xml")); ShadowType accountType = account.asObjectable(); PrismObject<ResourceType> resource = PrismTestUtil.parseObject(new File(TEST_FOLDER_COMMON, "resource-dummy.xml")); ResourceType resourceType = resource.asObjectable(); accountType.setResource(resourceType); ObjectSynchronizationType synchronization = resourceType.getSynchronization().getObjectSynchronization().get(0); for (ConditionalSearchFilterType filter : synchronization.getCorrelation()){ MapXNode clauseXNode = filter.getFilterClauseXNode(); // key = q:equal, value = map (path + expression) RootXNode expressionNode = ((MapXNode) clauseXNode.getSingleSubEntry("filter value").getValue()) .getEntryAsRoot(new QName(SchemaConstants.NS_C, "expression")); ExpressionType expression = PrismTestUtil.getPrismContext().parserFor(expressionNode).parseRealValue(ExpressionType.class); LOGGER.debug("Expression: {}",SchemaDebugUtil.prettyPrint(expression)); OperationResult result = new OperationResult("testCorrelationRule"); String name = expressionHandler.evaluateExpression(accountType, expression, "test expression", null, result); LOGGER.info(result.debugDump()); assertEquals("Wrong expression result", "hbarbossa", name); } }