com.metamatrix.platform.admin.apiimpl
Class RuntimeStateAdminAPIImpl

java.lang.Object
  extended by com.metamatrix.platform.admin.apiimpl.SubSystemAdminAPIImpl
      extended by com.metamatrix.platform.admin.apiimpl.RuntimeStateAdminAPIImpl
All Implemented Interfaces:
RuntimeStateAdminAPI, SubSystemAdminAPI, java.io.Serializable

public class RuntimeStateAdminAPIImpl
extends SubSystemAdminAPIImpl
implements RuntimeStateAdminAPI

See Also:
Serialized Form

Field Summary
protected  java.util.Set listeners
           
 
Method Summary
 void bounceServer()
          Shutdown server and restart.
 java.util.List<java.lang.String> getHosts()
          Return all hosts running in mm system.
static RuntimeStateAdminAPIImpl getInstance(ClusteredRegistryState registry, HostManagement hostManagement)
           
 java.util.List getLogEntries(java.util.Date startTime, java.util.Date endTime, java.util.List levels, java.util.List contexts, int maxRows)
          Get the log entries that match the specified criteria.
 ProcessStatistics getProcessStatistics(java.lang.String hostName, java.lang.String processName)
          Return VMStatistics object for Process.
 PscID getPscIDByName(java.lang.String hostName, java.lang.String processName, java.lang.String pscName)
          Return the PscID by Name
 java.util.Date getServerStartTime()
          Returns a Date object representing the time the server was started.
 ServiceID getServiceIDByName(java.lang.String hostName, java.lang.String processName, java.lang.String serviceName)
          Return the ServiceID by Name
 java.util.Collection getServiceQueueStatistics(ServiceID serviceID)
          Return Collection of QueueStats for service.
 WorkerPoolStats getServiceQueueStatistics(ServiceID serviceID, java.lang.String queueName)
          Return QueueStats object for queue.
 java.util.List<ServiceRegistryBinding> getServices()
          Return serviceID's for all services running in mm system.
 SystemState getSystemState()
          Return the running state of the system.
 java.util.List<ProcessRegistryBinding> getVMControllerBindings()
          Returns a list that contains all of the VMControllerBindings for all the VMControllers running in the MetaMatrix system.
 boolean isSystemStarted()
          Return TRUE if the system is started; i.e.
 void restartService(ServiceID serviceID)
          Restart a failed or stopped service.
 void setLoggingConfiguration(Configuration config, LogConfiguration logConfig, java.util.List actions)
          Sets the LogConfiguration on the given Configuration.
 void setLoggingConfiguration(LogConfiguration logConfig, java.lang.String hostName, java.lang.String processName)
          Sets the LogConfiguration on the LogManager running in the given VM.
 void shutdownServer()
          Gracefully shutdown server waiting for work to complete.
 void startHost(java.lang.String host)
          Start Host and all processes/services for host.
 void startProcess(java.lang.String host, java.lang.String process)
          Start Process and all services for process.
 void startPSC(PscID pscID)
          Start up all services in psc.
 void stopHost(java.lang.String host)
          Stop host processes/services once work is complete.
 void stopHostNow(java.lang.String host)
          Stop host processes/services now.
 void stopProcess(java.lang.String hostName, java.lang.String processName, boolean now)
          Stop process once work is complete.
 void stopPSC(PscID pscID)
          Stop up all services in psc, waiting for work to complete.
 void stopPSCNow(PscID pscID)
          Stop up all services in psc now.
 void stopService(ServiceID serviceID)
          Stop service once work is complete.
 void stopServiceNow(ServiceID serviceID)
          Stop service now.
 void synchronizeServer()
          Synchronize running services with runtime configuration.
 
Methods inherited from class com.metamatrix.platform.admin.apiimpl.SubSystemAdminAPIImpl
getSessionID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

protected java.util.Set listeners
Method Detail

getInstance

public static RuntimeStateAdminAPIImpl getInstance(ClusteredRegistryState registry,
                                                   HostManagement hostManagement)
                                            throws MetaMatrixComponentException
Throws:
MetaMatrixComponentException

isSystemStarted

public boolean isSystemStarted()
                        throws AuthorizationException,
                               InvalidSessionException,
                               MetaMatrixComponentException
