com.evolveum.midpoint.schema.processor
Class ResourceObjectDefinition

java.lang.Object
  extended by com.evolveum.midpoint.schema.processor.Definition
      extended by com.evolveum.midpoint.schema.processor.PropertyContainerDefinition
          extended by com.evolveum.midpoint.schema.processor.ResourceObjectDefinition

public class ResourceObjectDefinition
extends PropertyContainerDefinition

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

Constructor Summary
ResourceObjectDefinition(Schema schema, javax.xml.namespace.QName name, javax.xml.namespace.QName defaultName, javax.xml.namespace.QName typeName)
           
 
Method Summary
 ResourceObjectAttributeDefinition findAttributeDefinition(javax.xml.namespace.QName elementQName)
           
 ResourceObjectAttributeDefinition getDescriptionAttribute()
          Returns the definition of description attribute of a resource object.
 ResourceObjectAttributeDefinition getDisplayNameAttribute()
          Returns the definition of display name attribute.
 java.util.Set<ResourceObjectAttributeDefinition> getIdentifiers()
          Returns the definition of identifier attributes of a resource object.
 ResourceObjectAttributeDefinition 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.Set<ResourceObjectAttributeDefinition> getSecondaryIdentifiers()
          Returns the definition of secondary identifier attributes of a resource object.
 ResourceObject instantiate()
           
 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.
 java.util.Set<ResourceObjectAttribute> parseAttributes(java.util.List<org.w3c.dom.Element> elements)
           
 java.util.Set<ResourceObjectAttribute> parseIdentifiers(java.util.List<org.w3c.dom.Element> elements)
           
 void setAccountType(boolean accountType)
           
 void setDefaultAccountType(boolean defaultAccountType)
           
 void setDescriptionAttribute(ResourceObjectAttributeDefinition descriptionAttribute)
           
 void setNamingAttribute(ResourceObjectAttributeDefinition namingAttribute)
           
 
Methods inherited from class com.evolveum.midpoint.schema.processor.PropertyContainerDefinition
debugDump, findPropertyDefinition, findPropertyDefinition, getDefinitions, instantiate, parseProperties, parseProperties, parseProperties, serializePropertiesToDom
 
Methods inherited from class com.evolveum.midpoint.schema.processor.Definition
getDefaultName, getDisplayName, getHelp, getName, getNameOrDefaultName, getTypeName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceObjectDefinition

public ResourceObjectDefinition(Schema schema,
                                javax.xml.namespace.QName name,
                                javax.xml.namespace.QName defaultName,
                                javax.xml.namespace.QName typeName)
Method Detail

getIdentifiers

public java.util.Set<ResourceObjectAttributeDefinition> 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.Set<ResourceObjectAttributeDefinition> 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 ResourceObjectAttributeDefinition 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(ResourceObjectAttributeDefinition descriptionAttribute)

getNamingAttribute

public ResourceObjectAttributeDefinition 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(ResourceObjectAttributeDefinition 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.

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)

getDisplayNameAttribute

public ResourceObjectAttributeDefinition 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.

instantiate

public ResourceObject instantiate()
Overrides:
instantiate in class PropertyContainerDefinition

parseAttributes

public java.util.Set<ResourceObjectAttribute> parseAttributes(java.util.List<org.w3c.dom.Element> elements)

parseIdentifiers

public java.util.Set<ResourceObjectAttribute> parseIdentifiers(java.util.List<org.w3c.dom.Element> elements)

findAttributeDefinition

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


Copyright © 2011 evolveum. All Rights Reserved.