public class TLcdOGCServiceException
extends java.lang.Exception
This class can hold multiple TLcdOWSException
instances,
that each represent a subset or part of this service exception.
At least one TLcdOWSException
is required, initialized through one of the constructors.
Additional exceptions can be added through addException(com.luciad.ogc.ows.model.TLcdOWSException)
and addException(String, int, String)
. The list of exceptions can be retrieved through
getExceptions()
.
TLcdOWSException
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
AUTHENTICATION_REQUIRED
The user needs to be authenticated to access a resource.
|
static java.lang.String |
AUTHENTICATION_REQUIRED_STR
The user needs to be authenticated to access a resource.
|
static int |
CONFIG_ERROR |
static java.lang.String |
CONFIG_ERROR_STR |
static int |
INVALID_REQUEST |
static java.lang.String |
INVALID_REQUEST_STR |
static int |
NOT_AUTHORIZED
The user is not authorized to access a resource.
|
static java.lang.String |
NOT_AUTHORIZED_STR
The user is not authorized to access a resource.
|
static int |
REQUEST_XML_ERROR |
static java.lang.String |
REQUEST_XML_ERROR_STR |
static int |
UNKNOWN_REQUEST |
static java.lang.String |
UNKNOWN_REQUEST_STR |
Constructor and Description |
---|
TLcdOGCServiceException(int aCode)
Constructor with an error code.
|
TLcdOGCServiceException(java.lang.String aMessage,
int aCode)
Constructor with an error message and code.
|
TLcdOGCServiceException(java.lang.String aMessage,
int aCode,
java.lang.String aLocator)
Constructor with an error message, code and locator.
|
TLcdOGCServiceException(java.lang.String aMessage,
int aCode,
java.lang.String aLocator,
java.lang.String aServiceVersion,
java.lang.String aServiceName)
Constructor with an error message, code, locator and service information.
|
TLcdOGCServiceException(TLcdOWSException aException,
java.lang.String aServiceVersion,
java.lang.String aServiceName)
Constructor with an OWS exception.
|
Modifier and Type | Method and Description |
---|---|
void |
addException(java.lang.String aMessage,
int aCode,
java.lang.String aLocator)
Adds an exception with the given message, code and locator.
|
void |
addException(TLcdOWSException aException)
Adds the given OWS exception.
|
int |
getCode()
Returns the error code of the first exception.
|
java.lang.String |
getCodeAsAString(int aCode)
Returns a string describing the given error code.
|
java.util.List<TLcdOWSException> |
getExceptions()
Returns a list of exceptions.
|
java.lang.String |
getLocator()
Returns the locator of the first exception, if initialized.
|
java.lang.String |
getMessage()
Returns the error message of the first exception, if initialized.
|
java.lang.String |
getMimeType()
Returns the MIME type to be set when sending exception reports to a client.
|
java.lang.String |
getServiceName()
Returns the service name generated this exception.
|
java.lang.String |
getServiceVersion()
Returns the version of the service that generated this exception.
|
public static final int UNKNOWN_REQUEST
public static final int REQUEST_XML_ERROR
public static final int INVALID_REQUEST
public static final int CONFIG_ERROR
public static final int NOT_AUTHORIZED
public static final int AUTHENTICATION_REQUIRED
public static final java.lang.String UNKNOWN_REQUEST_STR
public static final java.lang.String REQUEST_XML_ERROR_STR
public static final java.lang.String INVALID_REQUEST_STR
public static final java.lang.String CONFIG_ERROR_STR
public static final java.lang.String NOT_AUTHORIZED_STR
public static final java.lang.String AUTHENTICATION_REQUIRED_STR
public TLcdOGCServiceException(int aCode)
TLcdOWSException
and added to the list of exceptions. This list can be retrieved through
getExceptions()
.aCode
- the exception's error code.public TLcdOGCServiceException(java.lang.String aMessage, int aCode)
TLcdOWSException
and added to the list of exceptions. This list can be retrieved through
getExceptions()
.aMessage
- the error messageaCode
- the exception's error code.public TLcdOGCServiceException(java.lang.String aMessage, int aCode, java.lang.String aLocator)
TLcdOWSException
and added to the list of exceptions. This list can be retrieved through
getExceptions()
.aMessage
- the error messageaCode
- the exception's error code.aLocator
- the location of the error in the client requestpublic TLcdOGCServiceException(java.lang.String aMessage, int aCode, java.lang.String aLocator, java.lang.String aServiceVersion, java.lang.String aServiceName)
TLcdOWSException
and added to the list of exceptions. This list can be retrieved through
getExceptions()
.aMessage
- the error messageaCode
- the exception's error code.aLocator
- the location of the error in the client requestaServiceVersion
- the version of the service that generated the exception.aServiceName
- the name of the service that generated the exception.public TLcdOGCServiceException(TLcdOWSException aException, java.lang.String aServiceVersion, java.lang.String aServiceName)
aException
- an OWS exception.aServiceVersion
- the version of the service that generated the exception.aServiceName
- the name of the service that generated the exception.public void addException(java.lang.String aMessage, int aCode, java.lang.String aLocator)
TLcdOWSException
,
and can be retrieved through getExceptions()
.aMessage
- the optional error message.aCode
- the mandatory exception's error code.aLocator
- the location of the error in the client request,
or null
if this information is not available.public void addException(TLcdOWSException aException)
aException
- the exception to be added.public java.util.List<TLcdOWSException> getExceptions()
public java.lang.String getMessage()
getMessage
in class java.lang.Throwable
null
otherwise.public int getCode()
public java.lang.String getLocator()
null
otherwise.public java.lang.String getServiceName()
null
if no service name is available.public java.lang.String getServiceVersion()
null
if no version information is available.public java.lang.String getCodeAsAString(int aCode)
aCode
- the exception's error codepublic java.lang.String getMimeType()