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 30, 2015
2 parents db9c9f6 + 7b48ed9 commit 9f4f8c2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2013 Evolveum
* Copyright (c) 2010-2015 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,20 +30,18 @@ public static enum HandlerUriActions{
ACTION_UNLINK("http://midpoint.evolveum.com/xml/ns/public/model/action-3#unlink"),
ACTION_ADD_FOCUS("http://midpoint.evolveum.com/xml/ns/public/model/action-3#addFocus"),
ACTION_DELETE_FOCUS("http://midpoint.evolveum.com/xml/ns/public/model/action-3#deleteFocus"),
ACTION_INACTIVE_FOCUS("http://midpoint.evolveum.com/xml/ns/public/model/action-3#inactiveFocus"),
ACTION_INACTIVATE_FOCUS("http://midpoint.evolveum.com/xml/ns/public/model/action-3#inactivateFocus"),
ACTION_DELETE_SHADOW("http://midpoint.evolveum.com/xml/ns/public/model/action-3#deleteShadow"),
ACTION_INACTIVE_SHADOW("http://midpoint.evolveum.com/xml/ns/public/model/action-3#inactiveShadow"),
ACTION_INACTIVATE_SHADOW("http://midpoint.evolveum.com/xml/ns/public/model/action-3#inactivateShadow"),
ACTION_SYNCHRONIZE("http://midpoint.evolveum.com/xml/ns/public/model/action-3#synchronize"),
ACTION_ADD_USER("http://midpoint.evolveum.com/xml/ns/public/model/action-3#adduser"),
ACTION_MODIFY_USER("http://midpoint.evolveum.com/xml/ns/public/model/action-3#modifyUser"),
ACTION_DISABLE_USER("http://midpoint.evolveum.com/xml/ns/public/model/action-3#disableUser"),
ACTION_DELETE_USER("http://midpoint.evolveum.com/xml/ns/public/model/action-3#deleteUser"),
ACTION_ADD_ACCOUNT("http://midpoint.evolveum.com/xml/ns/public/model/action-3#addAccount"),
ACTION_LINK_ACCOUNT("http://midpoint.evolveum.com/xml/ns/public/model/action-3#linkAccount"),
ACTION_UNLINK_ACCOUNT("http://midpoint.evolveum.com/xml/ns/public/model/action-3#unlinkAccount"),
ACTION_DELETE_ACCOUNT("http://midpoint.evolveum.com/xml/ns/public/model/action-3#deleteAccount"),
ACTION_DISABLE_ACCOUNT("http://midpoint.evolveum.com/xml/ns/public/model/action-3#disableAccount"),
ACTION_MODIFY_PASSWORD("http://midpoint.evolveum.com/xml/ns/public/model/action-3#modifyPassword");
ACTION_DISABLE_ACCOUNT("http://midpoint.evolveum.com/xml/ns/public/model/action-3#disableAccount");

protected String action;

Expand Down
Expand Up @@ -190,7 +190,7 @@ public <O extends ObjectType> void processAssignmentsProjections(LensContext<O>
try {
processAssignmentsProjectionsWithFocus((LensContext<? extends FocusType>)context, now, task, result);
} catch (SchemaException | ObjectNotFoundException | ExpressionEvaluationException | PolicyViolationException |
CommunicationException | ConfigurationException | SecurityViolationException e) {
CommunicationException | ConfigurationException | SecurityViolationException | RuntimeException | Error e) {
result.recordFatalError(e);
throw e;
}
Expand Down
Expand Up @@ -2291,7 +2291,13 @@ private void recordResume() {
}
OperationOptions options = optionsBuilder.build();

Filter filter = convertFilterToIcf(query, objectClassDefinition);
Filter filter;
try {
filter = convertFilterToIcf(query, objectClassDefinition);
} catch (SchemaException | RuntimeException e) {
result.recordFatalError(e);
throw e;
}

// Connector operation cannot create result for itself, so we need to
// create result for it
Expand Down
Expand Up @@ -71,7 +71,7 @@ public <T> Filter interpret(ObjectFilter objectFilter, IcfNameMapper icfNameMapp
EqualFilter<T> eq = (EqualFilter<T>) objectFilter;

Collection<Object> convertedValues = convertValues(propName, eq.getValues());
if (convertedValues.isEmpty()) {
if (convertedValues == null || convertedValues.isEmpty()) {
// See MID-1460
throw new UnsupportedOperationException("Equals filter with a null value is NOT supported by ICF");
} else {
Expand Down Expand Up @@ -150,6 +150,9 @@ public <T> Filter interpret(ObjectFilter objectFilter, IcfNameMapper icfNameMapp
}

private <T> Collection<Object> convertValues(QName propName, List<PrismPropertyValue<T>> values) throws SchemaException {
if (values == null) {
return null;
}
Collection<Object> convertedValues = new ArrayList<>();
for (PrismValue value : values) {
Object converted = UcfUtil.convertValueToIcf(value, null, propName);
Expand Down

0 comments on commit 9f4f8c2

Please sign in to comment.