Interface Exporter

  • All Superinterfaces:
    ExporterComp

    public interface Exporter
    extends ExporterComp
    Interface for exporting objects to a (job) file. This interface allows several objects to be specified for export via the methods: Once objects have been marked for export via this mechanism, they can be exported using the methods: These methods may be called multiple times to export the same set of objects.

    This interface is not expected to be synchronized; the results of multiple threads calling methods simultaneously are undefined.

    • Field Detail

      • COPYRIGHT_MESSAGE

        static final String COPYRIGHT_MESSAGE
    • Method Detail

      • exportObject

        void exportObject​(BusinessKeyObject object)
        Mark an object for export. Only objects that declare a business key can be exported. Note that not all objects that declare a business key can be exported.
        Parameters:
        object - The object to export.
      • exportObjects

        void exportObjects​(Iterator<? extends SchedulerEntity> objects)
        Mark a series of objects for export.
        Parameters:
        objects - Iterator over the objects to mark for export. All objects must be an instance of BusinessKeyObject.
      • exportSelectedObjects

        void exportSelectedObjects​(String sql)
        Mark for export all objects that match a query.
        Parameters:
        sql - an object SQL query that returns the objects to export.
      • addExportRuleSetXML

        void addExportRuleSetXML​(String newExportRuleSetXML)
        Call this method to add an XML representation of an ExportRuleSet, which will be added to the CAR file that is exported.
        Parameters:
        newExportRuleSetXML - The XML definition of the ExportRuleSet to add to the CAR file
      • exportSelectedObjects

        void exportSelectedObjects​(String sql,
                                   Object[] variables)
        Mark for export all objects that match a query.
        Parameters:
        sql - an object sql query that returns the objects to export.
        variables - variables to substitute where a ? occurs in the sql.
      • writeToFile

        void writeToFile​(String filename)
                  throws ExportException,
                         IOException,
                         LicenseException
        Export marked objects to a local file with the given name. If the file already exists, it will be overwritten.
        Parameters:
        filename - the name of the file to write to.
        Throws:
        ExportException - This is thrown if a problem occurs with the export of the marked objects.
        IOException - This is thrown if a problem occurs writing the export data to the supplied file.
        LicenseException - This is thrown if export functionality is not licensed.
      • writeToNewJobFile

        JobFile writeToNewJobFile​(Job job)
                           throws ExportException,
                                  IOException,
                                  LicenseException
        Export marked objects to a local job file that will be attached to the supplied job. The exporter has an implied local session; the supplied job need not be from within this local session, but the jobfile will be there.

        Note that because the jobfile is a new object, the local session must be persisted for the jobfile to be available.

        Parameters:
        job - the job to which the jobfile will be attached.
        Returns:
        the jobfile to which the export was written.
        Throws:
        ExportException - This is thrown if a problem occurs with the export of the marked objects.
        IOException - This is thrown if a problem occurs writing the export data to the supplied file.
        LicenseException - This is thrown if export functionality is not licensed.
      • getMarkedObjects

        RWIterable<SchedulerEntity> getMarkedObjects()
        Query the list of objects that are marked for export.
        Specified by:
        getMarkedObjects in interface ExporterComp
        Returns:
        an unmodifiable iterator over the set of objects that are marked for export.
      • reset

        void reset()
        Clear the list of objects that are marked for export.
      • setComment

        void setComment​(String comment)
        Set the comment on the car file. This is written in the export-info.
        Parameters:
        comment - the comment to set.