|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.petals.tools.webadmin.collector.DataCollector
public final class DataCollector
DataCollector is a singleton : only one can be instantiate and it's not cloneable. Clients can only gets a reference to the existing DataCollector and call methods through this reference.
Method Summary | |
---|---|
void |
activateMonitoring(java.lang.String serverName,
boolean showMessageContent)
starts monitoring on a server of the list of servers via a JMX call on the administration MBean of this server to call his activation method |
void |
activateMonitoringAllServers(boolean showMessageContent)
starts monitoring on each server of the list of servers via a JMX call on their administration MBean. |
void |
changeCompoState(java.lang.String serverName,
java.lang.String compoName,
java.lang.String action)
Change the state of a component on a PEtALS server |
void |
changeSAState(java.lang.String serverName,
java.lang.String saName,
java.lang.String operation)
Temporary method to change the state of a new Service Assembly |
protected void |
createListener(ServerConfiguration serverConf)
Creates a listener to a server and stores it in the messagesListeners map |
void |
deactivateMonitoring(java.lang.String serverName)
starts monitoring on a server of the list of servers via a JMX call on the administration MBean of this server to call his activation method |
void |
deactivateMonitoringAllServers()
stops monitoring on each server of the list of servers via a JMX call on their administration MBean. |
static DataCollector |
getCollector()
Return the actual collector |
ServerConfiguration |
getEntryServerConf()
Gets the configuration of PEtALS entry server |
MessageExchange |
getMessageExchange(java.lang.String serverName,
java.lang.String exchangeId)
|
java.util.Map<java.lang.String,MessageExchange> |
getMessagesExchanges(java.lang.String serverName)
|
javax.management.ObjectName |
getPetalsAdminName()
Gets admin MBean name of PEtALS |
java.util.List<ServerConfiguration> |
getPetalsServersConf()
Gets configuration of all servers |
ServerPropertiesManager |
getPropertiesManager()
Gets the manager of properties file |
ServerConfiguration |
getServer(java.lang.String serverName)
Gets a server configuration from the list of servers by his name |
ServerConfiguration |
getStorageServerConf()
Gets the configuration of storage server |
void |
init(java.lang.String rootPath)
Initialize the DataCollector. |
void |
installComponent(java.lang.String serverName,
java.lang.String filePath)
Install a component on a given server. |
void |
installServiceAssembly(java.lang.String serverName,
java.lang.String filepath)
Temporary method to install a new Service Assembly |
boolean |
isInit()
Indicates if DataCollector have successfully been initialized by init() method |
boolean |
isMessageContentShown(java.lang.String serverName)
|
boolean |
isMonitoring(java.lang.String serverName)
Indicates if monitoring is active or not on a server by retrieving the information on the server himself. |
void |
processNewDatas(java.util.List<Message> messagesList)
Process a new set of messages. |
void |
setEntryServerConf(ServerConfiguration serverConf)
Sets the PEtALS entry server configuration. |
void |
setLastRetrieveTime(java.lang.String serverName,
long timestamp)
Sets the last time of retrieval for a server by associating the name of the server as key to a timestamp as the time. |
void |
setPetalsAdminName(javax.management.ObjectName petalsAdminName)
Sets the admin MBean name of PEtALS |
void |
setPetalsServersConf(java.util.List<ServerConfiguration> petalsServersConf)
Sets the list of PEtALS servers to a new list. |
void |
setPropertiesManager(ServerPropertiesManager propertiesManager)
Sets the properties manager to a new ServerPropertiesManager |
void |
setStorageServerConf(ServerConfiguration serverConf)
Sets the configuration of datas storage server |
void |
showMessagesInConsole(java.util.List<java.util.Map<java.lang.String,java.lang.Object>> messages)
debug function to see the content of the messages in a list of messages |
void |
storeMessages(java.util.List<Message> list,
java.lang.String notificationNumber)
|
void |
uninstallComponent(java.lang.String serverName,
java.lang.String compoName)
Uninstall a component on a PEtALS server |
void |
uninstallServiceAssembly(java.lang.String serverName,
java.lang.String saName)
Temporary method to uninstall a new Service Assembly |
void |
updateAndExposeComponents()
Retrieves via a JMX call to each server of the list of servers petalsServersConf a |
void |
updateExposedServerConf(ServerConfiguration serverConf)
Update a server's configuration in the ServersList mbean on the storage server |
void |
updateListeners()
Updates the listeners stored : removes listeners to server unexisting or stopped and adds listeners to new active servers |
void |
updateServers()
Update the list of servers petalsServersConf and expose the list on the storage JMX server by retrieving the informations of all servers via a JMX call to the entry server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static DataCollector getCollector()
public void activateMonitoring(java.lang.String serverName, boolean showMessageContent) throws java.lang.NoSuchFieldException, javax.management.MBeanException
serverName
- the name of the server to monitorshowMessageContent
- true to monitor also the content of messages, false to ignore
it
java.lang.NoSuchFieldException
- thrown if server is not found in the list of servers
javax.management.MBeanException
- problem occured in communication with server when trying to
sets the new monitoring attribute valuepublic void activateMonitoringAllServers(boolean showMessageContent) throws java.lang.NoSuchFieldException, javax.management.MBeanException
showMessageContent
- true to monitor content of messages, false to ignore it
java.lang.NoSuchFieldException
- thrown if server is not found in the list of servers
javax.management.MBeanException
public void changeCompoState(java.lang.String serverName, java.lang.String compoName, java.lang.String action) throws java.lang.NoSuchFieldException, javax.management.MBeanException
serverName
- the name of the server on which the component is installedcompoName
- the name of the componentaction
- the action to do : "start" or "stop"
java.lang.NoSuchFieldException
javax.management.MBeanException
public void deactivateMonitoring(java.lang.String serverName) throws java.lang.NoSuchFieldException, javax.management.MBeanException
serverName
- the name of the server to monitorshowMessageContent
- true to monitor also the content of messages, false to ignore
it
java.lang.NoSuchFieldException
- thrown if server is not found in the list of servers
javax.management.MBeanException
- problem occured in communication with server when trying to
sets the new monitoring attribute valuepublic void deactivateMonitoringAllServers() throws java.lang.NoSuchFieldException, javax.management.MBeanException
java.lang.NoSuchFieldException
- thrown if server is not found in the list of servers
javax.management.MBeanException
public void updateAndExposeComponents() throws java.io.IOException, javax.management.MBeanException
java.io.IOException
- storage server is not reachable
javax.management.MBeanException
- invocation of MBean in storage server threw an exceptionpublic ServerConfiguration getEntryServerConf()
public javax.management.ObjectName getPetalsAdminName()
public java.util.List<ServerConfiguration> getPetalsServersConf()
public ServerPropertiesManager getPropertiesManager()
public ServerConfiguration getServer(java.lang.String serverName) throws java.lang.NoSuchFieldException
serverName
- the name of the server wanted
java.lang.NoSuchFieldException
- server doesn't exist
java.lang.NullPointerException
- serverName parameter is nullpublic ServerConfiguration getStorageServerConf()
public void init(java.lang.String rootPath) throws javax.management.MBeanException, java.io.IOException, javax.management.AttributeNotFoundException
java.io.IOException
- the properties manager file is not readable or is not found
javax.management.MBeanException
- problem occured in communication with storage server
javax.management.AttributeNotFoundException
public void installComponent(java.lang.String serverName, java.lang.String filePath) throws javax.management.MBeanException
serverName
- the name of the server where to install componentfilePath
- complete path of the archive on the server hosting the webapp
javax.management.MBeanException
- a problem occured with server during the installationpublic void installServiceAssembly(java.lang.String serverName, java.lang.String filepath) throws javax.management.MBeanException
javax.management.MBeanException
public void uninstallServiceAssembly(java.lang.String serverName, java.lang.String saName) throws javax.management.MBeanException
javax.management.MBeanException
public void changeSAState(java.lang.String serverName, java.lang.String saName, java.lang.String operation) throws javax.management.MBeanException
javax.management.MBeanException
public boolean isInit()
public boolean isMessageContentShown(java.lang.String serverName) throws javax.management.MBeanException, java.lang.NoSuchFieldException
javax.management.MBeanException
java.lang.NoSuchFieldException
public boolean isMonitoring(java.lang.String serverName) throws javax.management.MBeanException, java.lang.NoSuchFieldException
javax.management.MBeanException
java.lang.NoSuchFieldException
public void processNewDatas(java.util.List<Message> messagesList)
messagesList
- a list of Message object representations of messages. Must not
be null.
java.io.IOException
javax.management.MBeanException
public void setEntryServerConf(ServerConfiguration serverConf) throws java.io.IOException
serverConf
- a server's configuration
java.io.IOException
public void setLastRetrieveTime(java.lang.String serverName, long timestamp)
serverName
- the name of the servertimestamp
- the time to associate with the server's namepublic void setPetalsAdminName(javax.management.ObjectName petalsAdminName)
petalsAdminName
- an Objectname representation of the name of the MBeanpublic void setPetalsServersConf(java.util.List<ServerConfiguration> petalsServersConf)
petalsServersConf
- a list of ServerConfiguration representation of the
informations of each serverpublic void setPropertiesManager(ServerPropertiesManager propertiesManager)
propertiesManager
- a ServerPropertiesManager representation of a properties
managerpublic void setStorageServerConf(ServerConfiguration serverConf)
serverConf
- a ServerConfiguration containing informations of the JMX
Server to setpublic void uninstallComponent(java.lang.String serverName, java.lang.String compoName) throws javax.management.MBeanException
serverName
- the name of the PEtALS server on which component is installedcompoName
- the name of the component to uninstall
javax.management.MBeanException
public void updateExposedServerConf(ServerConfiguration serverConf) throws javax.management.MBeanException
serverConf
- the new server's configuration
javax.management.MBeanException
public void updateServers() throws java.io.IOException, javax.management.MBeanException
java.io.IOException
- one of the entry server or the storage server is not
reachable
javax.management.MBeanException
- re-throwing exception received from exposing servers
javax.management.AttributeNotFoundException
public void updateListeners() throws javax.management.MBeanException
javax.management.MBeanException
- an exception occured when trying to create a listenercreateListener(ServerConfiguration)
,
messagesListeners
protected void createListener(ServerConfiguration serverConf) throws javax.management.MBeanException
serverConf
- configuration of the server to listen
javax.management.MBeanException
- a problem occurs while communicating with the servermessagesListeners
public java.util.Map<java.lang.String,MessageExchange> getMessagesExchanges(java.lang.String serverName)
public MessageExchange getMessageExchange(java.lang.String serverName, java.lang.String exchangeId)
public void showMessagesInConsole(java.util.List<java.util.Map<java.lang.String,java.lang.Object>> messages)
messages
- the list of messagespublic void storeMessages(java.util.List<Message> list, java.lang.String notificationNumber)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |