Skip to content

Commit

Permalink
Fix operation names in TaskManager
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Oct 5, 2021
1 parent 43068b3 commit b4228c1
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@
public class TaskManagerQuartzImpl implements TaskManager, SystemConfigurationChangeListener {

private static final String DOT_INTERFACE = TaskManager.class.getName() + ".";
private static final String OP_COUNT_OBJECTS = DOT_INTERFACE + "countObjects";
private static final String OP_SEARCH_OBJECTS_ITERATIVE = DOT_INTERFACE + "searchObjectsIterative";
private static final String OP_SEARCH_OBJECTS = DOT_INTERFACE + "searchObjects";
private static final String OP_GET_OBJECT = DOT_INTERFACE + "getObject";
private static final String OP_DELETE_TASK_TREE = DOT_INTERFACE + "deleteTaskTree";
private static final String OP_DELETE_TASK = DOT_INTERFACE + "deleteTask";
private static final String OP_GET_NEXT_RUN_START_TIME = DOT_INTERFACE + "getNextStartTimes";
private static final String OP_GET_TASK_BY_IDENTIFIER = DOT_INTERFACE + "getTaskByIdentifier";
private static final String OP_STOP_LOCAL_SCHEDULER = DOT_INTERFACE + "stopLocalScheduler";
Expand Down Expand Up @@ -498,7 +504,7 @@ public void suspendAndCloseTaskNoException(Task task, long suspendTimeout, Opera

@Override
public void deleteTask(String oid, OperationResult parentResult) throws ObjectNotFoundException, SchemaException {
OperationResult result = parentResult.createSubresult(DOT_INTERFACE + "deleteTask");
OperationResult result = parentResult.createSubresult(OP_DELETE_TASK);
result.addParam("oid", oid);
try {
taskStateManager.deleteTask(oid, result);
Expand All @@ -513,7 +519,7 @@ public void deleteTask(String oid, OperationResult parentResult) throws ObjectNo
@Override
public void deleteTaskTree(String rootTaskOid, OperationResult parentResult)
throws SchemaException, ObjectNotFoundException {
OperationResult result = parentResult.createSubresult(DOT_INTERFACE + "deleteTaskTree");
OperationResult result = parentResult.createSubresult(OP_DELETE_TASK_TREE);
result.addParam("rootTaskOid", rootTaskOid);
try {
taskStateManager.deleteTaskTree(rootTaskOid, result);
Expand Down Expand Up @@ -541,7 +547,7 @@ public void waitForTransientChildrenAndCloseThem(RunningTask task, OperationResu
Collection<SelectorOptions<GetOperationOptions>> options,
OperationResult parentResult) throws SchemaException, ObjectNotFoundException {

OperationResult result = parentResult.createMinorSubresult(DOT_INTERFACE + ".getObject");
OperationResult result = parentResult.createMinorSubresult(OP_GET_OBJECT);
result.addParam("objectType", type);
result.addParam("oid", oid);
result.addArbitraryObjectCollectionAsParam("options", options);
Expand Down Expand Up @@ -604,7 +610,7 @@ public TaskQuartzImpl getTask(String oid, Collection<SelectorOptions<GetOperatio
@NotNull
public <T extends ObjectType> SearchResultList<PrismObject<T>> searchObjects(Class<T> type, ObjectQuery query,
Collection<SelectorOptions<GetOperationOptions>> options, OperationResult parentResult) throws SchemaException {
OperationResult result = parentResult.createMinorSubresult(DOT_INTERFACE + "searchObjects");
OperationResult result = parentResult.createMinorSubresult(OP_SEARCH_OBJECTS);
result.addParam("objectType", type);
result.addParam("query", query);
result.addArbitraryObjectCollectionAsParam("options", options);
Expand All @@ -631,7 +637,7 @@ public <T extends ObjectType> SearchResultList<PrismObject<T>> searchObjects(Cla
public <T extends ObjectType> SearchResultMetadata searchObjectsIterative(Class<T> type,
ObjectQuery query, Collection<SelectorOptions<GetOperationOptions>> options,
ResultHandler<T> handler, OperationResult parentResult) throws SchemaException {
OperationResult result = parentResult.createMinorSubresult(DOT_INTERFACE + "searchObjects");
OperationResult result = parentResult.createMinorSubresult(OP_SEARCH_OBJECTS_ITERATIVE);
result.addParam("objectType", type);
result.addParam("query", query);
result.addArbitraryObjectCollectionAsParam("options", options);
Expand Down Expand Up @@ -666,7 +672,7 @@ public <T extends ObjectType> int countObjects(
Class<T> type, ObjectQuery query, OperationResult parentResult)
throws SchemaException {

OperationResult result = parentResult.createMinorSubresult(DOT_INTERFACE + ".countObjects");
OperationResult result = parentResult.createMinorSubresult(OP_COUNT_OBJECTS);
result.addParam("objectType", type);
result.addParam("query", query);
result.addContext(OperationResult.CONTEXT_IMPLEMENTATION_CLASS, TaskManagerQuartzImpl.class);
Expand Down

0 comments on commit b4228c1

Please sign in to comment.