public class PolyglotRESTEasy extends Object implements PolyglotRESTEasyInterface
Modifier and Type | Field and Description |
---|---|
protected static org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer |
tjws |
Constructor and Description |
---|
PolyglotRESTEasy()
Class constructor.
|
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
Alive()
Used to verify if the server is responding
|
javax.ws.rs.core.Response |
appIcons(String fileName)
Returns the requested icon file if available.
|
javax.ws.rs.core.Response |
Convert(javax.ws.rs.core.UriInfo uriInfo,
String accept)
Used to list all the output formats produced by the polyglot server
|
javax.ws.rs.core.Response |
ConvertFile(javax.ws.rs.core.UriInfo uriInfo,
String accept,
javax.servlet.http.HttpServletRequest req,
String outFmt,
String file)
Used to post a conversion request to the softwareserver
|
javax.ws.rs.core.Response |
ConvertFmt(String outFmt)
Used to obtain a list the input formats associated with the output format
|
javax.ws.rs.core.Response |
Endpoints(javax.ws.rs.core.UriInfo uriInfo,
String accept)
Used to list the of endpoints in the polyglot server
|
javax.ws.rs.core.Response |
File(javax.ws.rs.core.UriInfo uri,
String fileName)
Used to download a file form polyglot server
|
javax.ws.rs.core.Response |
Form(javax.ws.rs.core.UriInfo uriInfo,
String accept)
Used to obtain a list of actions that can be performed (get, post)
|
javax.ws.rs.core.Response |
formPost(org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input,
String mediaType,
String accept,
javax.ws.rs.core.UriInfo uri,
javax.servlet.http.HttpServletRequest req,
String output)
Process a file submitted via the web form and return a link to the produced file
|
javax.ws.rs.core.Response |
Forms(javax.ws.rs.core.UriInfo uri,
String output,
String file,
String action)
Return a web form to interact with the Software Server
|
String |
getForm(boolean POST_UPLOADS,
String selected_output)
Get a web form interface for this restful service.
|
javax.ws.rs.core.Response |
Inputs(javax.ws.rs.core.UriInfo uriInfo,
String accept)
Used to list all the input formats the polyglot server is able to serve
|
javax.ws.rs.core.Response |
InputsOut(javax.ws.rs.core.UriInfo uriInfo,
String accept,
String out)
Used to list all the input formats that can be converted to output format
|
static void |
main(String[] args)
Start the Polyglot REST interface.
|
javax.ws.rs.core.Response |
Outputs()
Used to list all the file formats the polyglot server is able to produce
|
javax.ws.rs.core.Response |
printErrorMessage(String msg)
Returns an error message
|
javax.ws.rs.core.Response |
processPost(org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input,
String mediaType,
String accept,
javax.ws.rs.core.UriInfo uri,
javax.servlet.http.HttpServletRequest req,
String output,
boolean formPost)
This is an auxiliary method working for the formPost() and the taskPost() methods.
|
javax.ws.rs.core.Response |
Requests()
Used to obtain of a list of the processed task since startup
|
javax.ws.rs.core.Response |
Servers()
Used to list the software servers connected to polyglot server
|
javax.ws.rs.core.Response |
Software()
Used to list the applications available in polyglot server
|
static void |
stop()
Stop the REST interface.
|
javax.ws.rs.core.Response |
taskPost(org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input,
String mediaType,
String accept,
javax.ws.rs.core.UriInfo uri,
javax.servlet.http.HttpServletRequest req,
String output)
Process a file submitted to Polyglot and return a link to the produced file
|
static String |
toString(Collection<String> strings)
Convert a Collection of strings to a line separated list of strings.
|
static void |
updateMongo()
Push logged information to mongo.
|
static void |
updateMongo(PolyglotAuxiliary.RequestInformation request)
Push request information to mongo.
|
protected static org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer tjws
public javax.ws.rs.core.Response Endpoints(javax.ws.rs.core.UriInfo uriInfo, String accept)
Endpoints
in interface PolyglotRESTEasyInterface
uriInfo
- Basic URL informationaccept
- content type accepted by clientpublic javax.ws.rs.core.Response Convert(javax.ws.rs.core.UriInfo uriInfo, String accept)
Convert
in interface PolyglotRESTEasyInterface
uriInfo
- Basic URL informationaccept
- content type accepted by clientpublic javax.ws.rs.core.Response ConvertFmt(String outFmt)
ConvertFmt
in interface PolyglotRESTEasyInterface
outFmt
- the output formatpublic javax.ws.rs.core.Response ConvertFile(javax.ws.rs.core.UriInfo uriInfo, String accept, javax.servlet.http.HttpServletRequest req, String outFmt, String file) throws IOException
ConvertFile
in interface PolyglotRESTEasyInterface
uriInfo
- Basic URL informationaccept
- content type accepted by clientreq
- used to obtain the ip address of the clientoutFmt
- the output formatfile
- input file to be processedIOException
public javax.ws.rs.core.Response Form(javax.ws.rs.core.UriInfo uriInfo, String accept)
Form
in interface PolyglotRESTEasyInterface
uriInfo
- Basic URL informationaccept
- content type accepted by clientpublic javax.ws.rs.core.Response Forms(javax.ws.rs.core.UriInfo uri, String output, String file, String action)
Forms
in interface PolyglotRESTEasyInterface
uriInfo
- basic URL informationoutput
- the default output formatfile
- input file to be processedaction
- either get or postpublic javax.ws.rs.core.Response File(javax.ws.rs.core.UriInfo uri, String fileName) throws IOException
File
in interface PolyglotRESTEasyInterface
uri
- Basic URL informationfileName
- file to be downloaded polyglot serverIOException
public javax.ws.rs.core.Response appIcons(String fileName)
appIcons
in interface PolyglotRESTEasyInterface
fileName
- file name of iconpublic javax.ws.rs.core.Response Alive()
Alive
in interface PolyglotRESTEasyInterface
public javax.ws.rs.core.Response Servers()
Servers
in interface PolyglotRESTEasyInterface
public javax.ws.rs.core.Response Software()
Software
in interface PolyglotRESTEasyInterface
public javax.ws.rs.core.Response Inputs(javax.ws.rs.core.UriInfo uriInfo, String accept)
Inputs
in interface PolyglotRESTEasyInterface
public javax.ws.rs.core.Response InputsOut(javax.ws.rs.core.UriInfo uriInfo, String accept, String out)
InputsOut
in interface PolyglotRESTEasyInterface
uriInfo
- Basic URL informationaccept
- content type accepted by clientout
- output formatpublic javax.ws.rs.core.Response Outputs()
Outputs
in interface PolyglotRESTEasyInterface
public javax.ws.rs.core.Response Requests()
Requests
in interface PolyglotRESTEasyInterface
public javax.ws.rs.core.Response printErrorMessage(String msg)
printErrorMessage
in interface PolyglotRESTEasyInterface
msg
- String to be returned within the error messagepublic javax.ws.rs.core.Response formPost(org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input, String mediaType, String accept, javax.ws.rs.core.UriInfo uri, javax.servlet.http.HttpServletRequest req, String output)
formPost
in interface PolyglotRESTEasyInterface
input
- Form containing Input DatamediaType
- media type being processedaccept
- content type accepted by clienturi
- Basic URL informationreq
- used to obtain the ip address of the clientoutput
- the output formatpublic javax.ws.rs.core.Response taskPost(org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input, String mediaType, String accept, javax.ws.rs.core.UriInfo uri, javax.servlet.http.HttpServletRequest req, String output)
taskPost
in interface PolyglotRESTEasyInterface
input
- Form containing Input DatamediaType
- media type being processedaccept
- content type accepted by clienturi
- Basic URL informationreq
- used to obtain the ip address of the clientoutput
- the output formatpublic javax.ws.rs.core.Response processPost(org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input, String mediaType, String accept, javax.ws.rs.core.UriInfo uri, javax.servlet.http.HttpServletRequest req, String output, boolean formPost)
input
- Form containing Input DatamediaType
- media type being processedaccept
- content type accepted by clienturi
- Basic URL informationreq
- used to obtain the ip address of the clientoutput
- the output formatfromPost
- true if message comes from formPost; false otherwisepublic String getForm(boolean POST_UPLOADS, String selected_output)
POST_UPLOADS
- true if this form should use POST rather than GET for uploading filesselected_output
- the default output formatpublic static String toString(Collection<String> strings)
strings
- a Collection of stringspublic static void updateMongo()
public static void updateMongo(PolyglotAuxiliary.RequestInformation request)
public static void stop()
public static void main(String[] args)
args
- command line argumentsCopyright © 2014. All rights reserved.