@Repository public class TestSqlRepositoryServiceImpl extends SqlRepositoryServiceImpl
MAX_CONSTRAINT_NAME_LENGTH, PERFORMANCE_LOG_NAME
LOCKING_EXP_THRESHOLD, LOCKING_MAX_ATTEMPTS, LOCKING_TIMEOUT_STEP
ADD_OBJECT, ADVANCE_SEQUENCE, CLAIM_TASK, CLASS_NAME_WITH_DOT, CLEANUP_TASKS, COUNT_OBJECTS, DELETE_OBJECT, EXECUTE_QUERY_DIAGNOSTICS, GET_OBJECT, GET_VERSION, LIST_ACCOUNT_SHADOW, LIST_OBJECTS, LIST_RESOURCE_OBJECT_SHADOWS, MODIFY_OBJECT, RELEASE_TASK, RETURN_UNUSED_VALUES_TO_SEQUENCE, SEARCH_CONTAINERS, SEARCH_OBJECTS, SEARCH_OBJECTS_ITERATIVE, SEARCH_SHADOW_OWNER
Constructor and Description |
---|
TestSqlRepositoryServiceImpl(SqlRepositoryFactory repositoryFactory) |
Modifier and Type | Method and Description |
---|---|
<T extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> |
addObject(PrismObject<T> object,
RepoAddOptions options,
OperationResult result)
Add new object.
|
<T extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> |
deleteObject(Class<T> type,
String oid,
OperationResult result)
Deletes object with specified OID.
|
<T extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> |
modifyObject(Class<T> type,
String oid,
Collection<? extends ItemDelta> modifications,
OperationResult result)
Modifies object using relative change description.
|
<T extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> |
modifyObject(Class<T> type,
String oid,
Collection<? extends ItemDelta> modifications,
RepoModifyOptions options,
OperationResult result) |
advanceSequence, countObjects, executeQueryDiagnostics, getClosureManager, getObject, getRepositoryDiag, getVersion, isAnySubordinate, listAccountShadowOwner, listResourceObjectShadows, repositorySelfTest, returnUnusedValuesToSequence, searchContainers, searchObjects, searchObjectsIterative, searchShadowOwner, testOrgClosureConsistency
getConfiguration, getMatchingRuleRegistry, getPerformanceMonitor, getPrismContext, setMatchingRuleRegistry, setPrismContext
public TestSqlRepositoryServiceImpl(SqlRepositoryFactory repositoryFactory)
public <T extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> String addObject(PrismObject<T> object, RepoAddOptions options, OperationResult result) throws ObjectAlreadyExistsException, SchemaException
RepositoryService
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.
Note: no need for explicit type parameter here. The object parameter contains the information.
addObject
in interface RepositoryService
addObject
in class SqlRepositoryServiceImpl
object
- object to createresult
- parent OperationResult (in/out)ObjectAlreadyExistsException
- object with specified identifiers already exists, cannot addSchemaException
- error dealing with storage schema, e.g. schema violationpublic <T extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> void deleteObject(Class<T> type, String oid, OperationResult result) throws ObjectNotFoundException
RepositoryService
Deletes object with specified OID.
Must fail if object with specified OID does not exists. Should be atomic.
deleteObject
in interface RepositoryService
deleteObject
in class SqlRepositoryServiceImpl
oid
- OID of object to deleteresult
- parent OperationResult (in/out)ObjectNotFoundException
- specified object does not existpublic <T extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> void modifyObject(Class<T> type, String oid, Collection<? extends ItemDelta> modifications, OperationResult result) throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException
RepositoryService
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 lockingmodifyObject
in interface RepositoryService
modifyObject
in class SqlRepositoryServiceImpl
result
- parent OperationResult (in/out)ObjectNotFoundException
- specified object does not existSchemaException
- resulting object would violate the schemaObjectAlreadyExistsException
- if resulting object would have name which already exists in another object of the same typepublic <T extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> void modifyObject(Class<T> type, String oid, Collection<? extends ItemDelta> modifications, RepoModifyOptions options, OperationResult result) throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException
modifyObject
in interface RepositoryService
modifyObject
in class SqlRepositoryServiceImpl
ObjectNotFoundException
SchemaException
ObjectAlreadyExistsException
Copyright © 2016 evolveum. All rights reserved.