Skip to content

Commit

Permalink
Possible fix for "channel: null" in account notifications during reco…
Browse files Browse the repository at this point in the history
…nciliation.
  • Loading branch information
mederly committed Jun 9, 2016
1 parent e849553 commit b70b793
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Expand Up @@ -144,15 +144,14 @@ public final class WebComponentUtil {
private static final Trace LOGGER = TraceManager.getTrace(WebComponentUtil.class);
private static DatatypeFactory df = null;

public static enum Channel {
public enum Channel {
// TODO: move this to schema component
LIVE_SYNC(
"http://midpoint.evolveum.com/xml/ns/public/provisioning/channels-3#liveSync"), RECONCILIATION(
"http://midpoint.evolveum.com/xml/ns/public/provisioning/channels-3#reconciliation"), DISCOVERY(
"http://midpoint.evolveum.com/xml/ns/public/provisioning/channels-3#discovery"), IMPORT(
"http://midpoint.evolveum.com/xml/ns/public/provisioning/channels-3#import"), USER(
"http://midpoint.evolveum.com/xml/ns/public/provisioning/channels-3#user"), WEB_SERVICE(
"http://midpoint.evolveum.com/xml/ns/public/provisioning/channels-3#webService");
LIVE_SYNC(SchemaConstants.CHANGE_CHANNEL_LIVE_SYNC_URI),
RECONCILIATION(SchemaConstants.CHANGE_CHANNEL_RECON_URI),
DISCOVERY(SchemaConstants.CHANGE_CHANNEL_DISCOVERY_URI),
IMPORT(SchemaConstants.CHANNEL_OBJECT_IMPORT_URI),
USER(SchemaConstants.CHANNEL_GUI_USER_URI),
WEB_SERVICE(SchemaConstants.CHANNEL_WEB_SERVICE_URI);

private String channel;

Expand Down
Expand Up @@ -180,9 +180,11 @@ private ResourceObjectEvent createRequest(OperationStatus status,
LOGGER.warn("No owner for task " + task + ", therefore no requester will be set for event " + event.getId());
}

if (task != null) {
if (task != null && task.getChannel() != null) {
event.setChannel(task.getChannel());
}
} else if (operationDescription.getSourceChannel() != null) {
event.setChannel(operationDescription.getSourceChannel());
}

return event;
}
Expand Down

0 comments on commit b70b793

Please sign in to comment.