uws.service
Class UWSUrl_Old

java.lang.Object
  extended by uws.service.UWSUrl_Old
All Implemented Interfaces:
java.io.Serializable

public class UWSUrl_Old
extends java.lang.Object
implements java.io.Serializable

This class helps managing with UWS URLs.

Version:
01/2011
Author:
Grégory Mantelet (CDS)
See Also:
Serialized Form

Field Summary
protected  java.lang.String attributeName
          Name of the job attribute found in the last parsed URL.
protected  java.net.URL baseUrl
          Base UWS URL.
protected  java.lang.String jobId
          The JobID found in the last parsed URL.
protected  java.lang.String jobListName
          Name of a jobs list found in the last parsed URL.
 
Constructor Summary
UWSUrl_Old(java.net.URL baseUrl)
          Builds the UWS URL "interpreter" with the base UWS URL.
UWSUrl_Old(java.net.URL baseUrl, java.lang.String jobListName, java.lang.String jobId)
          Builds the UWS URL "interpreter" with the base UWS URL, a jobs list name and a job ID.
UWSUrl_Old(java.net.URL baseUrl, java.net.URL uwsUrl)
          Builds the UWS URL "interpreter" with the base UWS URL and a UWS URL (derived from the base UWS URL: uwsUrl = baseUrl + "/" + jobListName [+ "/" + jobID [+ "/" + parameter [+ "/" + queryPart]]]).
 
Method Summary
 java.lang.String abortJob()
          Gets the UWS URL (HTTP-GET ONLY) to abort the specified job.
 java.lang.String changeDestructionTime(java.lang.String newDestructionTime)
          Gets the UWS URL (HTTP-GET ONLY) to change the destruction time.
 java.lang.String changeExecDuration(java.lang.String newExecDuration)
          Gets the UWS URL (HTTP-GET ONLY) to change the execution duration.
 java.lang.String changeJobName(java.lang.String newName)
          Gets the UWS URL (HTTP-GET ONLY) to change the run ID.
 java.lang.String changeJobParam(java.lang.String paramName, java.lang.String paramValue)
          Gets the UWS URL (HTTP-GET ONLY) to change the specified parameter.
 java.lang.String createJob(java.util.Map<java.lang.String,java.lang.String> parameters)
          Gets the UWS URL (HTTP-GET ONLY) to create a job with the given parameters.
 java.lang.String deleteJob()
          Gets the UWS URL (HTTP-GET ONLY) to delete the specified job.
static java.net.URL extractBaseUWSUrl(javax.servlet.http.HttpServletRequest req, boolean endByJobList)
          Deprecated. Moved into UWSToolBox: UWSToolBox.extractBaseUWSUrl(HttpServletRequest, boolean)
 java.lang.String getAttributeName()
          Gets the job attribute name (i.e. jobId, phase, etc...) found in the last parsed UWS URL.
 java.net.URL getBaseUrl()
          Gets the base UWS URL given at the initialization of this instance of UWSUrl_Old.
 java.lang.String getJobId()
          Gets the job ID found in the last parsed UWS URL.
 java.lang.String getJobListName()
          Gets the jobs list name found in the last parsed UWS URL.
static java.util.Map<java.lang.String,java.lang.String> getParameters(java.lang.String queryPart)
          Deprecated. Moved into UWSToolBox: UWSToolBox.getParameters(String)
 java.lang.String getParamName()
          Deprecated. Replaced by getAttributeName(), so that avoiding confusion with the parameter of a HTTP request.
static java.lang.String getQueryPart(java.util.Map<java.lang.String,java.lang.String> parameters)
          Deprecated. Moved into UWSToolBox: UWSToolBox.getQueryPart(Map).
 java.lang.String getUWSName()
          Gets the supposed name of the UWS from its baseUrl.
 java.lang.String homePage()
          Gets the base UWS URL = UWS home page.
 java.lang.String jobDestruction()
          Gets the UWS URL to get the destruction time.
 java.lang.String jobError()
          Gets the UWS URL to get the error summary.
 java.lang.String jobExecDuration()
          Gets the UWS URL to get the execution duration.
 java.lang.String jobName()
          Gets the UWS URL to get the runID.
 java.lang.String jobOwner()
          Gets the UWS URL to get the owner ID.
 java.lang.String jobParameter(java.lang.String paramName)
          Gets the UWS URL to get the parameters/parameter.
 java.lang.String jobParameters()
          Gets the UWS URL to get the parameters.
 java.lang.String jobPhase()
          Gets the UWS URL to get the phase.
 java.lang.String jobQuote()
          Gets the UWS URL to get the quote.
 java.lang.String jobResult(java.lang.String resultId)
          Gets the UWS URL to get the specified result.
 java.lang.String jobResults()
          Gets the UWS URL to get the results.
 java.lang.String jobSummary()
          Gets the UWS URL to get the summary.
 java.lang.String listJobs()
          Gets the UWS URL to get the specified jobs list.
 void loadUwsURL(java.net.URL uwsUrl)
          Parses the given UWS URL.
 void setJobId(java.lang.String jobId)
          Sets the job ID to use to build any UWS URL.
 void setJobListName(java.lang.String jobListName)
          Sets the jobs list name to use to build any UWS URL.
 java.lang.String startJob()
          Gets the UWS URL (HTTP-GET ONLY) to start the specified job.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

