/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2013-2015 ForgeRock AS. All rights reserved.
*
* 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
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*/
// Parameters:
// The connector sends us the following:
// connection : SQL connection
// log: a handler to the Log facility
// objectClass: a String describing the Object class (recon, activity, access)
// id: The entry identifier (OpenICF "Name" atribute. Most often matches the uid)
// attributes: an Attribute Map, containg the <String> attribute name as a key
// and the <List> attribute value(s) as value.
// password: password string, clear text
// options: a handler to the OperationOptions Map
//Create must return UID. Let's return the id as the UID for now.
//convert attributes to map
}
switch ( objectClass ) {
case auditaccess:
"(objectid, activitydate, eventname, transactionid, userid, trackingids, server_ip, server_port, " +
"client_ip, client_port, request_protocol, request_operation, request_detail, " +
"http_request_secure, http_request_method, http_request_path, http_request_queryparameters, " +
"http_request_headers, http_request_cookies, http_response_headers, response_status, " +
"response_statuscode, response_elapsedtime, response_elapsedtimeunits, roles" +
") values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
[
id,
: null,
: null,
? json(attributeMap.get("http")?.getValue()?.get(0)?.get("request")?.get("queryParameters")).toString()
: null,
: null,
: null,
: null,
: null,
]);
break;
case auditauthentication:
"(objectid, transactionid, activitydate, userid, eventname, result, principals, context, " +
"entries, trackingids" +
") values (?,?,?,?,?,?,?,?,?,?)",
[
id,
: null,
: null,
: null
]);
break;
case auditactivity:
"objectid, activitydate, eventname, transactionid, userid, trackingids, runas, activityobjectid, " +
"operation, subjectbefore, subjectafter, changedfields, " +
"subjectrev, passwordchanged, message, status" +
") values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
[
id, // objectid
: null,
: null,
: null,
: null,
: null,
]);
break;
case auditrecon:
"objectid, transactionid, activitydate, eventname, userid, trackingids, activity, exceptiondetail, linkqualifier, " +
"mapping, message, messagedetail, situation, sourceobjectid, status, targetobjectid, reconciling, " +
"ambiguoustargetobjectids, reconaction, entrytype, reconid" +
") values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
[
id, // objectid
: null,
: null,
]);
break;
case auditsync:
"objectid, transactionid, activitydate, eventname, userid, trackingids, activity, exceptiondetail, " +
"linkqualifier, mapping, message, messagedetail, situation, sourceobjectid, status, targetobjectid" +
") values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
[
id,
: null,
: null,
]);
break;
case auditconfig:
"objectid, activitydate, eventname, transactionid, userid, trackingids, runas, configobjectid, " +
"operation, beforeObject, afterObject, changedfields, " +
"rev" +
") values (?,?,?,?,?,?,?,?,?,?,?,?,?)",
[
id, // objectid
: null,
: null,
: null,
: null,
]);
break;
default:
}
return id;