Crossfire JXClient, Trunk
Public Member Functions | List of all members
com.sun.jmx.examples.scandir.ResultLogManagerMXBean Interface Reference
Inheritance diagram for com.sun.jmx.examples.scandir.ResultLogManagerMXBean:
Inheritance graph
Collaboration diagram for com.sun.jmx.examples.scandir.ResultLogManagerMXBean:
Collaboration graph

Public Member Functions

void clearLogs () throws IOException, InstanceNotFoundException
 
long getLogFileCapacity () throws IOException, InstanceNotFoundException
 
String getLogFileName () throws IOException, InstanceNotFoundException
 
long getLoggedCount () throws IOException, InstanceNotFoundException
 
ResultRecord[] getMemoryLog () throws IOException, InstanceNotFoundException
 
int getMemoryLogCapacity () throws IOException, InstanceNotFoundException
 
void log (ResultRecord record) throws IOException, InstanceNotFoundException
 
void newLogFile (String basename, long maxRecord) throws IOException, InstanceNotFoundException
 
void setLogFileCapacity (long maxRecord) throws IOException, InstanceNotFoundException
 
void setMemoryLogCapacity (int size) throws IOException, InstanceNotFoundException
 

Detailed Description

The ResultLogManagerMXBean is in charge of managing result logs. DirectoryScanners can be configured to log a ResultRecord whenever they take action upon a file that matches their set of matching criteria. The ResultLogManagerMXBean is responsible for storing these results in its result logs.

The ResultLogManagerMXBean will let you interactively clear these result logs, change their capacity, and decide where (memory or file or both) the ResultRecords should be stored.

The memory log is useful in so far that its content can be interactively returned by the ResultLogManagerMXBean. The file log doesn't have this facility.

The result logs are intended to be used by e.g. an offline program that would take some actions on the files that were matched by the scanners criteria:

The scandir application could be configured to only produce logs (i.e. takes no action but logging the matching files), and the real action (e.g. mail the result log to the engineer which maintains the lab, or parse the log and prepare and send a single mail to the matching files owners, containing the list of file he/she should consider deleting) could be performed by such another program/module.

Author
Sun Microsystems, 2006 - All rights reserved.

Definition at line 73 of file ResultLogManagerMXBean.java.

Member Function Documentation

◆ clearLogs()

void com.sun.jmx.examples.scandir.ResultLogManagerMXBean.clearLogs ( ) throws IOException, InstanceNotFoundException

Clears the memory log and result log file.

Exceptions
IOExceptionA connection problem occurred when accessing the underlying resource.
InstanceNotFoundExceptionThe underlying MBean is not registered in the MBeanServer.

Implemented in com.sun.jmx.examples.scandir.ResultLogManager.

◆ getLogFileCapacity()

long com.sun.jmx.examples.scandir.ResultLogManagerMXBean.getLogFileCapacity ( ) throws IOException, InstanceNotFoundException

Gets the maximum number of records that can be logged in the result log file.

When that maximum number of records is reached the ResultLogManager will rename the result log file by appending a '~' to its name, and a new empty log file will be created.

See also
getLogFileName()
Returns
The maximum number of records that can be logged in the result log file.
Exceptions
IOExceptionA connection problem occurred when accessing the underlying resource.
InstanceNotFoundExceptionThe underlying MBean is not registered in the MBeanServer.

Implemented in com.sun.jmx.examples.scandir.ResultLogManager.

◆ getLogFileName()

String com.sun.jmx.examples.scandir.ResultLogManagerMXBean.getLogFileName ( ) throws IOException, InstanceNotFoundException

Gets the name of the current result log file.

null means that no log file is configured: logging to file is disabled.

Returns
The name of the current result log file, or null if logging to file is disabled.
Exceptions
IOExceptionA connection problem occurred when accessing the underlying resource.
InstanceNotFoundExceptionThe underlying MBean is not registered in the MBeanServer.

Implemented in com.sun.jmx.examples.scandir.ResultLogManager.

◆ getLoggedCount()

long com.sun.jmx.examples.scandir.ResultLogManagerMXBean.getLoggedCount ( ) throws IOException, InstanceNotFoundException

Gets The number of records that have been logged in the current result log file. This will always be less than getLogFileCapacity().

Returns
The number of records in the current result log file.
Exceptions
IOExceptionA connection problem occurred when accessing the underlying resource.
InstanceNotFoundExceptionThe underlying MBean is not registered in the MBeanServer.

Implemented in com.sun.jmx.examples.scandir.ResultLogManager.

◆ getMemoryLog()

ResultRecord [] com.sun.jmx.examples.scandir.ResultLogManagerMXBean.getMemoryLog ( ) throws IOException, InstanceNotFoundException

