com.perforce.p4java.impl.generic.core
Class Job

java.lang.Object
  extended by com.perforce.p4java.impl.generic.core.ServerResource
      extended by com.perforce.p4java.impl.generic.core.Job
All Implemented Interfaces:
IJob, IServerResource

public class Job
extends ServerResource
implements IJob

Simple generic default implementation class for the IJob interface.


Field Summary
 int SHORT_DESCR_LENGTH
          The max description length for "short" or summary descriptions
 
Fields inherited from class com.perforce.p4java.impl.generic.core.ServerResource
refreshable, server, updateable
 
Constructor Summary
Job(IServer server, java.util.Map<java.lang.String,java.lang.Object> map)
           
Job(IServer server, java.util.Map<java.lang.String,java.lang.Object> map, boolean longDescriptions)
           
 
Method Summary
 java.lang.String getDescription()
           
protected  java.lang.String getDescriptionString(java.util.Map<java.lang.String,java.lang.Object> map, boolean longDescriptions)
           
 java.lang.String getId()
           
protected  java.lang.String getJobIdString(java.util.Map<java.lang.String,java.lang.Object> map)
           
 IJobSpec getJobSpec()
           
 java.util.Map<java.lang.String,java.lang.Object> getRawFields()
           
 void refresh()
          This method will refresh by getting the complete job model.
 void setDescription(java.lang.String description)
           
 void setId(java.lang.String id)
           
 void setJobSpec(IJobSpec jobSpec)
           
 void setRawFields(java.util.Map<java.lang.String,java.lang.Object> rawFields)
           
 void update()
          Update the Perforce server object associated with the underlying P4Java object, if possible.
 java.lang.String updateOnServer()
          Update the underlying Perforce job associated with this object in the Perforce server.
 
Methods inherited from class com.perforce.p4java.impl.generic.core.ServerResource
canRefresh, canUpdate, complete, setRefreshable, setServer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.perforce.p4java.core.IServerResource
canRefresh, canUpdate, setServer
 

Field Detail

SHORT_DESCR_LENGTH

public int SHORT_DESCR_LENGTH
The max description length for "short" or summary descriptions

Constructor Detail

Job

public Job(IServer server,
           java.util.Map<java.lang.String,java.lang.Object> map)

Job

public Job(IServer server,
           java.util.Map<java.lang.String,java.lang.Object> map,
           boolean longDescriptions)
Method Detail

refresh

public void refresh()
             throws ConnectionException,
                    RequestException,
                    AccessException
This method will refresh by getting the complete job model. If this refresh is successful then this job will be marked as complete.

Specified by:
refresh in interface IServerResource
Overrides:
refresh in class ServerResource
Throws:
ConnectionException - if the Perforce server is unreachable or is not connected.
RequestException - if the Perforce server encounters an error during its processing of the request
AccessException - if the Perforce server denies access to the caller
See Also:
ServerResource.refresh()

updateOnServer

public java.lang.String updateOnServer()
                                throws ConnectionException,
                                       RequestException,
                                       AccessException
Description copied from interface: IJob
Update the underlying Perforce job associated with this object in the Perforce server.

Basically a convenience method for IServer.updateJob(job).

Specified by:
updateOnServer in interface IJob
Returns:
possibly-null Perforce server-generated status resulting from operation.
Throws:
ConnectionException - if the Perforce server is unreachable or is not connected.
RequestException - if the Perforce server encounters an error during its processing of the request
AccessException - if the Perforce server denies access to the caller
See Also:
NOTE: do not use this method if the server field has not been set.

update

public void update()
            throws ConnectionException,
                   RequestException,
                   AccessException
Description copied from interface: IServerResource
Update the Perforce server object associated with the underlying P4Java object, if possible. The semantics of server updates are generally object-specific and will be spelled out for each participating object.

The results of calling this method on objects whose canUpdate method returns false are undefined (but will generally result in a UnimplementedError being thrown).

Specified by:
update in interface IServerResource
Overrides:
update in class ServerResource
Throws:
ConnectionException - if the Perforce server is unreachable or is not connected.
RequestException - if the Perforce server encounters an error during its processing of the request
AccessException - if the Perforce server denies access to the caller
See Also:
IServerResource.update()

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface IJob
See Also:
IJob.getDescription()

getId

public java.lang.String getId()
Specified by:
getId in interface IJob
See Also:
IJob.getId()

getJobSpec

public IJobSpec getJobSpec()
Specified by:
getJobSpec in interface IJob
See Also:
IJob.getJobSpec()

getRawFields

public java.util.Map<java.lang.String,java.lang.Object> getRawFields()
Specified by:
getRawFields in interface IJob
See Also:
IJob.getRawFields()

setId

public void setId(java.lang.String id)
Specified by:
setId in interface IJob
See Also:
IJob.setId(java.lang.String)

setRawFields

public void setRawFields(java.util.Map<java.lang.String,java.lang.Object> rawFields)
Specified by:
setRawFields in interface IJob
See Also:
IJob.setRawFields(java.util.Map)

setDescription

public void setDescription(java.lang.String description)
Specified by:
setDescription in interface IJob
See Also:
IJob.setDescription(java.lang.String)

setJobSpec

public void setJobSpec(IJobSpec jobSpec)
Specified by:
setJobSpec in interface IJob
See Also:
IJob.setJobSpec(com.perforce.p4java.core.IJobSpec)

getJobIdString

protected java.lang.String getJobIdString(java.util.Map<java.lang.String,java.lang.Object> map)

getDescriptionString

protected java.lang.String getDescriptionString(java.util.Map<java.lang.String,java.lang.Object> map,
                                                boolean longDescriptions)


Copyright (c) 2008-2010 Perforce Software. All rights reserved.