fr.cnes.sitools.tasks.business
Class Task

java.lang.Object
  extended by fr.cnes.sitools.tasks.business.Task
All Implemented Interfaces:
java.lang.Runnable

public final class Task
extends java.lang.Object
implements java.lang.Runnable

Task class aims at execute the API servers requests; retrieve the results; treat them to create a file or other; notify the end of the job. It also aims at put all operations details in a log file for future investigations by the user.

Author:
jp.boignard (AKKA Technologies)

Constructor Summary
Task(org.restlet.Context context, org.restlet.Request r, org.restlet.Response response, java.lang.String id, ResourceModel resourceModel, org.restlet.security.User user, java.util.logging.Level loggerLvl)
          The Task constuctor
Task(TaskModel taskModel)
          Constructor Used for Task recovery at starting
 
Method Summary
 org.restlet.Context getContext()
          Gets the context value
 java.lang.String getCustomStatus()
          Gets the customStatus value
 java.util.Date getEndDate()
          Gets the endDate value
 java.util.logging.Logger getLogger()
          Gets the logger value
 java.lang.String getMediaResult()
          Gets the mediaResult value
 org.restlet.Request getRequest()
          Get the request
 ResourceModel getResourceModel()
          Gets the resourceModel value
 org.restlet.Response getResponse()
          Gets the response value
 org.restlet.representation.Representation getResult()
          Get the result of the treatment
 java.lang.String getRootUrl()
          Gets the rootUrl value
 TaskRunTypeAdministration getRunTypeAdministration()
          Gets the runType value
 java.util.Date getStartDate()
          Gets the startDate value
 org.restlet.data.Status getStatus()
          Gets the status value
 java.lang.String getStatusUrl()
          Gets the statusUrl value
 java.lang.String getTaskId()
          Get the task Identifier
 TaskModel getTaskModel()
          Gets the taskModel value
 TaskStatus getTaskStatus()
          Gets the status value
 long getTimestamp()
          Gets the time stamp value
 java.lang.String getUrlResult()
          Gets the urlResult value
 org.restlet.security.User getUser()
          Gets the user value
 java.lang.String getUserId()
          Gets the user value
 boolean isPersist()
          Gets the persist value
 void run()
           
 void runSynchrone()
          Synchronous run
 void setContext(org.restlet.Context context)
          Sets the value of context
 void setCustomStatus(java.lang.String customStatus)
          Sets the value of customStatus
 void setEndDate(java.util.Date endDate)
          Sets the value of endDate
 void setLogger(java.util.logging.Logger logger)
          Sets the value of logger
 void setMediaResult(java.lang.String mediaResult)
          Sets the value of mediaResult
 void setPersist(boolean persist)
          Sets the value of persist
 void setRequest(org.restlet.Request request)
          Set the request
 void setResourceModel(ResourceModel resourceModel)
          Sets the value of resourceModel
 void setResponse(org.restlet.Response response)
          Sets the value of response
 void setResult(org.restlet.representation.Representation result)
          Set the result of the treatment
 void setRootUrl(java.lang.String rootUrl)
          Sets the value of rootUrl
 void setRunType(TaskRunTypeAdministration runType)
          Sets the value of runType
 void setStartDate(java.util.Date startDate)
          Sets the value of startDate
 void setStatus(org.restlet.data.Status status)
          Sets the value of status
 void setStatusUrl(java.lang.String statusUrl)
          Sets the value of statusUrl
 void setTaskId(java.lang.String id)
          Set the task Identifier
 void setTaskModel(TaskModel taskModel)
          Sets the value of taskModel
 void setTaskStatus(TaskStatus status)
          Sets the value of status
 void setTimestamp(long timestamp)
          Sets the value of time stamp
 void setUrlResult(java.lang.String urlResult)
          Sets the value of urlResult
 void setUser(org.restlet.security.User user)
          Sets the value of user
 void setUserId(java.lang.String userId)
          Sets the value of user
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Task

public Task(org.restlet.Context context,
            org.restlet.Request r,
            org.restlet.Response response,
            java.lang.String id,
            ResourceModel resourceModel,
            org.restlet.security.User user,
            java.util.logging.Level loggerLvl)
The Task constuctor

Parameters:
context - the Restlet Context of the Task
r - the request object
response - the response object
id - the id of the Task
resourceModel - the Resource model
user - the User
loggerLvl - the level of the logger

Task

public Task(TaskModel taskModel)
Constructor Used for Task recovery at starting

Parameters:
taskModel - The TaskModel of the Task
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

runSynchrone

public void runSynchrone()
Synchronous run


setCustomStatus

public void setCustomStatus(java.lang.String customStatus)
Sets the value of customStatus

Parameters:
customStatus - the customStatus to set

getCustomStatus

public java.lang.String getCustomStatus()
Gets the customStatus value

Returns:
the customStatus

