org.opentox.toxotis.core.component
Class User

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

public class User
extends OTOnlineResource<User>
implements IHTMLSupport

An individual User and its publicly available attributes.

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

Field Summary
static User GUEST
           
 
Fields inherited from class org.opentox.toxotis.core.OTOnlineResource
XSD_DATATYPE_LINKS
 
Fields inherited from class org.opentox.toxotis.core.OTComponent
meta, RDF_ABOUT, RDF_RDF, RDF_RESOURCE, RDF_TYPE
 
Constructor Summary
User()
           
 
Method Summary
 com.hp.hpl.jena.ontology.Individual asIndividual(com.hp.hpl.jena.ontology.OntModel model)
          The OpenTox component as an individual.
 String getHashedPass()
           
 String getMail()
          Retrieve the email of the user
 int getMaxBibTeX()
           
 int getMaxModels()
           
 int getMaxParallelTasks()
           
 String getName()
           
 String getUid()
           
 HTMLContainer inHtml()
          Create an HTML container for the online resource.
protected  User loadFromRemote(VRI vri, AuthenticationToken token)
          Loads an OpenTox component from a remote location identified by its uri and parses it into an instance of T.
 void setHashedPass(String hashedPass)
           
 User setMail(String mail)
          Checks whethe the provided e-mail address is RDF-2822 compliant and sets the e-mail address of the user accordingly.
 void setMaxBibTeX(int maxBibTeX)
           
 void setMaxModels(int maxModels)
           
 void setMaxParallelTasks(int maxParallelTasks)
           
 User setName(String name)
           
 User setUid(String uid)
           
 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.OTOnlineResource
download, download, download, download, downloadImage, loadFromRemote, loadFromRemote
 
Methods inherited from class org.opentox.toxotis.core.OTComponent
addOntologicalClasses, asOntModel, endRdfWriter, equals, getMeta, getOntologicalClasses, getUri, 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
 
Methods inherited from interface org.opentox.toxotis.core.IOTComponent
addOntologicalClasses, asOntModel, getMeta, getOntologicalClasses, getUri, isEnabled, setEnabled, setMeta, setOntologicalClasses
 

Field Detail

GUEST

public static final User GUEST
Constructor Detail

User

public User()
Method Detail

getMaxBibTeX

public int getMaxBibTeX()

setMaxBibTeX

public void setMaxBibTeX(int maxBibTeX)

getMaxModels

public int getMaxModels()

setMaxModels

public void setMaxModels(int maxModels)

getMaxParallelTasks

public int getMaxParallelTasks()

setMaxParallelTasks

public void setMaxParallelTasks(int maxParallelTasks)

getHashedPass

public String getHashedPass()

setHashedPass

public void setHashedPass(String hashedPass)

getMail

public String getMail()
Retrieve the email of the user

Returns:
User email

setMail

public User setMail(String mail)
             throws ToxOtisException
Checks whethe the provided e-mail address is RDF-2822 compliant and sets the e-mail address of the user accordingly.

Parameters:
mail - The e-mail address of the user (Must be RDF-2822 compliant).
Throws:
ToxOtisException - In case the provided e-mail address is not compliant to the specifications of RFC 2822.
See Also:
EmailValidator

getName

public String getName()

setName

public User setName(String name)

getUid

public String getUid()

setUid

public User setUid(String uid)

toString

public String toString()
Overrides:
toString in class Object

loadFromRemote

protected User loadFromRemote(VRI vri,
                              AuthenticationToken token)
                       throws ServiceInvocationException
Description copied from class: OTOnlineResource
Loads an OpenTox component from a remote location identified by its uri and parses it into an instance of T. This method is protected and should be implemented by all subclasses of OTOnlineResource. The method is invoked by its public counterpart OTOnlineResource.loadFromRemote(org.opentox.toxotis.util.aa.AuthenticationToken) which accesses the remote location providing an authentication token.

Specified by:
loadFromRemote in class OTOnlineResource<User>
Parameters:
vri - Identifier of the location from where the component should be downloaded and parsed
token - Token provided
Returns:
Parsed instance of the component.
Throws:
ServiceInvocationException

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.

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.