RouterAuditEventHandler.java revision 21dcdac963f79c098a5ea1a2c5c5e109429c9786
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 2015 ForgeRock AS.
*
* 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]"
*/
/**
* Audit event handler that logs to a router target.
*/
public class RouterAuditEventHandler extends AuditEventHandlerBase<RouterAuditEventHandlerConfiguration> {
/** Logger */
/** router target resource path */
private ResourcePath resourcePath;
/** the DependencyProvider to provide access to the ConnectionFactory */
private DependencyProvider dependencyProvider;
/**
* {@inheritDoc}
*/
}
/**
* {@inheritDoc}
*/
this.dependencyProvider = provider;
}
}
/**
* {@inheritDoc}
*/
public void close() throws ResourceException {
}
/**
* {@inheritDoc}
*/
return RouterAuditEventHandlerConfiguration.class;
}
public Promise<ResourceResponse, ResourceException> publishEvent(final Context context, final String auditEventTopic,
final JsonValue auditEventContent) {
try {
} catch (ClassNotFoundException e) {
return new InternalServerErrorException(e).asPromise();
} catch (ResourceException e) {
return e.asPromise();
}
}
public Promise<ResourceResponse, ResourceException> readEvent(final Context context, final String auditEventTopic,
final String auditEventId) {
try {
} catch (ClassNotFoundException e) {
return new InternalServerErrorException(e).asPromise();
} catch (ResourceException e) {
return e.asPromise();
}
}
public Promise<QueryResponse, ResourceException> queryEvents(final Context context, final String auditEventTopic,
try {
return newResultPromise(
new QueryResourceHandler() {
}
}));
} catch (ClassNotFoundException e) {
return new InternalServerErrorException(e).asPromise();
} catch (ResourceException e) {
return e.asPromise();
}
}
}