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

java.lang.Object
  extended by com.perforce.p4java.impl.generic.core.ServerResource
      extended by 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
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
 
Constructor Summary
JobSpec()
           
JobSpec(Map<String,Object> map, IServer server)
           
 
Method Summary
 void complete()
          Completing a job spec calls refresh() and updates the #isComplete() flag.
 String getComments()
          Get the comments associated with this jobspec.
 String getFieldPreset(String fieldName)
          Get the preset for a given field.
 List<IJobSpec.IJobSpecField> getFields()
          Return a list of all known Perforce job fields on this jobspec.
 List<String> getFieldValues(String fieldName)
          Get a list of field values for a given field.
 Map<String,String> getPresets()
          Return a map of the possible presets for each known jobspec field.
 Map<String,List<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(String comments)
          Set the comments associated with this jobspec.
 void setFields(List<IJobSpec.IJobSpecField> fields)
          Set the list of all known Perforce job fields on this jobspec.
 void setPresets(Map<String,String> presets)
          Set the map of the possible presets for each known jobspec field.
 void setValues(Map<String,List<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, setRefreshable, setServer, 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, setServer, update, update, update
 

Constructor Detail

JobSpec

public JobSpec()

JobSpec

public JobSpec(Map<String,Object> map,
               IServer server)
Method Detail

complete

public void complete()
              throws ConnectionException,
                     RequestException,
                     AccessException
Completing a job spec calls refresh() and updates the #isComplete() flag.

Overrides:
complete in class ServerResource
Throws:
ConnectionException
RequestException
AccessException
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 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()

getComments

public String getComments()
Description copied from interface: IJobSpec
Get the comments associated with this jobspec.

Specified by:
getComments in interface IJobSpec
Returns:
possibly-null comments string. This may be rather large...
See Also:
IJobSpec.getComments()

getFields

public 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 interface IJobSpec
Returns:
non-null but possibly-empty list of IJobSpecField objects for all known job fields in this jobspec.
See Also:
IJobSpec.getFields()

getPresets

public Map<String,String> getPresets()
Description copied from interface: IJobSpec
Return a map of the possible presets for each known jobspec field.

Specified by:
getPresets in interface IJobSpec
Returns:
non-null but possibly-empty map of presets
See Also:
IJobSpec.getPresets()

getValues

public Map<String,List<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 interface IJobSpec
Returns:
non-null but possibly-empty map of select field value lists.
See Also:
IJobSpec.getValues()

getFieldValues

public List<String> getFieldValues(String fieldName)
Description copied from interface: IJobSpec
Get a list of field values for a given field.

Specified by:
getFieldValues in interface IJobSpec
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 String getFieldPreset(String fieldName)
Description copied from interface: IJobSpec
Get the preset for a given field.

Specified by:
getFieldPreset in interface IJobSpec
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(String comments)
Description copied from interface: IJobSpec
Set the comments associated with this jobspec.

Specified by:
setComments in interface IJobSpec
Parameters:
comments - jobspec comment string
See Also:
IJobSpec.setComments(java.lang.String)

setFields

public void setFields(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 interface IJobSpec
Parameters:
fields - list of job fields
See Also:
IJobSpec.setFields(java.util.List)

setPresets

public void setPresets(Map<String,String> presets)
Description copied from interface: IJobSpec
Set the map of the possible presets for each known jobspec field.

Specified by:
setPresets in interface IJobSpec
Parameters:
presets - map of presets
See Also:
IJobSpec.setPresets(java.util.Map)

setValues

public void setValues(Map<String,List<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 interface IJobSpec
Parameters:
values - value map
See Also:
IJobSpec.setValues(java.util.Map)


Copyright © 2015 Perforce Software. All Rights Reserved.