com.evolveum.midpoint.provisioning.impl
Class ProvisioningServiceImpl

java.lang.Object
  extended by com.evolveum.midpoint.provisioning.impl.ProvisioningServiceImpl
All Implemented Interfaces:
ProvisioningService

@Service(value="provisioningService")
public class ProvisioningServiceImpl
extends java.lang.Object
implements ProvisioningService

Implementation of provisioning service. It is just a "dispatcher" that routes interface calls to appropriate places. E.g. the operations regarding resource definitions are routed directly to the repository, operations of shadow objects are routed to the shadow cache and so on. WORK IN PROGRESS There be dragons. Beware the dog. Do not trespass.

Author:
Radovan Semancik

Field Summary
 
Fields inherited from interface com.evolveum.midpoint.provisioning.api.ProvisioningService
TEST_CONNECTION_CONNECTOR_CONNECTION_OPERATION, TEST_CONNECTION_CONNECTOR_INIT_OPERATION, TEST_CONNECTION_CONNECTOR_SANITY_OPERATION, TEST_CONNECTION_CONNECTOR_SCHEMA_OPERATION, TEST_CONNECTION_CONNECTOR_VALIDATION_OPERATION, TEST_CONNECTION_OPERATION
 
Constructor Summary
ProvisioningServiceImpl()
           
 
Method Summary
 java.lang.String addObject(ObjectType object, ScriptsType scripts, OperationResult parentResult)
          Add new object.
 void deleteObject(java.lang.String oid, ScriptsType scripts, OperationResult parentResult)
          Deleted object with provided OID.
 ObjectType getObject(java.lang.String oid, PropertyReferenceListType resolve, OperationResult parentResult)
          Returns object for provided OID.
 PropertyAvailableValuesListType getPropertyAvailableValues(java.lang.String oid, PropertyReferenceListType properties, OperationResult parentResult)
          Returns list of available values for specified properties.
 RepositoryService getRepositoryService()
          Get the value of repositoryService.
 ShadowCache getShadowCache()
           
 ObjectListType listObjects(java.lang.Class<? extends ObjectType> objectType, PagingType paging, OperationResult parentResult)
          Returns all objects of specified type that are available to the implementation.
 ObjectListType listResourceObjects(java.lang.String resourceOid, javax.xml.namespace.QName objectType, PagingType paging, OperationResult parentResult)
           
 void modifyObject(ObjectModificationType objectChange, ScriptsType scripts, OperationResult parentResult)
          Modifies object using relative change description.
 ObjectListType searchObjects(QueryType query, PagingType paging, OperationResult parentResult)
          Search for objects.
 void searchObjectsIterative(QueryType query, PagingType paging, ResultHandler handler, OperationResult parentResult)
          Search for objects iteratively.
 void setRepositoryService(RepositoryService repositoryService)
          Set the value of repositoryService Expected to be injected.
 void setShadowCache(ShadowCache shadowCache)
           
 int synchronize(java.lang.String resourceOid, Task task, OperationResult parentResult)
          Collect external changes on a resource and call the business logic with the accumulated change data.
 OperationResult testResource(java.lang.String resourceOid)
          Test the resource connection and basic resource connector functionality.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProvisioningServiceImpl

public ProvisioningServiceImpl()
Method Detail

getShadowCache

public ShadowCache getShadowCache()

setShadowCache

public void setShadowCache(ShadowCache shadowCache)

getRepositoryService

public RepositoryService getRepositoryService()
Get the value of repositoryService.

Returns:
the value of repositoryService

setRepositoryService

public void setRepositoryService(RepositoryService repositoryService)
Set the value of repositoryService Expected to be injected.

Parameters:
repositoryService - new value of repositoryService

getObject

public ObjectType getObject(java.lang.String oid,
                            PropertyReferenceListType resolve,
                            OperationResult parentResult)
                     throws ObjectNotFoundException,
                            CommunicationException,
                            SchemaException
Description copied from interface: ProvisioningService
Returns object for provided OID. Must fail if object with the OID does not exists. Resource Object Shadows: The resource object shadow attributes may be retrieved from the local database, directly form the resource or a combination of both. The retrieval may fail due to resource failure, network failure or similar external cases. The retrieval may also take relatively long time (e.g. until it times out).

Specified by:
getObject in interface ProvisioningService
Parameters:
oid - OID of the object to get
resolve - list of properties to resolve in the fetched object
Returns:
Object fetched from repository and/or resource
Throws:
ObjectNotFoundException - requested object does not exist
CommunicationException - error communicating with the resource
SchemaException - error dealing with resource schema

addObject

public java.lang.String addObject(ObjectType object,
                                  ScriptsType scripts,
                                  OperationResult parentResult)
                           throws ObjectAlreadyExistsException,
                                  SchemaException,
                                  CommunicationException,
                                  ObjectNotFoundException
Description copied from interface: ProvisioningService
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.

Specified by:
addObject in interface ProvisioningService
Parameters:
object - object to create
scripts - scripts to execute before/after the operation
parentResult - parent OperationResult (in/out)
Returns:
OID assigned to the created object
Throws:
ObjectAlreadyExistsException - object with specified identifiers already exists, cannot add
SchemaException - error dealing with resource schema, e.g. schema violation
CommunicationException - error communicating with the resource
ObjectNotFoundException - appropriate connector object was not found

synchronize

