org.opentox.toxotis.core.component
Class ErrorReport

java.lang.Object
  extended by org.opentox.toxotis.core.OTComponent<ErrorReport>
      extended by org.opentox.toxotis.core.component.ErrorReport
All Implemented Interfaces:
Serializable, IHTMLSupport, IOTComponent, IStAXWritable

public class ErrorReport
extends OTComponent<ErrorReport>
implements IHTMLSupport

Error Reports are part of the OpenTox API since version 1.1. Error Reports define a formal way to handle exceptional situations while invoking a service or during inter-service communication thus facilitating debugging. They are sufficiently documented online at http://opentox.org/dev/apis/api-1.1/Error Reports.

Author:
Pantelis Sopasakis, Charalampos Chomenides
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.opentox.toxotis.core.OTComponent
meta, RDF_ABOUT, RDF_RDF, RDF_RESOURCE, RDF_TYPE
 
Constructor Summary
ErrorReport()
           
ErrorReport(int httpStatus, String actor, String message, String details, String errorCode)
           
ErrorReport(VRI uri)
           
 
Method Summary
 com.hp.hpl.jena.ontology.Individual asIndividual(com.hp.hpl.jena.ontology.OntModel model)
          The OpenTox component as an individual.
 String getActor()
           
 String getDetails()
           
 ErrorReport getErrorCause()
           
 String getErrorCode()
           
 int getHttpStatus()
           
 String getMessage()
           
 VRI getUri()
          Get the URI of the resource (as an instance of VRI.
 HTMLContainer inHtml()
          Create an HTML container for the online resource.
 void setActor(String actor)
           
 void setDetails(String details)
           
 void setErrorCause(ErrorReport errorCause)
           
 void setErrorCode(String errorCode)
           
 void setHttpStatus(int errorCode)
           
 void setMessage(String message)
           
 String toString()
           
 void writeRdf(XMLStreamWriter writer)
          Due to the large size of some objects like datasets, it is advisable to use this method for serializing large objects to RDF/XML rather than the method OntModel#write(OutputStream).
 
Methods inherited from class org.opentox.toxotis.core.OTComponent
addOntologicalClasses, asOntModel, endRdfWriter, equals, getMeta, getOntologicalClasses, hashCode, initRdfWriter, isEnabled, setEnabled, setMeta, setOntologicalClasses, setUri, writeAnnotationProperty, writeClass, writeDatatypeProperty, writeMetaDataProperties, writeObjectProperty, writeRdf, writeRdf, writeSuperClassRelationships
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ErrorReport

public ErrorReport()

ErrorReport

public ErrorReport(VRI uri)

ErrorReport

public ErrorReport(int httpStatus,
                   String actor,
                   String message,
                   String details,
                   String errorCode)
Method Detail

getUri

public VRI getUri()
Description copied from class: OTComponent
Get the URI of the resource (as an instance of VRI. Anonymous resources, return null

Specified by:
getUri in interface IOTComponent
Overrides:
getUri in class OTComponent<ErrorReport>
Returns:
URI of the component or null if not any.

getActor

public String getActor()

setActor

public void setActor(String actor)

getDetails

public String getDetails()

setDetails

public void setDetails(String details)

getErrorCause

public ErrorReport getErrorCause()

setErrorCause

public void setErrorCause(ErrorReport errorCause)

getHttpStatus

public int getHttpStatus()

setHttpStatus

public void setHttpStatus(int errorCode)

getMessage

public String getMessage()

setMessage

public void setMessage(String message)

getErrorCode

public String getErrorCode()

setErrorCode

public void setErrorCode(String errorCode)

asIndividual

public com.hp.hpl.jena.ontology.Individual asIndividual(com.hp.hpl.jena.ontology.OntModel model)
Description copied from interface: IOTComponent
The OpenTox component as an individual.

Specified by:
asIndividual in interface IOTComponent
Parameters:
model - The ontological model to which the individual belongs.
Returns:
The OpenTox component as an individual of a data model.

toString

public String toString()
Overrides:
toString in class Object

writeRdf

public void writeRdf(XMLStreamWriter writer)
              throws XMLStreamException
Description copied from interface: IStAXWritable
Due to the large size of some objects like datasets, it is advisable to use this method for serializing large objects to RDF/XML rather than the method OntModel#write(OutputStream). In the case of Datasets, it has been shown that this method performs much faster (about 7,5 times faster on a dataset of 21 features and 1000 compounds).

Specified by:
writeRdf in interface IStAXWritable
Parameters:
writer - XML Stream Writer used for the serialization of the dataset object.
Throws:
XMLStreamException - In case the serialization is not possible due to syntax errors.

inHtml

public HTMLContainer inHtml()
Description copied from interface: IHTMLSupport
Create an HTML container for the online resource.

Specified by:
inHtml in interface IHTMLSupport
Returns:
HTMLContainer which can be used to create an HTML representation for the component.


Copyright © 2011-2012 OpenTox. All Rights Reserved.