Class Job
- java.lang.Object
-
- com.perforce.p4java.impl.generic.core.ServerResource
-
- 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
Fields Modifier and Type Field Description static 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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description 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()
get job nameprotected java.lang.String
getJobIdString(java.util.Map<java.lang.String,java.lang.Object> map)
IJobSpec
getJobSpec()
static Job
newJob(IServer server, java.util.Map<java.lang.String,java.lang.Object> map)
Simple factory method for creating a new Job class.void
refresh()
This method will refresh by getting the complete job model.void
setDescription(java.lang.String description)
void
setId(java.lang.String id)
Set job namevoid
setJobSpec(IJobSpec jobSpec)
void
update()
Update the Perforce server object associated with the underlying P4Java object, if possible.java.lang.String
updateOnServer()
Deprecated.use update() instead.-
Methods inherited from class com.perforce.p4java.impl.generic.core.ServerResource
canRefresh, canUpdate, clearRawFields, complete, getRawField, getRawFields, hasRawField, parseDate, setRawField, setRawFields, setRefreshable, setServer, toDateString, update, update
-
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, clearRawFields, complete, getRawField, getRawFields, hasRawField, setRawField, setRawFields, setServer, update, update
-
-
-
-
Method Detail
-
newJob
public static Job newJob(IServer server, java.util.Map<java.lang.String,java.lang.Object> map)
Simple factory method for creating a new Job class.- Parameters:
server
- non-null IServer to be associated with this job.map
- non-null fields map for the job to be created.- Returns:
- new Job object
-
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 interfaceIServerResource
- Overrides:
refresh
in classServerResource
- 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 requestAccessException
- if the Perforce server denies access to the caller- See Also:
IServerResource.refresh()
-
updateOnServer
@Deprecated public java.lang.String updateOnServer() throws ConnectionException, RequestException, AccessException
Deprecated.use update() instead.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 interfaceIJob
- 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 requestAccessException
- if the Perforce server denies access to the caller
-
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 interfaceIServerResource
- Overrides:
update
in classServerResource
- 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 requestAccessException
- if the Perforce server denies access to the caller- See Also:
IServerResource.update()
-
getDescription
public java.lang.String getDescription()
- Specified by:
getDescription
in interfaceIJob
-
getId
public java.lang.String getId()
get job name
-
getJobSpec
public IJobSpec getJobSpec()
- Specified by:
getJobSpec
in interfaceIJob
-
setId
public void setId(java.lang.String id)
Set job name
-
setDescription
public void setDescription(java.lang.String description)
- Specified by:
setDescription
in interfaceIJob
-
setJobSpec
public void setJobSpec(IJobSpec jobSpec)
- Specified by:
setJobSpec
in interfaceIJob
-
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)
-
-