setUrlResult

public void setUrlResult(java.lang.String urlResult)
Sets the value of urlResult

Parameters:
urlResult - the urlResult to set

getUrlResult

public java.lang.String getUrlResult()
Gets the urlResult value

Returns:
the urlResult

setMediaResult

public void setMediaResult(java.lang.String mediaResult)
Sets the value of mediaResult

Parameters:
mediaResult - the mediaResult to set

getMediaResult

public java.lang.String getMediaResult()
Gets the mediaResult value

Returns:
the mediaResult

setStatusUrl

public void setStatusUrl(java.lang.String statusUrl)
Sets the value of statusUrl

Parameters:
statusUrl - the statusUrl to set

getStatusUrl

public java.lang.String getStatusUrl()
Gets the statusUrl value

Returns:
the statusUrl

getTaskId

public java.lang.String getTaskId()
Get the task Identifier

Returns:
the task ID

setTaskId

public void setTaskId(java.lang.String id)
Set the task Identifier

Parameters:
id - the identifier

getContext

public org.restlet.Context getContext()
Gets the context value

Returns:
the context

setContext

public void setContext(org.restlet.Context context)
Sets the value of context

Parameters:
context - the context to set

setRequest

public void setRequest(org.restlet.Request request)
Set the request

Parameters:
request - the request to set

getRequest

public org.restlet.Request getRequest()
Get the request

Returns:
the request to get

getResponse

public org.restlet.Response getResponse()
Gets the response value

Returns:
the response

setResponse

public void setResponse(org.restlet.Response response)
Sets the value of response

Parameters:
response - the response to set

setResult

public void setResult(org.restlet.representation.Representation result)
Set the result of the treatment

Parameters:
result - the result to set

getResult

public org.restlet.representation.Representation getResult()
Get the result of the treatment

Returns:
the result

getTaskStatus

public TaskStatus getTaskStatus()
Gets the status value

Returns:
the status

setTaskStatus

public void setTaskStatus(TaskStatus status)
Sets the value of status

Parameters:
status - the status to set

setUserId

public void setUserId(java.lang.String userId)
Sets the value of user

Parameters:
userId - the userId to set

getUserId

public java.lang.String getUserId()
Gets the user value

Returns:
the user

setTimestamp

public void setTimestamp(long timestamp)
Sets the value of time stamp

Parameters:
timestamp - the time stamp to set

getTimestamp

public long getTimestamp()
Gets the time stamp value

Returns:
the time stamp

setRootUrl

public void setRootUrl(java.lang.String rootUrl)
Sets the value of rootUrl

Parameters:
rootUrl - the rootUrl to set

getRootUrl

public java.lang.String getRootUrl()
Gets the rootUrl value

Returns:
the rootUrl

setUser

public void setUser(org.restlet.security.User user)
Sets the value of user

Parameters:
user - the user to set

getUser

public org.restlet.security.User getUser()
Gets the user value

Returns:
the user

getStartDate

public java.util.Date getStartDate()
Gets the startDate value

Returns:
the startDate

setStartDate

public void setStartDate(java.util.Date startDate)
Sets the value of startDate

Parameters:
startDate - the startDate to set

getEndDate

public java.util.Date getEndDate()
Gets the endDate value

Returns:
the endDate

setEndDate

public void setEndDate(java.util.Date endDate)
Sets the value of endDate

Parameters:
endDate - the endDate to set

setLogger

public void setLogger(java.util.logging.Logger logger)
Sets the value of logger

Parameters:
logger - the logger to set

getLogger

public java.util.logging.Logger getLogger()
Gets the logger value

Returns:
the logger

setRunType

public void setRunType(TaskRunTypeAdministration runType)
Sets the value of runType

Parameters:
runType - the runType to set

getRunTypeAdministration

public TaskRunTypeAdministration getRunTypeAdministration()
Gets the runType value

Returns:
the runType

setPersist

public void setPersist(boolean persist)
Sets the value of persist

Parameters:
persist - the persist to set

isPersist

public boolean isPersist()
Gets the persist value

Returns:
the persist

getTaskModel

public TaskModel getTaskModel()
Gets the taskModel value

Returns:
the taskModel

setTaskModel

public void setTaskModel(TaskModel taskModel)
Sets the value of taskModel

Parameters:
taskModel - the taskModel to set

getResourceModel

public ResourceModel getResourceModel()
Gets the resourceModel value

Returns:
the resourceModel

setResourceModel

public void setResourceModel(ResourceModel resourceModel)
Sets the value of resourceModel

Parameters:
resourceModel - the resourceModel to set

setStatus

public void setStatus(org.restlet.data.Status status)
Sets the value of status

Parameters:
status - the status to set

getStatus

public org.restlet.data.Status getStatus()
Gets the status value

Returns:
the status


Copyright © 2010-2013 CNES. All Rights Reserved.