org.genepattern.webservice
Class UnavailableException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byorg.genepattern.webservice.WebServiceException
              extended byorg.genepattern.webservice.UnavailableException
All Implemented Interfaces:
java.io.Serializable

public class UnavailableException
extends WebServiceException

Defines an exception that a web service throws to indicate that it is permanently or temporarily unavailable.

When a web service is permanently unavailable, something is wrong with it, and it cannot handle requests until action is taken. For example, a web service might be configured incorrectly.

A web service is temporarily unavailable if it cannont handle requests momentarily due to some system-wide problem. For example, a database server might be down or insufficient memory to handle request.

Web services containers can safely handle both types of unavailable exceptions in the same way. Treating temporary unavailable exceptions makes the container more robust. The web services container can block RPC calls to a web service instead of rejecting them until the container restarts.

Version:
$Version$
See Also:
Serialized Form

Constructor Summary
UnavailableException(java.lang.String message)
          Constructs a new web service exeption with the specified message indicating that the web service is permanently unavailable.
UnavailableException(java.lang.String message, java.lang.Throwable rootCause)
          Constructs a new web service exeption with the specified message indicating that the web service is permanently unavailable along with the root cause exception.
UnavailableException(WebService webService, java.lang.String message)
          Constructs a new unavialable exeption with the specified message.
UnavailableException(WebService webService, java.lang.String message, int time)
          Constructs a new unavialable exeption for a web service with the specified message and the time in seconds it's unavialable.
UnavailableException(WebService webService, java.lang.String message, int time, java.lang.Throwable rootCause)
          Constructs a new unavialable exeption for a web service with the specified message and the time in seconds it's unavialable.
UnavailableException(WebService webService, java.lang.String message, java.lang.Throwable rootCause)
          Constructs a new unavialable exeption with the specified message.
 
Method Summary
 int getUnavailableTime()
          Returns the time in seconds that the web service is temporarily unavailable.
 WebService getWebService()
          Returns the web service that is unavailable.
 boolean isPermanent()
          Returns a boolean indicating whether this web service is permanently unavailable.
 
Methods inherited from class org.genepattern.webservice.WebServiceException
getRootCause, printStackTrace, toString
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnavailableException

public UnavailableException(java.lang.String message)
Constructs a new web service exeption with the specified message indicating that the web service is permanently unavailable.

Parameters:
message - a String specifying the text of the exception message

UnavailableException

public UnavailableException(java.lang.String message,
                            java.lang.Throwable rootCause)
Constructs a new web service exeption with the specified message indicating that the web service is permanently unavailable along with the root cause exception.

Parameters:
message - a String specifying the text of the exception message
rootCause - the Throwable exception that caused the problem, making this service exeption necessary.

UnavailableException

public UnavailableException(WebService webService,
                            java.lang.String message)
Constructs a new unavialable exeption with the specified message.

Parameters:
webService - a WebService that is unavailable
message - a String specifying the text of the exception message

UnavailableException

public UnavailableException(WebService webService,
                            java.lang.String message,
                            java.lang.Throwable rootCause)
Constructs a new unavialable exeption with the specified message.

Parameters:
webService - a WebService that is unavailable
message - a String specifying the text of the exception message
rootCause - the Throwable exception that caused the problem, making this service exeption necessary.

UnavailableException

public UnavailableException(WebService webService,
                            java.lang.String message,
                            int time)
Constructs a new unavialable exeption for a web service with the specified message and the time in seconds it's unavialable.

Parameters:
webService - a WebService that is unavailable
message - a String specifying the text of the exception message
time - a int specifying the time in seconds the web service is unavailable

UnavailableException

public UnavailableException(WebService webService,
                            java.lang.String message,
                            int time,
                            java.lang.Throwable rootCause)
Constructs a new unavialable exeption for a web service with the specified message and the time in seconds it's unavialable.

Parameters:
webService - a WebService that is unavailable
message - a String specifying the text of the exception message
time - a int specifying the time in seconds the web service is unavailable
rootCause - the Throwable exception that caused the problem, making this service exeption necessary.
Method Detail

isPermanent

public boolean isPermanent()
Returns a boolean indicating whether this web service is permanently unavailable. If it is then something is wrong with the web service and requires system administration.

Returns:
true if the web service is permanently unavailable; false if the web service is available or temporarily unavailable

getWebService

public WebService getWebService()
Returns the web service that is unavailable.

Returns:
the WebService object that is throwing the UnavailableException

getUnavailableTime

public int getUnavailableTime()
Returns the time in seconds that the web service is temporarily unavailable.

If this method returs a -1 this means that the web service is permanently unavailable. Otherwise, the time is returned that the web service will be unavailable.

Returns:
an integer that represents the time, in seconds, that the web service will be unavailable. A -1 will be returned if the service is permanently unavailable.


Hosted by docs.bugaco.com