baseUrl

protected final java.net.URL baseUrl
Base UWS URL.


jobListName

protected java.lang.String jobListName
Name of a jobs list found in the last parsed URL.


jobId

protected java.lang.String jobId
The JobID found in the last parsed URL.


attributeName

protected java.lang.String attributeName
Name of the job attribute found in the last parsed URL.

Constructor Detail

UWSUrl_Old

public UWSUrl_Old(java.net.URL baseUrl)
Builds the UWS URL "interpreter" with the base UWS URL.

Parameters:
baseUrl - The base UWS URL.

UWSUrl_Old

public UWSUrl_Old(java.net.URL baseUrl,
                  java.lang.String jobListName,
                  java.lang.String jobId)
Builds the UWS URL "interpreter" with the base UWS URL, a jobs list name and a job ID.

Parameters:
baseUrl - A base UWS URL.
jobListName - The name of a jobs list.
jobId - The ID of a job.
See Also:
UWSUrl_Old#UWSUrl(URL)

UWSUrl_Old

public UWSUrl_Old(java.net.URL baseUrl,
                  java.net.URL uwsUrl)
           throws UWSException
Builds the UWS URL "interpreter" with the base UWS URL and a UWS URL (derived from the base UWS URL: uwsUrl = baseUrl + "/" + jobListName [+ "/" + jobID [+ "/" + parameter [+ "/" + queryPart]]]).

Parameters:
baseUrl - The base UWS URL.
uwsUrl - Any valid UWS URL.
Throws:
UWSException - If the given UWS URL is not derived from the given base UWS URL.
See Also:
UWSUrl_Old#UWSUrl(URL), loadUwsURL(URL)
Method Detail

loadUwsURL

public void loadUwsURL(java.net.URL uwsUrl)
                throws UWSException

Parses the given UWS URL.

Warning: It must be derived from the base UWS URL given at the initialization of this instance of UWSUrl_Old:
uwsUrl = baseUrl + "/" + jobListName [+ "/" + jobID [+ "/" + parameter [+ "/" + queryPart]]]

Parameters:
uwsUrl - The UWS URL to parse.
Throws:
UWSException - If the given UWS URL is not derived from the base UWS URL given at the initialization.

getJobListName

public final java.lang.String getJobListName()
Gets the jobs list name found in the last parsed UWS URL.

Returns:
The jobListName.

setJobListName

public final void setJobListName(java.lang.String jobListName)
Sets the jobs list name to use to build any UWS URL.

Parameters:
jobListName - A jobs list name.

getJobId

public final java.lang.String getJobId()
Gets the job ID found in the last parsed UWS URL.

Returns:
The jobId.

setJobId

public final void setJobId(java.lang.String jobId)
Sets the job ID to use to build any UWS URL.

Parameters:
jobId - A job ID.

getBaseUrl

public final java.net.URL getBaseUrl()
Gets the base UWS URL given at the initialization of this instance of UWSUrl_Old.

Returns:
The baseUrl.

getUWSName

public final java.lang.String getUWSName()
Gets the supposed name of the UWS from its baseUrl.

Returns:
The presumed UWS name.

getParamName

@Deprecated
public final java.lang.String getParamName()
Deprecated. Replaced by getAttributeName(), so that avoiding confusion with the parameter of a HTTP request.

Gets the parameter name found in the last parsed UWS URL.

Returns:
The found parameter name.
See Also:
getAttributeName()

getAttributeName

public final java.lang.String getAttributeName()
Gets the job attribute name (i.e. jobId, phase, etc...) found in the last parsed UWS URL.

Returns:
The found attribute name.

homePage

public final java.lang.String homePage()
Gets the base UWS URL = UWS home page.


