@NotNull @Override public ResourceAttributeDefinitionImpl<T> clone() { ResourceAttributeDefinitionImpl<T> clone = new ResourceAttributeDefinitionImpl<>(getName(), getTypeName(), getPrismContext()); copyDefinitionData(clone); return clone; }
@Override public RefinedAttributeDefinition<T> deepClone(Map<QName, ComplexTypeDefinition> ctdMap, Map<QName, ComplexTypeDefinition> onThisPath, Consumer<ItemDefinition> postCloneAction) { return (RefinedAttributeDefinition<T>) super.deepClone(ctdMap, onThisPath, postCloneAction); }
protected void extendToString(StringBuilder sb) { super.extendToString(sb); if (getNativeAttributeName()!=null) { sb.append(" native="); sb.append(getNativeAttributeName()); } if (getFrameworkAttributeName()!=null) { sb.append(" framework="); sb.append(getFrameworkAttributeName()); } if (returnedByDefault != null) { sb.append(" returnedByDefault="); sb.append(returnedByDefault); } }
@NotNull @Override public ResourceAttribute<T> instantiate() { return instantiate(getName()); }
private MutablePrismPropertyDefinition createResourceAttributeDefinition(QName elementName, QName typeName, PrismContext prismContext, XSAnnotation annotation) throws SchemaException { ResourceAttributeDefinitionImpl attrDef = new ResourceAttributeDefinitionImpl(elementName, typeName, prismContext); // nativeAttributeName Element nativeAttrElement = SchemaProcessorUtil.getAnnotationElement(annotation, MidPointConstants.RA_NATIVE_ATTRIBUTE_NAME); String nativeAttributeName = nativeAttrElement == null ? null : nativeAttrElement.getTextContent(); if (!StringUtils.isEmpty(nativeAttributeName)) { attrDef.setNativeAttributeName(nativeAttributeName); } // frameworkAttributeName Element frameworkAttrElement = SchemaProcessorUtil.getAnnotationElement(annotation, MidPointConstants.RA_FRAMEWORK_ATTRIBUTE_NAME); String frameworkAttributeName = frameworkAttrElement == null ? null : frameworkAttrElement.getTextContent(); if (!StringUtils.isEmpty(frameworkAttributeName)) { attrDef.setFrameworkAttributeName(frameworkAttributeName); } // returnedByDefault attrDef.setReturnedByDefault(SchemaProcessorUtil.getAnnotationBoolean(annotation, MidPointConstants.RA_RETURNED_BY_DEFAULT_NAME)); return attrDef; }
xloginDef.setNativeAttributeName("LOGIN"); containerDefinition.setDisplayNameAttribute(xloginDef.getName()); xpasswdDef.setNativeAttributeName("PASSWORD"); xSepDef.setProcessing(ItemProcessing.IGNORE);
private ResourceSchema createResourceSchema() { ResourceSchemaImpl schema = new ResourceSchemaImpl(SCHEMA_NAMESPACE, PrismTestUtil.getPrismContext()); // Property container ObjectClassComplexTypeDefinitionImpl containerDefinition = (ObjectClassComplexTypeDefinitionImpl) schema.createObjectClassDefinition("AccountObjectClass"); containerDefinition.setKind(ShadowKindType.ACCOUNT); containerDefinition.setDefaultInAKind(true); containerDefinition.setDisplayName("The Account"); containerDefinition.setNativeObjectClass("ACCOUNT"); // ... in it ordinary attribute - an identifier ResourceAttributeDefinition<String> icfUidDef = containerDefinition.createAttributeDefinition( SchemaTestConstants.ICFS_UID, DOMUtil.XSD_STRING); ((Collection)containerDefinition.getPrimaryIdentifiers()).add(icfUidDef); ResourceAttributeDefinitionImpl<String> xloginDef = containerDefinition.createAttributeDefinition("login", DOMUtil.XSD_STRING); xloginDef.setNativeAttributeName("LOGIN"); containerDefinition.setDisplayNameAttribute(xloginDef.getName()); // ... and local property with a type from another schema ResourceAttributeDefinitionImpl<String> xpasswdDef = containerDefinition.createAttributeDefinition("password", ProtectedStringType.COMPLEX_TYPE); xpasswdDef.setNativeAttributeName("PASSWORD"); // ... property reference // TODO this should not go here, as it is not a ResourceAttributeDefinition //containerDefinition.createAttributeDefinition(SchemaConstants.C_CREDENTIALS, SchemaConstants.C_CREDENTIALS_TYPE); return schema; }
public static <T> MutableResourceAttributeDefinition<T> createResourceAttributeDefinition(QName name, QName typeName, PrismContext prismContext) { return new ResourceAttributeDefinitionImpl<T>(name, typeName, prismContext); }
protected void copyDefinitionData(RefinedAttributeDefinitionImpl<T> clone) { super.copyDefinitionData(clone); clone.accessOverride = this.accessOverride.clone(); clone.description = this.description; clone.displayName = this.displayName; clone.fetchStrategy = this.fetchStrategy; clone.inboundMappingTypes = this.inboundMappingTypes; clone.intolerantValuePattern = this.intolerantValuePattern; clone.isExclusiveStrong = this.isExclusiveStrong; clone.isVolatilityTrigger = this.isVolatilityTrigger; clone.limitationsMap = this.limitationsMap; clone.matchingRuleQName = this.matchingRuleQName; clone.modificationPriority = this.modificationPriority; clone.outboundMappingType = this.outboundMappingType; clone.readReplaceMode = this.readReplaceMode; clone.secondaryIdentifierOverride = this.secondaryIdentifierOverride; clone.tolerant = this.tolerant; clone.tolerantValuePattern = this.tolerantValuePattern; }
@Override public String debugDump(int indent, LayerType layer) { StringBuilder sb = new StringBuilder(); sb.append(super.debugDump(indent)); if (layer == null) { sb.append("\n"); DebugUtil.debugDumpMapSingleLine(sb, limitationsMap, indent + 1); } else { PropertyLimitations limitations = limitationsMap.get(layer); if (limitations != null) { sb.append(limitations.toString()); } } return sb.toString(); }
@Override public <X> ResourceAttributeDefinitionImpl<X> createAttributeDefinition(QName name, QName typeName) { ResourceAttributeDefinitionImpl<X> propDef = new ResourceAttributeDefinitionImpl<>(name, typeName, prismContext); add(propDef); return propDef; }
private ResourceAttribute<String> createStringAttribute(QName attrName, String value) { ResourceAttributeDefinition testAttrDef = new ResourceAttributeDefinitionImpl(attrName, DOMUtil.XSD_STRING, getPrismContext()); ResourceAttribute<String> testAttr = testAttrDef.instantiate(); testAttr.setRealValue(value); return testAttr; }