info.sswap.http.rest
Class MakeRQG

java.lang.Object
  extended by info.sswap.http.rest.RESTBase
      extended by info.sswap.http.rest.MakeRQG

public class MakeRQG
extends RESTBase

RESTful interface for the call that creates an RQG.

Author:
Blazej Bulka

Field Summary
private static java.lang.String DESCRIPTION_RESOURCE
           
private static java.lang.String JSON_SCHEMA_RESOURCE
           
private static org.apache.log4j.Logger LOGGER
          The logger for the makeRDG task.
private static java.lang.String RESOURCE_URI_PREFIX
           
 
Constructor Summary
MakeRQG()
           
 
Method Summary
private  void copyTypes(Entity jsonIndividual, info.sswap.api.model.SSWAPIndividual entity)
           
private  info.sswap.api.model.RQG doMakeRQG(java.lang.String jsonData, java.util.Map<java.lang.String,java.lang.String> prefixOverride)
          Actual creation of the RQG.
private static java.net.URI encodeResourceURI(java.lang.String resourceURI)
           
protected  java.lang.String getDescriptionResource()
          Returns the name of the resource (in the classpath) that contains the human-readable description about this RESTful interface
protected  java.lang.String getJSONSchemaResource()
          Returns the name of the resource (in the classpath) that contains the JSON schema for the document acceptable by this resource
private  info.sswap.api.model.SSWAPGraph makeMapping(info.sswap.api.model.RQG rqg, java.util.Map<java.lang.String,Entity> individuals, Mapping mapping)
           
 javax.ws.rs.core.Response makeRQG(javax.servlet.http.HttpServletRequest request)
           
 javax.ws.rs.core.Response makeRQG(java.lang.String uploadedJson, java.util.Map<java.lang.String,java.lang.String> prefixOverride)
           
 
Methods inherited from class info.sswap.http.rest.RESTBase
checkForUndefinedNS, clearLastForwardInTesting, displayDescription, displayJSONSchema, extractPrefixOverride, forward, getLastForwardInTesting, needsForwarding, rebuildPrefixOverrideQueryString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

private static final org.apache.log4j.Logger LOGGER
The logger for the makeRDG task.


DESCRIPTION_RESOURCE

private static final java.lang.String DESCRIPTION_RESOURCE
See Also:
Constant Field Values

JSON_SCHEMA_RESOURCE

private static final java.lang.String JSON_SCHEMA_RESOURCE
See Also:
Constant Field Values

RESOURCE_URI_PREFIX

private static java.lang.String RESOURCE_URI_PREFIX
Constructor Detail

MakeRQG

public MakeRQG()
Method Detail

makeRQG

public javax.ws.rs.core.Response makeRQG(@Context
                                         javax.servlet.http.HttpServletRequest request)

makeRQG

public javax.ws.rs.core.Response makeRQG(java.lang.String uploadedJson,
                                         java.util.Map<java.lang.String,java.lang.String> prefixOverride)

encodeResourceURI

private static java.net.URI encodeResourceURI(java.lang.String resourceURI)
                                       throws java.net.URISyntaxException
Throws:
java.net.URISyntaxException

doMakeRQG

private info.sswap.api.model.RQG doMakeRQG(java.lang.String jsonData,
                                           java.util.Map<java.lang.String,java.lang.String> prefixOverride)
                                    throws java.lang.IllegalArgumentException
Actual creation of the RQG.

Parameters:
jsonData - input JSON content to convert
Throws:
java.lang.IllegalArgumentException - on parsing and other failures

makeMapping

private info.sswap.api.model.SSWAPGraph makeMapping(info.sswap.api.model.RQG rqg,
                                                    java.util.Map<java.lang.String,Entity> individuals,
                                                    Mapping mapping)

copyTypes

private void copyTypes(Entity jsonIndividual,
                       info.sswap.api.model.SSWAPIndividual entity)

getDescriptionResource

protected java.lang.String getDescriptionResource()
Description copied from class: RESTBase
Returns the name of the resource (in the classpath) that contains the human-readable description about this RESTful interface

Specified by:
getDescriptionResource in class RESTBase
Returns:
the name of the resource (in the class path) that is a plain text file with the description

getJSONSchemaResource

protected java.lang.String getJSONSchemaResource()
Description copied from class: RESTBase
Returns the name of the resource (in the classpath) that contains the JSON schema for the document acceptable by this resource

Specified by:
getJSONSchemaResource in class RESTBase
Returns:
the name of the resource (in the classpath) that is a JSON schema file


Copyright (c) 2010, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin.