DebugFileProviderForTest.java revision ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * The contents of this file are subject to the terms of the Common Development and
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * Distribution License (the License). You may not use this file except in compliance with the
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * specific language governing permission and limitations under the License.
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * When distributing Covered Software, include this CDDL Header Notice in each file and include
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * Header, with the fields enclosed by brackets [] replaced by your own identifying
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * information: "Portions copyright [year] [name of copyright owner]".
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL * Copyright 2014-2015 ForgeRock AS.
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTELimport com.sun.identity.shared.configuration.SystemPropertiesManager;
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTELimport com.sun.identity.shared.debug.file.DebugConfiguration;
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTELimport com.sun.identity.shared.debug.file.DebugFile;
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTELimport com.sun.identity.shared.debug.file.DebugFileProvider;
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTELimport com.sun.identity.shared.debug.file.impl.DebugFileImpl;
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTELimport com.sun.identity.shared.debug.file.impl.StdDebugFile;
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL * Debug file provider with an accelerate clock
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTELpublic class DebugFileProviderForTest implements DebugFileProvider {
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL private Map<String, DebugFile> debugMap = new HashMap<String, DebugFile>();
ce2e2c2c7126b18ccfce0fe69a3bfa2eafea68b7Quentin CASTEL public DebugFileProviderForTest(DebugConfiguration configuration, TimeService accelerateClock) {
5e89746cb5bec21d15a044ce89cfcdbf99d3d49dQuentin CASTEL public void setClock(TimeService accelerateClock) {
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);