|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ModelService
IDM Model Interface
IDM Model Interface provides access unified to the identity objects stored in the repository and on the resources. It abstracts away the details about where and how are the data stored, it hides all the low-level system components.
Implementation of this interface are expected to enforce a consistency of access control decisions and model, e.g. to enforce Role-Based Access Control (RBAC). RBAC is only one of many possibly models and this interface may have many implementations.
Implementations of this interface may automatically derive properties and attributes for objects. E.g. RBAC models may automatically derive resource accounts attributes based on user role membership.
Field Summary | |
---|---|
static String |
ADD_OBJECT
|
static String |
ADD_USER
|
static String |
CLASS_NAME_WITH_DOT
|
static String |
DELETE_OBJECT
|
static String |
DISCOVER_CONNECTORS
|
static String |
EXECUTE_CHANGES
|
static String |
GET_OBJECT
|
static String |
GET_PROPERTY_AVAILABLE_VALUES
|
static String |
IMPORT_ACCOUNTS_FROM_RESOURCE
|
static String |
IMPORT_OBJECTS_FROM_FILE
|
static String |
IMPORT_OBJECTS_FROM_STREAM
|
static String |
LIST_ACCOUNT_SHADOW_OWNER
|
static String |
LIST_OBJECTS
|
static String |
LIST_RESOURCE_OBJECT_SHADOWS
|
static String |
LIST_RESOURCE_OBJECTS
|
static String |
MODIFY_OBJECT
|
static String |
POST_INIT
|
static String |
TEST_RESOURCE
|
Method Summary | ||
---|---|---|
|
addObject(PrismObject<T> object,
Task task,
OperationResult parentResult)
Deprecated. |
|
|
countObjects(Class<T> type,
ObjectQuery query,
Collection<SelectorOptions<GetOperationOptions>> options,
Task task,
OperationResult parentResult)
|
|
|
deleteObject(Class<T> type,
String oid,
Task task,
OperationResult parentResult)
Deprecated. |
|
Set<ConnectorType> |
discoverConnectors(ConnectorHostType hostType,
OperationResult parentResult)
Discovers local or remote connectors. |
|
void |
executeChanges(Collection<ObjectDelta<? extends ObjectType>> deltas,
ModelExecuteOptions options,
Task task,
OperationResult parentResult)
Execute the provided object deltas. |
|
|
getObject(Class<T> type,
String oid,
Collection<SelectorOptions<GetOperationOptions>> options,
Task task,
OperationResult result)
Returns object for provided OID. |
|
void |
importAccountsFromResource(String resourceOid,
QName objectClass,
Task task,
OperationResult parentResult)
Import accounts from resource. |
|
void |
importObjectsFromFile(File input,
ImportOptionsType options,
Task task,
OperationResult parentResult)
Import objects from file. |
|
void |
importObjectsFromStream(InputStream input,
ImportOptionsType options,
Task task,
OperationResult parentResult)
Import objects from stream. |
|
PrismObject<UserType> |
listAccountShadowOwner(String accountOid,
Task task,
OperationResult parentResult)
Returns the User object representing owner of specified account (account shadow). |
|
List<PrismObject<? extends ResourceObjectShadowType>> |
listResourceObjects(String resourceOid,
QName objectClass,
ObjectPaging paging,
Task task,
OperationResult result)
Returns all resource objects of specified type that are currently available to the system. |
|
|
listResourceObjectShadows(String resourceOid,
Class<T> resourceObjectShadowType,
Task task,
OperationResult parentResult)
Search for resource object shadows of a specified type that belong to the specified resource. |
|
|
modifyObject(Class<T> type,
String oid,
Collection<? extends ItemDelta> modifications,
Task task,
OperationResult parentResult)
Deprecated. |
|
void |
postInit(OperationResult parentResult)
Finish initialization of the model and lower system components (provisioning, repository, etc). |
|
|
searchObjects(Class<T> type,
ObjectQuery query,
Collection<SelectorOptions<GetOperationOptions>> options,
Task task,
OperationResult parentResult)
Search for objects. |
|
OperationResult |
testResource(String resourceOid,
Task task)
Test the resource connection and basic resource connector functionality. |
Field Detail |
---|
static final String CLASS_NAME_WITH_DOT
static final String ADD_OBJECT
static final String ADD_USER
static final String GET_OBJECT
static final String EXECUTE_CHANGES
static final String GET_PROPERTY_AVAILABLE_VALUES
static final String LIST_OBJECTS
static final String MODIFY_OBJECT
static final String DELETE_OBJECT
static final String LIST_ACCOUNT_SHADOW_OWNER
static final String LIST_RESOURCE_OBJECT_SHADOWS
static final String LIST_RESOURCE_OBJECTS
static final String TEST_RESOURCE
static final String IMPORT_ACCOUNTS_FROM_RESOURCE
static final String IMPORT_OBJECTS_FROM_FILE
static final String IMPORT_OBJECTS_FROM_STREAM
static final String POST_INIT
static final String DISCOVER_CONNECTORS
Method Detail |
---|
<T extends ObjectType> PrismObject<T> getObject(Class<T> type, String oid, Collection<SelectorOptions<GetOperationOptions>> options, Task task, OperationResult result) throws ObjectNotFoundException, SchemaException, SecurityViolationException
Returns object for provided OID.
Must fail if object with the OID does not exists.
T
- oid
- OID of the object to getresolve
- list of properties to resolve in the fetched objecttype
- (class) of an object to getresult
- parent OperationResult (in/out)
ObjectNotFoundException
- requested object does not exist
SchemaException
- the object is not schema compliant
IllegalArgumentException
- missing required parameter, wrong OID format, etc.
ClassCastException
- OID represents object of a type incompatible with requested
type
SystemException
- unknown error from underlying layers or other unexpected
state
SecurityViolationException
void executeChanges(Collection<ObjectDelta<? extends ObjectType>> deltas, ModelExecuteOptions options, Task task, OperationResult parentResult) throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException, PolicyViolationException, SecurityViolationException
Execute the provided object deltas.
The operation executes the provided object deltas. All deltas must relate to analogous objects (e.g. user and linked accounts). The implementation may throw an error if the objects are not analogous. The implementation also implicitly links the objects (mark them to be analogous) if such a link is part of the data model. E.g. the implementation links all accounts to the user if they are passed in a single delta collection. This is especially useful if the account deltas are ADD deltas without OID and therefore cannot be linked explicitly.
There must be no more than one delta for each object. The order of execution is not defined and the implementation is free to determine the correct or most suitable ordering.
The OID provided in ADD deltas may be empty. In that case the OID will be assigned by the implementation and the OIDs will be set in the deltas after the operation is completed.
Execution of ADD deltas should fail if such object already exists (if object with the provided OID already exists). Execution of MODIFY and DELETE deltas should fail if such objects do not exist.
The operation may fail if provided OIDs are in an unusable format for the storage. Generating own OIDs and providing them to this method is not recommended for normal operation.
There are no explicit atomicity guarantees for the operations. Some of the operations may pass, some may fail or even fail partially. The consistency of the data and state are not based on operation atomicity but rather a data model that can "repair" inconsistencies.
The operation may fail if any of the objects to be created or modified does not conform to the underlying schema of the storage system or the schema enforced by the implementation.
deltas
- Collection of object deltas to executeparentResult
- parent OperationResult (in/out)
ObjectAlreadyExistsException
- object with specified identifiers already exists, cannot add
ObjectNotFoundException
- object required to complete the operation was not found (e.g.
appropriate connector or resource definition)
SchemaException
- error dealing with resource schema, e.g. created object does
not conform to schema
ExpressionEvaluationException
- evaluation of expression associated with the object has failed
CommunicationException
ConfigurationException
PolicyViolationException
- Policy violation was detected during processing of the object
IllegalArgumentException
- wrong OID format, etc.
SystemException
- unknown error from underlying layers or other unexpected
state
SecurityViolationException
@Deprecated <T extends ObjectType> String addObject(PrismObject<T> object, Task task, OperationResult parentResult) throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException, PolicyViolationException, SecurityViolationException
Add new object.
The OID provided in the input message may be empty. In that case the OID will be assigned by the implementation of this method and it will be provided as return value.
This operation should fail if such object already exists (if object with the provided OID already exists).
The operation may fail if provided OID is in an unusable format for the storage. Generating own OIDs and providing them to this method is not recommended for normal operation.
Should be atomic. Should not allow creation of two objects with the same OID (even if created in parallel).
The operation may fail if the object to be created does not conform to the underlying schema of the storage system or the schema enforced by the implementation.
object
- object to createparentResult
- parent OperationResult (in/out)
ObjectAlreadyExistsException
- object with specified identifiers already exists, cannot add
ObjectNotFoundException
- object required to complete the operation was not found (e.g.
appropriate connector or resource definition)
SchemaException
- error dealing with resource schema, e.g. created object does
not conform to schema
ExpressionEvaluationException
- evaluation of expression associated with the object has failed
CommunicationException
ConfigurationException
PolicyViolationException
- Policy violation was detected during processing of the object
IllegalArgumentException
- wrong OID format, etc.
SystemException
- unknown error from underlying layers or other unexpected
state
SecurityViolationException
@Deprecated <T extends ObjectType> void modifyObject(Class<T> type, String oid, Collection<? extends ItemDelta> modifications, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException, ObjectAlreadyExistsException, PolicyViolationException, SecurityViolationException
Modifies object using relative change description.
Must fail if user with provided OID does not exists. Must fail if any of the described changes cannot be applied. Should be atomic.
If two or more modify operations are executed in parallel, the operations should be merged. In case that the operations are in conflict (e.g. one operation adding a value and the other removing the same value), the result is not deterministic.
The operation may fail if the modified object does not conform to the underlying schema of the storage system or the schema enforced by the implementation.
parentResult
- parent OperationResult (in/out)
ObjectNotFoundException
- specified object does not exist
SchemaException
- resulting object would violate the schema
ExpressionEvaluationException
- evaluation of expression associated with the object has failed
CommunicationException
ObjectAlreadyExistsException
- If the account or another "secondary" object already exists and cannot be created
PolicyViolationException
- Policy violation was detected during processing of the object
IllegalArgumentException
- wrong OID format, described change is not applicable
SystemException
- unknown error from underlying layers or other unexpected
state
ConfigurationException
SecurityViolationException
@Deprecated <T extends ObjectType> void deleteObject(Class<T> type, String oid, Task task, OperationResult parentResult) throws ObjectNotFoundException, ConsistencyViolationException, CommunicationException, SchemaException, ConfigurationException, PolicyViolationException, SecurityViolationException
Deletes object with specified OID.
Must fail if object with specified OID does not exists. Should be atomic.
oid
- OID of object to deleteparentResult
- parent OperationResult (in/out)
ObjectNotFoundException
- specified object does not exist
IllegalArgumentException
- wrong OID format, described change is not applicable
ConsistencyViolationException
- sub-operation failed, cannot delete objects as its deletion
would lead to inconsistent state
CommunicationException
ConfigurationException
PolicyViolationException
- Policy violation was detected during processing of the object
SystemException
- unknown error from underlying layers or other unexpected
state
SchemaException
SecurityViolationException
PrismObject<UserType> listAccountShadowOwner(String accountOid, Task task, OperationResult parentResult) throws ObjectNotFoundException
Returns the User object representing owner of specified account (account shadow).
May return null if there is no owner specified for the account.
Implements the backward "owns" association between account shadow and user. Forward association is implemented by property "account" of user object.
accountOid
- OID of the account to look for an ownerparentResult
- parent OperationResult (in/out)
ObjectNotFoundException
- specified account was not found
IllegalArgumentException
- wrong OID format, described change is not applicable
SystemException
- unknown error from underlying layers or other unexpected
state<T extends ResourceObjectShadowType> List<PrismObject<T>> listResourceObjectShadows(String resourceOid, Class<T> resourceObjectShadowType, Task task, OperationResult parentResult) throws ObjectNotFoundException
Search for resource object shadows of a specified type that belong to the specified resource.
Returns a list of such object shadows or empty list if nothing was found.
Returned shadows are "attached", that means they have OID and at they are stored in the repository.
Implements the backward "has" association between resource and resource object shadows. Forward association is implemented by property "resource" of resource object shadow.
TODO: add objectClass to be really usable ?
T
- specific shadow type (class) to returnresourceOid
- OID of the resource that the shadows resideresourceObjectShadowType
- specific shadow type (class) to returnparentResult
- parent OperationResult (in/out)
ObjectNotFoundException
List<PrismObject<? extends ResourceObjectShadowType>> listResourceObjects(String resourceOid, QName objectClass, ObjectPaging paging, Task task, OperationResult result) throws SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException
Returns all resource objects of specified type that are currently available to the system.
Returns empty list if object type is correct but there are no objects of that type. The operation should fail if object type is wrong (e.g. specified type is not part of resource schema).
This method does NOT use any repository shadow objects for reference or any other business objects in the local repository. It goes directly to the resource. The returned objects (indirectly) comply with the resource schema, but it is returned re-formated in a form of detached shadow object. Although the form is the same as shadow object, this is NOT really a shadow object because it is not stored in the repository (it is detached). It does NOT have OID.
The objects are identified by whatever identification properties/attributes are defined by the resource schema.
The purpose of this operation is diagnostics. It works directly with the resource without the potential problems of underlying implementation. E.g. it may be used to test resource connectivity or correctness of resource setup. It may also be used to reach object types that are not directly supported as "shadows" by the implementation. Therefore this method is not required to implement any form of caching, queuing, reference resolution or any other "smart" algorithm.
resourceOid
- OID of the resource to fetch objects fromobjectClass
- Object class of the objects to fetchpaging
- paging specification to limit operation result (optional)result
- parent OperationResult (in/out)
ObjectNotFoundException
- specified resource object does not exist
SchemaException
- error handling resource schema
CommunicationException
- error communicating with the resource
ConfigurationException
SecurityViolationException
<T extends ObjectType> List<PrismObject<T>> searchObjects(Class<T> type, ObjectQuery query, Collection<SelectorOptions<GetOperationOptions>> options, Task task, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, SecurityViolationException, CommunicationException, ConfigurationException
Search for objects.
Searches through all object types. Returns a list of objects that match search criteria.
Returns empty list if object type is correct but there are no objects of that type.
Should fail if object type is wrong. Should fail if unknown property is specified in the query.
query
- search querypaging
- paging specification to limit operation result (optional)parentResult
- parent OperationResult (in/out)
SchemaException
- unknown property used in search query
ObjectNotFoundException
- object required for a search was not found (e.g. resource
definition)
CommunicationException
- error communicating with the resource
ConfigurationException
IllegalArgumentException
- wrong query format
SecurityViolationException
<T extends ObjectType> int countObjects(Class<T> type, ObjectQuery query, Collection<SelectorOptions<GetOperationOptions>> options, Task task, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, SecurityViolationException
SchemaException
ObjectNotFoundException
SecurityViolationException
OperationResult testResource(String resourceOid, Task task) throws ObjectNotFoundException
Test the resource connection and basic resource connector functionality.
This operation will NOT throw exception in case the resource connection fails. It such case it will indicate the failure in the return message, but the operation itself succeeds. The operations fails only if the provided arguments are wrong, in case of system error, system misconfiguration, etc.
This returns OperationResult instead of taking it as in/out argument. This is different from the other methods. The testResource method is not using OperationResult to track its own execution but rather to track the execution of resource tests (that in fact happen in provisioning).
resourceOid
- OID of resource to test
ObjectNotFoundException
- specified object does not exist
IllegalArgumentException
- wrong OID formatvoid importAccountsFromResource(String resourceOid, QName objectClass, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, SecurityViolationException
Import accounts from resource.
Invocation of this method may be switched to background.
TODO: OperationResult
SchemaException
ObjectNotFoundException
SecurityViolationException
void importObjectsFromFile(File input, ImportOptionsType options, Task task, OperationResult parentResult)
input
- task
- void importObjectsFromStream(InputStream input, ImportOptionsType options, Task task, OperationResult parentResult)
input
- task
- Set<ConnectorType> discoverConnectors(ConnectorHostType hostType, OperationResult parentResult) throws CommunicationException
hostType
- definition of a connector host or nullparentResult
- parentResult parent OperationResult (in/out)
CommunicationException
- error communicating with the connector hostvoid postInit(OperationResult parentResult)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |