hp.telephony.media
Class MediaResourceException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byhp.telephony.media.MediaException
              extended byhp.telephony.media.MediaResourceException
All Implemented Interfaces:
Serializable

public class MediaResourceException
extends MediaException

Thrown when a Resource method fails for various reasons. MediaResourceException contains an embedded ResourceEvent that explains the details of the problem.

A MediaResourceException generally corresponds to a Resource error or other error detected by the implementation that prevents the normal completion of a request.

See Also:
Serialized Form

Constructor Summary
MediaResourceException()
          Constructs a MediaResourceException with no specified detail message.
MediaResourceException(ResourceEvent ev)
          Construct a MediaResourceException with the specified ResourceEvent and no detail message.
MediaResourceException(String s)
          Constructs a MediaResourceException with the specified detail message.
MediaResourceException(String s, ResourceEvent ev)
          Construct a MediaResourceException with the specified detail message and ResourceEvent.
 
Method Summary
 ResourceEvent getResourceEvent()
          Extract the underlying ResourceEvent from this MediaResourceException.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MediaResourceException

public MediaResourceException()
Constructs a MediaResourceException with no specified detail message.


MediaResourceException

public MediaResourceException(String s)
Constructs a MediaResourceException with the specified detail message.

Parameters:
s - the detail message.

MediaResourceException

public MediaResourceException(ResourceEvent ev)
Construct a MediaResourceException with the specified ResourceEvent and no detail message. Wraps the given ResourceEvent in a MediaResourceException. This exception is thrown if the ResourceEvent indicates an error or other exceptional status.

Parameters:
ev - a ResourceEvent

MediaResourceException

public MediaResourceException(String s,
                              ResourceEvent ev)
Construct a MediaResourceException with the specified detail message and ResourceEvent. Wraps the given ResourceEvent in a MediaResourceException. This exception is thrown if the ResourceEvent indicates an error or other exceptional status.

Parameters:
s - the detail message
ev - a ResourceEvent
Method Detail

getResourceEvent

public ResourceEvent getResourceEvent()
Extract the underlying ResourceEvent from this MediaResourceException. The application can use ResourceEvent accessors like ResourceEvent.getError() or ResourceEvent.getQualifier() to get more information.

The returned ResourceEvent may have getQualifier() == null indicating an error.

Note: It is safe to use getResourceEvent().getError() because getResourceEvent() != null and if there is no error, then getError() == Error.OK.

Returns:
the encapsulated ResourceEvent