com.bea.wli.monitoring
Class ServiceResourceStatistic

java.lang.Object
  extended by com.bea.wli.monitoring.ServiceResourceStatistic
All Implemented Interfaces:
Serializable

public final class ServiceResourceStatistic
extends Object
implements Serializable

This class contains statistical information for all resources of business or proxy service.

See Also:
Serialized Form

Constructor Summary
ServiceResourceStatistic(Ref serviceRef, Exception exception)
          Constructor
ServiceResourceStatistic(Ref serviceRef, Map<ResourceType,ResourceStatistic[]> resourceStatisticMap, String[] missingServers, long collectionTimestamp)
          Constructor
 
Method Summary
 ResourceStatistic[] getAllResourceStatistics()
          Gets statistics for all resources.
 long getCollectionTimestamp()
          Gets the time the statistics were collected from the cluster.
 String[] getMissingServers()
          Returns array of missing servers.
 ResourceStatistic[] getResourceStatisticsByType(ResourceType type)
          Gets statistics for all resources of specified type.
 Ref getServiceRef()
          Gets reference of service of which statistical information is available in this object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceResourceStatistic

public ServiceResourceStatistic(Ref serviceRef,
                                Map<ResourceType,ResourceStatistic[]> resourceStatisticMap,
                                String[] missingServers,
                                long collectionTimestamp)
                         throws IllegalArgumentException
Constructor

Parameters:
serviceRef -
resourceStatisticMap -
missingServers -
collectionTimestamp -
Throws:
IllegalArgumentException

ServiceResourceStatistic

public ServiceResourceStatistic(Ref serviceRef,
                                Exception exception)
                         throws IllegalArgumentException
Constructor

Parameters:
serviceRef -
exception -
Throws:
IllegalArgumentException
Method Detail

getServiceRef

public Ref getServiceRef()
Gets reference of service of which statistical information is available in this object.

Returns:
Service reference.

getCollectionTimestamp

public long getCollectionTimestamp()
                            throws IllegalStateException
Gets the time the statistics were collected from the cluster. Time (actual time from Admin Server) when this statistic was collected. This method should be called after making sure that statistics are retrieved successfully. In case of statistics retrieval failure, collection time data will have no meaning and in such case this method will throw IllegalStateException.

Returns:
Collection timestamp in mSec.
Throws:
IllegalStateException - If not collection timestamp is not set.

getAllResourceStatistics

public ResourceStatistic[] getAllResourceStatistics()
                                             throws InvalidServiceRefException,
                                                    MonitoringNotEnabledException,
                                                    MonitoringException
Gets statistics for all resources.

Returns:
Statistics for all resources of requested types. If statistics for one or more type of resources (that were specified in the operation which returned this object) are not present in the returned statistics, it means this service does not have any resources of those types.
Throws:
InvalidServiceRefException - If service reference is invalid or service is deleted.
MonitoringNotEnabledException - If statistics not found.
MonitoringException - If operation fails.

getResourceStatisticsByType

public ResourceStatistic[] getResourceStatisticsByType(ResourceType type)
                                                throws InvalidServiceRefException,
                                                       MonitoringNotEnabledException,
                                                       MonitoringException
Gets statistics for all resources of specified type.

Parameters:
type - Resource type.
Returns:
Statistics for all resources of specified type. Null will be returned in following two situations: 1. This service doen not have any resource of the specified type. 2. Statistics for specified type were not requested in the operation that returned this object.
Throws:
InvalidServiceRefException - If service reference is invalid or service is deleted.
MonitoringNotEnabledException - If statistics not found.
MonitoringException - If operation fails.

getMissingServers

public String[] getMissingServers()
                           throws IllegalStateException
Returns array of missing servers. This method should be called after making sure that statistics are retrieved successfully. In case of statistics retrieval failure, missing server data will have no meaning and in such case this method will throw IllegalStateException.

Returns:
Array of missing servers. Returns empty array if no server is missing and statistics retrieval was successful.
Throws:
IllegalStateException - If not collection timestamp is not set.