|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.globus.exec.client.GramJob
This class represents a simple gram job. It allows for submitting a job,canceling it, sending a signal command and registering and unregistering job state chang listeners. This class hides the middleware API from the consumer.
| Field Summary | |
static Authorization |
DEFAULT_AUTHZ
|
static int |
DEFAULT_DURATION_HOURS
|
static Integer |
DEFAULT_MSG_PROTECTION
|
static int |
DEFAULT_TIMEOUT
|
static boolean |
NOTIF_CONSUMER_SECURITY
|
| Constructor Summary | |
GramJob()
Creates a gram job with no RSL. |
|
GramJob(JobDescriptionType jobDescription)
Creates a gram job with specified job description. |
|
| Method Summary | |
void |
addListener(GramJobListener listener)
Add a listener to the GramJob. |
void |
addStderrPath(String path)
Preconditionthe job has not been submitted |
void |
addStdoutPath(String path)
Preconditionthe job has not been submitted |
void |
bind()
Registers a callback listener for this job. |
void |
cancel()
Cancels a job. |
void |
deliver(List topicPath,
EndpointReferenceType producer,
Object message)
Deliver the notification message |
void |
destroy()
Precondition: isRequested() Postcondition: isLocallyDestroyed() |
Authorization |
getAuthorization()
|
GSSCredential |
getCredentials()
Gets the credentials of this job. |
String |
getDelegationLevel()
|
JobDescriptionType |
getDescription()
|
EndpointReferenceType |
getEndpoint()
Precondition: isRequested() |
int |
getError()
Gets the error of the job. |
BaseFaultType |
getFault()
Return information about the cause of a job failure (when getStateAsString.equals(StateEnumeration._Failed)) |
String |
getHandle()
Can be used instead of #getEndpointReference
Precondition: isRequested() |
Integer |
getMessageProtectionType()
|
static List |
getStartedJobs(EndpointReferenceType factoryEndpoint)
|
StateEnumeration |
getState()
Get the current state of this job. |
boolean |
isLocallyDestroyed()
|
boolean |
isPersonal()
|
boolean |
isRequested()
Returns true if the job has been requested. |
boolean |
isStarted()
|
void |
prependBaseURLtoStageInSources(String baseURL)
|
void |
prependBaseURLtoStageOutDestinations(String baseURL)
|
void |
refreshStatus()
Asks the job service for its state,i.e. |
void |
removeListener(GramJobListener listener)
Remove a listener from the GramJob. |
void |
setAuthorization(Authorization auth)
|
void |
setCredentials(GSSCredential newProxy)
Sets credentials of the job |
void |
setDryRun(boolean enabled)
Preconditionthe job has not been submitted |
void |
setDuration(Date duration)
The default lifetime of the resource is 24 hours. |
void |
setEndpoint(EndpointReferenceType endpoint)
|
protected void |
setError(int code)
Sets the error code of the job. |
void |
setHandle(String resourceHandle)
Can be used instead of #setEndpointReference |
void |
setMessageProtectionType(Integer protectionType)
|
void |
setPersonal(boolean personal)
|
void |
setServiceTerminationTime()
Set TerminationTime RP of managed job service based on parameters specified as JavaBean properties on this object. |
void |
setStarted(boolean jobIsStarted)
|
void |
setTerminationTime(Date termTime)
|
void |
setTimeOut(int timeout)
Set timeout for HTTP socket. |
void |
start()
postcondition: isStarted() |
void |
submit(EndpointReferenceType factoryEndpoint)
Submits an interactive i.e. |
void |
submit(EndpointReferenceType factoryEndpoint,
boolean batch)
Submits a job with limited delegation. |
void |
submit(EndpointReferenceType factoryEndpoint,
boolean batch,
boolean limitedDelegation)
|
String |
toString()
Returns string representation of this job. |
void |
unbind()
Unregisters a callback listener for this job. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int DEFAULT_TIMEOUT
public static final boolean NOTIF_CONSUMER_SECURITY
public static final Integer DEFAULT_MSG_PROTECTION
public static final Authorization DEFAULT_AUTHZ
public static final int DEFAULT_DURATION_HOURS
| Constructor Detail |
public GramJob()
#setEndpoint().
public GramJob(JobDescriptionType jobDescription)
| Method Detail |
public void addListener(GramJobListener listener)
listener - The object that wishes to receive state updates.org.globus.gram.GramJobListenerpublic void removeListener(GramJobListener listener)
listener - The object that wishes to stop receiving state updates.org.globus.gram.GramJobListenerpublic GSSCredential getCredentials()
public void setCredentials(GSSCredential newProxy)
newProxy - user credentials
IllegalArgumentException - if credentials are already setpublic StateEnumeration getState()
public void submit(EndpointReferenceType factoryEndpoint)
throws Exception
Exceptionfor explanation
of parameters
public void submit(EndpointReferenceType factoryEndpoint,
boolean batch)
throws Exception
Exceptionfor explanation
of parameters
public void submit(EndpointReferenceType factoryEndpoint,
boolean batch,
boolean limitedDelegation)
throws Exception
factoryEndpoint - the resource manager service endpoint.
The service address can be specified in the following ways:
batch - specifies if the job should be submitted as
a batch job.limitedDelegation - true for limited delegation, false for
full delegation.
Exceptionfor detailed resource manager
contact specification.public void addStdoutPath(String path)
path - Stringpublic void addStderrPath(String path)
path - Stringpublic void prependBaseURLtoStageInSources(String baseURL)
public void prependBaseURLtoStageOutDestinations(String baseURL)
public void setDryRun(boolean enabled)
public JobDescriptionType getDescription()
throws Exception
Exceptionpublic boolean isRequested()
public void setPersonal(boolean personal)
public boolean isPersonal()
public void cancel()
throws Exception
Exception
public void bind()
throws Exception
GramException - if error occurs during job registration.
GSSException - if user credentials are invalid.
Exception
public void unbind()
throws NoSuchResourceException,
Exception
NoSuchResourceException
Exception
public void destroy()
throws Exception
GramException - if error occurs during job service destruction.
Exceptionpublic boolean isLocallyDestroyed()
public void start()
throws Exception
Exceptionprotected void setError(int code)
code - error codepublic int getError()
public BaseFaultType getFault()
getStateAsString.equals(StateEnumeration._Failed))
public EndpointReferenceType getEndpoint()
public void setEndpoint(EndpointReferenceType endpoint)
throws Exception
Exceptionpublic String getHandle()
#getEndpointReference
Precondition: isRequested()
public void setHandle(String resourceHandle)
throws Exception
#setEndpointReference
Exceptionpublic void setStarted(boolean jobIsStarted)
public boolean isStarted()
public void setTimeOut(int timeout)
timeout - the timeout value, in milliseconds.public String toString()
public void deliver(List topicPath,
EndpointReferenceType producer,
Object message)
topicPath - The topic path for the topic that generated the
notificationproducer - The producer endpoint referencemessage - The notification message
public void refreshStatus()
throws Exception
Exception - if the service data cannot be fetched or
the job state not extracted from the data.
public static List getStartedJobs(EndpointReferenceType factoryEndpoint)
throws Exception
Exceptionpublic void setAuthorization(Authorization auth)
public Authorization getAuthorization()
public void setMessageProtectionType(Integer protectionType)
public Integer getMessageProtectionType()
public String getDelegationLevel()
public void setDuration(Date duration)
duration - the duration after which the job service should be
destroyed. The hours and minutes will be used.public void setTerminationTime(Date termTime)
public void setServiceTerminationTime()
throws Exception
Exception
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||