001/* 002 * The contents of this file are subject to the terms of the Common Development and 003 * Distribution License (the License). You may not use this file except in compliance with the 004 * License. 005 * 006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the 007 * specific language governing permission and limitations under the License. 008 * 009 * When distributing Covered Software, include this CDDL Header Notice in each file and include 010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL 011 * Header, with the fields enclosed by brackets [] replaced by your own identifying 012 * information: "Portions copyright [year] [name of copyright owner]". 013 * 014 * Copyright 2015-2016 ForgeRock AS. 015 */ 016package org.forgerock.audit.events.handlers; 017 018import org.forgerock.audit.AuditException; 019import org.forgerock.audit.events.EventTopicsMetaData; 020 021/** 022 * Factory interface for creating instances of {@link AuditEventHandler}. 023 */ 024public interface AuditEventHandlerFactory { 025 026 /** 027 * Create a new AuditEventHandler instance. 028 * 029 * @param name 030 * The name of the AuditEventHandler object. 031 * @param clazz 032 * The type of AuditEventHandler to create. 033 * @param configuration 034 * Configuration parameters that can be adjusted by system administrators. 035 * @param eventTopicsMetaData 036 * Provides meta-data describing the audit event topics this AuditEventHandler may have to handle. 037 * @param <T> The type of the handler. 038 * @return The handler instance. 039 * @throws AuditException 040 * If the required handler could not be constructed for any reason. 041 */ 042 <T extends AuditEventHandler> T create( 043 String name, 044 Class<T> clazz, 045 EventHandlerConfiguration configuration, 046 EventTopicsMetaData eventTopicsMetaData) throws AuditException; 047}