com.dynatrace.diagnostics.pdk
Class Status

java.lang.Object
  extended by com.dynatrace.diagnostics.pdk.Status

public final class Status
extends java.lang.Object

A status that describes the result of the Plugin setup or execute method call.

The status contains:


Nested Class Summary
static class Status.StatusCode
          Standard Status Codes They contain: a status code the base status code a short message a message
 
Constructor Summary
Status()
          constructs a Status (per default successful)
Status(Status.StatusCode statusCode)
          create a new Status with the supplied status code. message and short message will be defaults depending on the used code.
Status(Status.StatusCode statusCode, java.lang.String shortMessage)
          create a new Status with the supplied status code and short message. extended message will have a default depending on the status code.
Status(Status.StatusCode statusCode, java.lang.String shortMessage, java.lang.String message)
          create a new Status with the supplied status code, short message and extended message
Status(Status.StatusCode statusCode, java.lang.String shortMessage, java.lang.String message, java.lang.Throwable throwable)
          create a new Status with the supplied status code, short message and extended message
 
Method Summary
 java.lang.String getExceptionClassName()
          Returns the Class Name of the last Exception
 java.lang.String getExceptionMessage()
          Returns the Message of the last Exception
 java.lang.String getMessage()
          Returns a longer Message explaining the current Status
 java.lang.String getShortMessage()
          Returns the short Message for this Status
 java.lang.String getStacktrace()
          Returns the Stack Trace of the last run
 Status.StatusCode getStatusCode()
          Returns the StatusCode of this run
static Status.StatusCode getStatusCode(int code)
          Returns the StatusCode enum for a specified code
 void setException(java.lang.Throwable throwable)
          Sets the Stack Trace, Exception Message and Exception Class If null is passed, those values will be set to null
 void setExceptionClassName(java.lang.String exceptionClassName)
          Sets the Class Name of the Exception that occurred during this run
 void setExceptionMessage(java.lang.String exceptionMessage)
          Sets the Exception Message for this run
 void setMessage(java.lang.String message)
          Sets the Message of the current Status
 void setShortMessage(java.lang.String shortMessage)
          Sets the short Message for this Status
 void setStacktrace(java.lang.String stacktrace)
          Sets the Stack Trace for this run
 void setStatusCode(Status.StatusCode statusCode)
          Sets the StatusCode
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Status

public Status()
constructs a Status (per default successful)


Status

public Status(Status.StatusCode statusCode)
create a new Status with the supplied status code. message and short message will be defaults depending on the used code.

Parameters:
statusCode - the code, must not be null

Status

public Status(Status.StatusCode statusCode,
              java.lang.String shortMessage)
create a new Status with the supplied status code and short message. extended message will have a default depending on the status code.

Parameters:
statusCode - the code, must not be null
shortMessage - may supply additional brief information for this status

Status

public Status(Status.StatusCode statusCode,
              java.lang.String shortMessage,
              java.lang.String message)
create a new Status with the supplied status code, short message and extended message

Parameters:
statusCode - the code, must not be null
shortMessage - may supply additional brief information for this status
message - an extended message for in depth information such as stack traces etc.

Status

public Status(Status.StatusCode statusCode,
              java.lang.String shortMessage,
              java.lang.String message,
              java.lang.Throwable throwable)
create a new Status with the supplied status code, short message and extended message

Parameters:
statusCode - the code, must not be null
shortMessage - may supply additional brief information for this status
message - an extended message for in depth information such as stack traces etc.
throwable - an optional throwable which may have been caught. may be null.
Method Detail

getStatusCode

public Status.StatusCode getStatusCode()
Returns the StatusCode of this run

Returns:
the StatusCode of this run

setStatusCode

public void setStatusCode(Status.StatusCode statusCode)
Sets the StatusCode

Parameters:
statusCode - the StatusCode to set

getShortMessage

public java.lang.String getShortMessage()
Returns the short Message for this Status

Returns:
the short Message for this Status

setShortMessage

public void setShortMessage(java.lang.String shortMessage)
Sets the short Message for this Status

Parameters:
shortMessage - the short Message to set

getMessage

public java.lang.String getMessage()
Returns a longer Message explaining the current Status

Returns:
a longer Message explaining the current Status

setMessage

public void setMessage(java.lang.String message)
Sets the Message of the current Status

Parameters:
message - the message to set

getStacktrace

public java.lang.String getStacktrace()
Returns the Stack Trace of the last run

Returns:
the Stack Trace of the last run

getExceptionMessage

public java.lang.String getExceptionMessage()
Returns the Message of the last Exception

Returns:
the Message of the last Exception

getExceptionClassName

public java.lang.String getExceptionClassName()
Returns the Class Name of the last Exception

Returns:
the Class Name of the last Exception

setStacktrace

public void setStacktrace(java.lang.String stacktrace)
Sets the Stack Trace for this run

Parameters:
stacktrace - the Stack Trace to set

setExceptionMessage

public void setExceptionMessage(java.lang.String exceptionMessage)
Sets the Exception Message for this run

Parameters:
exceptionMessage - the Exception Message to set

setExceptionClassName

public void setExceptionClassName(java.lang.String exceptionClassName)
Sets the Class Name of the Exception that occurred during this run

Parameters:
exceptionClassName - the Class Name to set

setException

public void setException(java.lang.Throwable throwable)
Sets the Stack Trace, Exception Message and Exception Class If null is passed, those values will be set to null

Parameters:
throwable - the Throwable that occurred during the last run

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getStatusCode

public static Status.StatusCode getStatusCode(int code)
Returns the StatusCode enum for a specified code

Parameters:
code - the integer value of this code
Returns:
the StatusCode enum for a specified code


Copyright © 2004-2012 dynaTrace software GmbH