public int synchronize(java.lang.String resourceOid,
                       Task task,
                       OperationResult parentResult)
                throws ObjectNotFoundException,
                       CommunicationException,
                       SchemaException
Description copied from interface: ProvisioningService
Collect external changes on a resource and call the business logic with the accumulated change data. This method will be invoked by scheduler/sync thread. TODO: Better description

Specified by:
synchronize in interface ProvisioningService
parentResult - parent OperationResult (in/out)
Returns:
the number of processed changes
Throws:
ObjectNotFoundException - specified resource definition (OID) does not exist
CommunicationException - error communicating with the resource
SchemaException - error dealing with resource schema

listObjects

public ObjectListType listObjects(java.lang.Class<? extends ObjectType> objectType,
                                  PagingType paging,
                                  OperationResult parentResult)
Description copied from interface: ProvisioningService
Returns all objects of specified type that are available to the implementation. This can be considered as a simplified search operation. Returns empty list if object type is correct but there are no objects of that type. Should fail if object type is wrong.

Specified by:
listObjects in interface ProvisioningService
paging - paging specification to limit operation result (optional)
parentResult - parent OperationResult (in/out)
Returns:
all objects of specified type (subject to paging)

searchObjects

public ObjectListType searchObjects(QueryType query,
                                    PagingType paging,
                                    OperationResult parentResult)
                             throws SchemaException,
                                    ObjectNotFoundException,
                                    CommunicationException
Description copied from interface: ProvisioningService
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.

Specified by:
searchObjects in interface ProvisioningService
Parameters:
query - search query
paging - paging specification to limit operation result (optional)
parentResult - parent OperationResult (in/out)
Returns:
all objects of specified type that match search criteria (subject to paging)
Throws:
SchemaException - unknown property used in search query
ObjectNotFoundException
CommunicationException

modifyObject

public void modifyObject(ObjectModificationType objectChange,
                         ScriptsType scripts,
                         OperationResult parentResult)
                  throws ObjectNotFoundException,
                         SchemaException,
                         CommunicationException
Description copied from interface: ProvisioningService
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. TODO: optimistic locking

Specified by:
modifyObject in interface ProvisioningService
Parameters:
objectChange - specification of object changes
scripts - scripts that should be executed before of after operation
parentResult - parent OperationResult (in/out)
Throws:
ObjectNotFoundException - specified object does not exist
SchemaException - resulting object would violate the schema
CommunicationException

deleteObject

public void deleteObject(java.lang.String oid,
                         ScriptsType scripts,
                         OperationResult parentResult)
                  throws ObjectNotFoundException,
                         CommunicationException,
                         SchemaException
Description copied from interface: ProvisioningService
Deleted object with provided OID. Must fail if object with specified OID does not exists. Should be atomic.

Specified by:
deleteObject in interface ProvisioningService
Parameters:
oid - OID of object to delete
scripts - scripts that should be executed before of after operation
parentResult - parent OperationResult (in/out)
Throws:
ObjectNotFoundException - specified object does not exist
CommunicationException
SchemaException

getPropertyAvailableValues

public PropertyAvailableValuesListType getPropertyAvailableValues(java.lang.String oid,
                                                                  PropertyReferenceListType properties,
                                                                  OperationResult parentResult)
                                                           throws ObjectNotFoundException
Description copied from interface: ProvisioningService
Returns list of available values for specified properties. The returned values can be used as valid values for properties of the specific object. The provided values can be used e.g. for listing them in GUI list boxes, for early validation (pre-validation), displaying help messages, auto-complete, etc. In case the list of available values is too big or it is not available, the empty list should be returned, setting the "closed" flag to false.

Specified by:
getPropertyAvailableValues in interface ProvisioningService
Parameters:
oid - OID of the object for which to determine values
properties - list of properties for which to determine values
parentResult - parentResult parent OperationResult (in/out)
Returns:
list of available values
Throws:
ObjectNotFoundException - specified object does not exist

testResource

public OperationResult testResource(java.lang.String resourceOid)
                             throws ObjectNotFoundException
Description copied from interface: ProvisioningService
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.

Specified by:
testResource in interface ProvisioningService
Parameters:
resourceOid - OID of resource to test
Returns:
results of executed tests
Throws:
ObjectNotFoundException - specified object does not exist

listResourceObjects

public ObjectListType listResourceObjects(java.lang.String resourceOid,
                                          javax.xml.namespace.QName objectType,
                                          PagingType paging,
                                          OperationResult parentResult)
Specified by:
listResourceObjects in interface ProvisioningService

searchObjectsIterative

public void searchObjectsIterative(QueryType query,
                                   PagingType paging,
                                   ResultHandler handler,
                                   OperationResult parentResult)
                            throws SchemaException,
                                   ObjectNotFoundException,
                                   CommunicationException
Description copied from interface: ProvisioningService
Search for objects iteratively. Searches through all object types. Calls a specified handler for each object found. If nothing is found the handler is not called and the operation returns. Should fail if object type is wrong. Should fail if unknown property is specified in the query.

Specified by:
searchObjectsIterative in interface ProvisioningService
Parameters:
query - search query
paging - paging specification to limit operation result (optional)
handler - result handler
parentResult - parent OperationResult (in/out)
Throws:
SchemaException - unknown property used in search query
ObjectNotFoundException - appropriate connector object was not found
CommunicationException


Copyright © 2011 evolveum. All Rights Reserved.