Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Oct 24, 2018
2 parents 5f85d46 + 1000f39 commit 947f77b
Show file tree
Hide file tree
Showing 19 changed files with 482 additions and 197 deletions.
11 changes: 11 additions & 0 deletions NOTICE
Expand Up @@ -31,3 +31,14 @@ GNU Lesser General Public Lincese (LGPL)
This product includes AdminLTE template
Copyright (c) 2014-2016 Abdullah Almsaeed
AdminLTE is distributed under the terms of The MIT License

This product includes software developed at
Python Software Foundation

This software contains unmodified binary redistributions for
H2 database engine (http://www.h2database.com/),
which is dual licensed and available under the MPL 2.0
(Mozilla Public License) or under the EPL 1.0 (Eclipse Public License).
An original copy of the license agreement can be found at:
http://www.h2database.com/html/license.html

16 changes: 0 additions & 16 deletions build-system/pom.xml
Expand Up @@ -463,11 +463,6 @@
<artifactId>javax.ws.rs-api</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<version>9.5.1-6</version>
</dependency>
<dependency>
<!-- In LDAP/AD connector we use custom build of HTTP client with CredSSP support.
As AD/LDAP connector is bundled then this triggers a conflict in dependency convergence.
Expand Down Expand Up @@ -652,17 +647,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.cryptacular</groupId>
<artifactId>cryptacular</artifactId>
<version>1.0</version>
<exclusions>
<exclusion> <!-- conflicted inside the opensaml-security-api dependency of WSS4J -->
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<!-- make this dependency explicit to detect conflicts with older versions -->
<groupId>org.codehaus.woodstox</groupId>
Expand Down
Expand Up @@ -331,7 +331,7 @@ public static ObjectManager getObjectManagerForClass(Class<? extends ObjectType>
return null;
}

public static Class getClassFromRestType(String restType) {
public static Class<? extends ObjectType> getClassFromRestType(String restType) {
Validate.notNull(restType, "Rest type must not be null.");

for (ObjectTypes type : ObjectTypes.values()) {
Expand Down
Expand Up @@ -931,7 +931,7 @@ public void testReplaceModelOperationContext() throws Exception {
assertNull(prismObject.findContainer(TaskType.F_MODEL_OPERATION_CONTEXT));
}

@Test(enabled = false)
@Test
public void testDiffSameValues() throws Exception {
PrismObject<ResourceType> before = PrismTestUtil.parseObject(new File(TEST_DIR, "resource-white-before.xml"));
PrismObject<ResourceType> after = PrismTestUtil.parseObject(new File(TEST_DIR, "resource-white-after.xml"));
Expand Down
Expand Up @@ -53,6 +53,7 @@ public interface TaskService {
* @return true if all the tasks were stopped, false if some tasks continue to run or if stopping was not requested (DO_NOT_STOP option)
*/
boolean suspendTasks(Collection<String> taskOids, long waitForStop, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException;
boolean suspendTask(String taskOid, long waitForStop, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException;

boolean suspendTaskTree(String taskOid, long waitForStop, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException;

Expand All @@ -69,6 +70,7 @@ public interface TaskService {
* @param parentResult
*/
void suspendAndDeleteTasks(Collection<String> taskOids, long waitForStop, boolean alsoSubtasks, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException;
void suspendAndDeleteTask(String taskOid, long waitForStop, boolean alsoSubtasks, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException;

/**
* Resume suspended tasks.
Expand All @@ -78,6 +80,7 @@ public interface TaskService {
* @throws com.evolveum.midpoint.util.exception.ObjectNotFoundException
*/
void resumeTasks(Collection<String> taskOids, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException;
void resumeTask(String taskOid, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException;
void resumeTaskTree(String coordinatorOid, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException;

/**
Expand All @@ -88,6 +91,7 @@ public interface TaskService {
* @param parentResult
*/
void scheduleTasksNow(Collection<String> taskOids, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException;
void scheduleTaskNow(String taskOid, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException;

/**
* Returns information about task, given its identifier.
Expand Down
Expand Up @@ -127,7 +127,7 @@ public void notifyChange(ResourceObjectShadowChangeDescriptionType changeDescrip
String oldShadowOid = changeDescription.getOldShadowOid();
ResourceEventDescription eventDescription = new ResourceEventDescription();

PrismObject<ShadowType> oldShadow = null;
PrismObject<ShadowType> oldShadow;
LOGGER.trace("resolving old object");
if (!StringUtils.isEmpty(oldShadowOid)){
oldShadow = getObject(ShadowType.class, oldShadowOid, SelectorOptions.createCollection(GetOperationOptions.createDoNotDiscovery()), task, parentResult);
Expand All @@ -151,7 +151,7 @@ public void notifyChange(ResourceObjectShadowChangeDescriptionType changeDescrip
ObjectDeltaType deltaType = changeDescription.getObjectDelta();
ObjectDelta delta = null;

PrismObject<ShadowType> shadowToAdd = null;
PrismObject<ShadowType> shadowToAdd;
if (deltaType != null){

delta = ObjectDelta.createEmptyDelta(ShadowType.class, deltaType.getOid(), prismContext, ChangeType.toChangeType(deltaType.getChangeType()));
Expand Down Expand Up @@ -245,6 +245,7 @@ public void notifyChange(ResourceObjectShadowChangeDescriptionType changeDescrip
* unknown error from underlying layers or other unexpected
* state
*/
@SuppressWarnings("JavaDoc")
public <T extends ObjectType> String addObject(PrismObject<T> object, ModelExecuteOptions options, Task task,
OperationResult parentResult) throws ObjectAlreadyExistsException, ObjectNotFoundException,
SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException,
Expand Down Expand Up @@ -313,9 +314,11 @@ public <T extends ObjectType> String addObject(PrismObject<T> object, ModelExecu
* @throws IllegalArgumentException
* wrong OID format, described change is not applicable
* @throws CommunicationException
* Communication problem was detected during processing of the object
* @throws ConfigurationException
* Configuration problem was detected during processing of the object
* @throws PolicyViolationException
* Policy violation was detected during processing of the object
* Policy violation was detected during processing of the object
* @throws SystemException
* unknown error from underlying layers or other unexpected
* state
Expand Down Expand Up @@ -384,6 +387,7 @@ public <T extends ObjectType> void deleteObject(Class<T> clazz, String oid, Mode
* @throws ExpressionEvaluationException
* evaluation of expression associated with the object has failed
* @throws CommunicationException
* Communication problem was detected during processing of the object
* @throws ObjectAlreadyExistsException
* If the account or another "secondary" object already exists and cannot be created
* @throws PolicyViolationException
Expand Down Expand Up @@ -424,30 +428,17 @@ public <T extends ObjectType> void modifyObject(Class<T> type, String oid,

try {

ObjectDelta<T> objectDelta = (ObjectDelta<T>) ObjectDelta.createModifyDelta(oid, modifications, type, prismContext);
ObjectDelta<T> objectDelta = ObjectDelta.createModifyDelta(oid, modifications, type, prismContext);
Collection<ObjectDelta<? extends ObjectType>> deltas = MiscSchemaUtil.createCollection(objectDelta);
modelService.executeChanges(deltas, options, task, result);

result.computeStatus();

} catch (ExpressionEvaluationException ex) {
} catch (ExpressionEvaluationException | ObjectNotFoundException ex) {
LOGGER.error("model.modifyObject failed: {}", ex.getMessage(), ex);
result.recordFatalError(ex);
throw ex;
} catch (ObjectNotFoundException ex) {
LOGGER.error("model.modifyObject failed: {}", ex.getMessage(), ex);
result.recordFatalError(ex);
throw ex;
} catch (SchemaException ex) {
ModelImplUtils.recordFatalError(result, ex);
throw ex;
} catch (ConfigurationException ex) {
ModelImplUtils.recordFatalError(result, ex);
throw ex;
} catch (SecurityViolationException ex) {
ModelImplUtils.recordFatalError(result, ex);
throw ex;
} catch (RuntimeException ex) {
} catch (SchemaException | ConfigurationException | SecurityViolationException | RuntimeException ex) {
ModelImplUtils.recordFatalError(result, ex);
throw ex;
} finally {
Expand Down Expand Up @@ -477,22 +468,23 @@ public OperationResult testResource(String resourceOid, Task task) throws Object


//TASK AREA
public boolean suspendTasks(Collection<String> taskOids, long waitForStop, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException {
return taskService.suspendTasks(taskOids, waitForStop, operationTask, parentResult);
public boolean suspendTask(String taskOid, long waitForStop, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException {
return taskService.suspendTask(taskOid, waitForStop, operationTask, parentResult);
}

public void suspendAndDeleteTasks(Collection<String> taskOids, long waitForStop, boolean alsoSubtasks, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException {
taskService.suspendAndDeleteTasks(taskOids, waitForStop, alsoSubtasks, operationTask, parentResult);
public void suspendAndDeleteTask(String taskOid, long waitForStop, boolean alsoSubtasks, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException {
taskService.suspendAndDeleteTask(taskOid, waitForStop, alsoSubtasks, operationTask, parentResult);
}

public void resumeTasks(Collection<String> taskOids, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException {
taskService.resumeTasks(taskOids, operationTask, parentResult);
public void resumeTask(String taskOid, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException {
taskService.resumeTask(taskOid, operationTask, parentResult);
}

public void scheduleTasksNow(Collection<String> taskOids, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException {
taskService.scheduleTasksNow(taskOids, operationTask, parentResult);
public void scheduleTaskNow(String taskOid, Task operationTask, OperationResult parentResult) throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException {
taskService.scheduleTaskNow(taskOid, operationTask, parentResult);
}

@SuppressWarnings("unused")
public PrismObject<TaskType> getTaskByIdentifier(String identifier, Collection<SelectorOptions<GetOperationOptions>> options, Task operationTask, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, SecurityViolationException, ConfigurationException, ExpressionEvaluationException, CommunicationException {
return taskService.getTaskByIdentifier(identifier, options, operationTask, parentResult);
}
Expand All @@ -505,6 +497,7 @@ public void reactivateServiceThreads(Task operationTask, OperationResult parentR
taskService.reactivateServiceThreads(operationTask, parentResult);
}

@SuppressWarnings("unused")
public boolean getServiceThreadsActivationState() {
return taskService.getServiceThreadsActivationState();
}
Expand All @@ -525,6 +518,7 @@ public void synchronizeTasks(Task operationTask, OperationResult parentResult) t
taskService.synchronizeTasks(operationTask, parentResult);
}

@SuppressWarnings("unused")
public List<String> getAllTaskCategories() {
return taskService.getAllTaskCategories();
}
Expand Down

0 comments on commit 947f77b

Please sign in to comment.