com.continuent.tungsten.common.cluster.resource.notification
Class ResourceStatus

java.lang.Object
  extended by com.continuent.tungsten.common.cluster.resource.notification.ResourceStatus
Direct Known Subclasses:
DataServerStatus, DataSourceStatus, HostStatus

public class ResourceStatus
extends java.lang.Object

Lists all states in which a resource can be found. This class instances are created by the checker class and then sent to the notifier for processing.
This class was based on tungsten sql router com.continuent.tungsten.router.manager.RouterState

Version:
1.0
Author:
Gilles Rayrat

Nested Class Summary
static class ResourceStatus.States
          Inner class enumerating the different possible RouterResource States
States are defined as strings so that they can be sent with native java functions by the notifier
static class ResourceStatus.Types
          Inner class enumerating the different possible RouterResource Types
Types are defined as strings so that they can be sent with native java functions by the notifier
 
Constructor Summary
ResourceStatus(java.lang.String type, java.lang.String name, java.lang.String state, TungstenProperties properties)
          Creates a new ResourceStatus object, giving all fields
 
Method Summary
 java.lang.String getClusterMemberName()
           
 java.lang.String getClusterName()
           
 java.lang.String getName()
          Retrieves the name of the resource
 TungstenProperties getProperties()
          Retrieves the resource-specific properties
 java.lang.String getState()
          Retrieves the state of the resource
 java.lang.String getType()
          Retrieves the type of the resource
 void setClusterMemberName(java.lang.String clusterMemberName)
           
 void setClusterName(java.lang.String clusterName)
           
protected  void setProperties(java.util.Map<java.lang.String,java.lang.String> additionalProps)
          Adds the given resource-specific properties to the current properties, possibly replacing current values
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceStatus

public ResourceStatus(java.lang.String type,
                      java.lang.String name,
                      java.lang.String state,
                      TungstenProperties properties)
Creates a new ResourceStatus object, giving all fields

Parameters:
type - Type of RouterResource
name - Possibly unique identifier for this resource
state - Last known state
properties - RouterResource-specific properties
Method Detail

getName

public java.lang.String getName()
Retrieves the name of the resource

Returns:
the resource name

getType

public java.lang.String getType()
Retrieves the type of the resource

Returns:
the resource type, on of ResourceStatus.Types

getState

public java.lang.String getState()
Retrieves the state of the resource

Returns:
the resource state, one of ResourceStatus.States

setProperties

protected void setProperties(java.util.Map<java.lang.String,java.lang.String> additionalProps)
Adds the given resource-specific properties to the current properties, possibly replacing current values

Parameters:
additionalProps - new properties to be added to the current ones

getProperties

public TungstenProperties getProperties()
Retrieves the resource-specific properties

Returns:
the resource properties containing resource specific information

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getClusterName

public java.lang.String getClusterName()

setClusterName

public void setClusterName(java.lang.String clusterName)

getClusterMemberName

public java.lang.String getClusterMemberName()

setClusterMemberName

public void setClusterMemberName(java.lang.String clusterMemberName)