com.evolveum.midpoint.schema.processor
Class ResourceAttributeContainerDefinition

java.lang.Object
  extended by com.evolveum.midpoint.prism.Definition
      extended by com.evolveum.midpoint.prism.ItemDefinition
          extended by com.evolveum.midpoint.prism.PrismContainerDefinition<ResourceObjectShadowAttributesType>
              extended by com.evolveum.midpoint.schema.processor.ResourceAttributeContainerDefinition
All Implemented Interfaces:
DebugDumpable, Dumpable, java.io.Serializable
Direct Known Subclasses:
RefinedAccountDefinition

public class ResourceAttributeContainerDefinition
extends PrismContainerDefinition<ResourceObjectShadowAttributesType>

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). See Definition 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.PrismContainerDefinition
compileTimeClass, complexTypeDefinition, isRuntimeSchema
 
Fields inherited from class com.evolveum.midpoint.prism.ItemDefinition
name
 
Fields inherited from class com.evolveum.midpoint.prism.Definition
defaultName, displayName, displayOrder, help, ignored, prismContext, typeName
 
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
 
Constructor Summary
ResourceAttributeContainerDefinition(javax.xml.namespace.QName name, ObjectClassComplexTypeDefinition complexTypeDefinition, PrismContext prismContext)
           
 
Method Summary
 ResourceAttributeContainerDefinition clone()
          Shallow clone
protected  void copyDefinitionData(ResourceAttributeContainerDefinition clone)
           
 java.lang.String debugDump(int indent)
           
 ResourceAttributeDefinition findAttributeDefinition(ItemPath elementPath)
           
 ResourceAttributeDefinition findAttributeDefinition(javax.xml.namespace.QName elementQName)
           
 ResourceAttributeDefinition findAttributeDefinition(java.lang.String elementLocalname)
           
 java.lang.String getAccountTypeName()
           
 java.util.Collection<? extends ResourceAttributeDefinition> getAttributeDefinitions()
           
 ObjectClassComplexTypeDefinition getComplexTypeDefinition()
           
 ResourceAttributeDefinition getDescriptionAttribute()
          Returns the definition of description attribute of a resource object.
 ResourceAttributeDefinition getDisplayNameAttribute()
          Returns the definition of display name attribute.
 java.util.Collection<ResourceAttributeDefinition> getIdentifiers()
          Returns the definition of identifier attributes of a resource object.
 ResourceAttributeDefinition getNamingAttribute()
          Specifies which resource attribute should be used as a "technical" name for the account.
 java.lang.String getNativeObjectClass()
          Returns the native object class string for the resource object.
 java.util.Collection<ResourceAttributeDefinition> getSecondaryIdentifiers()
          Returns the definition of secondary identifier attributes of a resource object.
 ResourceAttributeContainer instantiate()
          Create property container instance with a default name.
 ResourceAttributeContainer instantiate(javax.xml.namespace.QName name)
          Create property container instance with a specified name and element.
 boolean isAccountType()
          Indicates whether definition is should be used as account type.
 boolean isDefaultAccountType()
          Indicates whether definition is should be used as default account type.
 void setAccountType(boolean accountType)
           
 void setAccountTypeName(java.lang.String accountTypeName)
           
 void setDefaultAccountType(boolean defaultAccountType)
           
 void setDescriptionAttribute(ResourceAttributeDefinition descriptionAttribute)
           
 void setDisplayNameAttribute(javax.xml.namespace.QName displayName)
          TODO Convenience method.
 void setDisplayNameAttribute(ResourceAttributeDefinition displayName)
           
 void setNamingAttribute(javax.xml.namespace.QName namingAttribute)
           
 void setNamingAttribute(ResourceAttributeDefinition namingAttribute)
           
 void setNativeObjectClass(java.lang.String nativeObjectClass)
           
<T extends ResourceObjectShadowType>
PrismObjectDefinition<T>
toShadowDefinition()
           
 java.lang.String toString()
           
 
Methods inherited from class com.evolveum.midpoint.prism.PrismContainerDefinition
cloneWithReplacedDefinition, copyDefinitionData, createContainerDefinition, createContainerDefinition, createContainerDefinition, createEmptyDelta, createPropertyDefinition, createPropertyDefinition, createPropertyDefinition, createPropertyDefinition, createPropertyDefinition, createPropertyDefinition, extendToString, findContainerDefinition, findContainerDefinition, findContainerDefinition, findItemDefinition, findItemDefinition, findItemDefinition, findItemDefinition, findPropertyDefinition, findPropertyDefinition, findReferenceDefinition, getCompileTimeClass, getDebugDumpClassName, getDefinitions, getPropertyDefinitions, getSchemaNamespace, isEmpty, isRuntimeSchema, setCompileTimeClass, setComplexTypeDefinition, setRuntimeSchema
 
