/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Portions copyright 2015 ForgeRock AS.
*/
/**
* Base Template for sync related audit events.
*/
/**
* Base constructor for sync and recon audit event logs. Context is required to contain a SecurityContext.
*
* @param syncOperation the operation that holds the action and
* @param mapping
* @param context
*/
this.syncOperation = syncOperation;
// The context must hold a Security context.
throw new IllegalArgumentException(
"Context is required to have a SecurityContext in order to log an audit event.");
}
}
/**
* Simple setter.
*
* @param exception
*/
}
/**
* Returns the message that was previously set.
*
* @return
*/
return message;
}
/**
* Simple setter.
*
* @param message
*/
}
/**
* Simple setter.
*
* @param messageDetail
*/
this.messageDetail = messageDetail;
}
/**
* Simple setter.
*
* @param linkQualifier
*/
this.linkQualifier = linkQualifier;
}
/**
* Simple setter.
*
* @param mapping
*/
}
/**
* Simple setter.
*
* @param sourceObjectId
*/
this.sourceObjectId = sourceObjectId;
}
/**
* Simple setter.
*
* @param status
*/
}
/**
* Simpler setter.
*
* @param targetObjectId
*/
this.targetObjectId = targetObjectId;
}
/**
* Implementors should return the REST path to the audit log end points.
*
* @return the REST path to audit.
*/
/**
* Implementors should return the event name for this audit log event.
*
* @return the event name
*/
/**
* Implementors should return the proper AbstractSyncAuditEventBuilder for this logger.
*
* @return The builder to be used to make the log audit event.
*/
protected abstract T getEventBuilder();
/**
* Implementors should utilize the builder and apply the custom fields.
*
* @param builder The builder to customize.
* @return
*/
/**
* Calls buildAuditEvent() and invokes the request to the audit path.
*
* @param connectionFactory
* @throws ResourceException
*/
try {
T eventBuilder = getEventBuilder()
} catch (ResourceException e) {
throw e;
} catch (Exception e) {
throw new InternalServerErrorException(e.getMessage(), e);
}
}
}