Package com.sodius.oslc.core.model
Class OslcError
- java.lang.Object
-
- org.eclipse.lyo.oslc4j.core.model.Error
-
- com.sodius.oslc.core.model.OslcError
-
- All Implemented Interfaces:
IExtendedResource
,IResource
@OslcName("Error") @OslcNamespace("http://open-services.net/ns/core#") @OslcResourceShape(title="OSLC Error Resource Shape", describes="http://open-services.net/ns/core#Error") public class OslcError extends Error implements IExtendedResource
An OSLC Error that provides detailed information for the end user to report to its support. It includes:- A unique error identifier, for the end user to search for corresponding documentation and to report to its support.
- A message, that provides a summary of the error that occurred.
- A description, that provides more details on the error that occurred and possibly some steps for the user to resolve.
- Since:
- 1.13.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OslcError.ServerErrorDetails
Contains server side information for the associated Error resource, for computing an HTML description of the Error and before serializing it as a response entity.
-
Constructor Summary
Constructors Constructor Description OslcError()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCause(OslcError cause)
Adds a cause for this error.void
addType(URI type)
URI
getAbout()
OslcError[]
getCauses()
Returns the causes of this error.String
getDescription()
Map<QName,Object>
getExtendedProperties()
String
getIdentifier()
OslcError.ServerErrorDetails
getServerDetails()
Returns a ServerErrorDetails instance, for a server to store additional properties.Collection<URI>
getTypes()
void
setAbout(URI about)
void
setCauses(OslcError[] causes)
Sets the causes of this error.void
setDescription(String description)
void
setExtendedProperties(Map<QName,Object> properties)
void
setIdentifier(String identifier)
void
setTypes(Collection<URI> type)
-
Methods inherited from class org.eclipse.lyo.oslc4j.core.model.Error
getExtendedError, getMessage, getStatusCode, setExtendedError, setMessage, setStatusCode
-
-
-
-
Method Detail
-
setExtendedProperties
public void setExtendedProperties(Map<QName,Object> properties)
- Specified by:
setExtendedProperties
in interfaceIExtendedResource
-
getExtendedProperties
public Map<QName,Object> getExtendedProperties()
- Specified by:
getExtendedProperties
in interfaceIExtendedResource
-
getTypes
public Collection<URI> getTypes()
- Specified by:
getTypes
in interfaceIExtendedResource
-
setTypes
public void setTypes(Collection<URI> type)
- Specified by:
setTypes
in interfaceIExtendedResource
-
addType
public void addType(URI type)
- Specified by:
addType
in interfaceIExtendedResource
-
getIdentifier
@OslcDescription("A unique identifier for an error, that the end user can see and report to its support management.") @OslcOccurs(ExactlyOne) @OslcPropertyDefinition("http://purl.org/dc/terms/identifier") @OslcReadOnly @OslcTitle("Identifier") public String getIdentifier()
-
setIdentifier
public void setIdentifier(String identifier)
-
getDescription
@OslcDescription("Descriptive text about the error represented as rich text in XHTML content.") @OslcPropertyDefinition("http://purl.org/dc/terms/description") @OslcTitle("Description") @OslcValueType(XMLLiteral) public String getDescription()
-
setDescription
public void setDescription(String description)
-
getCauses
@OslcDescription("Errors that were the cause of this error.") @OslcOccurs(ZeroOrMany) @OslcName("cause") @OslcPropertyDefinition("http://open-services.net/ns/core#cause") @OslcReadOnly @OslcTitle("Cause") public OslcError[] getCauses()
Returns the causes of this error.It is expected to find at most one cause for this error, which is the OSLC error responded by the OSLC remote application, one the execution involved a communication with such remote application.
- Returns:
- the causes.
- Since:
- 1.14.0
-
addCause
public void addCause(OslcError cause)
Adds a cause for this error.- Parameters:
cause
- the cause to add.- Since:
- 1.14.0
-
setCauses
public void setCauses(OslcError[] causes)
Sets the causes of this error.- Parameters:
causes
- the new causes.- Since:
- 1.14.0
-
getServerDetails
public OslcError.ServerErrorDetails getServerDetails()
Returns a ServerErrorDetails instance, for a server to store additional properties. Those properties are used to compute an HTML description to set on the OSLC Error resource on server side. They are not serialized along the OSLC Error in a response, so not accessible from client side.- Returns:
- a ServerErrorDetails instance
-
-