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 classJobSpec.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 voidcomplete()Completing a job spec callsrefresh()java.lang.StringgetComments()Get the comments associated with this jobspec.java.lang.StringgetFieldPreset(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.voidrefresh()This method will refresh by getting the complete job spec model.voidsetComments(java.lang.String comments)Set the comments associated with this jobspec.voidsetFields(java.util.List<IJobSpec.IJobSpecField> fields)Set the list of all known Perforce job fields on this jobspec.voidsetPresets(java.util.Map<java.lang.String,java.lang.String> presets)Set the map of the possible presets for each known jobspec field.voidsetValues(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, AccessExceptionCompleting a job spec callsrefresh()- Specified by:
completein interfaceIServerResource- Overrides:
completein 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, AccessExceptionThis 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:
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:
ServerResource.refresh()
-
getComments
public java.lang.String getComments()
Description copied from interface:IJobSpecGet the comments associated with this jobspec.- Specified by:
getCommentsin 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:IJobSpecReturn a list of all known Perforce job fields on this jobspec.- Specified by:
getFieldsin 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:IJobSpecReturn a map of the possible presets for each known jobspec field.- Specified by:
getPresetsin 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:IJobSpecReturn a map of the values 'select' fields can have for each relevant jobspec field.- Specified by:
getValuesin 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:IJobSpecGet a list of field values for a given field.- Specified by:
getFieldValuesin 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:IJobSpecGet the preset for a given field.- Specified by:
getFieldPresetin 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:IJobSpecSet the comments associated with this jobspec.- Specified by:
setCommentsin 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:IJobSpecSet the list of all known Perforce job fields on this jobspec.- Specified by:
setFieldsin 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:IJobSpecSet the map of the possible presets for each known jobspec field.- Specified by:
setPresetsin 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:IJobSpecSet the map of the values 'select' fields can have for each relevant jobspec field.- Specified by:
setValuesin interfaceIJobSpec- Parameters:
values- value map- See Also:
IJobSpec.setValues(java.util.Map)
-
-