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 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     * @throws AuditException
038     *          If the required handler could not be constructed for any reason.
039     */
040    <T extends AuditEventHandler> T create(
041            String name,
042            Class<T> clazz,
043            EventHandlerConfiguration configuration,
044            EventTopicsMetaData eventTopicsMetaData) throws AuditException;
045}