com.ibm.able.platform
Class AbleEServerSituation

java.lang.Object
  |
  +--com.ibm.able.platform.AbleEServerSituation
All Implemented Interfaces:
java.io.Serializable

public class AbleEServerSituation
extends java.lang.Object
implements java.io.Serializable

The AbleEServerSituation class defines the situation of a capabilty of an AbleEServerAgent.

A capability of an agent defines a role or behavior that the agent will take on. An example might be a "DASD Monitor" capability. An AbleEServerSituation defines the situation that the capability it belongs to might encounter. An example of an AbleEServerSituation of a "DASD Monitor" AbleEServerCapability might be "DASD is too high". This situation would hold the severity and type of the situation, and also all of the possible answers that the agent might take for this situation.

The yesResponse is the response that will be taken if the automation level of the capability this situation belongs to is set to YES.

The noResponse is the response that will be taken if the automation level of the capabiltiy this situation belongs to is set ot NO.

If the autonomy level of the capability this situation belongs to is set to ASK, then the will create an AbleAgentSituationReport filled with all possible responses.

See Also:
Serialized Form

Field Summary
static com.ibm.able.AbleMessageContainer FAILURE_REQUEST
           
static int HIGH_SEVERITY
           
static com.ibm.able.AbleMessageContainer HIGH_SEVERITY_STRING
           
static com.ibm.able.AbleMessageContainer INFO_SITUATION
           
static int LOW_SEVERITY
          These three are the possible severity levels for a situation
static com.ibm.able.AbleMessageContainer LOW_SEVERITY_STRING
          Grab the NLS strings for the severity levels
static int MEDIUM_SEVERITY
           
static com.ibm.able.AbleMessageContainer MEDIUM_SEVERITY_STRING
           
static com.ibm.able.AbleMessageContainer PERMISSION_REQUEST
          These three are the possible types of requests for a situation
 
Constructor Summary
AbleEServerSituation(AbleEServerSituation theAbleEServerSituation)
          Creates an AbleEServerSituation based off another AbleEServerSituation.
AbleEServerSituation(java.io.Serializable theSituationIdentifier, com.ibm.able.AbleMessageContainer theSituationName, int theSeverityLevel, com.ibm.able.AbleMessageContainer theSituationType, com.ibm.able.AbleMessageContainer[] theResponses)
          Create an AbleEServerSituation
 
Method Summary
static java.lang.String Copyright()
          Gets the copyright of this class.
 java.lang.String debugString()
          Returns a translated representation of this AbleEServerSituation.
 boolean equals(java.lang.Object o)
          Compares this AbleEServerSituation with another to determine if the situations are equal.
 void formatResponse(int responseIndex, java.lang.Object[] subText)
          Format a response with the supplied substitution text.
 void formatSituationName(java.lang.Object[] subText)
          Format the situation name with the supplied substitution text.
 com.ibm.able.AbleMessageContainer getName()
          Method getName
 com.ibm.able.AbleMessageContainer getNoResponse()
          Method getNoResponse
 com.ibm.able.AbleMessageContainer getResponse(int responseIndex)
          Method getReponse
 com.ibm.able.AbleMessageContainer[] getResponses()
          Method getResponses
 int getSeverityLevel()
          Method getSeverityLevel
 com.ibm.able.AbleMessageContainer getSeverityLevelString()
          Method getSeverityLevelString
 java.io.Serializable getSituationIdentifier()
          Method getSituationIdentifier
 com.ibm.able.AbleMessageContainer getSituationType()
          Method getSituationType
 com.ibm.able.AbleMessageContainer getYesResponse()
          Method getYesResponse
 int hashCode()
          Return the hashCode for an AbleEServerSituation
 java.lang.String toString()
          Returns a brief description of this AbleEServerSituation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LOW_SEVERITY

public static final int LOW_SEVERITY
These three are the possible severity levels for a situation

MEDIUM_SEVERITY

public static final int MEDIUM_SEVERITY

HIGH_SEVERITY

public static final int HIGH_SEVERITY

LOW_SEVERITY_STRING

public static final com.ibm.able.AbleMessageContainer LOW_SEVERITY_STRING
Grab the NLS strings for the severity levels

MEDIUM_SEVERITY_STRING

public static final com.ibm.able.AbleMessageContainer MEDIUM_SEVERITY_STRING

HIGH_SEVERITY_STRING

public static final com.ibm.able.AbleMessageContainer HIGH_SEVERITY_STRING

PERMISSION_REQUEST

public static final com.ibm.able.AbleMessageContainer PERMISSION_REQUEST
These three are the possible types of requests for a situation

