Interface IJobDelegator

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      IJob createJob​(java.util.Map<java.lang.String,​java.lang.Object> fieldMap)
      Create a new Perforce job in the Perforce server corresponding to the passed-in Perforce job fields (which in turn should correspond to at least the mandatory fields defined in the reigning Perforce job spec).
      java.lang.String deleteJob​(java.lang.String jobId)
      Delete a job from the Perforce server.
      IJob getJob​(java.lang.String jobId)
      Get a specific job.
      java.lang.String updateJob​(IJob job)
      Update a Perforce job on the Perforce server.
    • Method Detail

      • createJob

        IJob createJob​(@Nonnull
                       java.util.Map<java.lang.String,​java.lang.Object> fieldMap)
                throws ConnectionException,
                       RequestException,
                       AccessException
        Create a new Perforce job in the Perforce server corresponding to the passed-in Perforce job fields (which in turn should correspond to at least the mandatory fields defined in the reigning Perforce job spec).

        Perforce job semantics, field count and layout, etc., are to some extent free-form and specified for each server by the associated job spec (retrievable using the getJobSpec() method below), so map fields are passed to the Perforce server exactly as passed to the create method in the job's field map, so you need to know the field names and semantics given by the associated job spec. This includes setting the relevant job ID field to "new", but otherwise, no checking is done on fields in this method against the job spec (this may be added later).

        Parameters:
        fieldMap - non-null field map defining the new job in the Perforce server.
        Returns:
        returns an IJob representing the newly-created job, if successful.
        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
      • deleteJob

        java.lang.String deleteJob​(java.lang.String jobId)
                            throws ConnectionException,
                                   RequestException,
                                   AccessException
        Delete a job from the Perforce server. Note that this method does not change the status of the associated job locally, just on the Perforce server.
        Parameters:
        jobId - ID of the job to be deleted.
        Returns:
        possibly-null status message as returned from the server; this may include form trigger output pre-pended and / or appended to the "normal" message.
        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
      • getJob

        IJob getJob​(java.lang.String jobId)
             throws ConnectionException,
                    RequestException,
                    AccessException
        Get a specific job. Note that some implementations of the underlying server do not return null if you ask for a job that doesn't exist; you must do your own checking to see of what's returned represents a real job or not.
        Parameters:
        jobId - non-null job Id.
        Returns:
        IJob for the named job; null if no such job.
        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
      • updateJob

        java.lang.String updateJob​(@Nonnull
                                   IJob job)
                            throws ConnectionException,
                                   RequestException,
                                   AccessException
        Update a Perforce job on the Perforce server. Note that only the associated raw fields map is used for field values; the main description and ID fields are actually ignored.

        The returned string will contain whatever the Perforce server returned in response to this command; in general, if the update fails, an exception will be thrown, meaning that the returned string represents success only. There are two success states -- either the job was saved or it didn't need saving (it was the same after updating). Consumers should parse this accordingly.

        Parameters:
        job - non-null candidate for updating.
        Returns:
        possibly-null status message as returned from the server; this may include form trigger output pre-pended and / or appended to the "normal" message.
        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