@Component public class ModelController extends Object implements ModelService, TaskService, WorkflowService, ScriptingService, AccessCertificationService
Modifier and Type | Field and Description |
---|---|
static String |
ADD_OBJECT_WITH_EXCLUSION |
static String |
CHANGE_ACCOUNT |
static String |
CLASS_NAME_WITH_DOT |
static String |
CREATE_ACCOUNT |
static String |
GET_SYSTEM_CONFIGURATION |
static String |
MODIFY_OBJECT_WITH_EXCLUSION |
static String |
PROCESS_USER_TEMPLATE |
static String |
RESOLVE_ACCOUNT_ATTRIBUTES |
static String |
RESOLVE_USER_ATTRIBUTES |
static String |
UPDATE_ACCOUNT |
AUTZ_NAMESPACE, COMPARE_OBJECT, COUNT_CONTAINERS, COUNT_OBJECTS, DISCOVER_CONNECTORS, EXECUTE_CHANGE, EXECUTE_CHANGES, GET_OBJECT, GET_PROPERTY_AVAILABLE_VALUES, IMPORT_ACCOUNTS_FROM_RESOURCE, IMPORT_OBJECTS_FROM_FILE, IMPORT_OBJECTS_FROM_STREAM, LIST_ACCOUNT_SHADOW_OWNER, LIST_OBJECTS, LIST_RESOURCE_OBJECT_SHADOWS, LIST_RESOURCE_OBJECTS, POST_INIT, RECOMPUTE, SEARCH_CONTAINERS, SEARCH_OBJECTS, TEST_RESOURCE
DO_NOT_STOP, DO_NOT_WAIT, WAIT_INDEFINITELY
Constructor and Description |
---|
ModelController() |
Modifier and Type | Method and Description |
---|---|
void |
approveOrRejectWorkItem(String workItemId,
boolean decision,
String comment,
OperationResult parentResult)
Approves or rejects a work item (without supplying any further information).
|
void |
claimWorkItem(String workItemId,
OperationResult parentResult) |
protected void |
cleanupOperationResult(OperationResult result) |
void |
closeCampaign(String campaignOid,
Task task,
OperationResult result)
Closes a campaign.
|
void |
closeCurrentStage(String campaignOid,
int stageNumber,
Task task,
OperationResult parentResult)
Opens the next stage in the certification campaign.
|
<T extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> |
compareObject(PrismObject<T> provided,
Collection<SelectorOptions<GetOperationOptions>> readOptions,
ModelCompareOptions compareOptions,
List<ItemPath> ignoreItems,
Task task,
OperationResult parentResult)
TODO
|
<T extends Containerable> |
countContainers(Class<T> type,
ObjectQuery query,
Collection<SelectorOptions<GetOperationOptions>> options,
Task task,
OperationResult parentResult) |
<T extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> |
countObjects(Class<T> type,
ObjectQuery query,
Collection<SelectorOptions<GetOperationOptions>> options,
Task task,
OperationResult parentResult)
Count objects.
|
com.evolveum.midpoint.xml.ns._public.common.common_3.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,
OperationResult parentResult)
Deactivates service threads (temporarily).
|
Set<com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType> |
discoverConnectors(com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorHostType hostType,
Task task,
OperationResult parentResult)
Discovers local or remote connectors.
|
ScriptExecutionResult |
evaluateExpression(com.evolveum.midpoint.xml.ns._public.model.scripting_3.ScriptingExpressionType expression,
Task task,
OperationResult result)
Synchronously executes any scripting expression (with no input data).
|
void |
evaluateExpressionInBackground(QName objectType,
ObjectFilter filter,
String actionName,
Task task,
OperationResult parentResult)
Asynchronously executes simple scripting expressions, consisting of one search command and one action.
|
void |
evaluateExpressionInBackground(com.evolveum.midpoint.xml.ns._public.model.scripting_3.ScriptingExpressionType expression,
Task task,
OperationResult parentResult)
Asynchronously executes any scripting expression.
|
Collection<ObjectDeltaOperation<? extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType>> |
executeChanges(Collection<ObjectDelta<? extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType>> deltas,
ModelExecuteOptions options,
Task task,
Collection<ProgressListener> statusListeners,
OperationResult parentResult) |
Collection<ObjectDeltaOperation<? extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType>> |
executeChanges(Collection<ObjectDelta<? extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType>> deltas,
ModelExecuteOptions options,
Task task,
OperationResult parentResult)
Execute the provided object deltas.
|
PrismObject<com.evolveum.midpoint.xml.ns._public.common.common_3.UserType> |
findShadowOwner(String accountOid,
Task task,
OperationResult parentResult)
Deprecated.
|
List<String> |
getAllTaskCategories()
Gets a list of all task categories.
|
com.evolveum.midpoint.xml.ns._public.common.common_3.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)
Returns a default handler URI for a given task category.
|
<T extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> |
getObject(Class<T> clazz,
String oid,
Collection<SelectorOptions<GetOperationOptions>> options,
Task task,
OperationResult parentResult)
Returns object for provided OID.
|
ModelObjectResolver |
getObjectResolver() |
boolean |
getServiceThreadsActivationState()
Returns true if the service threads are running.
|
PrismObject<com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType> |
getTaskByIdentifier(String identifier,
Collection<SelectorOptions<GetOperationOptions>> options,
OperationResult parentResult)
Returns information about task, given its identifier.
|
void |
importFromResource(String resourceOid,
QName objectClass,
Task task,
OperationResult parentResult)
Import accounts from resource.
|
void |
importFromResource(String shadowOid,
Task task,
OperationResult parentResult)
Import single account from resource.
|
void |
importObjectsFromFile(File input,
com.evolveum.midpoint.xml.ns._public.common.api_types_3.ImportOptionsType options,
Task task,
OperationResult parentResult)
Import objects from file.
|
void |
importObjectsFromStream(InputStream input,
com.evolveum.midpoint.xml.ns._public.common.api_types_3.ImportOptionsType options,
Task task,
OperationResult parentResult)
Import objects from stream.
|
protected boolean |
isFilterNone(ObjectQuery query,
OperationResult result) |
List<PrismObject<? extends com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType>> |
listResourceObjects(String resourceOid,
QName objectClass,
ObjectPaging paging,
Task task,
OperationResult parentResult)
Returns all resource objects of specified type that are currently
available to the system.
|
protected void |
logQuery(ObjectQuery query) |
void |
openNextStage(String campaignOid,
int stageNumber,
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(OperationResult parentResult)
Re-activates the service threads after they have been deactivated.
|
<F extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> |
recompute(Class<F> type,
String oid,
Task task,
OperationResult parentResult)
Recomputes focal object with the specified OID.
|
void |
recordDecision(String campaignOid,
long caseId,
com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationDecisionType decision,
Task task,
OperationResult parentResult)
Records a particular decision of a reviewer.
|
void |
releaseWorkItem(String workItemId,
OperationResult parentResult) |
protected void |
resolve(Containerable containerable,
Collection<SelectorOptions<GetOperationOptions>> options,
Task task,
OperationResult result) |
protected void |
resolve(PrismObject<?> object,
Collection<SelectorOptions<GetOperationOptions>> options,
Task task,
OperationResult result) |
void |
resumeTasks(Collection<String> taskOids,
OperationResult parentResult)
Resume suspended tasks.
|
void |
scheduleTasksNow(Collection<String> taskOids,
OperationResult parentResult)
Schedules a RUNNABLE/CLOSED tasks to be run immediately.
|
<T extends Containerable> |
searchContainers(Class<T> type,
ObjectQuery query,
Collection<SelectorOptions<GetOperationOptions>> options,
Task task,
OperationResult parentResult)
Search for "sub-object" structures, i.e.
|
List<com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCaseType> |
searchDecisionsToReview(ObjectQuery caseQuery,
boolean notDecidedOnly,
Collection<SelectorOptions<GetOperationOptions>> options,
Task task,
OperationResult parentResult)
Returns a set of certification decisions for currently logged-in user.
|
<T extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> |
searchObjects(Class<T> type,
ObjectQuery query,
Collection<SelectorOptions<GetOperationOptions>> options,
Task task,
OperationResult parentResult)
Search for objects.
|
<T extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> |
searchObjectsIterative(Class<T> type,
ObjectQuery query,
ResultHandler<T> handler,
Collection<SelectorOptions<GetOperationOptions>> options,
Task task,
OperationResult parentResult)
Search for objects in iterative fashion (using callback).
|
PrismObject<? extends com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType> |
searchShadowOwner(String shadowOid,
Collection<SelectorOptions<GetOperationOptions>> options,
Task task,
OperationResult parentResult)
Returns the Focus object representing owner of specified shadow.
|
void |
startRemediation(String campaignOid,
Task task,
OperationResult result)
Starts the remediation phase for the campaign.
|
void |
startSchedulers(Collection<String> nodeIdentifiers,
OperationResult parentResult)
Starts the scheduler on a given nodes.
|
void |
stopProcessInstance(String instanceId,
String username,
OperationResult parentResult) |
void |
stopSchedulers(Collection<String> nodeIdentifiers,
OperationResult parentResult)
Stops the schedulers on a given nodes.
|
boolean |
stopSchedulersAndTasks(Collection<String> nodeIdentifiers,
long waitTime,
OperationResult parentResult)
Stops a set of schedulers (on their nodes) and tasks that are executing on these nodes.
|
void |
suspendAndDeleteTasks(Collection<String> taskOids,
long waitForStop,
boolean alsoSubtasks,
OperationResult parentResult)
Suspends tasks and deletes them.
|
boolean |
suspendTasks(Collection<String> taskOids,
long waitForStop,
OperationResult parentResult)
Suspends a set of tasks.
|
void |
synchronizeTasks(OperationResult parentResult)
Synchronizes information in midPoint repository and task scheduling database.
|
void |
synchronizeWorkflowRequests(OperationResult parentResult)
Synchronizes information in midPoint repository and activiti database.
|
OperationResult |
testResource(String resourceOid,
Task task)
Test the resource connection and basic resource connector functionality.
|
public static final String CLASS_NAME_WITH_DOT
public static final String ADD_OBJECT_WITH_EXCLUSION
public static final String MODIFY_OBJECT_WITH_EXCLUSION
public static final String CHANGE_ACCOUNT
public static final String GET_SYSTEM_CONFIGURATION
public static final String RESOLVE_USER_ATTRIBUTES
public static final String RESOLVE_ACCOUNT_ATTRIBUTES
public static final String CREATE_ACCOUNT
public static final String UPDATE_ACCOUNT
public static final String PROCESS_USER_TEMPLATE
public ModelObjectResolver getObjectResolver()
public <T extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> PrismObject<T> getObject(Class<T> clazz, String oid, Collection<SelectorOptions<GetOperationOptions>> options, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException
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.
getObject
in interface ModelService
clazz
- (class) of an object to getoid
- OID of the object to getoptions
- 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)ObjectNotFoundException
- requested object does not existSchemaException
- the object is not schema compliantCommunicationException
- Communication (network) error during retrieval. E.g. error communicating with the resourceConfigurationException
SecurityViolationException
protected void resolve(PrismObject<?> object, Collection<SelectorOptions<GetOperationOptions>> options, Task task, OperationResult result) throws SchemaException, ObjectNotFoundException, SecurityViolationException, ConfigurationException
protected void resolve(Containerable containerable, Collection<SelectorOptions<GetOperationOptions>> options, Task task, OperationResult result) throws SchemaException, ObjectNotFoundException, SecurityViolationException, ConfigurationException
public Collection<ObjectDeltaOperation<? extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType>> executeChanges(Collection<ObjectDelta<? extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType>> deltas, ModelExecuteOptions options, Task task, OperationResult parentResult) throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException, PolicyViolationException, SecurityViolationException
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.
executeChanges
in interface ModelService
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)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)public Collection<ObjectDeltaOperation<? extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType>> executeChanges(Collection<ObjectDelta<? extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType>> deltas, ModelExecuteOptions options, Task task, Collection<ProgressListener> statusListeners, OperationResult parentResult) throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException, PolicyViolationException, SecurityViolationException
protected void cleanupOperationResult(OperationResult result)
public <F extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> void recompute(Class<F> type, String oid, Task task, OperationResult parentResult) throws SchemaException, PolicyViolationException, ExpressionEvaluationException, ObjectNotFoundException, ObjectAlreadyExistsException, CommunicationException, ConfigurationException, SecurityViolationException
ModelService
recompute
in interface ModelService
type
- type (class) of an object to recomputeoid
- OID of the object to recomputetask
- Task instance. It gives context to the execution (e.g. security context)parentResult
- parent OperationResult (in/out)SchemaException
PolicyViolationException
ExpressionEvaluationException
ObjectNotFoundException
ObjectAlreadyExistsException
CommunicationException
ConfigurationException
SecurityViolationException
public <T extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> SearchResultList<PrismObject<T>> searchObjects(Class<T> type, ObjectQuery query, Collection<SelectorOptions<GetOperationOptions>> options, Task task, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException
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.
searchObjects
in interface ModelService
type
- (class) of an object to searchquery
- search queryoptions
- 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)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
public <T extends Containerable> SearchResultList<T> searchContainers(Class<T> type, ObjectQuery query, Collection<SelectorOptions<GetOperationOptions>> options, Task task, OperationResult parentResult) throws SchemaException, SecurityViolationException, ConfigurationException, ObjectNotFoundException
ModelService
searchContainers
in interface ModelService
SchemaException
SecurityViolationException
ConfigurationException
ObjectNotFoundException
public <T extends Containerable> Integer countContainers(Class<T> type, ObjectQuery query, Collection<SelectorOptions<GetOperationOptions>> options, Task task, OperationResult parentResult) throws SchemaException, SecurityViolationException
countContainers
in interface ModelService
SchemaException
SecurityViolationException
protected boolean isFilterNone(ObjectQuery query, OperationResult result)
protected void logQuery(ObjectQuery query)
public <T extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> SearchResultMetadata searchObjectsIterative(Class<T> type, ObjectQuery query, ResultHandler<T> handler, Collection<SelectorOptions<GetOperationOptions>> options, Task task, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException
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.
searchObjectsIterative
in interface ModelService
type
- (class) of an object to searchquery
- search queryhandler
- callback handler that will be called for each found objectoptions
- 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)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
public <T extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> Integer countObjects(Class<T> type, ObjectQuery query, Collection<SelectorOptions<GetOperationOptions>> options, Task task, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, ConfigurationException, SecurityViolationException, CommunicationException
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.
countObjects
in interface ModelService
type
- (class) of an object to searchquery
- search queryoptions
- 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)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.CommunicationException
- Communication (network) error during retrieval. E.g. error communicating with the resourceSecurityViolationException
@Deprecated public PrismObject<com.evolveum.midpoint.xml.ns._public.common.common_3.UserType> findShadowOwner(String accountOid, Task task, OperationResult parentResult) throws ObjectNotFoundException, SecurityViolationException, SchemaException, ConfigurationException
ModelService
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.
findShadowOwner
in interface ModelService
accountOid
- OID of the account to look for an ownertask
- Task instance. It gives context to the execution (e.g. security context)parentResult
- parent OperationResult (in/out)ObjectNotFoundException
- specified account was not foundSecurityViolationException
SchemaException
ConfigurationException
public PrismObject<? extends com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType> searchShadowOwner(String shadowOid, Collection<SelectorOptions<GetOperationOptions>> options, Task task, OperationResult parentResult) throws ObjectNotFoundException, SecurityViolationException, SchemaException, ConfigurationException
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.
searchShadowOwner
in interface ModelService
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)ObjectNotFoundException
- specified account was not foundSecurityViolationException
SchemaException
ConfigurationException
public List<PrismObject<? extends com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType>> listResourceObjects(String resourceOid, QName objectClass, ObjectPaging paging, Task task, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException
ModelService
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.
listResourceObjects
in interface ModelService
resourceOid
- OID of the resource to fetch objects fromobjectClass
- Object class of the objects to fetchpaging
- paging specification to limit operation result (optional)parentResult
- parent OperationResult (in/out)SchemaException
- error handling resource schemaObjectNotFoundException
- specified resource object does not existCommunicationException
- error communicating with the resourceConfigurationException
SecurityViolationException
public OperationResult testResource(String resourceOid, Task task) throws ObjectNotFoundException
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).
testResource
in interface ModelService
resourceOid
- OID of resource to testObjectNotFoundException
- specified object does not existpublic void importFromResource(String resourceOid, QName objectClass, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException
ModelService
Import accounts from resource.
Invocation of this method may be switched to background.
TODO: Better descriptionimportFromResource
in interface ModelService
ObjectNotFoundException
SchemaException
CommunicationException
ConfigurationException
SecurityViolationException
public void importFromResource(String shadowOid, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, SecurityViolationException, CommunicationException, ConfigurationException, SecurityViolationException
ModelService
Import single account from resource.
TODO: Better descriptionimportFromResource
in interface ModelService
ObjectNotFoundException
SchemaException
SecurityViolationException
CommunicationException
ConfigurationException
public void importObjectsFromFile(File input, com.evolveum.midpoint.xml.ns._public.common.api_types_3.ImportOptionsType options, Task task, OperationResult parentResult) throws FileNotFoundException
ModelService
importObjectsFromFile
in interface ModelService
FileNotFoundException
public void importObjectsFromStream(InputStream input, com.evolveum.midpoint.xml.ns._public.common.api_types_3.ImportOptionsType options, Task task, OperationResult parentResult)
ModelService
importObjectsFromStream
in interface ModelService
public Set<com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType> discoverConnectors(com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorHostType hostType, Task task, OperationResult parentResult) throws CommunicationException, SecurityViolationException, SchemaException, ConfigurationException, ObjectNotFoundException
ModelService
discoverConnectors
in interface ModelService
hostType
- definition of a connector host or nullparentResult
- parentResult parent OperationResult (in/out)CommunicationException
- error communicating with the connector hostSecurityViolationException
SchemaException
ConfigurationException
ObjectNotFoundException
public void postInit(OperationResult parentResult)
ModelService
postInit
in interface ModelService
public <T extends com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType> com.evolveum.midpoint.xml.ns._public.common.api_types_3.CompareResultType compareObject(PrismObject<T> provided, Collection<SelectorOptions<GetOperationOptions>> readOptions, ModelCompareOptions compareOptions, @NotNull List<ItemPath> ignoreItems, Task task, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, SecurityViolationException, CommunicationException, ConfigurationException
ModelService
compareObject
in interface ModelService
SchemaException
ObjectNotFoundException
SecurityViolationException
CommunicationException
ConfigurationException
public boolean suspendTasks(Collection<String> taskOids, long waitForStop, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException
TaskService
suspendTasks
in interface TaskService
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.SecurityViolationException
ObjectNotFoundException
SchemaException
public void suspendAndDeleteTasks(Collection<String> taskOids, long waitForStop, boolean alsoSubtasks, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException
TaskService
suspendAndDeleteTasks
in interface TaskService
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?SecurityViolationException
ObjectNotFoundException
SchemaException
public void resumeTasks(Collection<String> taskOids, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException
TaskService
resumeTasks
in interface TaskService
taskOids
- a collection of OIDs of tasks that have to be resumedObjectNotFoundException
SchemaException
SecurityViolationException
public void scheduleTasksNow(Collection<String> taskOids, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException
TaskService
scheduleTasksNow
in interface TaskService
taskOids
- a collection of OIDs of tasks that have to be scheduledSecurityViolationException
ObjectNotFoundException
SchemaException
public PrismObject<com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType> getTaskByIdentifier(String identifier, Collection<SelectorOptions<GetOperationOptions>> options, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, ConfigurationException, SecurityViolationException
TaskService
getTaskByIdentifier
in interface TaskService
SchemaException
ObjectNotFoundException
ConfigurationException
SecurityViolationException
public boolean deactivateServiceThreads(long timeToWait, OperationResult parentResult) throws SchemaException, SecurityViolationException
TaskService
deactivateServiceThreads
in interface TaskService
SchemaException
SecurityViolationException
public void reactivateServiceThreads(OperationResult parentResult) throws SchemaException, SecurityViolationException
TaskService
reactivateServiceThreads
in interface TaskService
SchemaException
SecurityViolationException
public boolean getServiceThreadsActivationState()
TaskService
getServiceThreadsActivationState
in interface TaskService
public void stopSchedulers(Collection<String> nodeIdentifiers, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException
TaskService
stopSchedulers
in interface TaskService
nodeIdentifiers
- Nodes on which the schedulers should be stopped.SecurityViolationException
ObjectNotFoundException
SchemaException
public boolean stopSchedulersAndTasks(Collection<String> nodeIdentifiers, long waitTime, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException
TaskService
stopSchedulersAndTasks
in interface TaskService
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 executionSecurityViolationException
ObjectNotFoundException
SchemaException
public void startSchedulers(Collection<String> nodeIdentifiers, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException
TaskService
startSchedulers
in interface TaskService
nodeIdentifiers
- Nodes on which the scheduler should be started.SecurityViolationException
ObjectNotFoundException
SchemaException
public void synchronizeTasks(OperationResult parentResult) throws SchemaException, SecurityViolationException
TaskService
synchronizeTasks
in interface TaskService
SchemaException
SecurityViolationException
public void synchronizeWorkflowRequests(OperationResult parentResult) throws SchemaException, SecurityViolationException
TaskService
synchronizeWorkflowRequests
in interface TaskService
SchemaException
SecurityViolationException
public List<String> getAllTaskCategories()
TaskService
getAllTaskCategories
in interface TaskService
public String getHandlerUriForCategory(String category)
TaskService
getHandlerUriForCategory
in interface TaskService
public void approveOrRejectWorkItem(String workItemId, boolean decision, String comment, OperationResult parentResult) throws SecurityViolationException
WorkflowService
approveOrRejectWorkItem
in interface WorkflowService
decision
- true = approve, false = rejectSecurityViolationException
public void stopProcessInstance(String instanceId, String username, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, SecurityViolationException
stopProcessInstance
in interface WorkflowService
SchemaException
ObjectNotFoundException
SecurityViolationException
public void claimWorkItem(String workItemId, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException
claimWorkItem
in interface WorkflowService
SecurityViolationException
ObjectNotFoundException
public void releaseWorkItem(String workItemId, OperationResult parentResult) throws ObjectNotFoundException, SecurityViolationException
releaseWorkItem
in interface WorkflowService
ObjectNotFoundException
SecurityViolationException
public void evaluateExpressionInBackground(QName objectType, ObjectFilter filter, String actionName, Task task, OperationResult parentResult) throws SchemaException, SecurityViolationException
ScriptingService
evaluateExpressionInBackground
in interface ScriptingService
objectType
- Object type to search (e.g. c:UserType)filter
- Filter to be applied (ObjectFilter)actionName
- Action to be executed on objects found (e.g. "disable", "delete", "recompute", etc).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.SchemaException
- TODO consider removing this method (it was meant as a simplified version of the method below)SecurityViolationException
public void evaluateExpressionInBackground(com.evolveum.midpoint.xml.ns._public.model.scripting_3.ScriptingExpressionType expression, Task task, OperationResult parentResult) throws SchemaException, SecurityViolationException
ScriptingService
evaluateExpressionInBackground
in interface ScriptingService
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.SchemaException
SecurityViolationException
public ScriptExecutionResult evaluateExpression(com.evolveum.midpoint.xml.ns._public.model.scripting_3.ScriptingExpressionType expression, Task task, OperationResult result) throws ScriptExecutionException, SchemaException, SecurityViolationException
ScriptingService
evaluateExpression
in interface ScriptingService
expression
- Scripting expression to execute.task
- Task in context of which the script should execute (in foreground!)result
- Operation resultScriptExecutionException
- TODO return ExecutionContext (requires moving the context to model api)SchemaException
SecurityViolationException
public com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCasesStatisticsType getCampaignStatistics(String campaignOid, boolean currentStageOnly, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, SecurityViolationException, ObjectAlreadyExistsException
AccessCertificationService
getCampaignStatistics
in interface AccessCertificationService
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.ObjectNotFoundException
SchemaException
SecurityViolationException
ObjectAlreadyExistsException
public void recordDecision(String campaignOid, long caseId, com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationDecisionType decision, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, SecurityViolationException, ObjectAlreadyExistsException
AccessCertificationService
recordDecision
in interface AccessCertificationService
campaignOid
- OID of the campaign to which the decision belongs.caseId
- ID of the certification case to which the decision belongs.decision
- The decision itself.task
- Task in context of which all operations will take place.parentResult
- Result for the operations.ObjectNotFoundException
SchemaException
SecurityViolationException
ObjectAlreadyExistsException
public List<com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCaseType> searchDecisionsToReview(ObjectQuery caseQuery, boolean notDecidedOnly, Collection<SelectorOptions<GetOperationOptions>> options, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, SecurityViolationException
AccessCertificationService
searchDecisionsToReview
in interface AccessCertificationService
caseQuery
- 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.options
- Options to use (e.g. RESOLVE_NAMES).task
- Task in context of which all operations will take place.parentResult
- Result for the operations.ObjectNotFoundException
SchemaException
SecurityViolationException
public void closeCampaign(String campaignOid, Task task, OperationResult result) throws ObjectNotFoundException, SchemaException, SecurityViolationException, ObjectAlreadyExistsException
AccessCertificationService
closeCampaign
in interface AccessCertificationService
ObjectNotFoundException
SchemaException
SecurityViolationException
ObjectAlreadyExistsException
public void startRemediation(String campaignOid, Task task, OperationResult result) throws ObjectNotFoundException, SchemaException, SecurityViolationException, ObjectAlreadyExistsException
AccessCertificationService
startRemediation
in interface AccessCertificationService
ObjectNotFoundException
SchemaException
SecurityViolationException
ObjectAlreadyExistsException
public void closeCurrentStage(String campaignOid, int stageNumber, Task task, OperationResult parentResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ObjectAlreadyExistsException
AccessCertificationService
closeCurrentStage
in interface AccessCertificationService
campaignOid
- Certification campaign OID.stageNumber
- Stage that has to be closed. This has to be the current stage.task
- Task in context of which all operations will take place.parentResult
- Result for the operations.SchemaException
SecurityViolationException
ObjectNotFoundException
ObjectAlreadyExistsException
public void openNextStage(String campaignOid, int stageNumber, Task task, OperationResult parentResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ObjectAlreadyExistsException
AccessCertificationService
openNextStage
in interface AccessCertificationService
campaignOid
- Certification campaign OID.stageNumber
- Stage that has to be open. This has to be the stage after the current one (or the first one).task
- Task in context of which all operations will take place.parentResult
- Result for the operations.SchemaException
SecurityViolationException
ObjectNotFoundException
ObjectAlreadyExistsException
public com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCampaignType createCampaign(String definitionOid, Task task, OperationResult parentResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ObjectAlreadyExistsException
AccessCertificationService
createCampaign
in interface AccessCertificationService
definitionOid
- OID of certification definition for this campaign.task
- Task in context of which all operations will take place.parentResult
- Result for the operations.SchemaException
SecurityViolationException
ObjectNotFoundException
ObjectAlreadyExistsException
Copyright © 2016 evolveum. All rights reserved.