listJobs

public final java.lang.String listJobs()
Gets the UWS URL to get the specified jobs list.


jobSummary

public final java.lang.String jobSummary()
Gets the UWS URL to get the summary.


jobName

public final java.lang.String jobName()
Gets the UWS URL to get the runID.


jobPhase

public final java.lang.String jobPhase()
Gets the UWS URL to get the phase.


jobExecDuration

public final java.lang.String jobExecDuration()
Gets the UWS URL to get the execution duration.


jobDestruction

public final java.lang.String jobDestruction()
Gets the UWS URL to get the destruction time.


jobError

public final java.lang.String jobError()
Gets the UWS URL to get the error summary.


jobQuote

public final java.lang.String jobQuote()
Gets the UWS URL to get the quote.


jobResults

public final java.lang.String jobResults()
Gets the UWS URL to get the results.


jobResult

public final java.lang.String jobResult(java.lang.String resultId)
Gets the UWS URL to get the specified result.


jobParameters

public final java.lang.String jobParameters()
Gets the UWS URL to get the parameters.


jobParameter

public final java.lang.String jobParameter(java.lang.String paramName)
Gets the UWS URL to get the parameters/parameter.


jobOwner

public final java.lang.String jobOwner()
Gets the UWS URL to get the owner ID.


createJob

public final java.lang.String createJob(java.util.Map<java.lang.String,java.lang.String> parameters)
Gets the UWS URL (HTTP-GET ONLY) to create a job with the given parameters.


deleteJob

public final java.lang.String deleteJob()
Gets the UWS URL (HTTP-GET ONLY) to delete the specified job.


startJob

public final java.lang.String startJob()
Gets the UWS URL (HTTP-GET ONLY) to start the specified job.


abortJob

public final java.lang.String abortJob()
Gets the UWS URL (HTTP-GET ONLY) to abort the specified job.


changeJobName

public final java.lang.String changeJobName(java.lang.String newName)
Gets the UWS URL (HTTP-GET ONLY) to change the run ID.


changeDestructionTime

public final java.lang.String changeDestructionTime(java.lang.String newDestructionTime)
Gets the UWS URL (HTTP-GET ONLY) to change the destruction time.


changeExecDuration

public final java.lang.String changeExecDuration(java.lang.String newExecDuration)
Gets the UWS URL (HTTP-GET ONLY) to change the execution duration.


changeJobParam

public final java.lang.String changeJobParam(java.lang.String paramName,
                                             java.lang.String paramValue)
Gets the UWS URL (HTTP-GET ONLY) to change the specified parameter.


getQueryPart

@Deprecated
public static final java.lang.String getQueryPart(java.util.Map<java.lang.String,java.lang.String> parameters)
Deprecated. Moved into UWSToolBox: UWSToolBox.getQueryPart(Map).

Converts map of UWS parameters into a string corresponding to the query part of a HTTP-GET URL (i.e. ?EXECUTIONDURATION=60&DESTRUCTION=2010-09-01T13:58:00:000-0200).

Parameters:
parameters - A Map of parameters.
Returns:
The corresponding query part of an HTTP-GET URL (all keys have been set in upper case).
See Also:
UWSToolBox.getQueryPart(Map)

getParameters

@Deprecated
public static final java.util.Map<java.lang.String,java.lang.String> getParameters(java.lang.String queryPart)
Deprecated. Moved into UWSToolBox: UWSToolBox.getParameters(String)

Converts the given query part of a HTTP-GET URL to a map of parameters.

Parameters:
queryPart - A query part of a HTTP-GET URL.
Returns:
The corresponding map of parameters (all keys have been set in lower case).
See Also:
UWSToolBox.getParameters(String)

extractBaseUWSUrl

@Deprecated
public static final java.net.URL extractBaseUWSUrl(javax.servlet.http.HttpServletRequest req,
                                                              boolean endByJobList)
                                            throws java.net.MalformedURLException
Deprecated. Moved into UWSToolBox: UWSToolBox.extractBaseUWSUrl(HttpServletRequest, boolean)

Extracts the base UWS URL from the given request.

Parameters:
req - The request.
endByJobList - true if the servlet path (the url-pattern given in the web.xml) finishes by the name of the JobList, false if it does not contain the name of the JobList.
Returns:
The URL of the UWS.
Throws:
java.net.MalformedURLException - If it is impossible to build the base UWS URL with the given request.
See Also:
UWSToolBox.extractBaseUWSUrl(HttpServletRequest, boolean)