Class TaggerResource

java.lang.Object
org.restlet.resource.Resource
org.restlet.resource.ServerResource
org.opensextant.xlayer.server.TaggerResource
Direct Known Subclasses:
XlayerControl, XponentsGeotagger

public abstract class TaggerResource extends org.restlet.resource.ServerResource
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    protected static final HashSet<String>
     
    static final String
     
    static final String
     
    static final String
     
    protected Logger
    The log.
    protected String
     
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    operational parameter.
    void
    error(String msg, Exception err)
     
    protected List<String>
    fromArray(org.json.JSONArray a)
     
    protected org.opensextant.processing.Parameters
    fromRequest(org.json.JSONObject inputs)
     
    protected org.opensextant.processing.Parameters
    fromRequest(org.restlet.data.Form inputs)
    Get parameters for processing? None currently, but may be: - lower case tagging or filtering - coordinate parsing on|off Get parameters for formatting.
    abstract org.opensextant.extraction.Extractor
     
     
    void
    info(String msg)
     
    boolean
     
    protected void
    parseParameters(org.opensextant.processing.Parameters p, Set<String> kv)
     
    org.restlet.representation.Representation
    Ping.
    abstract org.restlet.representation.Representation
    process(org.opensextant.data.TextInput input, org.opensextant.processing.Parameters jobParams)
    Implement the processing of a single Input given some request parameters Based on the processing and the request, format response accordingly.
    protected void
    resetParameters(org.opensextant.processing.Parameters job)
    Convenience helper to reset data.
    protected org.restlet.ext.json.JsonRepresentation
    status(String status, String error)
     

    Methods inherited from class org.restlet.resource.ServerResource

    abort, commit, delete, delete, describeVariants, doCatch, doConditionalHandle, doError, doHandle, doHandle, doNegotiatedHandle, get, get, getAttribute, getDescription, getInfo, getInfo, getName, getOnSent, getPreferredVariant, getRole, getVariants, getVariants, handle, hasAnnotations, head, head, isAnnotated, isAutoCommitting, isCommitted, isConditional, isExisting, isInRole, isNegotiated, options, options, patch, patch, post, post, put, put, redirectPermanent, redirectPermanent, redirectSeeOther, redirectSeeOther, redirectTemporary, redirectTemporary, setAllowedMethods, setAnnotated, setAttribute, setAutoCommitting, setChallengeRequests, setCommitted, setConditional, setCookieSettings, setDescription, setDimensions, setExisting, setLocationRef, setLocationRef, setName, setNegotiated, setOnSent, setProxyChallengeRequests, setServerInfo, setStatus, setStatus, setStatus, setStatus, updateAllowedMethods, updateDimensions

    Methods inherited from class org.restlet.resource.Resource

    doError, doRelease, getAllowedMethods, getApplication, getChallengeRequests, getChallengeResponse, getClientInfo, getConditions, getConnegService, getContext, getConverterService, getCookies, getCookieSettings, getDimensions, getHostRef, getLocationRef, getLogger, getMatrix, getMatrixValue, getMaxForwards, getMetadataService, getMethod, getOriginalRef, getProtocol, getProxyChallengeRequests, getProxyChallengeResponse, getQuery, getQueryValue, getRanges, getReference, getReferrerRef, getRequest, getRequestAttributes, getRequestCacheDirectives, getRequestEntity, getResponse, getResponseAttributes, getResponseCacheDirectives, getResponseEntity, getRootRef, getServerInfo, getStatus, getStatusService, init, isConfidential, isLoggable, release, setApplication, setQueryValue, setRequest, setResponse, toBoolean, toByte, toDouble, toFloat, toInteger, toLong, toObject, toRepresentation, toRepresentation, toRepresentation, toShort, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • TaggerResource

      public TaggerResource()
  • Method Details

    • doInit

      public void doInit()
      operational parameter.
      Overrides:
      doInit in class org.restlet.resource.Resource
    • getProperty

      public String getProperty(String k)
    • ping

      public org.restlet.representation.Representation ping()
      Ping. trivial thing for now.
      Returns:
      status
    • getExtractor

      public abstract org.opensextant.extraction.Extractor getExtractor(String xid)
    • process

      public abstract org.restlet.representation.Representation process(org.opensextant.data.TextInput input, org.opensextant.processing.Parameters jobParams)
      Implement the processing of a single Input given some request parameters Based on the processing and the request, format response accordingly.
      Parameters:
      input - signal
      jobParams - controls
      Returns:
      JSON or other formatted response.
    • fromRequest

      protected org.opensextant.processing.Parameters fromRequest(org.restlet.data.Form inputs)
      Get parameters for processing? None currently, but may be: - lower case tagging or filtering - coordinate parsing on|off Get parameters for formatting. JSON, HTML, mainly. Output represents filters + format.
      Parameters:
      inputs - arguments to RESTful request
      Returns:
      Xponents Parameters
    • parseParameters

      protected void parseParameters(org.opensextant.processing.Parameters p, Set<String> kv)
    • resetParameters

      protected void resetParameters(org.opensextant.processing.Parameters job)
      Convenience helper to reset data.
      Parameters:
      job - job parameters
    • fromArray

      protected List<String> fromArray(org.json.JSONArray a)
      Parameters:
      a - JSONArray
      Returns:
    • fromRequest

      protected org.opensextant.processing.Parameters fromRequest(org.json.JSONObject inputs) throws org.json.JSONException
      Parameters:
      inputs - the inputs
      Returns:
      job parameters
      Throws:
      org.json.JSONException - on error.
    • status

      protected org.restlet.ext.json.JsonRepresentation status(String status, String error)
      Parameters:
      status - status
      error - error msg
      Returns:
      json formatted response
    • error

      public void error(String msg, Exception err)
    • info

      public void info(String msg)
    • debug

      public void debug(String msg)
    • isDebug

      public boolean isDebug()