Gets the whole content of the memory log. This cannot exceed getMemoryLogCapacity records.

Returns
the whole content of the memory log.
Exceptions
IOExceptionA connection problem occurred when accessing the underlying resource.
InstanceNotFoundExceptionThe underlying MBean is not registered in the MBeanServer.

Implemented in com.sun.jmx.examples.scandir.ResultLogManager.

◆ getMemoryLogCapacity()

int com.sun.jmx.examples.scandir.ResultLogManagerMXBean.getMemoryLogCapacity ( ) throws IOException, InstanceNotFoundException

Gets the maximum number of records that can be logged in the memory log.

A non positive value - 0 or negative - means that logging in memory is disabled.

The memory log is a FIFO: when its maximum capacity is reached, its head element is removed to make place for a new element at its tail.

Returns
The maximum number of records that can be logged in the memory log. A value
<= 0
means that logging in memory is disabled.
Exceptions
IOExceptionA connection problem occurred when accessing the underlying resource.
InstanceNotFoundExceptionThe underlying MBean is not registered in the MBeanServer.

Implemented in com.sun.jmx.examples.scandir.ResultLogManager.

◆ log()

void com.sun.jmx.examples.scandir.ResultLogManagerMXBean.log ( ResultRecord  record) throws IOException, InstanceNotFoundException

Logs a result record to the active result logs (memory,file,both,or none) depending on how this MBean is currently configured.

See also
getLogFileName()
getMemoryLogCapacity()
Parameters
recordThe result record to log.
Exceptions
IOExceptionA connection problem occurred when accessing the underlying resource.
InstanceNotFoundExceptionThe underlying MBean is not registered in the MBeanServer.

Implemented in com.sun.jmx.examples.scandir.ResultLogManager.

◆ newLogFile()

void com.sun.jmx.examples.scandir.ResultLogManagerMXBean.newLogFile ( String  basename,
long  maxRecord 
) throws IOException, InstanceNotFoundException

Creates a new log file in which to store results.

When this method is called, the ResultLogManager will stop logging in its current log file and use the new specified file instead. If that file already exists, it will be renamed by appending a '~' to its name, and a new empty file with the name specified by basename will be created.

Calling this method has no side effect on the {InitialResultLogConfig} held in the ScanDirConfigMXBean} configuration. To apply these new values to the ScanDirConfigMXBean} configuration, you must call { ScanManagerMXBean#applyCurrentResultLogConfig ScanManagerMXBean.applyCurrentResultLogConfig}.

Parameters
basenameThe name of the new log file. This will be the new name returned by getLogFileName.
maxRecordmaximum number of records to log in the specified file before creating a new file. maxRecord will be the new value returned by getLogFileCapacity. When that maximum number of records is reached the ResultLogManager will rename the file by appending a '~' to its name, and a new empty log file will be created.
Exceptions
IOExceptionA connection problem occurred when accessing the underlying resource.
InstanceNotFoundExceptionThe underlying MBean is not registered in the MBeanServer.

Implemented in com.sun.jmx.examples.scandir.ResultLogManager.

◆ setLogFileCapacity()

void com.sun.jmx.examples.scandir.ResultLogManagerMXBean.setLogFileCapacity ( long  maxRecord) throws IOException, InstanceNotFoundException

Sets the maximum number of records that can be logged in the result log file.

When that maximum number of records is reached the ResultLogManager will rename the result log file by appending a '~' to its name, and a new empty log file will be created.

If logging to file is disabled calling this method is irrelevant.

Parameters
maxRecordmaximum number of records to log in the result log file.
See also
getLogFileName()
Exceptions
IOExceptionA connection problem occurred when accessing the underlying resource.
InstanceNotFoundExceptionThe underlying MBean is not registered in the MBeanServer.

Implemented in com.sun.jmx.examples.scandir.ResultLogManager.

◆ setMemoryLogCapacity()

void com.sun.jmx.examples.scandir.ResultLogManagerMXBean.setMemoryLogCapacity ( int  size) throws IOException, InstanceNotFoundException

Sets the maximum number of records that can be logged in the memory log.

The memory log is a FIFO: when its maximum capacity is reached, its head element is removed to make place for a new element at its tail.

Parameters
sizeThe maximum number of result records that can be logged in the memory log.

A non positive value - 0 or negative - means that logging in memory is disabled. It will also have the side effect of clearing the memory log.

Exceptions
IOExceptionA connection problem occurred when accessing the underlying resource.
InstanceNotFoundExceptionThe underlying MBean is not registered in the MBeanServer.

Implemented in com.sun.jmx.examples.scandir.ResultLogManager.


The documentation for this interface was generated from the following file: