Class ResourceAttributeContainerDefinitionImpl
- java.lang.Object
-
- com.evolveum.midpoint.prism.impl.DefinitionImpl
-
- com.evolveum.midpoint.prism.impl.ItemDefinitionImpl<PrismContainer<C>>
-
- com.evolveum.midpoint.prism.impl.PrismContainerDefinitionImpl<ShadowAttributesType>
-
- com.evolveum.midpoint.schema.processor.ResourceAttributeContainerDefinitionImpl
-
- All Implemented Interfaces:
Definition
,ItemDefinition<PrismContainer<ShadowAttributesType>>
,LocalDefinitionStore
,MutableDefinition
,MutableItemDefinition<PrismContainer<ShadowAttributesType>>
,MutablePrismContainerDefinition<ShadowAttributesType>
,PrismContainerDefinition<ShadowAttributesType>
,Revivable
,Visitable
,ResourceAttributeContainerDefinition
,DebugDumpable
,Serializable
,Cloneable
public class ResourceAttributeContainerDefinitionImpl extends PrismContainerDefinitionImpl<ShadowAttributesType> implements ResourceAttributeContainerDefinition
Resource Object Definition (Object Class). Object Class refers to a type of object on the Resource. Unix account, Active Directory group, inetOrgPerson LDAP objectclass or a schema of USERS database table are all Object Classes from the midPoint point of view. Object class defines a set of attribute names, types for each attributes and few additional properties. This class represents schema definition for resource object (object class). SeeDefinition
for more details. Resource Object Definition is immutable. TODO: This will probably need to be changed to a mutable object.- Author:
- Radovan Semancik
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.evolveum.midpoint.prism.impl.PrismContainerDefinitionImpl
compileTimeClass, complexTypeDefinition
-
Fields inherited from class com.evolveum.midpoint.prism.impl.ItemDefinitionImpl
heterogeneousListItem, itemName, substitutionHead
-
Fields inherited from class com.evolveum.midpoint.prism.impl.DefinitionImpl
deprecated, deprecatedSince, displayName, displayOrder, documentation, elaborate, emphasized, experimental, help, isAbstract, isRuntimeSchema, plannedRemoval, prismContext, processing, typeName
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Constructor Summary
Constructors Constructor Description ResourceAttributeContainerDefinitionImpl(QName name, ObjectClassComplexTypeDefinition complexTypeDefinition, PrismContext prismContext)
-
Method Summary
-
Methods inherited from class com.evolveum.midpoint.prism.impl.PrismContainerDefinitionImpl
accept, canBeDefinitionOf, canRepresent, cloneWithReplacedDefinition, copyDefinitionData, createContainerDefinition, createContainerDefinition, createContainerDefinition, createEmptyDelta, createPropertyDefinition, createPropertyDefinition, createPropertyDefinition, createPropertyDefinition, createPropertyDefinition, createPropertyDefinition, createValue, debugDump, deepClone, findItemDefinition, findLocalItemDefinition, findNamedItemDefinition, getCompileTimeClass, getDebugDumpClassName, getDefaultNamespace, getDocClassName, getIgnoredNamespaces, getPropertyDefinitions, getSchemaNamespace, getTypeClass, isAbstract, isEmpty, replaceDefinition, revive, setCompileTimeClass, setComplexTypeDefinition, toMutable
-
Methods inherited from class com.evolveum.midpoint.prism.impl.ItemDefinitionImpl
adoptElementDefinitionFrom, canAdd, canBeDefinitionOf, canModify, canRead, copyDefinitionData, debugDumpShortToString, debugFlags, debugMultiplicity, deepClone, equals, extendToString, getItemName, getMaxOccurs, getMinOccurs, getNamespace, getSubstitutionHead, getValueEnumerationRef, hashCode, isDynamic, isHeterogeneousListItem, isIndexOnly, isInherited, isMandatory, isMultiValue, isOperational, isOptional, isSingleValue, isValidFor, isValidFor, setCanAdd, setCanModify, setCanRead, setDynamic, setHeterogeneousListItem, setIndexOnly, setInherited, setItemName, setMaxOccurs, setMinOccurs, setOperational, setReadOnly, setSubstitutionHead, setValueEnumerationRef
-
Methods inherited from class com.evolveum.midpoint.prism.impl.DefinitionImpl
addSchemaMigration, copyDefinitionData, extendDumpHeader, getAnnotation, getDeprecatedSince, getDisplayName, getDisplayOrder, getDocumentation, getDocumentationPreview, getHelp, getPlannedRemoval, getPrismContext, getProcessing, getSchemaMigrations, getTypeClassIfKnown, getTypeName, isDeprecated, isElaborate, isEmphasized, isExperimental, isIgnored, isRuntimeSchema, setAbstract, setAnnotation, setDeprecated, setDeprecatedSince, setDisplayName, setDisplayOrder, setDocumentation, setElaborate, setEmphasized, setExperimental, setHelp, setPlannedRemoval, setProcessing, setRuntimeSchema, setTypeName
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
-
Methods inherited from interface com.evolveum.midpoint.prism.Definition
debugDump, getAnnotation, getDeprecatedSince, getDisplayName, getDisplayOrder, getDocumentation, getDocumentationPreview, getHelp, getPlannedRemoval, getPrismContext, getProcessing, getSchemaMigrations, getSchemaRegistry, getTypeClassIfKnown, getTypeName, isAbstract, isDeprecated, isElaborate, isEmphasized, isExperimental, isIgnored, isRuntimeSchema, setAnnotation
-
Methods inherited from interface com.evolveum.midpoint.prism.ItemDefinition
adoptElementDefinitionFrom, canAdd, canBeDefinitionOf, canBeDefinitionOf, canModify, canRead, debugDumpShortToString, deepClone, deepClone, findItemDefinition, getItemName, getMaxOccurs, getMinOccurs, getNamespace, getSubstitutionHead, getValueEnumerationRef, isDynamic, isHeterogeneousListItem, isIndexOnly, isInherited, isMandatory, isMultiValue, isOperational, isOptional, isSingleValue, isValidFor, isValidFor
-
Methods inherited from interface com.evolveum.midpoint.prism.LocalDefinitionStore
findContainerDefinition, findContainerDefinition, findItemDefinition, findItemDefinition, findLocalItemDefinition, findLocalItemDefinition, findNamedItemDefinition, findPropertyDefinition, findReferenceDefinition, findReferenceDefinition
-
Methods inherited from interface com.evolveum.midpoint.prism.MutableDefinition
addSchemaMigration, setDeprecated, setDisplayName, setDisplayOrder, setDocumentation, setEmphasized, setExperimental, setHelp, setProcessing, setRuntimeSchema, setTypeName
-
Methods inherited from interface com.evolveum.midpoint.prism.MutableItemDefinition
setCanAdd, setCanModify, setCanRead, setDeprecatedSince, setDynamic, setElaborate, setHeterogeneousListItem, setIndexOnly, setItemName, setMaxOccurs, setMinOccurs, setOperational, setPlannedRemoval, setReadOnly, setSubstitutionHead, setValueEnumerationRef
-
Methods inherited from interface com.evolveum.midpoint.prism.MutablePrismContainerDefinition
setInherited
-
Methods inherited from interface com.evolveum.midpoint.prism.PrismContainerDefinition
canRepresent, cloneWithReplacedDefinition, createEmptyDelta, createValue, getCompileTimeClass, getDefaultNamespace, getIgnoredNamespaces, getPropertyDefinitions, getTypeClass, isEmpty, replaceDefinition, revive, toMutable
-
-
-
-
Constructor Detail
-
ResourceAttributeContainerDefinitionImpl
public ResourceAttributeContainerDefinitionImpl(QName name, ObjectClassComplexTypeDefinition complexTypeDefinition, PrismContext prismContext)
-
-
Method Detail
-
getComplexTypeDefinition
public ObjectClassComplexTypeDefinition getComplexTypeDefinition()
- Specified by:
getComplexTypeDefinition
in interfacePrismContainerDefinition<ShadowAttributesType>
- Specified by:
getComplexTypeDefinition
in interfaceResourceAttributeContainerDefinition
- Overrides:
getComplexTypeDefinition
in classPrismContainerDefinitionImpl<ShadowAttributesType>
-
getPrimaryIdentifiers
public Collection<? extends ResourceAttributeDefinition> getPrimaryIdentifiers()
Returns the definition of primary identifier attributes of a resource object. May return empty set if there are no identifier attributes. Must not return null. The exception should be never thrown unless there is some bug in the code. The validation of model consistency should be done at the time of schema parsing.- Specified by:
getPrimaryIdentifiers
in interfaceResourceAttributeContainerDefinition
- Returns:
- definition of identifier attributes
- Throws:
IllegalStateException
- if there is no definition for the referenced attributed
-
getSecondaryIdentifiers
public Collection<? extends ResourceAttributeDefinition> getSecondaryIdentifiers()
Returns the definition of secondary identifier attributes of a resource object. May return empty set if there are no secondary identifier attributes. Must not return null. The exception should be never thrown unless there is some bug in the code. The validation of model consistency should be done at the time of schema parsing.- Specified by:
getSecondaryIdentifiers
in interfaceResourceAttributeContainerDefinition
- Returns:
- definition of secondary identifier attributes
- Throws:
IllegalStateException
- if there is no definition for the referenced attributed
-
getAllIdentifiers
public Collection<? extends ResourceAttributeDefinition> getAllIdentifiers()
- Specified by:
getAllIdentifiers
in interfaceResourceAttributeContainerDefinition
-
getDescriptionAttribute
public ResourceAttributeDefinition getDescriptionAttribute()
Returns the definition of description attribute of a resource object. Returns null if there is no description attribute. The exception should be never thrown unless there is some bug in the code. The validation of model consistency should be done at the time of schema parsing.- Specified by:
getDescriptionAttribute
in interfaceResourceAttributeContainerDefinition
- Returns:
- definition of secondary identifier attributes
- Throws:
IllegalStateException
- if there is more than one description attribute. But this should never happen.IllegalStateException
- if there is no definition for the referenced attributed
-
setDescriptionAttribute
public void setDescriptionAttribute(ResourceAttributeDefinition descriptionAttribute)
-
getNamingAttribute
public ResourceAttributeDefinition getNamingAttribute()
Specifies which resource attribute should be used as a "technical" name for the account. This name will appear in log files and other troubleshooting tools. The name should be a form of unique identifier that can be used to locate the resource object for diagnostics. It should not contain white chars and special chars if that can be avoided and it should be reasonable short. It is different from a display name attribute. Display name is intended for a common user or non-technical administrator (such as role administrator). The naming attribute is intended for technical IDM administrators and developers.- Specified by:
getNamingAttribute
in interfaceResourceAttributeContainerDefinition
- Returns:
- resource attribute definition that should be used as a "technical" name for the account.
-
setNamingAttribute
public void setNamingAttribute(ResourceAttributeDefinition namingAttribute)
-
setNamingAttribute
public void setNamingAttribute(QName namingAttribute)
-
getNativeObjectClass
public String getNativeObjectClass()
Returns the native object class string for the resource object. Native object class is the name of the Resource Object Definition (Object Class) as it is seen by the resource itself. The name of the Resource Object Definition may be constrained by XSD or other syntax and therefore may be "mangled" to conform to such syntax. The native object class value will contain unmangled name (if available). Returns null if there is no native object class. The exception should be never thrown unless there is some bug in the code. The validation of model consistency should be done at the time of schema parsing.- Specified by:
getNativeObjectClass
in interfaceResourceAttributeContainerDefinition
- Returns:
- native object class
- Throws:
IllegalStateException
- if there is more than one description attribute.
-
setNativeObjectClass
public void setNativeObjectClass(String nativeObjectClass)
-
isDefaultInAKind
public boolean isDefaultInAKind()
Indicates whether definition is should be used as default account type. If true value is returned then the definition should be used as a default account type definition. This is a way how a resource connector may suggest applicable object classes (resource object definitions) for accounts. If no information about account type is present, false should be returned. This method must return true only if isAccountType() returns true. The exception should be never thrown unless there is some bug in the code. The validation of at-most-one value should be done at the time of schema parsing. The exception may not even be thrown at all if the implementation is not able to determine duplicity.- Specified by:
isDefaultInAKind
in interfaceResourceAttributeContainerDefinition
- Returns:
- true if the definition should be used as account type.
- Throws:
IllegalStateException
- if more than one default account is suggested in the schema.
-
setDefaultInAKind
public void setDefaultInAKind(boolean defaultAccountType)
-
getIntent
public String getIntent()
- Specified by:
getIntent
in interfaceResourceAttributeContainerDefinition
-
setIntent
public void setIntent(String accountTypeName)
-
getKind
public ShadowKindType getKind()
- Specified by:
getKind
in interfaceResourceAttributeContainerDefinition
-
setKind
public void setKind(ShadowKindType kind)
-
getDisplayNameAttribute
public ResourceAttributeDefinition getDisplayNameAttribute()
Returns the definition of display name attribute. Display name attribute specifies which resource attribute should be used as title when displaying objects of a specific resource object class. It must point to an attribute of String type. If not present, primary identifier should be used instead (but this method does not handle this default behavior). Returns null if there is no display name attribute. The exception should be never thrown unless there is some bug in the code. The validation of model consistency should be done at the time of schema parsing.- Specified by:
getDisplayNameAttribute
in interfaceResourceAttributeContainerDefinition
- Returns:
- native object class
- Throws:
IllegalStateException
- if there is more than one display name attribute or the definition of the referenced attribute does not exist.
-
setDisplayNameAttribute
public void setDisplayNameAttribute(ResourceAttributeDefinition displayName)
-
setDisplayNameAttribute
public void setDisplayNameAttribute(QName displayName)
TODO Convenience method. It will internally look up the correct definition.- Parameters:
displayName
-
-
instantiate
@NotNull public ResourceAttributeContainer instantiate()
Description copied from interface:ItemDefinition
Create an item instance. Definition name or default name will used as an element name for the instance. The instance will otherwise be empty.- Specified by:
instantiate
in interfaceItemDefinition<PrismContainer<ShadowAttributesType>>
- Specified by:
instantiate
in interfaceResourceAttributeContainerDefinition
- Overrides:
instantiate
in classPrismContainerDefinitionImpl<ShadowAttributesType>
- Returns:
- created item instance
-
instantiate
@NotNull public ResourceAttributeContainer instantiate(QName name)
Description copied from interface:ItemDefinition
Create an item instance. Definition name will use provided name. for the instance. The instance will otherwise be empty.- Specified by:
instantiate
in interfaceItemDefinition<PrismContainer<ShadowAttributesType>>
- Specified by:
instantiate
in interfaceResourceAttributeContainerDefinition
- Overrides:
instantiate
in classPrismContainerDefinitionImpl<ShadowAttributesType>
- Returns:
- created item instance
-
clone
@NotNull public ResourceAttributeContainerDefinitionImpl clone()
Description copied from class:PrismContainerDefinitionImpl
Shallow clone- Specified by:
clone
in interfaceDefinition
- Specified by:
clone
in interfaceItemDefinition<PrismContainer<ShadowAttributesType>>
- Specified by:
clone
in interfacePrismContainerDefinition<ShadowAttributesType>
- Specified by:
clone
in interfaceResourceAttributeContainerDefinition
- Overrides:
clone
in classPrismContainerDefinitionImpl<ShadowAttributesType>
-
copyDefinitionData
protected void copyDefinitionData(ResourceAttributeContainerDefinitionImpl clone)
-
findAttributeDefinition
public <T> ResourceAttributeDefinition<T> findAttributeDefinition(QName elementQName, boolean caseInsensitive)
- Specified by:
findAttributeDefinition
in interfaceResourceAttributeContainerDefinition
-
findAttributeDefinition
public ResourceAttributeDefinition findAttributeDefinition(ItemPath elementPath)
- Specified by:
findAttributeDefinition
in interfaceResourceAttributeContainerDefinition
-
findAttributeDefinition
public ResourceAttributeDefinition findAttributeDefinition(String elementLocalname)
- Specified by:
findAttributeDefinition
in interfaceResourceAttributeContainerDefinition
-
getAttributeDefinitions
public List<? extends ResourceAttributeDefinition> getAttributeDefinitions()
- Specified by:
getAttributeDefinitions
in interfaceResourceAttributeContainerDefinition
-
getDefinitions
public List<? extends ResourceAttributeDefinition> getDefinitions()
Description copied from class:PrismContainerDefinitionImpl
Returns set of property definitions.WARNING: This may return definitions from the associated complex type. Therefore changing the returned set may influence also the complex type definition.
The set contains all property definitions of all types that were parsed. Order of definitions is insignificant.
- Specified by:
getDefinitions
in interfacePrismContainerDefinition<ShadowAttributesType>
- Specified by:
getDefinitions
in interfaceResourceAttributeContainerDefinition
- Overrides:
getDefinitions
in classPrismContainerDefinitionImpl<ShadowAttributesType>
- Returns:
- set of definitions
-
toShadowDefinition
public <T extends ShadowType> PrismObjectDefinition<T> toShadowDefinition()
- Specified by:
toShadowDefinition
in interfaceResourceAttributeContainerDefinition
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDump
in interfaceDebugDumpable
- Overrides:
debugDump
in classPrismContainerDefinitionImpl<ShadowAttributesType>
-
toString
public String toString()
- Overrides:
toString
in classItemDefinitionImpl<PrismContainer<ShadowAttributesType>>
-
-