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 intSHORT_DESCR_LENGTHThe 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.StringgetDescription()protected java.lang.StringgetDescriptionString(java.util.Map<java.lang.String,java.lang.Object> map, boolean longDescriptions)java.lang.StringgetId()get job nameprotected java.lang.StringgetJobIdString(java.util.Map<java.lang.String,java.lang.Object> map)IJobSpecgetJobSpec()static JobnewJob(IServer server, java.util.Map<java.lang.String,java.lang.Object> map)Simple factory method for creating a new Job class.voidrefresh()This method will refresh by getting the complete job model.voidsetDescription(java.lang.String description)voidsetId(java.lang.String id)Set job namevoidsetJobSpec(IJobSpec jobSpec)voidupdate()Update the Perforce server object associated with the underlying P4Java object, if possible.java.lang.StringupdateOnServer()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, AccessExceptionThis method will refresh by getting the complete job model. If this refresh is successful then this job will be marked as complete.- Specified by:
refreshin interfaceIServerResource- Overrides:
refreshin 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, AccessExceptionDeprecated.use update() instead.Description copied from interface:IJobUpdate the underlying Perforce job associated with this object in the Perforce server.Basically a convenience method for IServer.updateJob(job).
- Specified by:
updateOnServerin 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, AccessExceptionDescription copied from interface:IServerResourceUpdate 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:
updatein interfaceIServerResource- Overrides:
updatein 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:
getDescriptionin interfaceIJob
-
getId
public java.lang.String getId()
get job name
-
getJobSpec
public IJobSpec getJobSpec()
- Specified by:
getJobSpecin interfaceIJob
-
setId
public void setId(java.lang.String id)
Set job name
-
setDescription
public void setDescription(java.lang.String description)
- Specified by:
setDescriptionin interfaceIJob
-
setJobSpec
public void setJobSpec(IJobSpec jobSpec)
- Specified by:
setJobSpecin 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)
-
-