FAILURE_REQUEST

public static final com.ibm.able.AbleMessageContainer FAILURE_REQUEST

INFO_SITUATION

public static final com.ibm.able.AbleMessageContainer INFO_SITUATION
Constructor Detail

AbleEServerSituation

public AbleEServerSituation(java.io.Serializable theSituationIdentifier,
                            com.ibm.able.AbleMessageContainer theSituationName,
                            int theSeverityLevel,
                            com.ibm.able.AbleMessageContainer theSituationType,
                            com.ibm.able.AbleMessageContainer[] theResponses)
Create an AbleEServerSituation

An AbleEServerSituation is used to define a situation that an agent may get in. This situaiton will belong to a certain capabiltiy of the agent.

Everything but the yesResponse and noResponse will be set on the constructor. The yesResponse will default to the first response in theResponses and the noResponse with default to the last.

Parameters:
theSituationIdentifier - The identifier of this situation.

theSituationName - The name of this situation.

theSeverityLevel - The severity level of this situation.

theSituationType - The type of this situation.

theResponses - All of the responses for this situation.

AbleEServerSituation

public AbleEServerSituation(AbleEServerSituation theAbleEServerSituation)
Creates an AbleEServerSituation based off another AbleEServerSituation.

An AbleEServerSituation is used to define a situation that an agent may get in. This situaiton will belong to a certain capabiltiy of the agent. This constructor should be used as a copy constructor.

Parameters:
theAbleEServerSituation - The AbleEServerSituation to create a new AbleEServerSituation based off of.
Method Detail

formatSituationName

public void formatSituationName(java.lang.Object[] subText)
Format the situation name with the supplied substitution text.

Parameters:
subText - The substitution text to format the situation name.

formatResponse

public void formatResponse(int responseIndex,
                           java.lang.Object[] subText)
Format a response with the supplied substitution text.

Parameters:
responseIndex - The index of the response string that is to be formatted.

subText - The substitution text to format the response at responseIndex.

getSituationIdentifier

public java.io.Serializable getSituationIdentifier()
Method getSituationIdentifier

Returns:
The identifier of this Situation

getResponses

public com.ibm.able.AbleMessageContainer[] getResponses()
Method getResponses

Returns:
The String[] of all responses.

getResponse

public com.ibm.able.AbleMessageContainer getResponse(int responseIndex)
Method getReponse

Parameters:
responseIndex - The index of the response that is to be returned.

Returns:
The response for responseIndex.

getName

public com.ibm.able.AbleMessageContainer getName()
Method getName

Returns:
The name of this situation

getSeverityLevel

public int getSeverityLevel()
Method getSeverityLevel

Returns:
The severity level

getSeverityLevelString

public com.ibm.able.AbleMessageContainer getSeverityLevelString()
Method getSeverityLevelString

Returns:
A string representation of the current severity level

getSituationType

public com.ibm.able.AbleMessageContainer getSituationType()
Method getSituationType

Returns:
The situation type.

getNoResponse

public com.ibm.able.AbleMessageContainer getNoResponse()
Method getNoResponse

Returns:
The response used for the NO response.

getYesResponse

public com.ibm.able.AbleMessageContainer getYesResponse()
Method getYesResponse

Returns:
The response used for the YES response.

debugString

public java.lang.String debugString()
Returns a translated representation of this AbleEServerSituation.

Returns:
The translated representation of this AbleEServerSituation

Copyright

public static java.lang.String Copyright()
Gets the copyright of this class.

Returns:
A string containing this class's copyright statement.

equals

public boolean equals(java.lang.Object o)
Compares this AbleEServerSituation with another to determine if the situations are equal.

AbleEServerSituation are equal if their internal, private, immutable handles are equal.

Overrides:
equals in class java.lang.Object
Parameters:
o - An instance of an AbleEServerSituation that is to be compared to this AbleEServerSituation.

Returns:
true, if this AbleEServerSituation is equal to the specified AbleEServerSituation; false, otherwise.

AbleEServerSituations are equal if their internal, private, immutable handles are equal.


hashCode

public int hashCode()
Return the hashCode for an AbleEServerSituation

The hashCode of an AbleEServerSituation is the sum of the hashCodes of all of the the internal, private, immutable handles of this Object.

Overrides:
hashCode in class java.lang.Object
Returns:
The sum of the hashCodes of all of the internal, private, immutable data members are equal.

toString

public java.lang.String toString()
Returns a brief description of this AbleEServerSituation.

Overrides:
toString in class java.lang.Object
Returns:
A breif description of this AbleEServerSituation.