DebugFileProviderImpl.java revision 5e89746cb5bec21d15a044ce89cfcdbf99d3d49d
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL * The contents of this file are subject to the terms of the Common Development and
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL * Distribution License (the License). You may not use this file except in compliance with the
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL * specific language governing permission and limitations under the License.
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL * When distributing Covered Software, include this CDDL Header Notice in each file and include
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL * Header, with the fields enclosed by brackets [] replaced by your own identifying
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL * information: "Portions copyright [year] [name of copyright owner]".
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL * Copyright 2014 ForgeRock AS.
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTELpackage com.sun.identity.shared.debug.file.impl;
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTELimport com.sun.identity.shared.configuration.SystemPropertiesManager;
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTELimport com.sun.identity.shared.debug.DebugConstants;
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTELimport com.sun.identity.shared.debug.file.DebugFile;
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTELimport com.sun.identity.shared.debug.file.DebugFileProvider;
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL * Debug file provider
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL * Manage Debug files controller
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL * Keep the following constraint one :
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL * - One debugFile instance for One log file
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTELpublic class DebugFileProviderImpl implements DebugFileProvider {
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL private Map<String, DebugFile> debugMap = new HashMap<String, DebugFile>();
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL public synchronized DebugFile getInstance(String debugName) {
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL DebugFile debugFile = debugMap.get(debugName);
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL String debugDirectory = SystemPropertiesManager.get(DebugConstants.CONFIG_DEBUG_DIRECTORY);