org.jboss.wise.lms.httpForward.mbean
Class AdminMBean

java.lang.Object
  extended by org.jboss.wise.lms.httpForward.mbean.AdminMBean
All Implemented Interfaces:
Admin

public class AdminMBean
extends java.lang.Object
implements Admin

This is the Admin mbean implementation, ie. the Lms core.

Author:
Stefano Maestri, stefano.maestri@javalinux.it, Alessio Soldano, alessio.soldano@javalinux.it

Constructor Summary
AdminMBean()
           
 
Method Summary
 void addLoggingServletMapping(java.lang.String name, java.lang.String url)
          Creates a new Lms mapping: requests coming to http://host:port/Lms/log/name are processed (recorded) and forwarded to the specified url.
 void cleanAllCommunications()
          Cleans up all the recorded communications
 void cleanCommunications(java.lang.String name)
          Cleans up the communications for the given mapping name.
 void create()
           
 void destroy()
           
 LogData getLogData(java.lang.String name)
          Gets the recorder data for a given mapping.
 void logCommunication(java.lang.String name, Request request, Response response)
          Requires the provided Request and Response to be recorder under the given mapping name.
 void removeLoggingServletMapping(java.lang.String name)
          Remove a mapping from the current list of Lms mapping
 java.util.List<LogData> showAllLogData()
          Returns the full list of recorded data.
 java.util.Map<java.lang.String,java.lang.String> showAllLogMappings()
          Returns a map whose keys are the mapping's short name and whose values are the corresponding specified urls.
 java.lang.String startLogRecording(java.lang.String name)
          Enable recording on the given mapping
 void stopAllLogRecording()
          Disable recording on all the mappings currently in place.
 java.lang.String stopLogRecording(java.lang.String name)
          Disable recording on the given mapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdminMBean

public AdminMBean()
Method Detail

addLoggingServletMapping

public void addLoggingServletMapping(java.lang.String name,
                                     java.lang.String url)
Description copied from interface: Admin
Creates a new Lms mapping: requests coming to http://host:port/Lms/log/name are processed (recorded) and forwarded to the specified url. Responses also pass through Lms and are recorded too.

Specified by:
addLoggingServletMapping in interface Admin
Parameters:
name - The short name to be used for the mapping
url - The actual address requests should be forwarded to when using this mapping

removeLoggingServletMapping

public void removeLoggingServletMapping(java.lang.String name)
Description copied from interface: Admin
Remove a mapping from the current list of Lms mapping

Specified by:
removeLoggingServletMapping in interface Admin
Parameters:
name - The name of the mapping to be removed.

showAllLogMappings

public java.util.Map<java.lang.String,java.lang.String> showAllLogMappings()
Description copied from interface: Admin
Returns a map whose keys are the mapping's short name and whose values are the corresponding specified urls.

Specified by:
showAllLogMappings in interface Admin
Returns:
The mappings' map.

getLogData

public LogData getLogData(java.lang.String name)
Description copied from interface: Admin
Gets the recorder data for a given mapping.

Specified by:
getLogData in interface Admin
Parameters:
name - The mapping name of the required data
Returns:
The recorder data for a given mapping

showAllLogData

public java.util.List<LogData> showAllLogData()
Description copied from interface: Admin
Returns the full list of recorded data.

Specified by:
showAllLogData in interface Admin
Returns:
The full list of recorded data.

create

public void create()
Specified by:
create in interface Admin

destroy

public void destroy()
Specified by:
destroy in interface Admin

startLogRecording

public java.lang.String startLogRecording(java.lang.String name)
Description copied from interface: Admin
Enable recording on the given mapping

Specified by:
startLogRecording in interface Admin
Parameters:
name - The name of the mapping on which the recording has to be enabled.
Returns:
A confirmation/error string

stopLogRecording

public java.lang.String stopLogRecording(java.lang.String name)
Description copied from interface: Admin
Disable recording on the given mapping

Specified by:
stopLogRecording in interface Admin
Parameters:
name - The name of the mapping on which the recording has to be disabled.
Returns:
A confirmation/error string

stopAllLogRecording

public void stopAllLogRecording()
Description copied from interface: Admin
Disable recording on all the mappings currently in place.

Specified by:
stopAllLogRecording in interface Admin

logCommunication

public void logCommunication(java.lang.String name,
                             Request request,
                             Response response)
Description copied from interface: Admin
Requires the provided Request and Response to be recorder under the given mapping name.

Specified by:
logCommunication in interface Admin
Parameters:
name - The mapping name
request - The request object
response - The response object

cleanCommunications

public void cleanCommunications(java.lang.String name)
Description copied from interface: Admin
Cleans up the communications for the given mapping name.

Specified by:
cleanCommunications in interface Admin

cleanAllCommunications

public void cleanAllCommunications()
Description copied from interface: Admin
Cleans up all the recorded communications

Specified by:
cleanAllCommunications in interface Admin