public ItemName getName() { return ItemPathTypeUtil.asSingleNameOrFail(resourceObjectAssociationType.getRef()); }
default boolean containsAttributeDefinition(ItemPathType pathType) { QName segmentQName = ItemPathTypeUtil.asSingleNameOrFailNullSafe(pathType); return containsAttributeDefinition(segmentQName); }
if ((target == null || ItemPathTypeUtil.isEmpty(target.getPath())) && isExecute(policyItemDefinition)) { LOGGER.error("Target item path must be defined"); throw new SchemaException("Target item path must be defined");
private ResourceAttributeDefinitionType findAttributeDefinitionType(QName attrName, ResourceObjectTypeDefinitionType rOcDefType, String contextDescription) throws SchemaException { ResourceAttributeDefinitionType foundAttrDefType = null; for (ResourceAttributeDefinitionType attrDefType : rOcDefType.getAttribute()) { if (attrDefType.getRef() != null) { QName ref = ItemPathTypeUtil.asSingleNameOrFail(attrDefType.getRef()); if (QNameUtil.match(ref, attrName)) { if (foundAttrDefType == null) { foundAttrDefType = attrDefType; } else { throw new SchemaException("Duplicate definition of attribute " + ref + " in "+kind+" type " + rOcDefType.getIntent() + ", in " + contextDescription); } } } else { throw new SchemaException("Missing reference to the attribute schema definition in definition " + SchemaDebugUtil.prettyPrint(attrDefType) + " during processing of " + contextDescription); } } return foundAttrDefType; }
private void evaluateAssociations(Task task, OperationResult result) throws ExpressionEvaluationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, CommunicationException { associationMappings = new ArrayList<>(); for (ResourceObjectAssociationType associationDefinitionType : getConstructionType().getAssociation()) { QName assocName = ItemPathTypeUtil.asSingleNameOrFailNullSafe(associationDefinitionType.getRef()); if (assocName == null) { throw new SchemaException( "No association name (ref) in association definition in construction in " + getSource()); } MappingType outboundMappingType = associationDefinitionType.getOutbound(); if (outboundMappingType == null) { throw new SchemaException("No outbound section in definition of association " + assocName + " in construction in " + getSource()); } MappingImpl<PrismContainerValue<ShadowAssociationType>, PrismContainerDefinition<ShadowAssociationType>> assocMapping = evaluateAssociation(associationDefinitionType, task, result); if (assocMapping != null) { associationMappings.add(assocMapping); } } }
boolean foundDepartmentNumber = false; for (ResourceAttributeDefinitionType attributeDefinitionType : accountType.getAttribute()) { if ("description".equals(ItemPathTypeUtil.asSingleNameOrFail(attributeDefinitionType.getRef()).getLocalPart())) { foundDescription = true; MappingType outbound = attributeDefinitionType.getOutbound(); assertEquals("wrong expression evaluator element name for description", SchemaConstantsGenerated.C_VALUE, valueEvaluator.getName()); assertEquals("wrong expression evaluator actual type for description", RawType.class, valueEvaluator.getValue().getClass()); } else if ("departmentNumber".equals(ItemPathTypeUtil.asSingleNameOrFail(attributeDefinitionType.getRef()).getLocalPart())) { foundDepartmentNumber = true; MappingType outbound = attributeDefinitionType.getOutbound();
private void evaluateAttributes(Task task, OperationResult result) throws ExpressionEvaluationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, CommunicationException { attributeMappings = new ArrayList<>(); // LOGGER.trace("Assignments used for account construction for {} ({}): // {}", new Object[]{this.resource, // assignments.size(), assignments}); for (ResourceAttributeDefinitionType attribudeDefinitionType : getConstructionType().getAttribute()) { QName attrName = ItemPathTypeUtil.asSingleNameOrFailNullSafe(attribudeDefinitionType.getRef()); if (attrName == null) { throw new SchemaException( "No attribute name (ref) in attribute definition in account construction in " + getSource()); } if (!attribudeDefinitionType.getInbound().isEmpty()) { throw new SchemaException("Cannot process inbound section in definition of attribute " + attrName + " in account construction in " + getSource()); } MappingType outboundMappingType = attribudeDefinitionType.getOutbound(); if (outboundMappingType == null) { throw new SchemaException("No outbound section in definition of attribute " + attrName + " in account construction in " + getSource()); } MappingImpl<? extends PrismPropertyValue<?>, ? extends PrismPropertyDefinition<?>> attributeMapping = evaluateAttribute( attribudeDefinitionType, task, result); if (attributeMapping != null) { attributeMappings.add(attributeMapping); } } }
for (PrismContainerValue<ResourceAttributeDefinitionType> cval: attributeCont.getValues()) { ResourceAttributeDefinitionType attrType = cval.getValue(); if (ItemPathTypeUtil.asSingleNameOrFail(attrType.getRef()).getLocalPart().equals(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_WEAPON_NAME)) { oldAttrContainer = cval;
private <T> MappingImpl<PrismPropertyValue<T>, ResourceAttributeDefinition<T>> evaluateAttribute( ResourceAttributeDefinitionType attribudeDefinitionType, Task task, OperationResult result) throws ExpressionEvaluationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, CommunicationException { QName attrName = ItemPathTypeUtil.asSingleNameOrFailNullSafe(attribudeDefinitionType.getRef()); if (attrName == null) { throw new SchemaException("Missing 'ref' in attribute construction in account construction in "
private MappingImpl<PrismContainerValue<ShadowAssociationType>, PrismContainerDefinition<ShadowAssociationType>> evaluateAssociation( ResourceObjectAssociationType associationDefinitionType, Task task, OperationResult result) throws ExpressionEvaluationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, CommunicationException { QName assocName = ItemPathTypeUtil.asSingleNameOrFailNullSafe(associationDefinitionType.getRef()); if (assocName == null) { throw new SchemaException("Missing 'ref' in association in construction in " + getSource());