Return TRUE if the system is started; i.e. at leat one of every essential services in a product is running. Authorization, Configuration, Membership and Session services are considered to be essential.

Specified by:
isSystemStarted in interface RuntimeStateAdminAPI
Returns:
Boolean - TRUE if system is started, FALSE if not.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.

getServices

public java.util.List<ServiceRegistryBinding> getServices()
                                                   throws AuthorizationException,
                                                          InvalidSessionException,
                                                          MetaMatrixComponentException
Return serviceID's for all services running in mm system.

Specified by:
getServices in interface RuntimeStateAdminAPI
Returns:
List of ServiceIDs.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.

getHosts

public java.util.List<java.lang.String> getHosts()
                                          throws AuthorizationException,
                                                 InvalidSessionException,
                                                 MetaMatrixComponentException
Return all hosts running in mm system.

Specified by:
getHosts in interface RuntimeStateAdminAPI
Returns:
List of HostRegistryBindings.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.

stopService

public void stopService(ServiceID serviceID)
                 throws AuthorizationException,
                        InvalidSessionException,
                        MetaMatrixComponentException
Stop service once work is complete.

Specified by:
stopService in interface RuntimeStateAdminAPI
Parameters:
serviceID - ID of service instance.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.

stopServiceNow

public void stopServiceNow(ServiceID serviceID)
                    throws AuthorizationException,
                           InvalidSessionException,
                           MetaMatrixComponentException
Stop service now.

Specified by:
stopServiceNow in interface RuntimeStateAdminAPI
Parameters:
serviceID - ID of service instance.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.

stopHost

public void stopHost(java.lang.String host)
              throws AuthorizationException,
                     InvalidSessionException,
                     MetaMatrixComponentException,
                     MultipleException
Stop host processes/services once work is complete.

Specified by:
stopHost in interface RuntimeStateAdminAPI
Parameters:
host - Name of host.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.
MultipleException

stopHostNow

public void stopHostNow(java.lang.String host)
                 throws AuthorizationException,
                        InvalidSessionException,
                        MetaMatrixComponentException,
                        MultipleException
Stop host processes/services now.

Specified by:
stopHostNow in interface RuntimeStateAdminAPI
Parameters:
host - Name of host.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.
MultipleException

stopProcess

public void stopProcess(java.lang.String hostName,
                        java.lang.String processName,
                        boolean now)
                 throws AuthorizationException,
                        InvalidSessionException,
                        MetaMatrixComponentException
Stop process once work is complete.

Specified by:
stopProcess in interface RuntimeStateAdminAPI
Parameters:
processID - VMControllerID.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.

shutdownServer

public void shutdownServer()
                    throws AuthorizationException,
                           InvalidSessionException,
                           MetaMatrixComponentException
Gracefully shutdown server waiting for work to complete.

Specified by:
shutdownServer in interface RuntimeStateAdminAPI
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.

bounceServer

public void bounceServer()
                  throws AuthorizationException,
                         InvalidSessionException,
                         MetaMatrixComponentException
Shutdown server and restart.

Specified by:
bounceServer in interface RuntimeStateAdminAPI
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.

restartService

public void restartService(ServiceID serviceID)
                    throws AuthorizationException,
                           InvalidSessionException,
                           MetaMatrixComponentException
Restart a failed or stopped service.

Specified by:
restartService in interface RuntimeStateAdminAPI
Parameters:
serviceID - ID of service instance.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.

startHost

public void startHost(java.lang.String host)
               throws AuthorizationException,
                      InvalidSessionException,
                      MetaMatrixComponentException
Start Host and all processes/services for host.

Specified by:
startHost in interface RuntimeStateAdminAPI
Parameters:
host - Name of host to start.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.

startProcess

public void startProcess(java.lang.String host,
                         java.lang.String process)
                  throws AuthorizationException,
                         InvalidSessionException,
                         MetaMatrixComponentException
Start Process and all services for process.

Specified by:
startProcess in interface RuntimeStateAdminAPI
Parameters:
host - Host processes belongs to.
process - Name of process to start.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.

startPSC

public void startPSC(PscID pscID)
              throws AuthorizationException,
                     InvalidSessionException,
                     MetaMatrixComponentException,
                     MultipleException
