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 classOslcError.ServerErrorDetailsContains 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 voidaddCause(OslcError cause)Adds a cause for this error.voidaddType(URI type)URIgetAbout()OslcError[]getCauses()Returns the causes of this error.StringgetDescription()Map<QName,Object>getExtendedProperties()StringgetIdentifier()OslcError.ServerErrorDetailsgetServerDetails()Returns a ServerErrorDetails instance, for a server to store additional properties.Collection<URI>getTypes()voidsetAbout(URI about)voidsetCauses(OslcError[] causes)Sets the causes of this error.voidsetDescription(String description)voidsetExtendedProperties(Map<QName,Object> properties)voidsetIdentifier(String identifier)voidsetTypes(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:
setExtendedPropertiesin interfaceIExtendedResource
-
getExtendedProperties
public Map<QName,Object> getExtendedProperties()
- Specified by:
getExtendedPropertiesin interfaceIExtendedResource
-
getTypes
public Collection<URI> getTypes()
- Specified by:
getTypesin interfaceIExtendedResource
-
setTypes
public void setTypes(Collection<URI> type)
- Specified by:
setTypesin interfaceIExtendedResource
-
addType
public void addType(URI type)
- Specified by:
addTypein 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") @OslcValueType(LocalResource) @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
-
-