org.opentox.resource
Class AbstractResource

java.lang.Object
  extended by org.restlet.resource.UniformResource
      extended by org.restlet.resource.ServerResource
          extended by org.opentox.resource.AbstractResource
Direct Known Subclasses:
Algorithm, IndexResource, ListAlgorithms, ListModels, ListTasks, ModelInfoResource, ModelResource, ShutDownResource, TaskResource, TestResource

public abstract class AbstractResource
extends org.restlet.resource.ServerResource

Every Resource of the package extends this class.

Version:
1.3.3 (Last update: Dec 20, 2009)
Author:
OpenTox - http://www.opentox.org/, Sopasakis Pantelis, Sarimveis Harry

Nested Class Summary
static class AbstractResource.Directories
          Directories on the server.
static class AbstractResource.URIs
          URIs of the available services.
 
Field Summary
protected static java.lang.String htmlEND
          End of HTML files
protected  java.lang.String htmlHEAD
          Head of HTML files
static java.lang.String PMMLIntro
          Head of PMML files
private static long serialVersionUID
          version unique serial number.
static java.lang.String xmlIntro
          The first line of every XML file.
 
Constructor Summary
AbstractResource()
           
 
Method Summary
 java.util.Set<java.lang.String> AlgorithmsSet()
          Returns the set of all algorithms, that is classification, regression and feature selection.
private  java.util.Set<java.lang.String> ClassificationAlgorithmsSet()
           
 void doInit()
           
private  java.util.Set<java.lang.String> FeatureSelectionAlgorithmsSet()
           
protected abstract  org.restlet.representation.Representation get(org.restlet.representation.Variant variant)
           
protected  java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getAlgorithmIdsAsMap()
          Returns a Map<String, Set<String>> which maps a key to a set of algorithm ids.
private  java.util.Set<java.lang.String> RegressionAlgorithmsSet()
           
private  java.util.Set<java.lang.String> ValidationRoutinesSet()
          Returns the set of all validation routines such as "test_set_validation/svc" and "test_set_validation_mlr".
 
Methods inherited from class org.restlet.resource.ServerResource
delete, delete, describeVariants, doConditionalHandle, doGetInfo, doHandle, doHandle, doNegotiatedHandle, get, getInfo, getInfo, getPreferredVariant, getVariants, getVariants, handle, head, head, isAnnotated, isConditional, isExisting, isInRole, isNegotiated, options, options, post, post, put, put, redirectPermanent, redirectPermanent, redirectSeeOther, redirectSeeOther, redirectTemporary, redirectTemporary, setAllowedMethods, setAnnotated, setChallengeRequest, setChallengeRequests, setConditional, setCookieSettings, setDimensions, setExisting, setLocationRef, setLocationRef, setNegotiated, setServerInfo, setStatus, setStatus, setStatus, setStatus, setVariants, updateAllowedMethods, updateDimensions
 
Methods inherited from class org.restlet.resource.UniformResource
doRelease, getAllowedMethods, getApplication, getChallengeRequests, getChallengeResponse, getClientInfo, getConditions, getContext, getCookies, getCookieSettings, getDimensions, getHostRef, getLocationRef, getLogger, getMatrix, getMethod, getOriginalRef, getProtocol, getQuery, getRanges, getReference, getReferrerRef, getRequest, getRequestAttributes, getRequestEntity, getResponse, getResponseAttributes, getResponseEntity, getRootRef, getServerInfo, getStatus, init, isConfidential, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
version unique serial number.

See Also:
Constant Field Values

xmlIntro

public static final java.lang.String xmlIntro
The first line of every XML file.

See Also:
Constant Field Values

htmlHEAD

protected java.lang.String htmlHEAD
Head of HTML files


htmlEND

protected static final java.lang.String htmlEND
End of HTML files

See Also:
Constant Field Values

PMMLIntro

public static final java.lang.String PMMLIntro
Head of PMML files

See Also:
Constant Field Values
Constructor Detail

AbstractResource

public AbstractResource()
Method Detail

doInit

public void doInit()
            throws org.restlet.resource.ResourceException
Overrides:
doInit in class org.restlet.resource.UniformResource
Throws:
org.restlet.resource.ResourceException

get

protected abstract org.restlet.representation.Representation get(org.restlet.representation.Variant variant)
                                                          throws org.restlet.resource.ResourceException
Overrides:
get in class org.restlet.resource.ServerResource
Throws:
org.restlet.resource.ResourceException

getAlgorithmIdsAsMap

protected java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getAlgorithmIdsAsMap()
Returns a Map<String, Set<String>> which maps a key to a set of algorithm ids. For example if we want to retrieve the validation algorithms' ids as a Set, that would be:

Set<String> validationAlgorithmsIds = getAlgorithmIdsAsMap().get("validation");

Valid key values are classification, regression, featureselection and validation. For example you can get the set of classification algorithms using the following line:

Set<String> ClassificationIdsSet= getAlgorithmIdsAsMap().get("classification");

Returns:
All algorithms as a map.

RegressionAlgorithmsSet

private java.util.Set<java.lang.String> RegressionAlgorithmsSet()
Returns:
the set of regression algorithms

ClassificationAlgorithmsSet

private java.util.Set<java.lang.String> ClassificationAlgorithmsSet()
Returns:
The set of classification algorithms

FeatureSelectionAlgorithmsSet

private java.util.Set<java.lang.String> FeatureSelectionAlgorithmsSet()
Returns:
The set of all feature selection algorithms

AlgorithmsSet

public java.util.Set<java.lang.String> AlgorithmsSet()
Returns the set of all algorithms, that is classification, regression and feature selection. Every algorithm has a unique algorithm id.

Returns:
The set of all algorithms

ValidationRoutinesSet

private java.util.Set<java.lang.String> ValidationRoutinesSet()
Returns the set of all validation routines such as "test_set_validation/svc" and "test_set_validation_mlr".

Returns:
The set of validation routines