public class GramJob extends java.lang.Object implements GRAMConstants
Modifier and Type | Field and Description |
---|---|
protected int |
error |
protected int |
exitCode |
protected int |
status |
SIGNAL_CANCEL, SIGNAL_COMMIT_END, SIGNAL_COMMIT_EXTEND, SIGNAL_COMMIT_REQUEST, SIGNAL_PRIORITY, SIGNAL_RESUME, SIGNAL_STDIO_SIZE, SIGNAL_STDIO_UPDATE, SIGNAL_STOP_MANAGER, SIGNAL_SUSPEND, STATUS_ACTIVE, STATUS_ALL, STATUS_DONE, STATUS_FAILED, STATUS_PENDING, STATUS_STAGE_IN, STATUS_STAGE_OUT, STATUS_SUSPENDED, STATUS_UNSUBMITTED
Constructor and Description |
---|
GramJob(org.ietf.jgss.GSSCredential cred,
java.lang.String rsl)
Creates a gram job with specified rsl and
user credentials.
|
GramJob(java.lang.String rsl)
Creates a gram job with specified rsl with
default user credentials.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(GramJobListener listener)
Add a listener to the GramJob.
|
void |
bind()
Registers a callback listener for this job.
|
void |
cancel()
Cancels a job.
|
org.ietf.jgss.GSSCredential |
getCredentials()
Gets the credentials of this job.
|
int |
getError()
Gets the error of the job.
|
int |
getExitCode()
Allows querying the job exit code.
|
GlobusURL |
getID()
Gets the job handle of this job.
|
java.lang.String |
getIDAsString()
Gets the job handle of this job and
returns it as a string representaion.
|
java.lang.String |
getRSL()
Gets the rsl of this job.
|
int |
getStatus()
Gets the current status of this job.
|
java.lang.String |
getStatusAsString()
Get the status of the GramJob.
|
static java.lang.String |
getStatusAsString(int status)
Convert the status of a GramJob from an integer to a string.
|
boolean |
isExitCodeValid()
Can be used to determine whether the job exit code
returned by
getExitCode() is valid. |
void |
removeListener(GramJobListener listener)
Remove a listener from the GramJob.
|
void |
renew(org.ietf.jgss.GSSCredential newCred)
Requests that the job's delegated credentials be renewed/refreshed.
|
void |
renew(org.ietf.jgss.GSSCredential newCred,
boolean limitedDelegation)
Requests that the job's delegated credentials be renewed/refreshed.
|
void |
request(boolean forceSSLV3ForGram,
java.lang.String contact)
Submits a job to the specified gatekeeper as an
interactive job.
|
void |
request(boolean forceSSLV3ForGram,
java.lang.String contact,
boolean batch)
Submits a job to the specified gatekeeper either as
an interactive or batch job.
|
void |
request(boolean forceSSLV3ForGram,
java.lang.String contact,
boolean batch,
boolean limitedDelegation)
Submits a job to the specified gatekeeper either as
an interactive or batch job.
|
void |
request(java.lang.String contact)
Submits a job to the specified gatekeeper as an
interactive job.
|
void |
request(java.lang.String contact,
boolean batch)
Submits a job to the specified gatekeeper either as
an interactive or batch job.
|
void |
request(java.lang.String contact,
boolean batch,
boolean limitedDelegation)
Submits a job to the specified gatekeeper either as
an interactive or batch job.
|
void |
setCredentials(org.ietf.jgss.GSSCredential credential)
Sets credentials of the job
|
protected void |
setError(int code)
Sets the error code of the job.
|
protected void |
setExitCode(int exitCode)
Sets the job exit code.
|
void |
setID(java.lang.String jobUrl)
Sets the job handle.
|
protected void |
setStatus(int status)
Sets the status of the job.
|
int |
signal(int signal)
Sends a signal command to the job.
|
int |
signal(int signal,
java.lang.String arg)
Sends a signal command to the job.
|
java.lang.String |
toString()
Returns string representation of this job.
|
void |
unbind()
Unregisters a callback listener for this job.
|
public GramJob(java.lang.String rsl)
rsl
- resource specification stringpublic GramJob(org.ietf.jgss.GSSCredential cred, java.lang.String rsl)
cred
- user credentialsrsl
- resource specification stringpublic void addListener(GramJobListener listener)
listener
- The object that wishes to receive status updates.GramJobListener
public void removeListener(GramJobListener listener)
listener
- The object that wishes to stop receiving status updates.GramJobListener
public java.lang.String getRSL()
public org.ietf.jgss.GSSCredential getCredentials()
public void setCredentials(org.ietf.jgss.GSSCredential credential)
credential
- user credentialspublic void setID(java.lang.String jobUrl) throws java.net.MalformedURLException
jobUrl
- job handle in form of urljava.net.MalformedURLException
- if the job
handle is invalidpublic GlobusURL getID()
public java.lang.String getIDAsString()
public int getStatus()
protected void setStatus(int status)
status
- status of the jobprotected void setExitCode(int exitCode)
exitCode
- the job exit codepublic int getExitCode()
Allows querying the job exit code. It only makes sense
to retrieve the exit code after the job has completed. If
the job has not completed, or if the service did not provide
an exit code for this job, this method will return
0
and isExitCodeValid()
will return
false
.
0
if the service did
not provide one or the job has not completed.public boolean isExitCodeValid()
Can be used to determine whether the job exit code
returned by getExitCode()
is valid.
This method will return false
if either
of the following is true:
getExitCode()
represents the
actual process exit code of this job.public void request(java.lang.String contact) throws GramException, org.ietf.jgss.GSSException
false
.contact
- the resource manager contact.
The contact can be specified in number of ways for 1.1.3 gatekeepers:
GramException
- if error occurs during job submission.org.ietf.jgss.GSSException
- if user credentials are invalid.GlobusGSSContextImpl
public void request(boolean forceSSLV3ForGram, java.lang.String contact) throws GramException, org.ietf.jgss.GSSException
forceSSLV3ForGram
- Communication with GRAM servers will currently only succeed with
SSLv3 and a narrow set of cipher suites. So, applications attempting
communication with GRAM must set this to true to force the GSSAPI layer to constrain
JSSE to SSLv3 and SSL_RSA_WITH_3DES_EDE_CBC_SHA when confidentiality is requested via
requestConf() and SSL_RSA_WITH_NULL_SHA otherwise.
Also see gss/src/main/java/org/globus/gsi/gssapi/Java_GSI_GSSAPI.html.contact
- the resource manager contact.
The contact can be specified in number of ways for 1.1.3 gatekeepers:
GramException
- if error occurs during job submission.org.ietf.jgss.GSSException
- if user credentials are invalid.public void request(java.lang.String contact, boolean batch) throws GramException, org.ietf.jgss.GSSException
false
.contact
- the resource manager contact.batch
- specifies if the job should be submitted as
a batch job.GramException
- if error occurs during job submission.org.ietf.jgss.GSSException
- if user credentials are invalid.GlobusGSSContextImpl
,
for detailed resource manager
contact specification.
public void request(boolean forceSSLV3ForGram, java.lang.String contact, boolean batch) throws GramException, org.ietf.jgss.GSSException
forceSSLV3ForGram
- Communication with GRAM servers will currently only succeed with
SSLv3 and a narrow set of cipher suites. So, applications attempting
communication with GRAM must set this to true to force the GSSAPI layer to constrain
JSSE to SSLv3 and SSL_RSA_WITH_3DES_EDE_CBC_SHA when confidentiality is requested via
requestConf() and SSL_RSA_WITH_NULL_SHA otherwise.
Also see gss/src/main/java/org/globus/gsi/gssapi/Java_GSI_GSSAPI.html.contact
- the resource manager contact.batch
- specifies if the job should be submitted as
a batch job.GramException
- if error occurs during job submission.org.ietf.jgss.GSSException
- if user credentials are invalid.for detailed resource manager
contact specification.
public void request(java.lang.String contact, boolean batch, boolean limitedDelegation) throws GramException, org.ietf.jgss.GSSException
false
.contact
- the resource manager contact.batch
- specifies if the job should be submitted as
a batch job.limitedDelegation
- true for limited delegation, false for
full delegation.GramException
- if error occurs during job submission.org.ietf.jgss.GSSException
- if user credentials are invalid.GlobusGSSContextImpl
,
for detailed resource manager
contact specification.
public void request(boolean forceSSLV3ForGram, java.lang.String contact, boolean batch, boolean limitedDelegation) throws GramException, org.ietf.jgss.GSSException
forceSSLV3ForGram
- Communication with GRAM servers will currently only succeed with
SSLv3 and a narrow set of cipher suites. So, applications attempting
communication with GRAM must set this to true to force the GSSAPI layer to constrain
JSSE to SSLv3 and SSL_RSA_WITH_3DES_EDE_CBC_SHA when confidentiality is requested via
requestConf() and SSL_RSA_WITH_NULL_SHA otherwise.
Also see gss/src/main/java/org/globus/gsi/gssapi/Java_GSI_GSSAPI.html.contact
- the resource manager contact.batch
- specifies if the job should be submitted as
a batch job.limitedDelegation
- true for limited delegation, false for
full delegation.GramException
- if error occurs during job submission.org.ietf.jgss.GSSException
- if user credentials are invalid.for detailed resource manager
contact specification.
public void renew(org.ietf.jgss.GSSCredential newCred) throws GramException, org.ietf.jgss.GSSException
newCred
- The credentials to use in the delegation processGramException
- if a connection/comunication error occurs or if
delegation failedorg.ietf.jgss.GSSException
- if a GSSAPI error occurspublic void renew(org.ietf.jgss.GSSCredential newCred, boolean limitedDelegation) throws GramException, org.ietf.jgss.GSSException
newCred
- The credentials to use in the delegation processlimitedDelegation
- Whether to use limited or full delegated proxyGramException
- if a connection/comunication error occurs or if
delegation failedorg.ietf.jgss.GSSException
- if a GSSAPI error occurspublic void cancel() throws GramException, org.ietf.jgss.GSSException
GramException
- if error occurs during job cancelation.org.ietf.jgss.GSSException
- if user credentials are invalid.public void bind() throws GramException, org.ietf.jgss.GSSException
GramException
- if error occurs during job registration.org.ietf.jgss.GSSException
- if user credentials are invalid.public void unbind() throws GramException, org.ietf.jgss.GSSException
GramException
- if error occurs during job unregistration.org.ietf.jgss.GSSException
- if user credentials are invalid.public int signal(int signal, java.lang.String arg) throws GramException, org.ietf.jgss.GSSException
signal
- signal typearg
- argument of signalGramException
- if error occurs during signalization.org.ietf.jgss.GSSException
- if user credentials are invalid.public int signal(int signal) throws GramException, org.ietf.jgss.GSSException
signal
- signal typeGramException
- if error occurs during signalization.org.ietf.jgss.GSSException
- if user credentials are invalid.protected void setError(int code)
code
- error codepublic int getError()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getStatusAsString()
public static java.lang.String getStatusAsString(int status)
Copyright © 2013. All Rights Reserved.