konark.gui
Class SMSManager

java.lang.Object
  extended bykonark.gui.SMSManager

public class SMSManager
extends java.lang.Object

Manages connections to SMS servers and caches


Constructor Summary
SMSManager()
          Creates a new instance of SMSManager
SMSManager(java.util.Vector initialServerList)
          Create a new instance of SMSManager with an initial list of servers Will NOT get a list of the agents in the servers.
 
Method Summary
 void addCustomDetector(java.lang.String detName)
           
 void addCustomEvent(java.lang.String eventName)
           
 void addDetector(java.lang.String smsAgentName, java.lang.String monAgentName, java.lang.String event, java.lang.String handler)
           
 void addSubscription(java.lang.String smsAgentName, java.lang.String toAgent, java.lang.String fromAgent, java.lang.String eventName, java.lang.String eventHandler)
           
 int attachCount()
          Returns the number of attached agents
 void attachSMS(java.lang.String serverUrl, java.lang.String username, java.lang.String password, java.lang.String agentName)
          Attaches to a network.SMSAgent via a network.SMSAgentServer.
 void detachSMS(java.lang.String agentName)
          Detach from an SMS server.
 java.util.Vector getAvailableDetectorsForAgents(java.lang.String smsAgentName, java.util.Vector monAgents)
           
 java.util.Vector getConfigHandles(java.lang.String smsAgentName)
           
 ConfigObject getConfigObject(java.lang.String configName, java.lang.String agentName)
           
 java.util.Hashtable getConfigsFromAllSMSAgents()
           
 java.util.Vector getConfigurations(java.lang.String smsAgentName)
           
 java.util.Vector getDetectorNames(java.lang.String monAgentURN)
           
 java.util.Vector getEventNames(java.lang.String monAgentURN)
           
 java.util.Vector getMonAgentsInSMSAgent(java.lang.String smsAgentName)
           
 java.lang.String getSMSAgentName(java.lang.String monAgentURN)
           
 java.util.Vector getSMSAgentsInSMSServer(java.lang.String server)
          Gives a list of the agents from a particular sms server
 java.util.Vector getSubscriptions(java.lang.String monAgentURN)
           
 boolean isSMSAttached(java.lang.String smsURL)
           
 void launchAgents(java.lang.String smsAgentName, java.lang.String configFile, java.lang.String configHandle)
           
 void launchConfigFile(java.lang.String smsAgentName, java.lang.String filename, java.lang.String configName, java.lang.String backupDirectory, java.lang.String backupBaseFileName)
           
 void launchSMS(java.lang.String serverUrl, java.lang.String agentName)
          Launches an SMSAgent.
 void launchSMSAgentRestartMode(java.lang.String serverUrl, java.lang.String agentName, java.util.Vector restartConfigFiles)
          Launches an SMSAgent in restart mode.
 java.util.Vector listAgentServers()
          Gives a list of known sms servers
 java.util.Vector listAttachedSMSAgents()
          Returns an Enumeration of attached SMS servers
 java.util.Vector listAvailableAgentServers()
           
 void modifyDetector(java.lang.String smsAgentName, java.lang.String monAgentURN, java.lang.String detectorName, java.lang.Object[] args)
           
 void refreshAgentsInServers()
          Updates the list of agents in a particular SMS agent server
 void registerForHostStatusEvents(java.lang.String smsAgentName, java.util.Vector configNames, java.lang.String clientURL)
           
 void registerToReceiveEvents(java.lang.String smsAgentName, java.lang.String configHandle, java.lang.String url, java.util.Vector eventNameList)
           
 void removeAgent(java.lang.String smsAgentName, java.lang.String monAgentURN)
           
 void removeConfig(java.lang.String smsAgentName, java.lang.String configHandle)
           
 void removeDetector(java.lang.String smsAgentName, java.lang.String monAgent, java.lang.String detector)
           
 void removeSubscription(java.lang.String smsAgentName, java.lang.String publisher, java.lang.String subscriber, java.lang.String eventName)
           
 boolean smsAgentExists(java.lang.String serverURL, java.lang.String agentName)
           
 void startUpdater()
           
 void stopUpdater()
           
 void unregisterForAllHostStatusEvents(java.lang.String smsAgentName, java.lang.String clientURL)
           
 void unRegisterToReceiveEvents(java.lang.String agentName, java.lang.String configName, java.lang.String url, java.util.Vector eventNameList)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SMSManager

