Class ExportDelegator

    • Constructor Detail

      • ExportDelegator

        public ExportDelegator​(IOptionsServer server)
        Instantiate a new ExportDelegator, providing the server object that will be used to execute Perforce Helix attribute commands.
        Parameters:
        server - a concrete implementation of a Perforce Helix Server
    • Method Detail

      • getExportRecords

        public java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> getExportRecords​(boolean useJournal,
                                                                                                       long maxRecs,
                                                                                                       int sourceNum,
                                                                                                       long offset,
                                                                                                       boolean format,
                                                                                                       java.lang.String journalPrefix,
                                                                                                       java.lang.String filter)
                                                                                                throws ConnectionException,
                                                                                                       RequestException,
                                                                                                       AccessException
        Description copied from interface: IExportDelegator
        Get a list of exported journal or checkpoint records (admin / superuser command).

        See the main p4 export command documentation for full semantics and usage details.

        Note that the 'skip*' options in ExportRecordsOptions are specific to P4Java only; they are not Perforce command options. These options are for field handling rules in the lower layers of P4Java. The field rules are for identifying the fields that should skip charset translation of their values; leaving their values as bytes instead of converting them to strings. Please see ExportRecordsOptions for usage details.

        Specified by:
        getExportRecords in interface IExportDelegator
        Parameters:
        useJournal - *If true, specifies a journal number and optional offset position (journal number/offset) from which to start exporting. Corresponds to the '-j token' flag.

        If false, specifies a checkpoint number and optional offset position (checkpoint number#offset) from which to start exporting. Corresponds to the '-c token' flag.

        maxRecs - If greater than zero, limits the number of lines (records) exported. Corresponds to the '-l lines' flag.
        sourceNum - If positive, specifies a journal or checkpoint number. Corresponds to the 'token' part of the '-j token' and '-c token' flags.

        The '-j token' flag specifies a journal number and optional position (in the form: journal number/offset) from which to start exporting. The -c token flag specifies a checkpoint number and optional position (in the form: checkpoint number#offset) from which to start exporting.

        offset - If positive, specifies a journal or checkpoint optional offset position (journal number/offset or checkpoint number#offset) from which to start exporting.
        format - If true, formats non-textual datatypes appropriately. Corresponds to the '-f' flag.
        journalPrefix - If non-null, specifies a file name prefix to match the one used with 'p4d -jc prefix'. Corresponds to the '-J' flag.
        filter - If non-null, limits output to records that match the filter pattern. Corresponds to the '-F' flag.
        Returns:
        export records list
        Throws:
        ConnectionException - on error
        RequestException - on error
        AccessException - on error
      • getExportRecords

        public java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> getExportRecords​(ExportRecordsOptions opts)
                                                                                                throws P4JavaException
        Description copied from interface: IExportDelegator
        Get a list of exported journal or checkpoint records (admin / superuser command).

        See the main p4 export command documentation for full semantics and usage details.

        Note that the 'skip*' options in ExportRecordsOptions are specific to P4Java only; they are not Perforce command options. These options are for field handling rules in the lower layers of P4Java. The field rules are for identifying the fields that should skip charset translation of their values; leaving their values as bytes instead of converting them to strings. Please see ExportRecordsOptions for usage details.

        Specified by:
        getExportRecords in interface IExportDelegator
        Parameters:
        opts - ExportRecordsOptions object describing optional parameters; if null, no options are set.
        Returns:
        non-null but possibly empty list of maps representing exported journal or checkpoint records.
        Throws:
        P4JavaException - if an error occurs processing this method and its parameters.
      • getStreamingExportRecords

        public void getStreamingExportRecords​(ExportRecordsOptions opts,
                                              @Nonnull
                                              IStreamingCallback callback,
                                              int key)
                                       throws P4JavaException
        Description copied from interface: IExportDelegator
        Get each exported journal or checkpoint record (admin / superuser command) as it comes in from the server, rather than waiting for the entire command to complete.

        The results are sent to the user using the IStreamingCallback handleResult method; see the IStreamingCallback Javadoc for details. The payload passed to handleResult is usually the raw map gathered together deep in the RPC protocol layer, and the user is assumed to have the knowledge and technology to be able to parse it and use it suitably in much the same way as a user unpacks or processes the results from the other low-level exec methods like execMapCommand.

        See the main p4 export command documentation for full semantics and usage details.

        Note that the 'skip*' options in ExportRecordsOptions are specific to P4Java only; they are not Perforce command options. These options are for field handling rules in the lower layers of P4Java. The field rules are for identifying the fields that should skip charset translation of their values; leaving their values as bytes instead of converting them to strings. Please see ExportRecordsOptions for usage details.

        Specified by:
        getStreamingExportRecords in interface IExportDelegator
        Parameters:
        opts - ExportRecordsOptions object describing optional parameters; if null, no options are set.
        callback - a non-null IStreamingCallback to be used to process the incoming results.
        key - an opaque integer key that is passed to the IStreamingCallback callback methods to identify the action as being associated with this specific call.
        Throws:
        P4JavaException - if an error occurs processing this method and its parameters.