Class ModelController
- java.lang.Object
-
- com.evolveum.midpoint.model.impl.controller.ModelController
-
- All Implemented Interfaces:
AccessCertificationService
,ModelService
,ScriptingService
,TaskService
,WorkflowService
@Component public class ModelController extends Object implements ModelService, TaskService, WorkflowService, ScriptingService, AccessCertificationService
This used to be an interface, but it was switched to class for simplicity. I don't expect that the implementation of the controller will be ever replaced. In extreme case the whole Model will be replaced by a different implementation, but not just the controller. However, the common way to extend the functionality will be the use of hooks that are implemented here. Great deal of code is copied from the old ModelControllerImpl.- Author:
- lazyman, Radovan Semancik
Note: don't autowire this bean by implementing class (ModelController), as it is proxied by Spring AOP. Use its interfaces instead.
-
-
Field Summary
Fields Modifier and Type Field Description static String
CLASS_NAME_WITH_DOT
-
Fields inherited from interface com.evolveum.midpoint.model.api.ModelService
AUTZ_NAMESPACE, CHECK_INDESTRUCTIBLE, COMPARE_OBJECT, COUNT_CONTAINERS, COUNT_OBJECTS, DISCOVER_CONNECTORS, EXECUTE_CHANGE, EXECUTE_CHANGES, GET_OBJECT, IMPORT_ACCOUNTS_FROM_RESOURCE, IMPORT_OBJECTS_FROM_FILE, IMPORT_OBJECTS_FROM_STREAM, LIST_ACCOUNT_SHADOW_OWNER, MERGE_OBJECTS, NOTIFY_CHANGE, OPERATION_LOGGER_NAME, POST_INIT, RECOMPUTE, SEARCH_CONTAINERS, SEARCH_OBJECTS
-
Fields inherited from interface com.evolveum.midpoint.model.api.TaskService
DO_NOT_STOP, DO_NOT_WAIT, WAIT_INDEFINITELY
-
-
Constructor Summary
Constructors Constructor Description ModelController()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
cancelCase(String caseOid, Task task, OperationResult parentResult)
void
claimWorkItem(WorkItemId workItemId, Task task, OperationResult parentResult)
void
cleanupCampaigns(@NotNull CleanupPolicyType policy, Task task, OperationResult result)
protected void
cleanupOperationResult(OperationResult result)
void
closeCampaign(String campaignOid, Task task, OperationResult result)
Closes a campaign.void
closeCurrentStage(String campaignOid, Task task, OperationResult parentResult)
Opens the next stage in the certification campaign.<T extends ObjectType>
CompareResultTypecompareObject(PrismObject<T> provided, Collection<SelectorOptions<GetOperationOptions>> rawReadOptions, ModelCompareOptions compareOptions, @NotNull List<? extends ItemPath> ignoreItems, Task task, OperationResult parentResult)
TODOvoid
completeWorkItem(@NotNull WorkItemId workItemId, @NotNull AbstractWorkItemOutputType output, @NotNull Task task, @NotNull OperationResult parentResult)
Approves or rejects a work itemvoid
completeWorkItem(WorkItemId workItemId, @NotNull AbstractWorkItemOutputType output, ObjectDelta additionalDelta, Task task, OperationResult parentResult)
Approves or rejects a work item.<T extends Containerable>
IntegercountContainers(Class<T> type, ObjectQuery query, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task task, OperationResult parentResult)
<T extends ObjectType>
IntegercountObjects(Class<T> type, ObjectQuery origQuery, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task task, OperationResult parentResult)
Count objects.int
countOpenWorkItems(ObjectQuery baseWorkItemsQuery, boolean notDecidedOnly, boolean allItems, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task task, OperationResult parentResult)
AccessCertificationCampaignType
createCampaign(String definitionOid, Task task, OperationResult parentResult)
Creates a certification campaign: creates AccessCertificationCampaignType object, based on general information in certification definition.boolean
deactivateServiceThreads(long timeToWait, Task operationTask, OperationResult parentResult)
Deactivates service threads (temporarily).void
delegateWorkItem(WorkItemId workItemId, WorkItemDelegationRequestType delegationRequest, Task task, OperationResult parentResult)
void
deleteWorkersAndWorkState(String rootTaskOid, boolean deleteWorkers, long subtasksWaitTime, Task operationTask, OperationResult parentResult)
Set<ConnectorType>
discoverConnectors(ConnectorHostType hostType, Task task, OperationResult parentResult)
Discovers local or remote connectors.ScriptExecutionResult
evaluateExpression(@NotNull ExecuteScriptType scriptExecutionCommand, @NotNull VariablesMap initialVariables, boolean recordProgressAndIterationStatistics, @NotNull Task task, @NotNull OperationResult result)
ScriptExecutionResult
evaluateExpression(ScriptingExpressionType expression, Task task, OperationResult result)
Synchronously executes any scripting expression (with no input data).void
evaluateExpressionInBackground(ExecuteScriptType executeScriptCommand, Task task, OperationResult parentResult)
void
evaluateExpressionInBackground(ScriptingExpressionType expression, Task task, OperationResult parentResult)
Asynchronously executes any scripting expression.void
evaluateIterativeExpressionInBackground(ExecuteScriptType executeScriptCommand, Task task, OperationResult parentResult)
Asynchronously executes any scripting expression.Collection<ObjectDeltaOperation<? extends ObjectType>>
executeChanges(Collection<ObjectDelta<? extends ObjectType>> deltas, ModelExecuteOptions options, Task task, OperationResult parentResult)
Execute the provided object deltas.Collection<ObjectDeltaOperation<? extends ObjectType>>
executeChanges(Collection<ObjectDelta<? extends ObjectType>> deltas, ModelExecuteOptions options, Task task, Collection<ProgressListener> statusListeners, OperationResult parentResult)
List<String>
getAllTaskCategories()
Deprecated.AccessCertificationCasesStatisticsType
getCampaignStatistics(String campaignOid, boolean currentStageOnly, Task task, OperationResult parentResult)
Provides statistical information about outcomes of cases in a given campaign.String
getHandlerUriForCategory(String category)
Deprecated.<T extends ObjectType>
@NotNull PrismObject<T>getObject(Class<T> clazz, String oid, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task task, OperationResult parentResult)
Returns object for provided OID.ModelObjectResolver
getObjectResolver()
@NotNull PrismContext
getPrismContext()
String
getRunningTasksThreadsDump(@NotNull Task task, @NotNull OperationResult parentResult)
boolean
getServiceThreadsActivationState()
Returns true if the service threads are running.PrismObject<TaskType>
getTaskByIdentifier(String identifier, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task operationTask, OperationResult parentResult)
Returns information about task, given its identifier.String
getTaskThreadsDump(@NotNull String taskOid, @NotNull Task task, @NotNull OperationResult parentResult)
String
getThreadsDump(@NotNull Task task, @NotNull OperationResult parentResult)
void
importFromResource(String shadowOid, Task task, OperationResult parentResult)
Import single account from resource.void
importFromResource(String resourceOid, QName objectClass, Task task, OperationResult parentResult)
Import accounts from resource.void
importObject(PrismObject object, ImportOptionsType options, Task task, OperationResult parentResult)
Import object.void
importObjectsFromFile(File input, ImportOptionsType options, Task task, OperationResult parentResult)
Import objects from file.void
importObjectsFromStream(InputStream input, String language, ImportOptionsType options, Task task, OperationResult parentResult)
Import objects from stream.protected boolean
isFilterNone(ObjectQuery query, OperationResult result)
protected void
logQuery(ObjectQuery query)
<O extends ObjectType>
Collection<ObjectDeltaOperation<? extends ObjectType>>mergeObjects(Class<O> type, String leftOid, String rightOid, String mergeConfigurationName, Task task, OperationResult parentResult)
Merge two objects into one.void
notifyChange(ResourceObjectShadowChangeDescriptionType changeDescription, Task task, OperationResult parentResult)
void
openNextStage(String campaignOid, Task task, OperationResult parentResult)
Opens the next review stage in the certification campaign.void
postInit(OperationResult parentResult)
Finish initialization of the model and lower system components (provisioning, repository, etc).void
reactivateServiceThreads(Task operationTask, OperationResult parentResult)
Re-activates the service threads after they have been deactivated.<F extends ObjectType>
voidrecompute(Class<F> type, String oid, ModelExecuteOptions options, Task task, OperationResult parentResult)
Recomputes focal object with the specified OID.void
reconcileWorkers(String oid, Task opTask, OperationResult result)
void
recordDecision(String campaignOid, long caseId, long workItemId, AccessCertificationResponseType response, String comment, Task task, OperationResult parentResult)
Records a particular decision of a reviewer.String
recordRunningTasksThreadsDump(String cause, @NotNull Task task, @NotNull OperationResult parentResult)
void
reiterateCampaign(String campaignOid, Task task, OperationResult result)
Reiterates a closed campaign.void
releaseWorkItem(WorkItemId workItemId, Task task, OperationResult parentResult)
void
resumeTask(String taskOid, Task operationTask, OperationResult parentResult)
void
resumeTasks(Collection<String> taskOids, Task operationTask, OperationResult parentResult)
Resume suspended tasks.void
resumeTaskTree(String coordinatorOid, Task operationTask, OperationResult parentResult)
void
scheduleTaskNow(String taskOid, Task operationTask, OperationResult parentResult)
void
scheduleTasksNow(Collection<String> taskOids, Task operationTask, OperationResult parentResult)
Schedules a RUNNABLE/CLOSED tasks to be run immediately.<T extends Containerable>
SearchResultList<T>searchContainers(Class<T> type, ObjectQuery query, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task task, OperationResult parentResult)
Search for "sub-object" structures, i.e.<T extends ObjectType>
SearchResultList<PrismObject<T>>searchObjects(Class<T> type, ObjectQuery origQuery, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task task, OperationResult parentResult)
Search for objects.<T extends ObjectType>
SearchResultMetadatasearchObjectsIterative(Class<T> type, ObjectQuery origQuery, ResultHandler<T> handler, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task task, OperationResult parentResult)
Search for objects in iterative fashion (using callback).List<AccessCertificationWorkItemType>
searchOpenWorkItems(ObjectQuery baseWorkItemsQuery, boolean notDecidedOnly, boolean allItems, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task task, OperationResult parentResult)
TODO update description Returns a set of certification decisions for currently logged-in user.PrismObject<? extends FocusType>
searchShadowOwner(String shadowOid, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task task, OperationResult parentResult)
Returns the Focus object representing owner of specified shadow.void
shutdown()
shutdown model and lower system componentsvoid
startRemediation(String campaignOid, Task task, OperationResult result)
Starts the remediation phase for the campaign.void
startSchedulers(Collection<String> nodeIdentifiers, Task operationTask, OperationResult parentResult)
Starts the scheduler on a given nodes.void
stopSchedulers(Collection<String> nodeIdentifiers, Task operationTask, OperationResult parentResult)
Stops the schedulers on a given nodes.boolean
stopSchedulersAndTasks(Collection<String> nodeIdentifiers, long waitTime, Task operationTask, OperationResult parentResult)
Stops a set of schedulers (on their nodes) and tasks that are executing on these nodes.void
suspendAndDeleteTask(String taskOid, long waitForStop, boolean alsoSubtasks, Task operationTask, OperationResult parentResult)
void
suspendAndDeleteTasks(Collection<String> taskOids, long waitForStop, boolean alsoSubtasks, Task operationTask, OperationResult parentResult)
Suspends tasks and deletes them.boolean
suspendTask(String taskOid, long waitForStop, Task operationTask, OperationResult parentResult)
boolean
suspendTasks(Collection<String> taskOids, long waitForStop, Task operationTask, OperationResult parentResult)
Suspends a set of tasks.boolean
suspendTaskTree(String taskOid, long waitForStop, Task operationTask, OperationResult parentResult)
void
synchronizeTasks(Task operationTask, OperationResult parentResult)
Synchronizes information in midPoint repository and task scheduling database.OperationResult
testResource(String resourceOid, Task task)
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
-
Methods inherited from interface com.evolveum.midpoint.model.api.AccessCertificationService
countOpenWorkItems, searchOpenWorkItems
-
-
-
-
Field Detail
-
CLASS_NAME_WITH_DOT
public static final String CLASS_NAME_WITH_DOT
-
-
Method Detail
-
getObjectResolver
public ModelObjectResolver getObjectResolver()
-
getObject
@NotNull public <T extends ObjectType> @NotNull PrismObject<T> getObject(Class<T> clazz, String oid, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException
Description copied from interface:ModelService
Returns object for provided OID. It retrieves the object from an appropriate source for an object type (e.g. internal repository, resource or both), merging data as necessary, processing any policies, caching mechanisms, etc. This can be influenced by using options.
Fails if object with the OID does not exists.
- Specified by:
getObject
in interfaceModelService
- Parameters:
clazz
- (class) of an object to getoid
- OID of the object to getrawOptions
- options influencing the retrieval and processing of the objecttask
- Task instance. It gives context to the execution (e.g. security context)parentResult
- parent OperationResult (in/out)- Returns:
- Retrieved object
- Throws:
ObjectNotFoundException
- requested object does not existSchemaException
- the object is not schema compliantCommunicationException
- Communication (network) error during retrieval. E.g. error communicating with the resourceConfigurationException
- Configuration error. E.g. misconfigured resource parameters, invalid policies, etc.SecurityViolationException
- Security violation during operation execution. May be caused either by midPoint internal security mechanism but also by external mechanism (e.g. on the resource)ExpressionEvaluationException
-
executeChanges
public Collection<ObjectDeltaOperation<? extends ObjectType>> executeChanges(Collection<ObjectDelta<? extends ObjectType>> deltas, ModelExecuteOptions options, Task task, OperationResult parentResult) throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException, PolicyViolationException, SecurityViolationException
Description copied from interface:ModelService
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.
- Specified by:
executeChanges
in interfaceModelService
- Parameters:
deltas
- Collection of object deltas to executeoptions
- options influencing processing of the deltastask
- Task instance. It gives context to the execution (e.g. security context)parentResult
- parent OperationResult (in/out)- Returns:
- A collection of executed ObjectDeltaOperations (ObjectDelta + OperationResult). OIDs of newly created objects can be found in these ObjectDeltas (which may or may not be original ObjectDeltas passed to the method).
- Throws:
ObjectAlreadyExistsException
- object with specified identifiers already exists, cannot addObjectNotFoundException
- 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 schemaExpressionEvaluationException
- evaluation of expression associated with the object has failedCommunicationException
- Communication (network) error during retrieval. E.g. error communicating with the resourceConfigurationException
- Configuration error. E.g. misconfigured resource parameters, invalid policies, etc.PolicyViolationException
- Policy violation was detected during processing of the objectSecurityViolationException
- Security violation during operation execution. May be caused either by midPoint internal security mechanism but also by external mechanism (e.g. on the resource)
-
executeChanges
public Collection<ObjectDeltaOperation<? extends ObjectType>> executeChanges(Collection<ObjectDelta<? extends ObjectType>> deltas, ModelExecuteOptions options, Task task, Collection<ProgressListener> statusListeners, OperationResult parentResult) throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException, PolicyViolationException, SecurityViolationException
-
cleanupOperationResult
protected void cleanupOperationResult(OperationResult result)
-
recompute
public <F extends ObjectType> void recompute(Class<F> type, String oid, ModelExecuteOptions options, Task task, OperationResult parentResult) throws SchemaException, PolicyViolationException, ExpressionEvaluationException, ObjectNotFoundException, ObjectAlreadyExistsException, CommunicationException, ConfigurationException, SecurityViolationException
Description copied from interface:ModelService
Recomputes focal object with the specified OID. The operation considers all the applicable policies and mapping and tries to re-apply them as necessary.- Specified by:
recompute
in interfaceModelService
- Parameters:
type
- type (class) of an object to recomputeoid
- OID of the object to recomputeoptions
- execute optionstask
- Task instance. It gives context to the execution (e.g. security context)parentResult
- parent OperationResult (in/out)- Throws:
SchemaException
PolicyViolationException
ExpressionEvaluationException
ObjectNotFoundException
ObjectAlreadyExistsException
CommunicationException
ConfigurationException
SecurityViolationException
-
searchObjects
public <T extends ObjectType> SearchResultList<PrismObject<T>> searchObjects(Class<T> type, ObjectQuery origQuery, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task task, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException
Description copied from interface:ModelService
Search for objects.
Searches through all object of a specified type. Returns a list of objects that match search criteria.
Note that this method has a very limited scaling capability as all the results are stored in the memory. DO NOT USE on large datasets. Recommended usage is only when using queries that cannot return large number of results (e.g. queries for unique values) or when combined with paging capability. For other cases use searchObjectsIterative instead.
Returns empty list if object type is correct but there are no objects of that type. Fails if object type is wrong. Should fail if unknown property is specified in the query.
- Specified by:
searchObjects
in interfaceModelService
- Parameters:
type
- (class) of an object to searchorigQuery
- search queryrawOptions
- options influencing the retrieval and processing of the objectstask
- Task instance. It gives context to the execution (e.g. security context)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 queryObjectNotFoundException
- object required for a search was not found (e.g. resource definition)CommunicationException
- Communication (network) error during retrieval. E.g. error communicating with the resourceConfigurationException
- Configuration error. E.g. misconfigured resource parameters, invalid policies, etc.SecurityViolationException
- Security violation during operation execution. May be caused either by midPoint internal security mechanism but also by external mechanism (e.g. on the resource)ExpressionEvaluationException
-
searchContainers
public <T extends Containerable> SearchResultList<T> searchContainers(Class<T> type, ObjectQuery query, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task task, OperationResult parentResult) throws SchemaException, SecurityViolationException, ConfigurationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException
Description copied from interface:ModelService
Search for "sub-object" structures, i.e. containers. Supported types are: AccessCertificationCaseType, CaseWorkItemType.- Specified by:
searchContainers
in interfaceModelService
- Throws:
SchemaException
SecurityViolationException
ConfigurationException
ObjectNotFoundException
ExpressionEvaluationException
CommunicationException
-
countContainers
public <T extends Containerable> Integer countContainers(Class<T> type, ObjectQuery query, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task task, OperationResult parentResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException
- Specified by:
countContainers
in interfaceModelService
- Throws:
SchemaException
SecurityViolationException
ObjectNotFoundException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
isFilterNone
protected boolean isFilterNone(ObjectQuery query, OperationResult result)
-
logQuery
protected void logQuery(ObjectQuery query)
-
searchObjectsIterative
public <T extends ObjectType> SearchResultMetadata searchObjectsIterative(Class<T> type, ObjectQuery origQuery, ResultHandler<T> handler, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task task, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException
Description copied from interface:ModelService
Search for objects in iterative fashion (using callback).
Searches through all object of a specified type. A handler is invoked for each object found.
The handler is not called at all if object type is correct but there are no objects of that type. Fails if object type is wrong. Should fail if unknown property is specified in the query.
- Specified by:
searchObjectsIterative
in interfaceModelService
- Parameters:
type
- (class) of an object to searchorigQuery
- search queryhandler
- callback handler that will be called for each found objectrawOptions
- options influencing the retrieval and processing of the objectstask
- Task instance. It gives context to the execution (e.g. security context)parentResult
- parent OperationResult (in/out)- Throws:
SchemaException
- unknown property used in search queryObjectNotFoundException
- object required for a search was not found (e.g. resource definition)CommunicationException
- Communication (network) error during retrieval. E.g. error communicating with the resourceConfigurationException
- Configuration error. E.g. misconfigured resource parameters, invalid policies, etc.SecurityViolationException
- Security violation during operation execution. May be caused either by midPoint internal security mechanism but also by external mechanism (e.g. on the resource)ExpressionEvaluationException
-
countObjects
public <T extends ObjectType> Integer countObjects(Class<T> type, ObjectQuery origQuery, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task task, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, ConfigurationException, SecurityViolationException, CommunicationException, ExpressionEvaluationException
Description copied from interface:ModelService
Count objects.
Searches through all object of a specified type and returns a count of such objects. This method is usually much more efficient than equivalent search method. It is used mostly for presentation purposes, e.g. displaying correct number of pages in the GUI listings.
- Specified by:
countObjects
in interfaceModelService
- Parameters:
type
- (class) of an object to searchorigQuery
- search queryrawOptions
- options influencing the retrieval and processing of the objectstask
- Task instance. It gives context to the execution (e.g. security context)parentResult
- parent OperationResult (in/out)- Returns:
- number of objects of specified type that match search criteria (subject to paging). May return null if the number of objects is not known.
- Throws:
SchemaException
- unknown property used in search queryObjectNotFoundException
- object required for a search was not found (e.g. resource definition)ConfigurationException
- Configuration error. E.g. misconfigured resource parameters, invalid policies, etc.SecurityViolationException
- Security violation during operation execution. May be caused either by midPoint internal security mechanism but also by external mechanism (e.g. on the resource)CommunicationException
- Communication (network) error during retrieval. E.g. error communicating with the resourceExpressionEvaluationException
-
searchShadowOwner
public PrismObject<? extends FocusType> searchShadowOwner(String shadowOid, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task task, OperationResult parentResult) throws ObjectNotFoundException, SecurityViolationException, SchemaException, ConfigurationException, ExpressionEvaluationException, CommunicationException
Description copied from interface:ModelService
Returns the Focus object representing owner of specified 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.
- Specified by:
searchShadowOwner
in interfaceModelService
- Parameters:
shadowOid
- OID of the shadow to look for an ownertask
- Task instance. It gives context to the execution (e.g. security context)parentResult
- parent OperationResult (in/out)- Returns:
- owner of the account or null
- Throws:
ObjectNotFoundException
- specified account was not foundSecurityViolationException
SchemaException
ConfigurationException
ExpressionEvaluationException
CommunicationException
-
testResource
public OperationResult testResource(String resourceOid, Task task) throws ObjectNotFoundException
Description copied from interface:ModelService
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).
- Specified by:
testResource
in interfaceModelService
- Parameters:
resourceOid
- OID of resource to test- Returns:
- results of executed tests
- Throws:
ObjectNotFoundException
- specified object does not exist
-
importFromResource
public void importFromResource(String resourceOid, QName objectClass, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException
Description copied from interface:ModelService
Import accounts from resource.
Invocation of this method may be switched to background.
TODO: Better description- Specified by:
importFromResource
in interfaceModelService
- Throws:
ObjectNotFoundException
SchemaException
CommunicationException
ConfigurationException
SecurityViolationException
ExpressionEvaluationException
-
importFromResource
public void importFromResource(String shadowOid, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException
Description copied from interface:ModelService
Import single account from resource.
TODO: Better description- Specified by:
importFromResource
in interfaceModelService
- Throws:
ObjectNotFoundException
SchemaException
CommunicationException
ConfigurationException
SecurityViolationException
ExpressionEvaluationException
-
importObjectsFromFile
public void importObjectsFromFile(File input, ImportOptionsType options, Task task, OperationResult parentResult) throws FileNotFoundException
Description copied from interface:ModelService
Import objects from file. Invocation of this method may be switched to background.- Specified by:
importObjectsFromFile
in interfaceModelService
- Throws:
FileNotFoundException
-
importObjectsFromStream
public void importObjectsFromStream(InputStream input, String language, ImportOptionsType options, Task task, OperationResult parentResult)
Description copied from interface:ModelService
Import objects from stream. Invocation of this method will happen in foreground, as the stream cannot be serialized. The results will be provided in the task.- Specified by:
importObjectsFromStream
in interfaceModelService
-
importObject
public void importObject(PrismObject object, ImportOptionsType options, Task task, OperationResult parentResult)
Description copied from interface:ModelService
Import object. The results will be provided in the task.- Specified by:
importObject
in interfaceModelService
-
discoverConnectors
public Set<ConnectorType> discoverConnectors(ConnectorHostType hostType, Task task, OperationResult parentResult) throws CommunicationException, SecurityViolationException, SchemaException, ConfigurationException, ObjectNotFoundException, ExpressionEvaluationException
Description copied from interface:ModelService
Discovers local or remote connectors. The operation will try to search for new connectors. It works either on local host (hostType is null) or on a remote host (hostType is not null). All discovered connectors are stored in the repository. It returns connectors that were discovered: those that were not in the repository before invocation of this operation.- Specified by:
discoverConnectors
in interfaceModelService
- Parameters:
hostType
- definition of a connector host or nullparentResult
- parentResult parent OperationResult (in/out)- Returns:
- discovered connectors
- Throws:
CommunicationException
- error communicating with the connector hostSecurityViolationException
SchemaException
ConfigurationException
ObjectNotFoundException
ExpressionEvaluationException
-
postInit
public void postInit(OperationResult parentResult)
Description copied from interface:ModelService
Finish initialization of the model and lower system components (provisioning, repository, etc). The implementation may execute resource-intensive tasks in this method. All the dependencies should be already constructed, properly wired and initialized. Also logging and other infrastructure should be already set up.- Specified by:
postInit
in interfaceModelService
-
shutdown
public void shutdown()
Description copied from interface:ModelService
shutdown model and lower system components- Specified by:
shutdown
in interfaceModelService
-
compareObject
public <T extends ObjectType> CompareResultType compareObject(PrismObject<T> provided, Collection<SelectorOptions<GetOperationOptions>> rawReadOptions, ModelCompareOptions compareOptions, @NotNull @NotNull List<? extends ItemPath> ignoreItems, Task task, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, SecurityViolationException, CommunicationException, ConfigurationException, ExpressionEvaluationException
Description copied from interface:ModelService
TODO- Specified by:
compareObject
in interfaceModelService
- Throws:
SchemaException
ObjectNotFoundException
SecurityViolationException
CommunicationException
ConfigurationException
ExpressionEvaluationException
-
suspendTasks
public boolean suspendTasks(Collection<String> taskOids, long waitForStop, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:TaskService
Suspends a set of tasks. Sets their execution status to SUSPENDED. Stops their execution (unless doNotStop is set).- Specified by:
suspendTasks
in interfaceTaskService
- Parameters:
taskOids
- a collection of OIDs of tasks that have to be suspendedwaitForStop
- how long (in milliseconds) to wait for stopping the execution of tasks; WAIT_INDEFINITELY means wait indefinitely DO_NOT_WAIT means stop the tasks, but do not wait for finishing their execution DO_NOT_STOP means do not try to stop the task execution. Tasks will only be put into SUSPENDED state, and their executions (if any) will be left as they are. Use this option only when you know what you're doing.operationTask
- Task in which the operation is executed. NOT the task that be being operated on.- Returns:
- true if all the tasks were stopped, false if some tasks continue to run or if stopping was not requested (DO_NOT_STOP option)
- Throws:
SecurityViolationException
ObjectNotFoundException
SchemaException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
suspendTask
public boolean suspendTask(String taskOid, long waitForStop, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException
- Specified by:
suspendTask
in interfaceTaskService
- Throws:
SecurityViolationException
ObjectNotFoundException
SchemaException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
suspendTaskTree
public boolean suspendTaskTree(String taskOid, long waitForStop, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException
- Specified by:
suspendTaskTree
in interfaceTaskService
- Throws:
SecurityViolationException
ObjectNotFoundException
SchemaException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
suspendAndDeleteTasks
public void suspendAndDeleteTasks(Collection<String> taskOids, long waitForStop, boolean alsoSubtasks, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:TaskService
Suspends tasks and deletes them.- Specified by:
suspendAndDeleteTasks
in interfaceTaskService
- Parameters:
taskOids
- Collection of task OIDs to be suspended and deleted.waitForStop
- How long (in milliseconds) to wait for task stop before proceeding with deletion. WAIT_INDEFINITELY means wait indefinitely DO_NOT_WAIT means stop the tasks, but do not wait for finishing their execution DO_NOT_STOP means do not try to stop the task execution. Tasks will only be put into SUSPENDED state, and their executions (if any) will be left as they are. Use this option only when you know what you're doing.alsoSubtasks
- Should also subtasks be deleted?- Throws:
SecurityViolationException
ObjectNotFoundException
SchemaException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
suspendAndDeleteTask
public void suspendAndDeleteTask(String taskOid, long waitForStop, boolean alsoSubtasks, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException
- Specified by:
suspendAndDeleteTask
in interfaceTaskService
- Throws:
SecurityViolationException
ObjectNotFoundException
SchemaException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
resumeTasks
public void resumeTasks(Collection<String> taskOids, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:TaskService
Resume suspended tasks.- Specified by:
resumeTasks
in interfaceTaskService
- Parameters:
taskOids
- a collection of OIDs of tasks that have to be resumed- Throws:
ObjectNotFoundException
SchemaException
SecurityViolationException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
resumeTask
public void resumeTask(String taskOid, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException
- Specified by:
resumeTask
in interfaceTaskService
- Throws:
SecurityViolationException
ObjectNotFoundException
SchemaException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
resumeTaskTree
public void resumeTaskTree(String coordinatorOid, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException
- Specified by:
resumeTaskTree
in interfaceTaskService
- Throws:
SecurityViolationException
ObjectNotFoundException
SchemaException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
scheduleTasksNow
public void scheduleTasksNow(Collection<String> taskOids, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:TaskService
Schedules a RUNNABLE/CLOSED tasks to be run immediately. (If a task will really start immediately, depends e.g. on whether a scheduler is started, whether there are available threads, and so on.)- Specified by:
scheduleTasksNow
in interfaceTaskService
- Parameters:
taskOids
- a collection of OIDs of tasks that have to be scheduled- Throws:
SecurityViolationException
ObjectNotFoundException
SchemaException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
scheduleTaskNow
public void scheduleTaskNow(String taskOid, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException
- Specified by:
scheduleTaskNow
in interfaceTaskService
- Throws:
SecurityViolationException
ObjectNotFoundException
SchemaException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
getTaskByIdentifier
public PrismObject<TaskType> getTaskByIdentifier(String identifier, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task operationTask, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException, CommunicationException
Description copied from interface:TaskService
Returns information about task, given its identifier.- Specified by:
getTaskByIdentifier
in interfaceTaskService
- Returns:
- Throws:
SchemaException
ObjectNotFoundException
ConfigurationException
SecurityViolationException
ExpressionEvaluationException
CommunicationException
-
deactivateServiceThreads
public boolean deactivateServiceThreads(long timeToWait, Task operationTask, OperationResult parentResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:TaskService
Deactivates service threads (temporarily). This will suspend all background activity such as scanning threads, heartbeats and similar mechanisms. Note: The threads are normally activated after task manager implementation starts. This methods should not be used in a normal case. WARNING: this feature is intended for development-time diagnostics and should not be used on production environments. Suspending the threads may affect correct behavior of the system (such as timeouts on heartbeats). Use this feature only if you really know what you are doing. timeToWait is only for orientation = it may be so that the implementation would wait 2 or 3 times this value (if it waits separately for several threads completion)
-
reactivateServiceThreads
public void reactivateServiceThreads(Task operationTask, OperationResult parentResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:TaskService
Re-activates the service threads after they have been deactivated.
-
getServiceThreadsActivationState
public boolean getServiceThreadsActivationState()
Description copied from interface:TaskService
Returns true if the service threads are running. This method returns true in a normal case. It returns false is the threads were temporarily suspended.- Specified by:
getServiceThreadsActivationState
in interfaceTaskService
- Returns:
- true if the service threads are running.
-
stopSchedulers
public void stopSchedulers(Collection<String> nodeIdentifiers, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:TaskService
Stops the schedulers on a given nodes. This means that at that nodes no tasks will be started.- Specified by:
stopSchedulers
in interfaceTaskService
- Parameters:
nodeIdentifiers
- Nodes on which the schedulers should be stopped.- Throws:
SecurityViolationException
ObjectNotFoundException
SchemaException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
stopSchedulersAndTasks
public boolean stopSchedulersAndTasks(Collection<String> nodeIdentifiers, long waitTime, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:TaskService
Stops a set of schedulers (on their nodes) and tasks that are executing on these nodes.- Specified by:
stopSchedulersAndTasks
in interfaceTaskService
- Parameters:
nodeIdentifiers
- collection of node identifierswaitTime
- how long to wait for task shutdown, in milliseconds WAIT_INDEFINITELY means wait indefinitely DO_NOT_WAIT means stop the tasks, but do not wait for finishing their execution- Returns:
- Throws:
ExpressionEvaluationException
SecurityViolationException
ObjectNotFoundException
SchemaException
CommunicationException
ConfigurationException
-
startSchedulers
public void startSchedulers(Collection<String> nodeIdentifiers, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:TaskService
Starts the scheduler on a given nodes. A prerequisite is that nodes are running and their TaskManagers are not in an error state.- Specified by:
startSchedulers
in interfaceTaskService
- Parameters:
nodeIdentifiers
- Nodes on which the scheduler should be started.- Throws:
SecurityViolationException
ObjectNotFoundException
SchemaException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
synchronizeTasks
public void synchronizeTasks(Task operationTask, OperationResult parentResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:TaskService
Synchronizes information in midPoint repository and task scheduling database. Not needed to use during normal operation (only when problems occur).- Specified by:
synchronizeTasks
in interfaceTaskService
- Throws:
SchemaException
SecurityViolationException
ObjectNotFoundException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
reconcileWorkers
public void reconcileWorkers(String oid, Task opTask, OperationResult result) throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, ExpressionEvaluationException, ObjectAlreadyExistsException
-
deleteWorkersAndWorkState
public void deleteWorkersAndWorkState(String rootTaskOid, boolean deleteWorkers, long subtasksWaitTime, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException
-
getAllTaskCategories
@Deprecated public List<String> getAllTaskCategories()
Deprecated.Description copied from interface:TaskService
Gets a list of all task categories.- Specified by:
getAllTaskCategories
in interfaceTaskService
-
getHandlerUriForCategory
@Deprecated public String getHandlerUriForCategory(String category)
Deprecated.Description copied from interface:TaskService
Returns a default handler URI for a given task category.- Specified by:
getHandlerUriForCategory
in interfaceTaskService
-
completeWorkItem
public void completeWorkItem(WorkItemId workItemId, @NotNull @NotNull AbstractWorkItemOutputType output, ObjectDelta additionalDelta, Task task, OperationResult parentResult) throws SecurityViolationException, SchemaException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:WorkflowService
Approves or rejects a work item. Additional delta is here present in "prism" form (not as ObjectDeltaType), to simplify the life for clients. It is applied only if the output signals that work item is approved.- Specified by:
completeWorkItem
in interfaceWorkflowService
- Throws:
SecurityViolationException
SchemaException
ObjectNotFoundException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
completeWorkItem
public void completeWorkItem(@NotNull @NotNull WorkItemId workItemId, @NotNull @NotNull AbstractWorkItemOutputType output, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult parentResult) throws SecurityViolationException, SchemaException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:WorkflowService
Approves or rejects a work item- Specified by:
completeWorkItem
in interfaceWorkflowService
- Throws:
SecurityViolationException
SchemaException
ObjectNotFoundException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
cancelCase
public void cancelCase(String caseOid, Task task, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, SecurityViolationException, ExpressionEvaluationException, CommunicationException, ConfigurationException, ObjectAlreadyExistsException
-
claimWorkItem
public void claimWorkItem(WorkItemId workItemId, Task task, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException, CommunicationException, ConfigurationException, ExpressionEvaluationException
-
releaseWorkItem
public void releaseWorkItem(WorkItemId workItemId, Task task, OperationResult parentResult) throws ObjectNotFoundException, SecurityViolationException, SchemaException, ObjectAlreadyExistsException, CommunicationException, ConfigurationException, ExpressionEvaluationException
-
delegateWorkItem
public void delegateWorkItem(WorkItemId workItemId, WorkItemDelegationRequestType delegationRequest, Task task, OperationResult parentResult) throws ObjectNotFoundException, SecurityViolationException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException
- Specified by:
delegateWorkItem
in interfaceWorkflowService
- Throws:
ObjectNotFoundException
SecurityViolationException
SchemaException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
evaluateExpressionInBackground
public void evaluateExpressionInBackground(ScriptingExpressionType expression, Task task, OperationResult parentResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:ScriptingService
Asynchronously executes any scripting expression.- Specified by:
evaluateExpressionInBackground
in interfaceScriptingService
- Parameters:
expression
- Expression to be executed.task
- Task in context of which the script should execute. The task should be "clean", i.e. (1) transient, (2) without any handler. This method puts the task into background, and assigns ScriptExecutionTaskHandler to it, to execute the script.- Throws:
SchemaException
CommunicationException
ConfigurationException
SecurityViolationException
ObjectNotFoundException
ExpressionEvaluationException
-
evaluateExpressionInBackground
public void evaluateExpressionInBackground(ExecuteScriptType executeScriptCommand, Task task, OperationResult parentResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException
-
evaluateIterativeExpressionInBackground
public void evaluateIterativeExpressionInBackground(ExecuteScriptType executeScriptCommand, Task task, OperationResult parentResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:ScriptingService
Asynchronously executes any scripting expression.- Specified by:
evaluateIterativeExpressionInBackground
in interfaceScriptingService
- Parameters:
executeScriptCommand
- ExecuteScript to be executed.task
- Task in context of which the script should execute. The task should be "clean", i.e. (1) transient, (2) without any handler. This method puts the task into background, and assigns IterativeScriptExecutionTaskHandler to it, to execute the script.- Throws:
SchemaException
CommunicationException
ConfigurationException
SecurityViolationException
ObjectNotFoundException
ExpressionEvaluationException
-
evaluateExpression
public ScriptExecutionResult evaluateExpression(ScriptingExpressionType expression, Task task, OperationResult result) throws ScriptExecutionException, SchemaException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:ScriptingService
Synchronously executes any scripting expression (with no input data).- Specified by:
evaluateExpression
in interfaceScriptingService
- Parameters:
expression
- Scripting expression to execute.task
- Task in context of which the script should execute (in foreground!)result
- Operation result- Throws:
ScriptExecutionException
- TODO return ExecutionContext (requires moving the context to model api)SchemaException
SecurityViolationException
ObjectNotFoundException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
evaluateExpression
public ScriptExecutionResult evaluateExpression(@NotNull @NotNull ExecuteScriptType scriptExecutionCommand, @NotNull @NotNull VariablesMap initialVariables, boolean recordProgressAndIterationStatistics, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result) throws ScriptExecutionException, SchemaException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException
-
getCampaignStatistics
public AccessCertificationCasesStatisticsType getCampaignStatistics(String campaignOid, boolean currentStageOnly, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, SecurityViolationException, ObjectAlreadyExistsException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:AccessCertificationService
Provides statistical information about outcomes of cases in a given campaign.- Specified by:
getCampaignStatistics
in interfaceAccessCertificationService
- Parameters:
campaignOid
- OID of the campaign to report oncurrentStageOnly
- Whether to report on stage outcomes for current-stage cases (if true), or to report on overall outcomes of all cases (if false).task
- Task in context of which all operations will take place.parentResult
- Result for the operations.- Returns:
- filled-in statistics object
- Throws:
ObjectNotFoundException
SchemaException
SecurityViolationException
ObjectAlreadyExistsException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
cleanupCampaigns
public void cleanupCampaigns(@NotNull @NotNull CleanupPolicyType policy, Task task, OperationResult result)
- Specified by:
cleanupCampaigns
in interfaceAccessCertificationService
-
recordDecision
public void recordDecision(String campaignOid, long caseId, long workItemId, AccessCertificationResponseType response, String comment, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, SecurityViolationException, ObjectAlreadyExistsException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:AccessCertificationService
Records a particular decision of a reviewer.- Specified by:
recordDecision
in interfaceAccessCertificationService
- Parameters:
campaignOid
- OID of the campaign to which the decision belongs.caseId
- ID of the certification case to which the decision belongs.workItemId
- ID of the work item to which the decision belongs.response
- The response.comment
- Reviewer's comment.task
- Task in context of which all operations will take place.parentResult
- Result for the operations.- Throws:
ObjectNotFoundException
SchemaException
SecurityViolationException
ObjectAlreadyExistsException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
searchOpenWorkItems
public List<AccessCertificationWorkItemType> searchOpenWorkItems(ObjectQuery baseWorkItemsQuery, boolean notDecidedOnly, boolean allItems, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, SecurityViolationException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:AccessCertificationService
TODO update description Returns a set of certification decisions for currently logged-in user. Each decision is returned in context of its certification case. Case has to match a given query. So, in contrast to model.searchContainers(AccessCertificationCaseType...) method that returns specified cases with all their decisions, this one returns a list of cases where each case has at most one decision: the one that corresponds to specified reviewer and current certification stage. Zero decisions means that the reviewer has not provided any decision yet. Query argument for cases is the same as in the model.searchContainers(AccessCertificationCaseType...) call.- Specified by:
searchOpenWorkItems
in interfaceAccessCertificationService
- Parameters:
baseWorkItemsQuery
- Specification of the cases to retrieve.notDecidedOnly
- If true, only response==(NO_DECISION or null) should be returned. Although it can be formulated in Query API terms, this would refer to implementation details - so the cleaner way is keep this knowledge inside certification module only.allItems
- If true, returns items for all users (requires "ALL" authorization).rawOptions
- Options to use (e.g. RESOLVE_NAMES).task
- Task in context of which all operations will take place.parentResult
- Result for the operations.- Returns:
- A list of relevant certification cases.
- Throws:
ObjectNotFoundException
SchemaException
SecurityViolationException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
countOpenWorkItems
public int countOpenWorkItems(ObjectQuery baseWorkItemsQuery, boolean notDecidedOnly, boolean allItems, Collection<SelectorOptions<GetOperationOptions>> rawOptions, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, SecurityViolationException, ExpressionEvaluationException, CommunicationException, ConfigurationException
-
closeCampaign
public void closeCampaign(String campaignOid, Task task, OperationResult result) throws ObjectNotFoundException, SchemaException, SecurityViolationException, ObjectAlreadyExistsException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:AccessCertificationService
Closes a campaign.
-
reiterateCampaign
public void reiterateCampaign(String campaignOid, Task task, OperationResult result) throws ObjectNotFoundException, SchemaException, SecurityViolationException, ObjectAlreadyExistsException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:AccessCertificationService
Reiterates a closed campaign.
-
startRemediation
public void startRemediation(String campaignOid, Task task, OperationResult result) throws ObjectNotFoundException, SchemaException, SecurityViolationException, ObjectAlreadyExistsException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:AccessCertificationService
Starts the remediation phase for the campaign. The campaign has to be in the last stage and that stage has to be already closed.
-
closeCurrentStage
public void closeCurrentStage(String campaignOid, Task task, OperationResult parentResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ObjectAlreadyExistsException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:AccessCertificationService
Opens the next stage in the certification campaign. If the stage being opened is the first stage, certification cases will be generated for the campaign, depending on the certification definition (scope and handler). In all stages, reviewers will be assigned to cases, based again on the definition (reviewer specification in stage definition and handler).- Specified by:
closeCurrentStage
in interfaceAccessCertificationService
- Parameters:
campaignOid
- Certification campaign OID.task
- Task in context of which all operations will take place.parentResult
- Result for the operations.- Throws:
SchemaException
SecurityViolationException
ObjectNotFoundException
ObjectAlreadyExistsException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
openNextStage
public void openNextStage(String campaignOid, Task task, OperationResult parentResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ObjectAlreadyExistsException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:AccessCertificationService
Opens the next review stage in the certification campaign. If the stage being opened is the first stage, certification cases will be generated for the campaign, depending on the certification definition (scope and handler). In all stages, reviewers will be assigned to cases, based again on the definition (reviewer specification in stage definition and handler).- Specified by:
openNextStage
in interfaceAccessCertificationService
- Parameters:
campaignOid
- Certification campaign OID.task
- Task in context of which all operations will take place.parentResult
- Result for the operations.- Throws:
SchemaException
SecurityViolationException
ObjectNotFoundException
ObjectAlreadyExistsException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
createCampaign
public AccessCertificationCampaignType createCampaign(String definitionOid, Task task, OperationResult parentResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ObjectAlreadyExistsException, ExpressionEvaluationException, CommunicationException, ConfigurationException
Description copied from interface:AccessCertificationService
Creates a certification campaign: creates AccessCertificationCampaignType object, based on general information in certification definition. Mandatory information in the certification definition are: - definition name - definition description - handlerUri - scope definition - stage(s) definition Optional information in the certification definition: - tenant reference Owner of newly created campaign is the currently logged-on user. The campaign will NOT be started upon creation. It should be started explicitly by calling openNextStage method.- Specified by:
createCampaign
in interfaceAccessCertificationService
- Parameters:
definitionOid
- OID of certification definition for this campaign.task
- Task in context of which all operations will take place.parentResult
- Result for the operations.- Returns:
- Object for the created campaign. It will be stored in the repository as well.
- Throws:
SchemaException
SecurityViolationException
ObjectNotFoundException
ObjectAlreadyExistsException
ExpressionEvaluationException
CommunicationException
ConfigurationException
-
mergeObjects
public <O extends ObjectType> Collection<ObjectDeltaOperation<? extends ObjectType>> mergeObjects(Class<O> type, String leftOid, String rightOid, String mergeConfigurationName, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, ConfigurationException, ObjectAlreadyExistsException, ExpressionEvaluationException, CommunicationException, PolicyViolationException, SecurityViolationException
Description copied from interface:ModelService
Merge two objects into one. EXPERIMENTAL feature. The method signature is likely to change in the future.- Specified by:
mergeObjects
in interfaceModelService
- Parameters:
type
- object typeleftOid
- left-side object OIDrightOid
- right-side object OIDmergeConfigurationName
- name of the merge configuration to use- Throws:
ObjectNotFoundException
SchemaException
ConfigurationException
ObjectAlreadyExistsException
ExpressionEvaluationException
CommunicationException
PolicyViolationException
SecurityViolationException
-
getPrismContext
@NotNull public @NotNull PrismContext getPrismContext()
- Specified by:
getPrismContext
in interfaceModelService
-
getThreadsDump
public String getThreadsDump(@NotNull @NotNull Task task, @NotNull @NotNull OperationResult parentResult) throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, ExpressionEvaluationException
- Specified by:
getThreadsDump
in interfaceTaskService
- Throws:
CommunicationException
ObjectNotFoundException
SchemaException
SecurityViolationException
ConfigurationException
ExpressionEvaluationException
-
getRunningTasksThreadsDump
public String getRunningTasksThreadsDump(@NotNull @NotNull Task task, @NotNull @NotNull OperationResult parentResult) throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, ExpressionEvaluationException
-
recordRunningTasksThreadsDump
public String recordRunningTasksThreadsDump(String cause, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult parentResult) throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, ExpressionEvaluationException, ObjectAlreadyExistsException
-
getTaskThreadsDump
public String getTaskThreadsDump(@NotNull @NotNull String taskOid, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult parentResult) throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, ExpressionEvaluationException
- Specified by:
getTaskThreadsDump
in interfaceTaskService
- Throws:
CommunicationException
ObjectNotFoundException
SchemaException
SecurityViolationException
ConfigurationException
ExpressionEvaluationException
-
notifyChange
public void notifyChange(ResourceObjectShadowChangeDescriptionType changeDescription, Task task, OperationResult parentResult) throws CommonException
- Specified by:
notifyChange
in interfaceModelService
- Throws:
CommonException
-
-