com.evolveum.midpoint.schema.processor
Class ObjectClassComplexTypeDefinition

java.lang.Object
  extended by com.evolveum.midpoint.prism.Definition
      extended by com.evolveum.midpoint.prism.ComplexTypeDefinition
          extended by com.evolveum.midpoint.schema.processor.ObjectClassComplexTypeDefinition
All Implemented Interfaces:
DebugDumpable, Dumpable, java.io.Serializable

public class ObjectClassComplexTypeDefinition
extends ComplexTypeDefinition

Author:
semancik
See Also:
Serialized Form

Field Summary
 
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
ObjectClassComplexTypeDefinition(javax.xml.namespace.QName defaultName, javax.xml.namespace.QName typeName, PrismContext prismContext)
           
 
Method Summary
 ObjectClassComplexTypeDefinition clone()
          Shallow clone.
protected  void copyDefinitionData(ObjectClassComplexTypeDefinition clone)
           
 ResourceAttributeDefinition createAttributeDefinition(javax.xml.namespace.QName name, javax.xml.namespace.QName typeName)
           
 ResourceAttributeDefinition createAttributeDefinition(java.lang.String localName, javax.xml.namespace.QName typeName)
           
 ResourceAttributeDefinition createAttributeDefinition(java.lang.String localName, java.lang.String localTypeName)
           
 ResourceAttributeDefinition findAttributeDefinition(javax.xml.namespace.QName name)
          Finds a attribute definition by looking at the property name.
 ResourceAttributeDefinition findAttributeDefinition(java.lang.String name)
           
 java.util.Collection<? extends ResourceAttributeDefinition> getAttributeDefinitions()
           
protected  java.lang.String getDebugDumpClassName()
          Return a human readable name of this class suitable for logs.
 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.
 java.lang.String getIntent()
           
 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.Set<ResourceAttributeDefinition> getSecondaryIdentifiers()
          Returns the definition of secondary identifier attributes of a resource object.
 ResourceAttributeContainer instantiate(javax.xml.namespace.QName elementName)
          This may not be really "clean" as it actually does two steps instead of one.
 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.
 boolean isIdentifier(javax.xml.namespace.QName attrName)
           
 boolean isSecondaryIdentifier(javax.xml.namespace.QName attrName)
           
 void setAccountType(boolean accountType)
           
 void setDefaultAccountType(boolean defaultAccountType)
           
 void setDescriptionAttribute(ResourceAttributeDefinition descriptionAttribute)
           
 void setDisplayNameAttribute(javax.xml.namespace.QName displayName)
          TODO Convenience method.
 void setDisplayNameAttribute(ResourceAttributeDefinition displayName)
           
 void setIntent(java.lang.String intent)
           
 void setNamingAttribute(javax.xml.namespace.QName namingAttribute)
           
 void setNamingAttribute(ResourceAttributeDefinition namingAttribute)
           
 void setNativeObjectClass(java.lang.String nativeObjectClass)
           
 ResourceAttributeContainerDefinition toResourceAttributeContainerDefinition(javax.xml.namespace.QName elementName)
           
 
Methods inherited from class com.evolveum.midpoint.prism.ComplexTypeDefinition
add, copyDefinitionData, createPropertyDefinifion, createPropertyDefinifion, createPropertyDefinifion, createPropertyDefinition, debugDump, findContainerDefinition, findItemDefinition, findPropertyDefinition, getCompileTimeClass, getDefinitions, getExtensionForType, getSchemaNamespace, getSuperType, isContainerMarker, isEmpty, isObjectMarker, isXsdAnyMarker, replaceDefinition, setCompileTimeClass, setContainerMarker, setExtensionForType, setObjectMarker, setSuperType, setXsdAnyMarker
 
Methods inherited from class com.evolveum.midpoint.prism.Definition
copyDefinitionData, debugDump, dump, equals, getDefaultName, getDisplayName, getDisplayOrder, getHelp, getPrismContext, getSchemaRegistry, getTypeClass, getTypeName, hashCode, isIgnored, setDisplayName, setDisplayOrder, setHelp, setIgnored, setTypeName, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectClassComplexTypeDefinition

public ObjectClassComplexTypeDefinition(javax.xml.namespace.QName defaultName,
                                        javax.xml.namespace.QName typeName,
                                        PrismContext prismContext)
Method Detail

getAttributeDefinitions

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

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

isIdentifier

public boolean isIdentifier(javax.xml.namespace.QName attrName)

getSecondaryIdentifiers

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

isSecondaryIdentifier

public boolean isSecondaryIdentifier(javax.xml.namespace.QName attrName)

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)

getIntent

public java.lang.String getIntent()

setIntent

public void setIntent(java.lang.String intent)

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 -

findAttributeDefinition

public ResourceAttributeDefinition findAttributeDefinition(javax.xml.namespace.QName name)
Finds a attribute definition by looking at the property name.

Returns null if nothing is found.

Parameters:
name - property definition name
Returns:
found property definition or null

findAttributeDefinition

public ResourceAttributeDefinition findAttributeDefinition(java.lang.String name)

createAttributeDefinition

public ResourceAttributeDefinition createAttributeDefinition(javax.xml.namespace.QName name,
                                                             javax.xml.namespace.QName typeName)

createAttributeDefinition

public ResourceAttributeDefinition createAttributeDefinition(java.lang.String localName,
                                                             javax.xml.namespace.QName typeName)

createAttributeDefinition

public ResourceAttributeDefinition createAttributeDefinition(java.lang.String localName,
                                                             java.lang.String localTypeName)

toResourceAttributeContainerDefinition

public ResourceAttributeContainerDefinition toResourceAttributeContainerDefinition(javax.xml.namespace.QName elementName)

instantiate

public ResourceAttributeContainer instantiate(javax.xml.namespace.QName elementName)
This may not be really "clean" as it actually does two steps instead of one. But it is useful.


clone

public ObjectClassComplexTypeDefinition clone()
Description copied from class: ComplexTypeDefinition
Shallow clone.

Overrides:
clone in class ComplexTypeDefinition

copyDefinitionData

protected void copyDefinitionData(ObjectClassComplexTypeDefinition clone)

getDebugDumpClassName

protected java.lang.String getDebugDumpClassName()
Description copied from class: ComplexTypeDefinition
Return a human readable name of this class suitable for logs.

Overrides:
getDebugDumpClassName in class ComplexTypeDefinition


Copyright © 2012 evolveum. All Rights Reserved.