Start up all services in psc.

Specified by:
startPSC in interface RuntimeStateAdminAPI
Parameters:
pscID - PSC to start.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.
MultipleException

stopPSCNow

public void stopPSCNow(PscID pscID)
                throws AuthorizationException,
                       InvalidSessionException,
                       MetaMatrixComponentException,
                       MultipleException
Description copied from interface: RuntimeStateAdminAPI
Stop up all services in psc now.

Specified by:
stopPSCNow in interface RuntimeStateAdminAPI
Parameters:
pscID - PSC to stop.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.
MultipleException
Since:
4.3
See Also:
RuntimeStateAdminAPI.stopPSC(com.metamatrix.platform.admin.api.runtime.PscID)

stopPSC

public void stopPSC(PscID pscID)
             throws AuthorizationException,
                    InvalidSessionException,
                    MetaMatrixComponentException,
                    MultipleException
Description copied from interface: RuntimeStateAdminAPI
Stop up all services in psc, waiting for work to complete.

Specified by:
stopPSC in interface RuntimeStateAdminAPI
Parameters:
pscID - PSC to stop.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.
MultipleException
Since:
4.3
See Also:
RuntimeStateAdminAPI.stopPSCNow(com.metamatrix.platform.admin.api.runtime.PscID)

synchronizeServer

public void synchronizeServer()
                       throws AuthorizationException,
                              InvalidSessionException,
                              MetaMatrixComponentException,
                              MultipleException
Synchronize running services with runtime configuration. Any running hosts/processes/services that are running but not in the configuration are killed Any deployed hosts/processes/services that are not running but are deployed are started Any deployed services that are running are set to the open state.

Specified by:
synchronizeServer in interface RuntimeStateAdminAPI
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.
a - MultipleException if an error occurs
MultipleException

getServerStartTime

public java.util.Date getServerStartTime()
                                  throws AuthorizationException,
                                         InvalidSessionException,
                                         MetaMatrixComponentException
Returns a Date object representing the time the server was started. If the server is not started a null is returned.

Specified by:
getServerStartTime in interface RuntimeStateAdminAPI
Returns:
Date
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.

setLoggingConfiguration

public void setLoggingConfiguration(Configuration config,
                                    LogConfiguration logConfig,
                                    java.util.List actions)
                             throws AuthorizationException,
                                    InvalidSessionException,
                                    MetaMatrixComponentException
Sets the LogConfiguration on the given Configuration. If the configuration is operational, then the log configuration is set on the Logmanager running in each VM.

Specified by:
setLoggingConfiguration in interface RuntimeStateAdminAPI
Parameters:
config - The configuration for which to set the log configuration.
logConfig - The log configuration with which to affect the log properties.
actions - The Actions from the ConfigurationObjectEditor used to affect the configuration database.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.

setLoggingConfiguration

public void setLoggingConfiguration(LogConfiguration logConfig,
                                    java.lang.String hostName,
                                    java.lang.String processName)
                             throws AuthorizationException,
                                    InvalidSessionException,
                                    MetaMatrixComponentException
Sets the LogConfiguration on the LogManager running in the given VM. If null>/code> is passed in for vmID, set log config on the App Server VM - the MetaMatrix registry does not have a handle for that VM.

Specified by:
setLoggingConfiguration in interface RuntimeStateAdminAPI
Parameters:
logConfig - The log configuration with which to affect the log properties.
vmID - The ID of the VM for which to set log configuration used to affect the configuration database. If null, set the App Server VM's log config.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.

getServiceQueueStatistics

public java.util.Collection getServiceQueueStatistics(ServiceID serviceID)
                                               throws AuthorizationException,
                                                      InvalidSessionException,
                                                      MetaMatrixComponentException
Return Collection of QueueStats for service.

Specified by:
getServiceQueueStatistics in interface RuntimeStateAdminAPI
Parameters:
serviceID - ID of the service.
Returns:
Collection of QueueStats objects.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.

getServiceQueueStatistics

public WorkerPoolStats getServiceQueueStatistics(ServiceID serviceID,
                                                 java.lang.String queueName)
                                          throws AuthorizationException,
                                                 InvalidSessionException,
                                                 MetaMatrixComponentException
Return QueueStats object for queue.

