public class SoftwareServerRESTEasy extends Object implements SoftwareServerRESTEasyInterface
Modifier and Type | Field and Description |
---|---|
protected static org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer |
tjws |
Constructor and Description |
---|
SoftwareServerRESTEasy()
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 |
busy()
Used to verify if the server is busy
|
javax.ws.rs.core.Response |
completedTasks()
Used to know the number of task completed since the server starts
|
static String |
createHTMLList(String list,
String link,
boolean APPEND,
String title)
Convert a line separated list into an HTML list of links.
|
void |
executeTask(int session,
String application_alias,
String task_string,
String file,
String format,
String url)
Execute a task.
|
void |
executeTaskLater(int session,
String application_alias,
String task_string,
String file,
String format,
String uri)
Execute a task asynchronously.
|
javax.ws.rs.core.Response |
fileOrDir(javax.ws.rs.core.UriInfo uri,
String fileOrDirName)
Returns a link to either a produced file or to a directory tree
|
javax.ws.rs.core.Response |
form()
Returns a list of actions that can be performed (get or post or convert)
|
javax.ws.rs.core.Response |
formPost(org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input,
String mediaType,
String accept,
javax.ws.rs.core.UriInfo uri,
String application,
String task,
String format,
String file)
Process a file submitted via the web form and return a link to the produced file
|
String |
getApplications()
Get the applications available.
|
String |
getApplicationStack()
Get an icon representation of the available software.
|
String |
getApplicationTaskInputs(String alias,
String task)
Get the input formats supported by the given task.
|
String |
getApplicationTaskInputsOutputs(String alias,
String task)
Get the input and output formats supported by the given task.
|
String |
getApplicationTaskOutputs(String alias,
String task)
Get the output formats supported by the given task.
|
String |
getApplicationTasks(String alias)
Get the tasks available for the given application.
|
String |
getConvertForm()
Get a web form interface for converting via this restful service.
|
String |
getForm()
Get a web form interface for this restful service.
|
String |
getForm(boolean POST_UPLOADS,
String selected_application,
boolean HIDE_APPLICATIONS)
Get a web form interface for this restful service.
|
Vector<SoftwareServerAuxiliary.Subtask> |
getTask(String application_alias,
String task_string,
String filename,
String output_format)
Get the task involved in using the given applications to convert the given file to the specified output format.
|
javax.ws.rs.core.Response |
kills()
Used to know the number of task killed since the server starts
|
javax.ws.rs.core.Response |
listApplications(javax.ws.rs.core.UriInfo uriInfo,
String Accept)
Returns a list of applications available in software server
|
javax.ws.rs.core.Response |
listInputAndOutputFormats(String app,
String tsk)
Returns a list of input and output file formats accepted and produced by the application
|
javax.ws.rs.core.Response |
listInputFormats(javax.ws.rs.core.UriInfo uriInfo,
String Accept,
String app,
String tsk)
Returns a list of input file formats accepted by the application
|
javax.ws.rs.core.Response |
listOutputFile(javax.ws.rs.core.UriInfo uriInfo,
String Accept,
String app,
String tsk,
String fmt,
String file)
Returns a link to the produced file
|
javax.ws.rs.core.Response |
listOutputFmts(javax.ws.rs.core.UriInfo uriInfo,
String Accept,
String app,
String tsk)
Return a list of the file formats produced by the application
|
javax.ws.rs.core.Response |
listTasks(javax.ws.rs.core.UriInfo uriInfo,
String Accept,
String app)
Returns a list of tasks performed by a particular application
|
javax.ws.rs.core.Response |
load()
Used to get a measure of the server load
|
static void |
main(String[] args)
Used to initialize and start the servlet server called the Tiny Java Web Server and Servlet (TJWS) Container.
|
javax.ws.rs.core.Response |
memory()
Used to know the memory available to the server
|
javax.ws.rs.core.Response |
printErrorMessage(String msg)
Returns an error message
|
javax.ws.rs.core.Response |
processGet(javax.ws.rs.core.UriInfo uri,
String application,
String task,
String format,
String file,
String action)
Returns a link to the produced file
|
javax.ws.rs.core.Response |
processors()
Used to know the number of processor available to the server
|
javax.ws.rs.core.Response |
processPost(org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input,
String mediaType,
String accept,
javax.ws.rs.core.UriInfo uri,
String application,
String task,
String format,
String file,
boolean formPost)
This is an auxiliary method working for the formPost() and the taskPost() methods.
|
static String |
queryEndpoint(String url)
Query an endpoint.
|
javax.ws.rs.core.Response |
reboot()
Used to reboot the server remotely in case it is necessary
|
static String |
removeParameters(String url)
Remove parameters from a URL.
|
javax.ws.rs.core.Response |
reset()
Used to reset the server remotely in case it is necessary
|
javax.ws.rs.core.Response |
screen()
Used to have a look at the server screen and determine if the
server must be restarted due to hang application.
|
static void |
stop()
Used to stop the servlet server
|
javax.ws.rs.core.Response |
taskPost(org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input,
String mediaType,
String accept,
javax.ws.rs.core.UriInfo uri,
String application,
String task,
String format)
Process a file submitted to the Software Server and return a link to the produced file
|
javax.ws.rs.core.Response |
tasks()
Used to know the number of task processed since the server starts
|
javax.ws.rs.core.Response |
WelcomeToSoftwareServer()
Returns SoftwareServer greetings
|
protected static org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer tjws
public javax.ws.rs.core.Response WelcomeToSoftwareServer()
WelcomeToSoftwareServer
in interface SoftwareServerRESTEasyInterface
public javax.ws.rs.core.Response listApplications(javax.ws.rs.core.UriInfo uriInfo, String Accept)
listApplications
in interface SoftwareServerRESTEasyInterface
uriInfo
- Basic URL informationAccept
- content type accepted by clientpublic javax.ws.rs.core.Response listTasks(javax.ws.rs.core.UriInfo uriInfo, String Accept, String app)
listTasks
in interface SoftwareServerRESTEasyInterface
uriInfo
- Basic URL informationAccept
- content type accepted by clientapp
- application's namepublic javax.ws.rs.core.Response listOutputFmts(javax.ws.rs.core.UriInfo uriInfo, String Accept, String app, String tsk)
listOutputFmts
in interface SoftwareServerRESTEasyInterface
uriInfo:
- Basic URL informationAccept
- content type accepted by clientapp
- application's nametsk
- task to be performedpublic javax.ws.rs.core.Response listInputAndOutputFormats(String app, String tsk)
listInputAndOutputFormats
in interface SoftwareServerRESTEasyInterface
app
- application's nametsk
- task to be performedpublic javax.ws.rs.core.Response listInputFormats(javax.ws.rs.core.UriInfo uriInfo, String Accept, String app, String tsk)
listInputFormats
in interface SoftwareServerRESTEasyInterface
uriInfo
- Basic URL informationAccept
- content type accepted by clientapp
- application's nametsk
- task to be performedpublic javax.ws.rs.core.Response listOutputFile(javax.ws.rs.core.UriInfo uriInfo, String Accept, String app, String tsk, String fmt, String file)
listOutputFile
in interface SoftwareServerRESTEasyInterface
uriInfo
- Basic URL informationproduces
- content type accepted by clientapp
- application's nametsk
- task to be performedfmt
- requested output formatfile
- input file to be processedpublic javax.ws.rs.core.Response form()
form
in interface SoftwareServerRESTEasyInterface
public javax.ws.rs.core.Response processGet(javax.ws.rs.core.UriInfo uri, String application, String task, String format, String file, String action)
processGet
in interface SoftwareServerRESTEasyInterface
uri
- Basic URL informationapplication
- application's nametask
- task to be performedformat
- requested output formatfile
- input file to be processedaction
- (get or post or convert)public javax.ws.rs.core.Response fileOrDir(javax.ws.rs.core.UriInfo uri, String fileOrDirName) throws IOException
fileOrDir
in interface SoftwareServerRESTEasyInterface
uri
- Basic URL informationfileOrDirName
- input file or directoryIOException
public javax.ws.rs.core.Response appIcons(String fileName)
appIcons
in interface SoftwareServerRESTEasyInterface
fileName
- file name of iconpublic javax.ws.rs.core.Response alive()
alive
in interface SoftwareServerRESTEasyInterface
public javax.ws.rs.core.Response busy()
busy
in interface SoftwareServerRESTEasyInterface
public javax.ws.rs.core.Response processors()
processors
in interface SoftwareServerRESTEasyInterface
public javax.ws.rs.core.Response memory()
memory
in interface SoftwareServerRESTEasyInterface
public javax.ws.rs.core.Response load()
load
in interface SoftwareServerRESTEasyInterface
public javax.ws.rs.core.Response tasks()
tasks
in interface SoftwareServerRESTEasyInterface
public javax.ws.rs.core.Response kills()
kills
in interface SoftwareServerRESTEasyInterface
public javax.ws.rs.core.Response completedTasks()
completedTasks
in interface SoftwareServerRESTEasyInterface
public javax.ws.rs.core.Response screen()
screen
in interface SoftwareServerRESTEasyInterface
public javax.ws.rs.core.Response reset()
reset
in interface SoftwareServerRESTEasyInterface
public javax.ws.rs.core.Response reboot()
reboot
in interface SoftwareServerRESTEasyInterface
public javax.ws.rs.core.Response printErrorMessage(String msg)
printErrorMessage
in interface SoftwareServerRESTEasyInterface
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, String application, String task, String format, String file)
formPost
in interface SoftwareServerRESTEasyInterface
input
- Form containing Input DatamediaType
- media type being processedaccept
- content type accepted by clienturi
- Basic URL informationapplication
- application's nametask
- task to be performedformat
- requested output formatfile
- name of the input file to be processedpublic javax.ws.rs.core.Response taskPost(org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input, String mediaType, String accept, javax.ws.rs.core.UriInfo uri, String application, String task, String format)
taskPost
in interface SoftwareServerRESTEasyInterface
input
- Form containing Input DatamediaType
- media type being processedaccept
- content type accepted by clienturi
- Basic URL informationapplication
- application's nametask
- task to be performedformat
- requested 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, String application, String task, String format, String file, boolean formPost)
input
- Form containing Input DatamediaType
- media type being processedaccept
- content type accepted by clienturi
- Basic URL informationapplication
- application's nametask
- task to be performedformat
- requested output formatfile
- name of the input file to be processedfromPost
- true if message comes from formPost; false otherwisepublic String getApplicationStack()
public String getApplications()
public String getApplicationTasks(String alias)
alias
- the application aliaspublic String getApplicationTaskOutputs(String alias, String task)
alias
- the application aliastask
- the application taskpublic String getApplicationTaskInputsOutputs(String alias, String task)
alias
- the application aliastask
- the application taskpublic String getApplicationTaskInputs(String alias, String task)
alias
- the application aliastask
- the application taskpublic Vector<SoftwareServerAuxiliary.Subtask> getTask(String application_alias, String task_string, String filename, String output_format)
application_alias
- the alias of the application to use.task_string
- the task to performfilename
- the file name of the cached file to convertoutput_format
- the output formatpublic void executeTask(int session, String application_alias, String task_string, String file, String format, String url)
session
- the session id to use while executing the taskapplication_alias
- the application to usetask_string
- the task to perform (nothing assumed to be a conversion)file
- the URL of the file to convertformat
- the output formatpublic void executeTaskLater(int session, String application_alias, String task_string, String file, String format, String uri)
session
- the session id to use while executing the taskapplication_alias
- the application to usetask_string
- the task to perform (nothing assumed to be a conversion)file
- the URL of the input fileformat
- the output formatpublic String getForm(boolean POST_UPLOADS, String selected_application, boolean HIDE_APPLICATIONS)
POST_UPLOADS
- true if this form should use POST rather than GET for uploading filesselected_application
- the default applicationHIDE_APPLICATIONS
- true if applications menu should be hiddenpublic String getForm()
public String getConvertForm()
public static String createHTMLList(String list, String link, boolean APPEND, String title)
list
- the line separated list of itemslink
- the URL baseAPPEND
- true if list items should be appended to the end of linktitle
- the title of the generated HTML page (can be null)public static String removeParameters(String url)
url
- the URL of a filepublic static String queryEndpoint(String url)
url
- the URL of the endpointpublic static void stop()
public static void main(String[] args)
args
- the input argumentsCopyright © 2014. All rights reserved.