public SMSManager()
Creates a new instance of SMSManager


SMSManager

public SMSManager(java.util.Vector initialServerList)
Create a new instance of SMSManager with an initial list of servers Will NOT get a list of the agents in the servers.

Method Detail

attachSMS

public void attachSMS(java.lang.String serverUrl,
                      java.lang.String username,
                      java.lang.String password,
                      java.lang.String agentName)
               throws AlreadyAttachedException,
                      java.rmi.NotBoundException,
                      java.rmi.RemoteException,
                      java.rmi.AccessException,
                      java.net.MalformedURLException
Attaches to a network.SMSAgent via a network.SMSAgentServer.

Parameters:
serverUrl - The RMI URL of the network.SMSAgentServer to which to attach
username - Username
password - Password
agentName - the SMSAgent name
Throws:
AlreadyAttachedException
java.rmi.NotBoundException
java.rmi.RemoteException
java.rmi.AccessException
java.net.MalformedURLException

launchSMSAgentRestartMode

public void launchSMSAgentRestartMode(java.lang.String serverUrl,
                                      java.lang.String agentName,
                                      java.util.Vector restartConfigFiles)
                               throws AlreadyAttachedException,
                                      java.rmi.NotBoundException,
                                      java.rmi.RemoteException,
                                      java.rmi.AccessException,
                                      java.net.MalformedURLException,
                                      java.lang.Exception
Launches an SMSAgent in restart mode.

Parameters:
serverUrl - The RMI URL of the network.SMSAgentServer to which to attach
agentName - the name of the SMSAgent to be launched
Throws:
AlreadyAttachedException
java.rmi.NotBoundException
java.rmi.RemoteException
java.rmi.AccessException
java.net.MalformedURLException
java.lang.Exception

launchSMS

public void launchSMS(java.lang.String serverUrl,
                      java.lang.String agentName)
               throws AlreadyAttachedException,
                      java.rmi.NotBoundException,
                      java.rmi.RemoteException,
                      java.rmi.AccessException,
                      java.net.MalformedURLException
Launches an SMSAgent.

Parameters:
serverUrl - The RMI URL of the network.SMSAgentServer to which to attach
agentName - the name of the SMSAgent to be launched
Throws:
AlreadyAttachedException
java.rmi.NotBoundException
java.rmi.RemoteException
java.rmi.AccessException
java.net.MalformedURLException

detachSMS

public void detachSMS(java.lang.String agentName)
Detach from an SMS server.

Parameters:
agentName - The SMSAgent name to be detached

unRegisterToReceiveEvents

public void unRegisterToReceiveEvents(java.lang.String agentName,
                                      java.lang.String configName,
                                      java.lang.String url,
                                      java.util.Vector eventNameList)
                               throws java.lang.Exception
Throws:
java.lang.Exception

registerToReceiveEvents

public void registerToReceiveEvents(java.lang.String smsAgentName,
                                    java.lang.String configHandle,
                                    java.lang.String url,
                                    java.util.Vector eventNameList)
                             throws java.lang.Exception
Throws:
java.lang.Exception

startUpdater

public void startUpdater()

stopUpdater

public void stopUpdater()

attachCount

public int attachCount()
Returns the number of attached agents

Returns:
The number of attached agents

listAgentServers

public java.util.Vector listAgentServers()
Gives a list of known sms servers

Returns:
A vector of SMSServer strings.

smsAgentExists

public boolean smsAgentExists(java.lang.String serverURL,
                              java.lang.String agentName)

listAvailableAgentServers

public java.util.Vector listAvailableAgentServers()

getSMSAgentsInSMSServer

public java.util.Vector getSMSAgentsInSMSServer(java.lang.String server)
                                         throws java.rmi.NotBoundException,
                                                java.rmi.RemoteException,
                                                java.rmi.AccessException,
                                                java.net.MalformedURLException
Gives a list of the agents from a particular sms server

Returns:
A vector containing a list of agents in an SMS server
Throws:
java.rmi.NotBoundException
java.rmi.RemoteException
java.rmi.AccessException
java.net.MalformedURLException

