TracedStorage.java revision a069e2643d6be5b34309179220b2777d42df13fc
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2015 ForgeRock AS
*/
/** Decorates a {@link Storage} with additional trace logging. */
final class TracedStorage implements Storage
{
/** Decorates an {@link Importer} with additional trace logging. */
private final class TracedImporter implements Importer
{
{
}
{
}
{
}
{
return value;
}
public void close()
{
}
private int id()
{
return System.identityHashCode(this);
}
{
}
}
/** Decorates an {@link ReadableTransaction} with additional trace logging. */
private final class TracedReadableTransaction implements ReadableTransaction
{
private final ReadableTransaction txn;
{
}
{
return count;
}
{
return cursor;
}
{
return value;
}
private int id()
{
return System.identityHashCode(this);
}
}
/** Decorates an {@link WriteableTransaction} with additional trace logging. */
private final class TracedWriteableTransaction implements WriteableTransaction
{
private final WriteableTransaction txn;
{
}
{
}
{
return isDeleted;
}
{
}
{
return count;
}
{
return cursor;
}
{
}
{
return value;
}
{
return isUpdated;
}
private int id()
{
return System.identityHashCode(this);
}
}
{
}
public void close()
{
if (logger.isTraceEnabled())
{
}
}
public StorageStatus getStorageStatus()
{
return storage.getStorageStatus();
}
{
if (logger.isTraceEnabled())
{
.trace("Storage@%s.open(accessMode=%s) - Opened storage for backend %s", storageId(), accessMode, backendId);
}
}
{
if (logger.isTraceEnabled())
{
op = new ReadOperation<T>()
{
{
}
};
}
}
public void removeStorageFiles() throws StorageRuntimeException
{
if (logger.isTraceEnabled())
{
}
}
{
if (logger.isTraceEnabled())
{
return new TracedImporter(importer);
}
return importer;
}
public boolean supportsBackupAndRestore()
{
return storage.supportsBackupAndRestore();
}
{
if (logger.isTraceEnabled())
{
op = new WriteOperation()
{
{
}
};
}
}
{
if (logger.isTraceEnabled())
{
}
}
public void removeBackup(BackupDirectory backupDirectory, String backupID) throws DirectoryException
{
if (logger.isTraceEnabled())
{
}
}
{
if (logger.isTraceEnabled())
{
}
}
{
if (logger.isTraceEnabled())
{
}
return results;
}
{
}
private int storageId()
{
return System.identityHashCode(this);
}
}