com.evolveum.midpoint.schema.processor
Class ResourceObject

java.lang.Object
  extended by com.evolveum.midpoint.schema.processor.Item
      extended by com.evolveum.midpoint.schema.processor.PropertyContainer
          extended by com.evolveum.midpoint.schema.processor.ResourceObject
All Implemented Interfaces:
DebugDumpable, Dumpable, java.io.Serializable

public final class ResourceObject
extends PropertyContainer

Resource Object. Resource Object understands resource-specific annotations, such as identifiers, native object class, etc. Object class can be determined by using the definition (inherited from PropertyContainer)

Author:
Radovan Semancik
See Also:
Serialized Form

Field Summary
protected  ActivationType activation
           
protected  CredentialsType credentials
           
 
Fields inherited from class com.evolveum.midpoint.schema.processor.Item
definition, element, name
 
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
 
Constructor Summary
ResourceObject()
          Default constructor.
ResourceObject(javax.xml.namespace.QName name)
          The constructors should be used only occasionally (if used at all).
ResourceObject(javax.xml.namespace.QName name, ResourceObjectDefinition definition)
          The constructors should be used only occasionally (if used at all).
ResourceObject(javax.xml.namespace.QName name, ResourceObjectDefinition definition, java.lang.Object element)
          The constructors should be used only occasionally (if used at all).
 
Method Summary
 ActivationType createOrGetActivation()
           
 CredentialsType createOrGetCredentials()
           
 ResourceObjectAttribute findAttribute(javax.xml.namespace.QName attributeQName)
          Finds a specific attribute in the resource object by name.
 ActivationType getActivation()
           
 java.util.Set<ResourceObjectAttribute> getAttributes()
          Returns set of resource object attributes.
 CredentialsType getCredentials()
           
protected  java.lang.String getDebugDumpClassName()
          Return a human readable name of this class suitable for logs.
 ResourceObjectDefinition getDefinition()
          Returns applicable property container definition.
 ResourceObjectAttribute getDescriptionAttribute()
          Returns description attribute of a resource object.
 ResourceObjectAttribute getDisplayNameAttribute()
          Returns display name attribute of a resource object.
 Property getIdentifier()
          Returns a (single) identifier.
 java.util.Set<ResourceObjectAttribute> getIdentifiers()
          Returns identifiers.
 ResourceObjectAttribute 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.
 Property getSecondaryIdentifier()
          Returns a (single) secondary identifier.
 java.util.Set<Property> getSecondaryIdentifiers()
          Returns secondary identifiers.
 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 setActivation(ActivationType activation)
           
 void setCredentials(CredentialsType credentials)
           
 
Methods inherited from class com.evolveum.midpoint.schema.processor.PropertyContainer
add, addAll, addAllReplaceExisting, addReplaceExisting, applyModification, applyModifications, debugDump, dump, findItem, findItem, findProperty, findProperty, getItems, getProperties, isEmpty, serializePropertiesToJaxb, serializeToDom, setDefinition, toString
 
Methods inherited from class com.evolveum.midpoint.schema.processor.Item
debugDump, getDisplayName, getElement, getHelp, getName, setDefinition, setElement, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

activation

protected ActivationType activation

credentials

protected CredentialsType credentials
Constructor Detail

ResourceObject

public ResourceObject()
Default constructor. The constructors should be used only occasionally (if used at all). Use the factory methods in the ResourceObjectDefintion instead.


ResourceObject

public ResourceObject(javax.xml.namespace.QName name)
The constructors should be used only occasionally (if used at all). Use the factory methods in the ResourceObjectDefintion instead.

Parameters:
name - resource object name (element name)

ResourceObject

public ResourceObject(javax.xml.namespace.QName name,
                      ResourceObjectDefinition definition)
The constructors should be used only occasionally (if used at all). Use the factory methods in the ResourceObjectDefintion instead.

Parameters:
name - resource object name (element name)
definition - resource object definition (schema)

ResourceObject

public ResourceObject(javax.xml.namespace.QName name,
                      ResourceObjectDefinition definition,
                      java.lang.Object element)
