|
||||||||||
| 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 | |
private Authorization |
authorization
|
private int |
axisStubTimeOut
|
private static java.lang.String |
BASE_SERVICE_PATH
|
static Authorization |
DEFAULT_AUTHZ
|
static int |
DEFAULT_DURATION_HOURS
|
static java.lang.Integer |
DEFAULT_MSG_PROTECTION
|
private static java.lang.String |
DEFAULT_SECURITY_TYPE
|
static int |
DEFAULT_TIMEOUT
|
private boolean |
delegationEnabled
|
protected org.apache.axis.message.addressing.EndpointReferenceType |
delegationFactoryEndpoint
|
private boolean |
destroyed
|
private java.util.Date |
duration
|
private int |
error
|
private int |
exitCode
|
private org.globus.exec.generated.FaultType |
fault
|
private boolean |
holding
|
private static org.globus.util.I18n |
i18n
|
private java.lang.String |
id
|
private org.globus.exec.generated.JobDescriptionType |
jobDescription
|
private org.apache.axis.message.addressing.EndpointReferenceType |
jobEndpointReference
|
private java.lang.String |
jobHandle
|
private boolean |
limitedDelegation
|
private java.util.Vector |
listeners
|
private static org.apache.commons.logging.Log |
logger
|
private java.lang.Integer |
msgProtectionType
|
private org.apache.axis.message.addressing.EndpointReferenceType |
notificationConsumerEPR
|
private NotificationConsumerManager |
notificationConsumerManager
|
private org.apache.axis.message.addressing.EndpointReferenceType |
notificationProducerEPR
|
private boolean |
personal
|
private static java.lang.String |
PERSONAL_SERVICE_PATH
|
private org.ietf.jgss.GSSCredential |
proxy
|
private java.lang.String |
securityType
|
private static java.lang.String |
SERVICE_PATH
|
protected org.apache.axis.message.addressing.EndpointReferenceType |
stagingDelegationFactoryEndpoint
|
private org.globus.exec.generated.StateEnumeration |
state
|
private java.lang.Object |
stateMonitor
|
private java.util.Date |
terminationDate
|
private boolean |
useDefaultNotificationConsumer
|
| Constructor Summary | |
GramJob()
Creates a gram job with no RSL. |
|
GramJob(java.io.File rslFile)
Creates a gram job with specified file containing the rsl. |
|
GramJob(org.globus.exec.generated.JobDescriptionType jobDescription)
Creates a gram job with specified job description. |
|
GramJob(java.lang.String rsl)
Creates a gram job with specified rsl. |
|
| Method Summary | |
private static void |
addDefaultDurationTo(java.util.Calendar currentTime)
|
void |
addListener(GramJobListener listener)
Add a listener to the GramJob. |
private java.lang.String[] |
addPathToArray(java.lang.String[] pathArray,
java.lang.String newPath)
|
void |
bind()
Registers a callback listener for this job. |
void |
cancel()
Cancels a job. |
private java.lang.String |
catenate(java.lang.String baseURL,
java.lang.String path)
|
private org.apache.axis.message.addressing.EndpointReferenceType |
createJobEndpoint(org.globus.exec.generated.ManagedJobFactoryPortType factoryPort,
boolean batch)
|
private org.apache.axis.message.addressing.EndpointReferenceType |
delegate(org.apache.axis.message.addressing.EndpointReferenceType delegationFactoryEndpoint,
boolean limitedDelegation)
|
void |
deliver(java.util.List topicPath,
org.apache.axis.message.addressing.EndpointReferenceType producer,
java.lang.Object message)
Deliver the notification message |
private org.globus.exec.generated.FaultType |
deserializeFaultRP(javax.xml.soap.SOAPElement any)
|
void |
destroy()
Precondition: isRequested() Postcondition: isLocallyDestroyed() |
private void |
destroyDelegatedCredential(org.apache.axis.message.addressing.EndpointReferenceType credentialEndpoint)
|
private void |
destroyDelegatedCredentials()
|
private void |
destroyTransferDelegatedCredential(org.globus.exec.generated.JobDescriptionType jobDescription)
|
org.apache.axis.message.addressing.EndpointReferenceType[] |
fetchDelegationFactoryEndpoints(org.apache.axis.message.addressing.EndpointReferenceType factoryEndpoint)
|
Authorization |
getAuthorization()
|
org.ietf.jgss.GSSCredential |
getCredentials()
Gets the credentials of this job. |
private static java.util.Calendar |
getDefaultTerminationTime()
|
java.lang.String |
getDelegationLevel()
|
org.globus.exec.generated.JobDescriptionType |
getDescription()
|
org.apache.axis.message.addressing.EndpointReferenceType |
getEndpoint()
Precondition: isRequested() |
int |
getError()
Gets the error of the job. |
int |
getExitCode()
|
org.globus.exec.generated.FaultType |
getFault()
Return information about the cause of a job failure (when getStateAsString.equals(StateEnumeration._Failed)) |
private org.globus.exec.generated.FaultType |
getFaultFromRP(org.globus.exec.generated.FaultResourcePropertyType fault)
|
java.lang.String |
getHandle()
Can be used instead of #getEndpointReference
Precondition: isRequested() |
java.lang.String |
getID()
|
static java.util.List |
getJobs(org.apache.axis.message.addressing.EndpointReferenceType factoryEndpoint)
|
private org.globus.exec.generated.ManagedJobFactoryPortType |
getManagedJobFactoryPortType(org.apache.axis.message.addressing.EndpointReferenceType factoryEndpoint)
|
java.lang.Integer |
getMessageProtectionType()
|
org.apache.axis.message.addressing.EndpointReferenceType |
getNotificationConsumerEPR()
|
java.lang.String |
getSecurityType()
|
org.globus.exec.generated.StateEnumeration |
getState()
Get the current state of this job. |
private java.util.Calendar |
getTerminationTime()
get termination time of managed job service based on parameters specified as JavaBean properties on this object. |
boolean |
isDelegationEnabled()
|
boolean |
isHolding()
|
boolean |
isLocallyDestroyed()
|
boolean |
isMultiJob()
|
boolean |
isPersonal()
|
boolean |
isRequested()
Returns true if the job has been requested. |
boolean |
isSingleJob()
|
private void |
populateJobDescriptionEndpoints(org.apache.axis.message.addressing.EndpointReferenceType mjFactoryEndpoint)
|
private void |
populateStagingDescriptionEndpoints(org.apache.axis.message.addressing.EndpointReferenceType mjFactoryEndpoint,
org.apache.axis.message.addressing.EndpointReferenceType delegationFactoryEndpoint,
org.globus.exec.generated.JobDescriptionType jobDescription)
|
void |
prependBaseURLtoStageInSources(java.lang.String baseURL)
|
void |
prependBaseURLtoStageOutDestinations(java.lang.String baseURL)
|
private void |
refreshRSLAttributes()
Gets submitted RSL from remote Managed Job Service. |
void |
refreshStatus()
Asks the job service for its state,i.e. |
void |
release()
|
void |
removeListener(GramJobListener listener)
Remove a listener from the GramJob. |
void |
setAuthorization(Authorization authz)
|
void |
setCredentials(org.ietf.jgss.GSSCredential newProxy)
Sets credentials of the job |
void |
setDelegationEnabled(boolean delegationEnabled)
|
void |
setDuration(java.util.Date duration)
The default lifetime of the resource is 24 hours. |
void |
setEndpoint(org.apache.axis.message.addressing.EndpointReferenceType endpoint)
|
protected void |
setError(int code)
Sets the error code of the job. |
private void |
setFault(org.globus.exec.generated.FaultType fault)
|
void |
setHandle(java.lang.String handle)
Can be used instead of #setEndpointReference |
void |
setMessageProtectionType(java.lang.Integer protectionType)
|
void |
setNotificationConsumerEPR(org.apache.axis.message.addressing.EndpointReferenceType notificationConsumerEPR)
|
void |
setPersonal(boolean personal)
|
void |
setSecurityType(java.lang.String securityType)
|
private void |
setSecurityTypeFromEndpoint(org.apache.axis.message.addressing.EndpointReferenceType epr)
|
void |
setServiceTerminationTime()
Set TerminationTime RP of managed job service based on parameters specified as JavaBean properties on this object. |
private void |
setState(org.globus.exec.generated.StateEnumeration state,
boolean holding)
Sets the state of the job and update the local state listeners. |
private void |
setStubSecurityProperties(javax.xml.rpc.Stub stub)
|
void |
setTerminationTime(java.util.Date termTime)
|
void |
setTimeOut(int timeout)
Set timeout for HTTP socket. |
private void |
setupNotificationConsumer()
|
private void |
setupNotificationConsumerManager()
|
void |
submit(org.apache.axis.message.addressing.EndpointReferenceType factoryEndpoint)
Submits an interactive i.e. |
void |
submit(org.apache.axis.message.addressing.EndpointReferenceType factoryEndpoint,
boolean batch)
Submits a job with limited delegation. |
void |
submit(org.apache.axis.message.addressing.EndpointReferenceType factoryEndpoint,
boolean batch,
boolean limitedDelegation,
java.lang.String jobId)
|
java.lang.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 |
private static org.apache.commons.logging.Log logger
private static org.globus.util.I18n i18n
public static final int DEFAULT_DURATION_HOURS
private static final java.lang.String DEFAULT_SECURITY_TYPE
public static final java.lang.Integer DEFAULT_MSG_PROTECTION
public static final Authorization DEFAULT_AUTHZ
private java.lang.String securityType
private java.lang.Integer msgProtectionType
private Authorization authorization
private org.ietf.jgss.GSSCredential proxy
private boolean limitedDelegation
private boolean delegationEnabled
private boolean personal
private org.globus.exec.generated.JobDescriptionType jobDescription
private org.apache.axis.message.addressing.EndpointReferenceType jobEndpointReference
private java.lang.String jobHandle
private java.lang.String id
private org.globus.exec.generated.FaultType fault
private org.globus.exec.generated.StateEnumeration state
private java.lang.Object stateMonitor
private boolean holding
private int error
private int exitCode
private java.util.Vector listeners
private boolean destroyed
private java.util.Date duration
private java.util.Date terminationDate
private boolean useDefaultNotificationConsumer
private NotificationConsumerManager notificationConsumerManager
private org.apache.axis.message.addressing.EndpointReferenceType notificationConsumerEPR
private org.apache.axis.message.addressing.EndpointReferenceType notificationProducerEPR
public static final int DEFAULT_TIMEOUT
private int axisStubTimeOut
private static final java.lang.String BASE_SERVICE_PATH
private static final java.lang.String SERVICE_PATH
private static final java.lang.String PERSONAL_SERVICE_PATH
protected org.apache.axis.message.addressing.EndpointReferenceType delegationFactoryEndpoint
protected org.apache.axis.message.addressing.EndpointReferenceType stagingDelegationFactoryEndpoint
| Constructor Detail |
public GramJob()
#setEndpoint().
public GramJob(org.globus.exec.generated.JobDescriptionType jobDescription)
public GramJob(java.io.File rslFile)
throws org.globus.exec.utils.rsl.RSLParseException,
java.io.FileNotFoundException
rslFile - file with job specification
public GramJob(java.lang.String rsl)
throws org.globus.exec.utils.rsl.RSLParseException
rsl - resource specification string| 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 org.ietf.jgss.GSSCredential getCredentials()
public void setCredentials(org.ietf.jgss.GSSCredential newProxy)
newProxy - user credentials
java.lang.IllegalArgumentException - if credentials are already setpublic org.globus.exec.generated.StateEnumeration getState()
private void setState(org.globus.exec.generated.StateEnumeration state,
boolean holding)
state - state of the jobpublic boolean isHolding()
public void submit(org.apache.axis.message.addressing.EndpointReferenceType factoryEndpoint)
throws java.lang.Exception
java.lang.Exceptionfor explanation
of parameters
public void submit(org.apache.axis.message.addressing.EndpointReferenceType factoryEndpoint,
boolean batch)
throws java.lang.Exception
java.lang.Exceptionfor explanation
of parameters
public void submit(org.apache.axis.message.addressing.EndpointReferenceType factoryEndpoint,
boolean batch,
boolean limitedDelegation,
java.lang.String jobId)
throws java.lang.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.jobId - For reliable service instance creation, use the specified jobId
to allow repeated, reliable attempts to submit the job submission
in the presence of an unreliable transport.
java.lang.Exceptionfor detailed resource manager
contact specification.private void setSecurityTypeFromEndpoint(org.apache.axis.message.addressing.EndpointReferenceType epr)
private void populateJobDescriptionEndpoints(org.apache.axis.message.addressing.EndpointReferenceType mjFactoryEndpoint)
throws java.lang.Exception
java.lang.Exception
private void populateStagingDescriptionEndpoints(org.apache.axis.message.addressing.EndpointReferenceType mjFactoryEndpoint,
org.apache.axis.message.addressing.EndpointReferenceType delegationFactoryEndpoint,
org.globus.exec.generated.JobDescriptionType jobDescription)
throws java.lang.Exception
java.lang.Exception
public org.apache.axis.message.addressing.EndpointReferenceType[] fetchDelegationFactoryEndpoints(org.apache.axis.message.addressing.EndpointReferenceType factoryEndpoint)
throws java.lang.Exception
java.lang.Exception
private org.apache.axis.message.addressing.EndpointReferenceType delegate(org.apache.axis.message.addressing.EndpointReferenceType delegationFactoryEndpoint,
boolean limitedDelegation)
throws java.lang.Exception
java.lang.Exception
private java.lang.String[] addPathToArray(java.lang.String[] pathArray,
java.lang.String newPath)
pathArray - String[] oldnewPath - String
private java.lang.String catenate(java.lang.String baseURL,
java.lang.String path)
public void prependBaseURLtoStageInSources(java.lang.String baseURL)
public void prependBaseURLtoStageOutDestinations(java.lang.String baseURL)
public org.globus.exec.generated.JobDescriptionType getDescription()
throws java.lang.Exception
java.lang.Exception
private org.apache.axis.message.addressing.EndpointReferenceType createJobEndpoint(org.globus.exec.generated.ManagedJobFactoryPortType factoryPort,
boolean batch)
throws java.lang.Exception
java.lang.Exception
private void setupNotificationConsumerManager()
throws org.ietf.jgss.GSSException,
ContainerException
org.ietf.jgss.GSSException
ContainerException
private void setupNotificationConsumer()
throws SecurityDescriptorException,
ResourceException
SecurityDescriptorException
ResourceExceptionpublic boolean isRequested()
public void setPersonal(boolean personal)
public boolean isPersonal()
private org.globus.exec.generated.ManagedJobFactoryPortType getManagedJobFactoryPortType(org.apache.axis.message.addressing.EndpointReferenceType factoryEndpoint)
throws java.lang.Exception
java.lang.Exception
public void cancel()
throws java.lang.Exception
java.lang.Exception
public void bind()
throws java.lang.Exception
GramException - if error occurs during job registration.
org.ietf.jgss.GSSException - if user credentials are invalid.
java.lang.Exception
public void unbind()
throws NoSuchResourceException,
java.lang.Exception
NoSuchResourceException
java.lang.Exception
public void destroy()
throws java.lang.Exception
GramException - if error occurs during job service destruction.
java.lang.Exception
private void destroyDelegatedCredentials()
throws java.lang.Exception
java.lang.Exception
private void destroyTransferDelegatedCredential(org.globus.exec.generated.JobDescriptionType jobDescription)
throws java.lang.Exception
java.lang.Exception
private void destroyDelegatedCredential(org.apache.axis.message.addressing.EndpointReferenceType credentialEndpoint)
throws java.lang.Exception
java.lang.Exceptionpublic boolean isLocallyDestroyed()
public void release()
throws java.lang.Exception
java.lang.Exceptionprotected void setError(int code)
code - error codepublic int getError()
public org.globus.exec.generated.FaultType getFault()
getStateAsString.equals(StateEnumeration._Failed))
public org.apache.axis.message.addressing.EndpointReferenceType getEndpoint()
public void setEndpoint(org.apache.axis.message.addressing.EndpointReferenceType endpoint)
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String getID()
public java.lang.String getHandle()
#getEndpointReference
Precondition: isRequested()
public void setHandle(java.lang.String handle)
throws java.lang.Exception
#setEndpointReference
java.lang.Exceptionpublic int getExitCode()
public void setTimeOut(int timeout)
timeout - the timeout value, in milliseconds.public java.lang.String toString()
public void deliver(java.util.List topicPath,
org.apache.axis.message.addressing.EndpointReferenceType producer,
java.lang.Object message)
deliver in interface NotifyCallbacktopicPath - The topic path for the topic that generated the
notificationproducer - The producer endpoint referencemessage - The notification message
private void setFault(org.globus.exec.generated.FaultType fault)
throws java.lang.Exception
java.lang.Exceptionprivate org.globus.exec.generated.FaultType getFaultFromRP(org.globus.exec.generated.FaultResourcePropertyType fault)
private org.globus.exec.generated.FaultType deserializeFaultRP(javax.xml.soap.SOAPElement any)
throws DeserializationException
DeserializationException
public void refreshStatus()
throws java.lang.Exception
java.lang.Exception - if the service data cannot be fetched or
the job state not extracted from the data.
private void refreshRSLAttributes()
throws java.lang.Exception
getRSLAttributes afterwards.
Preconditionjob has been submitted
java.lang.Exception
public static java.util.List getJobs(org.apache.axis.message.addressing.EndpointReferenceType factoryEndpoint)
throws java.lang.Exception
java.lang.Exceptionprivate void setStubSecurityProperties(javax.xml.rpc.Stub stub)
public void setAuthorization(Authorization authz)
public Authorization getAuthorization()
public void setSecurityType(java.lang.String securityType)
public java.lang.String getSecurityType()
public void setMessageProtectionType(java.lang.Integer protectionType)
public java.lang.Integer getMessageProtectionType()
public java.lang.String getDelegationLevel()
public void setDelegationEnabled(boolean delegationEnabled)
public boolean isDelegationEnabled()
public void setDuration(java.util.Date duration)
duration - the duration after which the job service should be
destroyed. The hours and minutes will be used.public void setTerminationTime(java.util.Date termTime)
private java.util.Calendar getTerminationTime()
throws java.lang.Exception
java.lang.Exception
public void setServiceTerminationTime()
throws java.lang.Exception
java.lang.Exceptionprivate static void addDefaultDurationTo(java.util.Calendar currentTime)
private static java.util.Calendar getDefaultTerminationTime()
public boolean isSingleJob()
public boolean isMultiJob()
public org.apache.axis.message.addressing.EndpointReferenceType getNotificationConsumerEPR()
public void setNotificationConsumerEPR(org.apache.axis.message.addressing.EndpointReferenceType notificationConsumerEPR)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||