Class JobSpec
- java.lang.Object
-
- com.perforce.p4java.impl.generic.core.ServerResource
-
- com.perforce.p4java.impl.generic.core.JobSpec
-
- All Implemented Interfaces:
IJobSpec
,IServerResource
public class JobSpec extends ServerResource implements IJobSpec
Simple generic default implementation class for the IJobSpec interface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
JobSpec.JobSpecField
-
Nested classes/interfaces inherited from interface com.perforce.p4java.core.IJobSpec
IJobSpec.IJobSpecField
-
-
Field Summary
-
Fields inherited from class com.perforce.p4java.impl.generic.core.ServerResource
refreshable, server, updateable
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
complete()
Completing a job spec callsrefresh()
java.lang.String
getComments()
Get the comments associated with this jobspec.java.lang.String
getFieldPreset(java.lang.String fieldName)
Get the preset for a given field.java.util.List<IJobSpec.IJobSpecField>
getFields()
Return a list of all known Perforce job fields on this jobspec.java.util.List<java.lang.String>
getFieldValues(java.lang.String fieldName)
Get a list of field values for a given field.java.util.Map<java.lang.String,java.lang.String>
getPresets()
Return a map of the possible presets for each known jobspec field.java.util.Map<java.lang.String,java.util.List<java.lang.String>>
getValues()
Return a map of the values 'select' fields can have for each relevant jobspec field.void
refresh()
This method will refresh by getting the complete job spec model.void
setComments(java.lang.String comments)
Set the comments associated with this jobspec.void
setFields(java.util.List<IJobSpec.IJobSpecField> fields)
Set the list of all known Perforce job fields on this jobspec.void
setPresets(java.util.Map<java.lang.String,java.lang.String> presets)
Set the map of the possible presets for each known jobspec field.void
setValues(java.util.Map<java.lang.String,java.util.List<java.lang.String>> values)
Set the map of the values 'select' fields can have for each relevant jobspec field.-
Methods inherited from class com.perforce.p4java.impl.generic.core.ServerResource
canRefresh, canUpdate, clearRawFields, getRawField, getRawFields, hasRawField, parseDate, setRawField, setRawFields, setRefreshable, setServer, toDateString, update, 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, getRawField, getRawFields, hasRawField, setRawField, setRawFields, setServer, update, update, update
-
-
-
-
Constructor Detail
-
JobSpec
public JobSpec()
-
JobSpec
public JobSpec(java.util.Map<java.lang.String,java.lang.Object> map, IServer server)
-
-
Method Detail
-
complete
public void complete() throws ConnectionException, RequestException, AccessException
Completing a job spec callsrefresh()
- Specified by:
complete
in interfaceIServerResource
- Overrides:
complete
in classServerResource
- Throws:
ConnectionException
- when there is an error talking to the Helix serverRequestException
- when there is a problem with the data provided in the requestAccessException
- when access to the branch command is not authorised- See Also:
refresh()
,ServerResource.complete()
-
refresh
public void refresh() throws ConnectionException, RequestException, AccessException
This method will refresh by getting the complete job spec model. If this refresh is successful then this job spec 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:
ServerResource.refresh()
-
getComments
public java.lang.String getComments()
Description copied from interface:IJobSpec
Get the comments associated with this jobspec.- Specified by:
getComments
in interfaceIJobSpec
- Returns:
- possibly-null comments string. This may be rather large...
- See Also:
IJobSpec.getComments()
-
getFields
public java.util.List<IJobSpec.IJobSpecField> getFields()
Description copied from interface:IJobSpec
Return a list of all known Perforce job fields on this jobspec.- Specified by:
getFields
in interfaceIJobSpec
- Returns:
- non-null but possibly-empty list of IJobSpecField objects for all known job fields in this jobspec.
- See Also:
IJobSpec.getFields()
-
getPresets
public java.util.Map<java.lang.String,java.lang.String> getPresets()
Description copied from interface:IJobSpec
Return a map of the possible presets for each known jobspec field.- Specified by:
getPresets
in interfaceIJobSpec
- Returns:
- non-null but possibly-empty map of presets
- See Also:
IJobSpec.getPresets()
-
getValues
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getValues()
Description copied from interface:IJobSpec
Return a map of the values 'select' fields can have for each relevant jobspec field.- Specified by:
getValues
in interfaceIJobSpec
- Returns:
- non-null but possibly-empty map of select field value lists.
- See Also:
IJobSpec.getValues()
-
getFieldValues
public java.util.List<java.lang.String> getFieldValues(java.lang.String fieldName)
Description copied from interface:IJobSpec
Get a list of field values for a given field.- Specified by:
getFieldValues
in interfaceIJobSpec
- Parameters:
fieldName
- non-null field name- Returns:
- possibly-null list of field values for the field.
- See Also:
IJobSpec.getFieldValues(java.lang.String)
-
getFieldPreset
public java.lang.String getFieldPreset(java.lang.String fieldName)
Description copied from interface:IJobSpec
Get the preset for a given field.- Specified by:
getFieldPreset
in interfaceIJobSpec
- Parameters:
fieldName
- non-null field name- Returns:
- possibly-null preset for the named field.
- See Also:
IJobSpec.getFieldPreset(java.lang.String)
-
setComments
public void setComments(java.lang.String comments)
Description copied from interface:IJobSpec
Set the comments associated with this jobspec.- Specified by:
setComments
in interfaceIJobSpec
- Parameters:
comments
- jobspec comment string- See Also:
IJobSpec.setComments(java.lang.String)
-
setFields
public void setFields(java.util.List<IJobSpec.IJobSpecField> fields)
Description copied from interface:IJobSpec
Set the list of all known Perforce job fields on this jobspec.- Specified by:
setFields
in interfaceIJobSpec
- Parameters:
fields
- list of job fields- See Also:
IJobSpec.setFields(java.util.List)
-
setPresets
public void setPresets(java.util.Map<java.lang.String,java.lang.String> presets)
Description copied from interface:IJobSpec
Set the map of the possible presets for each known jobspec field.- Specified by:
setPresets
in interfaceIJobSpec
- Parameters:
presets
- map of presets- See Also:
IJobSpec.setPresets(java.util.Map)
-
setValues
public void setValues(java.util.Map<java.lang.String,java.util.List<java.lang.String>> values)
Description copied from interface:IJobSpec
Set the map of the values 'select' fields can have for each relevant jobspec field.- Specified by:
setValues
in interfaceIJobSpec
- Parameters:
values
- value map- See Also:
IJobSpec.setValues(java.util.Map)
-
-