com.metamatrix.platform.admin.apiimpl
Class RuntimeStateAdminAPIImpl

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

@RolesAllowed(value="Admin.ReadOnlyAdmin")
public class RuntimeStateAdminAPIImpl
extends java.lang.Object
implements RuntimeStateAdminAPI


Method Summary
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.
 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 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 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 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static RuntimeStateAdminAPIImpl getInstance(ClusteredRegistryState registry,
                                                   HostManagement hostManagement)

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.

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.

stopService

@RolesAllowed(value="Admin.ProductAdmin")
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

@RolesAllowed(value="Admin.ProductAdmin")
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

@RolesAllowed(value="Admin.ProductAdmin")
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

@RolesAllowed(value="Admin.ProductAdmin")
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

@RolesAllowed(value="Admin.ProductAdmin")
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

@RolesAllowed(value="Admin.ProductAdmin")
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.

restartService

@RolesAllowed(value="Admin.ProductAdmin")
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

@RolesAllowed(value="Admin.ProductAdmin")
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

@RolesAllowed(value="Admin.ProductAdmin")
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.

synchronizeServer

@RolesAllowed(value="Admin.ProductAdmin")
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

@RolesAllowed(value="Admin.ProductAdmin")
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.

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)

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.