Specified by:
getServiceQueueStatistics in interface RuntimeStateAdminAPI
Parameters:
serviceID - ID of the service.
queueName - Name of queue.
Returns:
QueueStats object.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.

getProcessStatistics

public ProcessStatistics getProcessStatistics(java.lang.String hostName,
                                              java.lang.String processName)
                                       throws AuthorizationException,
                                              InvalidSessionException,
                                              MetaMatrixComponentException
Return VMStatistics object for Process.

Specified by:
getProcessStatistics in interface RuntimeStateAdminAPI
Parameters:
VMControllerID - ID of the process.
Returns:
VMStatistics.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.

getServiceIDByName

public ServiceID getServiceIDByName(java.lang.String hostName,
                                    java.lang.String processName,
                                    java.lang.String serviceName)
                             throws AuthorizationException,
                                    InvalidSessionException,
                                    MetaMatrixComponentException
Description copied from interface: RuntimeStateAdminAPI
Return the ServiceID by Name

Specified by:
getServiceIDByName in interface RuntimeStateAdminAPI
Parameters:
hostName - name of the host to that the service is configured
processName - process name of the service is configured
serviceName - name of the service to be retrieved
Returns:
ServiceID
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.
Since:
4.2.1
See Also:
com.metamatrix.platform.admin.apiimpl.RuntimeStateAdminAPI#getServiceIDByName(java.lang.String, java.lang.String, java.lang.String)

getPscIDByName

public PscID getPscIDByName(java.lang.String hostName,
                            java.lang.String processName,
                            java.lang.String pscName)
                     throws ResourceNotBoundException,
                            AuthorizationException,
                            InvalidSessionException,
                            MetaMatrixComponentException
Description copied from interface: RuntimeStateAdminAPI
Return the PscID by Name

Specified by:
getPscIDByName in interface RuntimeStateAdminAPI
Parameters:
hostName - name of the host process for the PSC
processName - name of the process for the PSC
pscName - name of the PSC
Returns:
Throws:
AuthorizationException
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException
ResourceNotBoundException
Since:
4.2.1
See Also:
com.metamatrix.platform.admin.apiimpl.RuntimeStateAdminAPI#getPscIDByName( java.lang.String, java.lang.String, java.lang.String)

getVMControllerBindings

public java.util.List<ProcessRegistryBinding> getVMControllerBindings()
                                                               throws InvalidSessionException,
                                                                      AuthorizationException,
                                                                      MetaMatrixComponentException
Description copied from interface: RuntimeStateAdminAPI
Returns a list that contains all of the VMControllerBindings for all the VMControllers running in the MetaMatrix system.

Specified by:
getVMControllerBindings in interface RuntimeStateAdminAPI
Returns:
List of VMControllerBindings
Throws:
InvalidSessionException - if the callerSessionID is not valid or is expired.
AuthorizationException
MetaMatrixComponentException
Since:
4.2.1
See Also:
com.metamatrix.platform.admin.apiimpl.RuntimeStateAdminAPI#getVMControllerBindings()

getLogEntries

public java.util.List getLogEntries(java.util.Date startTime,
                                    java.util.Date endTime,
                                    java.util.List levels,
                                    java.util.List contexts,
                                    int maxRows)
                             throws AuthorizationException,
                                    InvalidSessionException,
                                    MetaMatrixComponentException
Description copied from interface: RuntimeStateAdminAPI
Get the log entries that match the specified criteria.

Specified by:
getLogEntries in interface RuntimeStateAdminAPI
endTime - If null, will ignore this criterion.
levels - List of Integers
Returns:
List of LogEntry objects
Throws:
AuthorizationException
InvalidSessionException
MetaMatrixComponentException
Since:
4.3
See Also:
RuntimeStateAdminAPI.getLogEntries(java.util.Date, java.util.Date, java.util.List, java.util.List, int)

getSystemState

public SystemState getSystemState()
                           throws AuthorizationException,
                                  InvalidSessionException,
                                  MetaMatrixComponentException
Description copied from interface: RuntimeStateAdminAPI
Return the running state of the system.

Specified by:
getSystemState in interface RuntimeStateAdminAPI
Returns:
SysteState object that represents the system.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.


Copyright © 2009. All Rights Reserved.