listAttachedSMSAgents

public java.util.Vector listAttachedSMSAgents()
Returns an Enumeration of attached SMS servers

Returns:
A list of attached SMS servers

isSMSAttached

public boolean isSMSAttached(java.lang.String smsURL)
Parameters:
smsURL - A url for an sms agent
Returns:
True if the given sms agent is attached

refreshAgentsInServers

public void refreshAgentsInServers()
Updates the list of agents in a particular SMS agent server


launchAgents

public void launchAgents(java.lang.String smsAgentName,
                         java.lang.String configFile,
                         java.lang.String configHandle)
                  throws java.lang.Exception
Throws:
java.lang.Exception

modifyDetector

public void modifyDetector(java.lang.String smsAgentName,
                           java.lang.String monAgentURN,
                           java.lang.String detectorName,
                           java.lang.Object[] args)
                    throws java.lang.Exception
Throws:
java.lang.Exception

registerForHostStatusEvents

public void registerForHostStatusEvents(java.lang.String smsAgentName,
                                        java.util.Vector configNames,
                                        java.lang.String clientURL)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

unregisterForAllHostStatusEvents

public void unregisterForAllHostStatusEvents(java.lang.String smsAgentName,
                                             java.lang.String clientURL)
                                      throws java.lang.Exception
Throws:
java.lang.Exception

addSubscription

public void addSubscription(java.lang.String smsAgentName,
                            java.lang.String toAgent,
                            java.lang.String fromAgent,
                            java.lang.String eventName,
                            java.lang.String eventHandler)
                     throws java.lang.Exception
Throws:
java.lang.Exception

removeAgent

public void removeAgent(java.lang.String smsAgentName,
                        java.lang.String monAgentURN)
                 throws java.lang.Exception
Throws:
java.lang.Exception

removeConfig

public void removeConfig(java.lang.String smsAgentName,
                         java.lang.String configHandle)
                  throws java.lang.Exception
Throws:
java.lang.Exception

launchConfigFile

public void launchConfigFile(java.lang.String smsAgentName,
                             java.lang.String filename,
                             java.lang.String configName,
                             java.lang.String backupDirectory,
                             java.lang.String backupBaseFileName)
                      throws java.lang.Exception
Throws:
java.lang.Exception

removeSubscription

public void removeSubscription(java.lang.String smsAgentName,
                               java.lang.String publisher,
                               java.lang.String subscriber,
                               java.lang.String eventName)
                        throws java.lang.Exception
Throws:
java.lang.Exception

removeDetector

public void removeDetector(java.lang.String smsAgentName,
                           java.lang.String monAgent,
                           java.lang.String detector)
                    throws java.lang.Exception
Throws:
java.lang.Exception

addDetector

public void addDetector(java.lang.String smsAgentName,
                        java.lang.String monAgentName,
                        java.lang.String event,
                        java.lang.String handler)
                 throws java.lang.Exception
Throws:
java.lang.Exception

getEventNames

public java.util.Vector getEventNames(java.lang.String monAgentURN)

getSubscriptions

public java.util.Vector getSubscriptions(java.lang.String monAgentURN)

getAvailableDetectorsForAgents

public java.util.Vector getAvailableDetectorsForAgents(java.lang.String smsAgentName,
                                                       java.util.Vector monAgents)

getDetectorNames

public java.util.Vector getDetectorNames(java.lang.String monAgentURN)

getConfigurations

public java.util.Vector getConfigurations(java.lang.String smsAgentName)

getMonAgentsInSMSAgent

public java.util.Vector getMonAgentsInSMSAgent(java.lang.String smsAgentName)

getSMSAgentName

public java.lang.String getSMSAgentName(java.lang.String monAgentURN)

getConfigHandles

public java.util.Vector getConfigHandles(java.lang.String smsAgentName)

getConfigObject

public ConfigObject getConfigObject(java.lang.String configName,
                                    java.lang.String agentName)
                             throws java.lang.Exception
Throws:
java.lang.Exception

getConfigsFromAllSMSAgents

public java.util.Hashtable getConfigsFromAllSMSAgents()

addCustomDetector

public void addCustomDetector(java.lang.String detName)

addCustomEvent

public void addCustomEvent(java.lang.String eventName)