Skip to content

Commit

Permalink
MID-1949: Reconciliation of associations
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Jun 27, 2014
1 parent 5bf1b48 commit fc7c455
Show file tree
Hide file tree
Showing 8 changed files with 338 additions and 29 deletions.
Expand Up @@ -68,4 +68,12 @@ public boolean isExclusiveStrong() {
return BooleanUtils.isTrue(resourceObjectAssociationType.isExclusiveStrong());
}

public boolean isIgnored() {
return false; // todo implement!
}

public boolean isTolerant() {
return BooleanUtils.isNotFalse(resourceObjectAssociationType.isTolerant());
}

}
Expand Up @@ -232,6 +232,14 @@ public RefinedAssociationDefinition findEntitlementAssociation(QName name) {
return null;
}

public Collection<QName> getNamesOfAssociations() {
Collection<QName> names = new HashSet<QName>();
for (RefinedAssociationDefinition assocDef : getAssociations()) {
names.add(assocDef.getName());
}
return names;
}

public Collection<? extends QName> getNamesOfAssociationsWithOutboundExpressions() {
Collection<QName> names = new HashSet<QName>();
for (RefinedAssociationDefinition assocDef : getAssociations()) {
Expand All @@ -242,7 +250,7 @@ public Collection<? extends QName> getNamesOfAssociationsWithOutboundExpressions
return names;
}

public Collection<ResourceObjectPattern> getProtectedObjectPatterns() {
public Collection<ResourceObjectPattern> getProtectedObjectPatterns() {
if (protectedObjectPatterns == null) {
protectedObjectPatterns = new ArrayList<ResourceObjectPattern>();
}
Expand Down
Expand Up @@ -100,6 +100,7 @@ public abstract class SchemaConstants {
public static final QName C_SHADOW = new QName(NS_C, "shadow");
public static final QName C_SHADOW_TYPE = new QName(NS_C, "ShadowType");
public static final QName C_ATTRIBUTES = new QName(NS_C, "attributes");
public static final QName C_ASSOCIATION = new QName(NS_C, "association");
public static final QName C_CREDENTIALS_TYPE = new QName(NS_C, "CredentialsType");
public static final QName C_CREDENTIALS = new QName(NS_C, "credentials");
public static final QName C_ACTIVATION = new QName(NS_C, "activation");
Expand Down Expand Up @@ -133,6 +134,7 @@ public abstract class SchemaConstants {
public static final ItemPath PATH_ACTIVATION_VALID_TO = new ItemPath(C_ACTIVATION, ActivationType.F_VALID_TO);
public static final ItemPath PATH_ACTIVATION_DISABLE_REASON = new ItemPath(ShadowType.F_ACTIVATION, ActivationType.F_DISABLE_REASON);
public static final ItemPath PATH_ATTRIBUTES = new ItemPath(C_ATTRIBUTES);
public static final ItemPath PATH_ASSOCIATION = new ItemPath(C_ASSOCIATION);
public static final ItemPath PATH_TRIGGER = new ItemPath(ObjectType.F_TRIGGER);

public static final String NS_PROVISIONING = NS_MIDPOINT_PUBLIC + "/provisioning";
Expand Down
Expand Up @@ -5847,6 +5847,7 @@
</xsd:sequence>
<xsd:attribute name="id" type="xsd:long" use="optional"/>
</xsd:complexType>
<xsd:element name="shadowAssociation" type="tns:ShadowAssociationType" />

<xsd:complexType name="ShadowIdentifiersType">
<xsd:annotation>
Expand Down
Expand Up @@ -210,7 +210,7 @@ private void evaluateAssignment(EvaluatedAssignment evalAssignment, AssignmentPa
AssignmentPath assignmentPath, Task task, OperationResult result) throws SchemaException, ObjectNotFoundException, ExpressionEvaluationException, PolicyViolationException {
assertSource(source, evalAssignment);

LOGGER.trace("Evaluate assignment {} (eval costr: {})", assignmentPath, assignmentPathSegment.isEvaluateConstructions());
LOGGER.trace("Evaluate assignment {} (eval constr: {})", assignmentPath, assignmentPathSegment.isEvaluateConstructions());

AssignmentType assignmentType = assignmentPathSegment.getAssignmentType();

Expand Down
Expand Up @@ -139,7 +139,7 @@ public Collection<ResourceType> getResources(OperationResult result) throws Obje
public void evaluateConstructions(ObjectDeltaObject<F> focusOdo, Task task, OperationResult result) throws SchemaException, ExpressionEvaluationException, ObjectNotFoundException {
for (Construction<F> construction :constructions) {
construction.setUserOdo(focusOdo);
LOGGER.trace("Evaluating construction '{}' in {}", construction);
LOGGER.trace("Evaluating construction '{}' in {}", construction, construction.getSource());
construction.evaluate(task, result);
}
}
Expand Down
Expand Up @@ -43,10 +43,21 @@ public ItemValueWithOrigin(V propertyValue,
this.mapping = mapping;
this.construction = accountConstruction;
}


@Deprecated
public V getPropertyValue() {
return itemValue;
}

// the same as above, but with correct name
public V getItemValue() {
return itemValue;
}

// use with care
public void setItemValue(V value) {
this.itemValue = value;
}

public Mapping<?> getMapping() {
return mapping;
Expand Down

0 comments on commit fc7c455

Please sign in to comment.