Methods inherited from class com.evolveum.midpoint.prism.ItemDefinition
copyDefinitionData, equals, getDefaultName, getMaxOccurs, getMinOccurs, getName, getNameOrDefaultName, getNamespace, hashCode, isDynamic, isMandatory, isMultiValue, isOptional, isSingleValue, isValidFor, setDynamic, setMaxOccurs, setMinOccurs, setName
 
Methods inherited from class com.evolveum.midpoint.prism.Definition
copyDefinitionData, debugDump, dump, getDisplayName, getDisplayOrder, getHelp, getPrismContext, getSchemaRegistry, getTypeClass, getTypeName, isIgnored, setDisplayName, setDisplayOrder, setHelp, setIgnored, setTypeName
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceAttributeContainerDefinition

public ResourceAttributeContainerDefinition(javax.xml.namespace.QName name,
                                            ObjectClassComplexTypeDefinition complexTypeDefinition,
                                            PrismContext prismContext)
Method Detail

getComplexTypeDefinition

public ObjectClassComplexTypeDefinition getComplexTypeDefinition()
Overrides:
getComplexTypeDefinition in class PrismContainerDefinition<ResourceObjectShadowAttributesType>

getIdentifiers

public java.util.Collection<ResourceAttributeDefinition> getIdentifiers()
Returns the definition of 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.

Returns:
definition of identifier attributes
Throws:
java.lang.IllegalStateException - if there is no definition for the referenced attributed

getSecondaryIdentifiers

public java.util.Collection<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.

Returns:
definition of secondary identifier attributes
Throws:
java.lang.IllegalStateException - if there is no definition for the referenced attributed

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.

Returns:
definition of secondary identifier attributes
Throws:
java.lang.IllegalStateException - if there is more than one description attribute. But this should never happen.
java.lang.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.

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(javax.xml.namespace.QName namingAttribute)

getNativeObjectClass

public java.lang.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.

Returns:
native object class
Throws:
java.lang.IllegalStateException - if there is more than one description attribute.

setNativeObjectClass

public void setNativeObjectClass(java.lang.String nativeObjectClass)

isAccountType

public boolean isAccountType()
Indicates whether definition is should be used as account type. If true value is returned then the definition should be used as an 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.

Returns:
true if the definition should be used as account type.

setAccountType

public void setAccountType(boolean accountType)

isDefaultAccountType

public boolean isDefaultAccountType()
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.

Returns:
true if the definition should be used as account type.
Throws:
java.lang.IllegalStateException - if more than one default account is suggested in the schema.

setDefaultAccountType

public void setDefaultAccountType(boolean defaultAccountType)

getAccountTypeName

public java.lang.String getAccountTypeName()

setAccountTypeName

public void setAccountTypeName(java.lang.String accountTypeName)

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.

Returns:
native object class
Throws:
java.lang.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(javax.xml.namespace.QName displayName)
TODO Convenience method. It will internally look up the correct definition.

Parameters:
displayName -

instantiate

public ResourceAttributeContainer instantiate()
Description copied from class: PrismContainerDefinition
Create property container instance with a default name.

This is a preferred way how to create property container.

Overrides:
instantiate in class PrismContainerDefinition<ResourceObjectShadowAttributesType>
Returns:
created item instance

instantiate

public ResourceAttributeContainer instantiate(javax.xml.namespace.QName name)
Description copied from class: PrismContainerDefinition
Create property container instance with a specified name and element.

This is a preferred way how to create property container.

Overrides:
instantiate in class PrismContainerDefinition<ResourceObjectShadowAttributesType>
Returns:
created item instance

clone

public ResourceAttributeContainerDefinition clone()
Description copied from class: PrismContainerDefinition
Shallow clone

Overrides:
clone in class PrismContainerDefinition<ResourceObjectShadowAttributesType>

copyDefinitionData

protected void copyDefinitionData(ResourceAttributeContainerDefinition clone)

findAttributeDefinition

public ResourceAttributeDefinition findAttributeDefinition(javax.xml.namespace.QName elementQName)

findAttributeDefinition

public ResourceAttributeDefinition findAttributeDefinition(ItemPath elementPath)

findAttributeDefinition

public ResourceAttributeDefinition findAttributeDefinition(java.lang.String elementLocalname)

getAttributeDefinitions

public java.util.Collection<? extends ResourceAttributeDefinition> getAttributeDefinitions()

toShadowDefinition

public <T extends ResourceObjectShadowType> PrismObjectDefinition<T> toShadowDefinition()

debugDump

public java.lang.String debugDump(int indent)
Specified by:
debugDump in interface DebugDumpable
Overrides:
debugDump in class PrismContainerDefinition<ResourceObjectShadowAttributesType>

toString

public java.lang.String toString()
Overrides:
toString in class ItemDefinition


Copyright © 2012 evolveum. All Rights Reserved.