org.opends.server.loggers
Class TimeStampNaming

java.lang.Object
  extended by org.opends.server.loggers.TimeStampNaming
All Implemented Interfaces:
FileNamingPolicy

public class TimeStampNaming
extends java.lang.Object
implements FileNamingPolicy

A file name policy that names files suffixed by the time it was created.


Constructor Summary
TimeStampNaming(java.io.File file)
          Create a new instance of the TimeStampNaming policy.
 
Method Summary
 java.io.FilenameFilter getFilenameFilter()
          Gets the filename filter that can be used to filter files named by this policy.
 java.io.File getInitialName()
          Initializes the policy and returns the current name to use.
 java.io.File getNextName()
          Gets the next name to use.
 java.io.File[] listFiles()
          Gets all the existing files named by this policy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeStampNaming

public TimeStampNaming(java.io.File file)
Create a new instance of the TimeStampNaming policy. Files will be created with the names in the prefix.utctime format.

Parameters:
file - the file to use as the naming prefix.
Method Detail

getInitialName

public java.io.File getInitialName()
Initializes the policy and returns the current name to use.

Specified by:
getInitialName in interface FileNamingPolicy
Returns:
the initial file.

getNextName

public java.io.File getNextName()
Gets the next name to use.

Specified by:
getNextName in interface FileNamingPolicy
Returns:
the next file.

getFilenameFilter

public java.io.FilenameFilter getFilenameFilter()
Gets the filename filter that can be used to filter files named by this policy.

Specified by:
getFilenameFilter in interface FileNamingPolicy
Returns:
The FilenameFilter that can filter files named by this policy.

listFiles

public java.io.File[] listFiles()
Gets all the existing files named by this policy.

Specified by:
listFiles in interface FileNamingPolicy
Returns:
The files named by this policy or null if an error occured.