The constructors should be used only occasionally (if used at all). Use the factory methods in the ResourceObjectDefintion instead.

Method Detail

getDefinition

public ResourceObjectDefinition getDefinition()
Description copied from class: PropertyContainer
Returns applicable property container definition. May return null if no definition is applicable or the definition is not know.

Overrides:
getDefinition in class PropertyContainer
Returns:
applicable property container definition

getAttributes

public java.util.Set<ResourceObjectAttribute> getAttributes()
Returns set of resource object attributes. The order of attributes is insignificant. The returned set is imutable! Any change to it will be ignored.

Returns:
set of resource object attributes.

getIdentifier

public Property getIdentifier()
Returns a (single) identifier. This method returns a property that acts as an (primary) identifier for the resource object. Primary identifiers are used to access the resource objects, retrieve them from resource, identify objects for modifications, etc. Returns null if no identifier is defined. Resource objects may have multiple (composite) identifiers, but this method assumes that there is only a single identifier. The method will throw exception if that assumption is not satisfied.

Returns:
identifier property
Throws:
java.lang.IllegalStateException - if resource object has multiple identifiers

getIdentifiers

public java.util.Set<ResourceObjectAttribute> getIdentifiers()
Returns identifiers. This method returns properties that act as (primary) identifiers for the resource object. Primary identifiers are used to access the resource objects, retrieve them from resource, identify objects for modifications, etc. Returns empty set if no identifier is defined. Must not return null. Resource objects may have multiple (composite) identifiers, all of them are returned. The returned set it immuatble! Any modifications will be lost.

Returns:
set of identifier properties

getSecondaryIdentifier

public Property getSecondaryIdentifier()
Returns a (single) secondary identifier. This method returns a property that acts as an secondary identifier for the resource object. Secondary identifiers are used to confirm primary identification of resource object. Returns null if no secondary identifier is defined. Resource objects may have multiple (composite) identifiers, but this method assumes that there is only a single identifier. The method will throw exception if that assumption is not satisfied.

Returns:
secondary identifier property
Throws:
java.lang.IllegalStateException - if resource object has multiple secondary identifiers

getSecondaryIdentifiers

public java.util.Set<Property> getSecondaryIdentifiers()
Returns secondary identifiers. This method returns properties that act as secondary identifiers for the resource object. Secondary identifiers are used to confirm primary identification of resource object. Returns empty set if no identifier is defined. Must not return null. Resource objects may have multiple (composite) identifiers, all of them are returned.

Returns:
set of secondary identifier properties

getDescriptionAttribute

public ResourceObjectAttribute getDescriptionAttribute()
Returns description attribute of a resource object. Returns null if there is no description attribute or the attribute is not known. 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:
description attribute of a resource object.
Throws:
java.lang.IllegalStateException - if there is no definition for the referenced attributed

getNamingAttribute

public ResourceObjectAttribute 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:
attribute that should be used as a "technical" name for the account.

getDisplayNameAttribute

public ResourceObjectAttribute getDisplayNameAttribute()
Returns display name attribute of a resource object. Returns null if there is no display name attribute or the attribute is not known. 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:
display name attribute of a resource object.
Throws:
java.lang.IllegalStateException - if there is no definition for the referenced attributed

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 or the native object class is not known. 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.

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.

findAttribute

public ResourceObjectAttribute findAttribute(javax.xml.namespace.QName attributeQName)
Finds a specific attribute in the resource object by name. Returns null if nothing is found.

Parameters:
attributeQName - attribute name to find.
Returns:
found attribute or null

getActivation

public ActivationType getActivation()

createOrGetActivation

public ActivationType createOrGetActivation()

setActivation

public void setActivation(ActivationType activation)

getCredentials

public CredentialsType getCredentials()

createOrGetCredentials

public CredentialsType createOrGetCredentials()

setCredentials

public void setCredentials(CredentialsType credentials)

getDebugDumpClassName

protected java.lang.String getDebugDumpClassName()
Return a human readable name of this class suitable for logs.

Overrides:
getDebugDumpClassName in class PropertyContainer


Copyright © 2011 evolveum. All Rights Reserved.