Interface JobFile

    • Field Detail

      • VERSION_JOBFILE

        static final com.redwood.scheduler.infrastructure.logging.Versions VERSION_JOBFILE
      • PREFERRED_CHARACTERSET

        static final String PREFERRED_CHARACTERSET
        The character encoding that we prefer for output files.
        See Also:
        Constant Field Values
      • PREFERRED_CHARSET

        static final Charset PREFERRED_CHARSET
        The character encoding that we prefer for output files.
      • STANDARD_INTERNAL_LOG

        static final String STANDARD_INTERNAL_LOG
        The conventional name for the first job log file used for internal purposes. (eg. by the job processor on UNIX).
        See Also:
        Constant Field Values
      • STANDARD_ERROR

        static final String STANDARD_ERROR
        The conventional name for the first job error file. (eg. the standard error stream on UNIX).
        See Also:
        Constant Field Values
      • STANDARD_OUTPUT

        static final String STANDARD_OUTPUT
        The conventional name for the first job output file. (eg. the standard output stream on UNIX).
        See Also:
        Constant Field Values
      • STANDARD_OUTPUT_ORDER

        static final Long STANDARD_OUTPUT_ORDER
        Standard output file order constant.
      • STANDARD_ERROR_ORDER

        static final Long STANDARD_ERROR_ORDER
        Standard error file order constant.
      • STANDARD_INTERNAL_LOG_ORDER

        static final Long STANDARD_INTERNAL_LOG_ORDER
        Standard internal log file order constant.
      • STANDARD_JARIN_ORDER

        static final Long STANDARD_JARIN_ORDER
        Standard jarin file order constant.
      • STANDARD_CARIN_ORDER

        static final Long STANDARD_CARIN_ORDER
        Standard carin file order constant.
      • STANDARD_TUTORIALS_ORDER

        @Deprecated
        static final Long STANDARD_TUTORIALS_ORDER
        Deprecated.
        This constant is deprecated, do not use.

        Standard tutorials file order constant.

      • STANDARD_CAROUT_ORDER

        static final Long STANDARD_CAROUT_ORDER
        Standard carout file order constant.
      • STANDARD_AUDIT_ARCHIVE_ORDER

        static final Long STANDARD_AUDIT_ARCHIVE_ORDER
        Standard audit archive file order constant.
      • STANDARD_REPORT_ORDER

        static final Long STANDARD_REPORT_ORDER
        Standard report file order constant.
      • STANDARD_REPORT_ORDER_XML

        static final Long STANDARD_REPORT_ORDER_XML
        Standard report file as xml order constant.
      • STANDARD_ON_BEFORE_USER_JOB_CHANGE_ORDER

        static final Long STANDARD_ON_BEFORE_USER_JOB_CHANGE_ORDER
        Standard log file order constant for trigger OnBeforeUserJobChange constant.
      • STANDARD_ON_BEFORE_USER_JOB_CHANGE

        static final String STANDARD_ON_BEFORE_USER_JOB_CHANGE
        Standard OnBeforeUserJobChange file name.
        See Also:
        Constant Field Values
      • AS400_FILENUMBER_START

        static final Long AS400_FILENUMBER_START
        Standard AS/400 filenumber start file order constant.
      • SAP_FILENUMBER_START

        static final Long SAP_FILENUMBER_START
        Standard SAP filenumber start file order constant.
      • SAP_JOBLOG_ORDER

        static final Long SAP_JOBLOG_ORDER
        Standard SAP joblog file order constant.
      • SAP_STATISTICS_ORDER

        static final Long SAP_STATISTICS_ORDER
        Standard SAP job statistics file order constant.
      • SAP_SPOOLLISTS_ORDER_START

        static final Long SAP_SPOOLLISTS_ORDER_START
        Standard SAP filenumber start of spoollists file order constant.
      • SAP_SPOOLLIST_XLSX

        static final String SAP_SPOOLLIST_XLSX
        Standard SAP spoollist file in XLSX format.
        See Also:
        Constant Field Values
      • SAP_SPOOLLIST_HTML

        static final String SAP_SPOOLLIST_HTML
        Standard SAP spoollist file in HTML format.
        See Also:
        Constant Field Values
      • SAP_SPOOLLIST_MHTML

        static final String SAP_SPOOLLIST_MHTML
        Standard SAP spoollist file in MHTML format.
        See Also:
        Constant Field Values
      • SAP_SPOOLLISTID_MAPPING

        static final String SAP_SPOOLLISTID_MAPPING
        Additional output file with the mapping of the job file name to the spool id.
        See Also:
        Constant Field Values
      • SAP_SPOOLLISTID_MAPPING_ORDER

        static final Long SAP_SPOOLLISTID_MAPPING_ORDER
        Standard spool id mapping file order constant.
      • SAP_APPLLOGS_ORDER_START

        static final Long SAP_APPLLOGS_ORDER_START
        Standard SAP filenumber start of application logs file order constant.
      • SAP_CC_BASIC_LIST

        static final String SAP_CC_BASIC_LIST
        Standard SAP FCC basic list file in PDF format.
        See Also:
        Constant Field Values
      • SAP_CC_BASIC_LIST_ORDER

        static final Long SAP_CC_BASIC_LIST_ORDER
        Standard SAP filenumber of FCC basic lists file order constant.
      • SAP_CC_DETAIL_LIST

        static final String SAP_CC_DETAIL_LIST
        Standard SAP FCC detail list file in PDF format.
        See Also:
        Constant Field Values
      • SAP_CC_DETAIL_LIST_ORDER

        static final Long SAP_CC_DETAIL_LIST_ORDER
        Standard SAP filenumber of FCC detail list file order constant.
      • CUSTOMER_ORDER_START

        static final Long CUSTOMER_ORDER_START
        File order: start of customer defined files.
      • CUSTOMER_ORDER_END

        static final Long CUSTOMER_ORDER_END
        File order: end of customer defined files.
      • SAP_APPLLOG_PDF

        static final String SAP_APPLLOG_PDF
        Standard SAP job application log file in PDF format.
        See Also:
        Constant Field Values
      • SAP_APPLLOG_HTML

        static final String SAP_APPLLOG_HTML
        Standard SAP job application log file in HTML format.
        See Also:
        Constant Field Values
      • SAP_APPLLOG_MHTML

        static final String SAP_APPLLOG_MHTML
        Standard SAP job application log file in MHTML format.
        See Also:
        Constant Field Values
      • SAP_APPLLOG_DAT

        static final String SAP_APPLLOG_DAT
        Standard SAP job application log file in DAT format.
        See Also:
        Constant Field Values
      • SAP_APPLLOG_CSV

        static final String SAP_APPLLOG_CSV
        Standard SAP job application log file in CSV format.
        See Also:
        Constant Field Values
      • APPS_JOBLOG_ORDER

        static final Long APPS_JOBLOG_ORDER
        Standard Oracle Applications joblog file order constant.
      • APPS_OUTPUT_ORDER

        static final Long APPS_OUTPUT_ORDER
        Standard Oracle Applications output file order constant.
      • APPS_EXTRAOUTPUT_ORDER

        static final Long APPS_EXTRAOUTPUT_ORDER
        Extra Oracle Applications output file order constant.
      • OHI_JOBLOG_ORDER

        static final Long OHI_JOBLOG_ORDER
        Standard Oracle Health Insurance joblog file order constant.
      • OHI_OUTPUT_ORDER

        static final Long OHI_OUTPUT_ORDER
        Standard Oracle Health Insurance output file order constant.
      • STANDARD_UPLOAD_ORDER_START

        static final Long STANDARD_UPLOAD_ORDER_START
        File order: start of uploaded files range.
      • STANDARD_UPLOAD_ORDER_END

        static final Long STANDARD_UPLOAD_ORDER_END
        File order: end of uploaded files range.
      • STANDARD_EXPORT_INFO

        static final Long STANDARD_EXPORT_INFO
        Standard export-info.xml output file order constant.
      • STANDARD_SEARCH_RESULTS_ORDER

        static final Long STANDARD_SEARCH_RESULTS_ORDER
        Standard object search results file order constant.
      • STANDARD_SEARCH_RESULTS

        static final String STANDARD_SEARCH_RESULTS
        Standard object search results file name.
        See Also:
        Constant Field Values
    • Method Detail

      • getName

        String getName()
        Get the value for Name. (Short, standardized name of the file.) This value is mandatory, and therefore will not be null if this object has been retrieved from the database.
        Returns:
        the field
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getFileName

        String getFileName()
        Get the value for FileName. (Name of the file (usually a full operating system dependent name)) This value is mandatory, and therefore will not be null if this object has been retrieved from the database.
        Returns:
        the field
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getFileOrder

        Long getFileOrder()
        Get the value for FileOrder. (Order in which this file (relative to siblings) should be presented.) This value is mandatory, and therefore will not be null if this object has been retrieved from the database.
        Returns:
        the field
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getFileLastModificationTime

        DateTimeZone getFileLastModificationTime()
        Get the value for FileLastModificationTime. (When the file was last modified.)
        Returns:
        the field
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getSize

        Long getSize()
        Get the value for Size. (Length of the file in bytes.)
        Returns:
        the field
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getType

        JobFileType getType()
        Get the value for Type. (The type of file that this represents.) This value is mandatory, and therefore will not be null if this object has been retrieved from the database.
        Returns:
        the field
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • isInCommonLogFormat

        boolean isInCommonLogFormat()
        Get the value for InCommonLogFormat. (The file uses the common log format.)
        Returns:
        the field
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getCharacterSet

        String getCharacterSet()
        Get the value for CharacterSet. (Character set of the content of the file.)
        Returns:
        the field
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getViewerURL

        String getViewerURL()
        Get the value for ViewerURL. ( Viewer URL of this JobFile. The URL returned can either point to the contents of the JobFile or the processed information of this JobFile by one or more ExtensionPoints. )
        Returns:
        the field
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • isLinkedJobFile

        boolean isLinkedJobFile()
        Get the value for LinkedJobFile. (Check if this JobFile is linked to another JobFile.)
        Returns:
        the field
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setName

        void setName​(String newName)
        Set the value for Name. (Short, standardized name of the file.) This value is mandatory.
        Parameters:
        newName - the new value for Name. If this is null, then the object cannot be persisted.
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setInCommonLogFormat

        void setInCommonLogFormat​(boolean newInCommonLogFormat)
        Set the value for InCommonLogFormat. (The file uses the common log format.)
        Parameters:
        newInCommonLogFormat - the new value for InCommonLogFormat.
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setCharacterSet

        void setCharacterSet​(String newCharacterSet)
        Set the value for CharacterSet. (Character set of the content of the file.) This value is optional.
        Parameters:
        newCharacterSet - the new value for CharacterSet.
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getInputStream

        InputStream getInputStream​(Long offset,
                                   Long length)
                            throws JobFileException,
                                   JobFileTransientException
        Retrieve an input stream for this jobfile. For example, to return an InputStream on the JobFile ignoring first 6 and last 6 lines: JobFile.getInputStream("Hello World", 7L, -7L)
        Parameters:
        offset - Offset within the file at which the stream should be positioned.
        length - Length of the stream required.
        Returns:
        An input stream that corresponds to the jobfile.
        Throws:
        JobFileException - Failure to retrieve the job-file, likely permanent in nature.
        JobFileTransientException - Failure to retrieve the job-file, likely transient in nature.
      • getInputStream

        InputStream getInputStream​(String searchPattern,
                                   long beginLine,
                                   long endLine,
                                   long searchOptions)
                            throws JobFileException
        Retrieve an input stream for this jobfile. Parameters for this method allow for setting of filters to stream only certain information. For example, to search for "Hello World" case-insensitively in the whole JobFile and return an InputStream of all matching lines: JobFile.getInputStream("Hello World", 1L, -1L, SearchFile.IgnoreCaseCode + SearchFile.RangeResultCode)
        Parameters:
        searchPattern - A character pattern to search for.
        beginLine - The line to start searching at: 0 or 1 mean beginning of file and -1 means end of the file. Positive numbers are line number offsets from the beginning. Negative numbers are line number offsets from the end of the file. If SearchFile.ByteOffsetCode is included in the searchOptions then this is a byte offset starting at 0. A negative value is a byte offset from the end of the file. The line returned will start at or beyond the indicated byte offset, and will be a full line (assuming normal line lengths less than 1024.)
        endLine - The line to end searching at: 0 or 1 mean beginning of file and -1 means end of the file. Positive numbers are line number offsets from the beginning. Negative numbers are line number offsets from the end of the file. If SearchFile.ByteOffsetCode is included in the searchOptions then this is a byte offset starting at 0. A negative value is a byte offset from the end of the file. The line returned will start at or beyond the indicated byte offset, and will be a full line (assuming normal line lengths less than 1024.)
        searchOptions - A long representing the search options. You add-up the constants to specify multiple options. For example, WildCard, IgnoreCase, and RangeResult is specified as 1L+8L+32L so 41L (L for 'long' value) or a mathematical addition of the above constants.
        Returns:
        An input stream that corresponds to the jobfile.
        Throws:
        JobFileException - Failure to retrieve the job-file, likely permanent in nature.
      • getInputStream

        InputStream getInputStream​(String searchPattern,
                                   long beginLine,
                                   long endLine,
                                   SearchFile[] searchOptions)
                            throws JobFileException
        Retrieve an input stream for this jobfile. Parameters for this method allow for setting of filters to stream only certain information. For example, to search for "Hello World" case-insensitively in the whole JobFile and return an InputStream of all matching lines JobFile.getInputStream("Hello World", 1L, -1L, new SearchFile[]{SearchFile.IgnoreCase, SearchFile.RangeResultCode})
        Parameters:
        searchPattern - A character pattern to search for.
        beginLine - The line to start searching at: 0 or 1 mean beginning of file and -1 means end of the file. Positive numbers are line number offsets from the beginning. Negative numbers are line number offsets from the end of the file. If SearchFile.ByteOffsetCode is included in the searchOptions then this is a byte offset starting at 0. A negative value is a byte offset from the end of the file. The line returned will start at or beyond the indicated byte offset, and will be a full line (assuming normal line lengths less than 1024.)
        endLine - The line to end searching at: 0 or 1 mean beginning of file and -1 means end of the file. Positive numbers are line number offsets from the beginning. Negative numbers are line number offsets from the end of the file. If SearchFile.ByteOffsetCode is included in the searchOptions then this is a byte offset starting at 0. A negative value is a byte offset from the end of the file. The line returned will start at or beyond the indicated byte offset, and will be a full line (assuming normal line lengths less than 1024.)
        searchOptions - An array of SearchFile representing the search options.
        Returns:
        An input stream that corresponds to the jobfile.
        Throws:
        JobFileException - Failure to retrieve the job-file, likely permanent in nature.
      • getURLTail

        String getURLTail()
        Request the tail portion of an URL to retrieve the job-file. This can be appended to an URL that refers to the job-file servlet to form a complete URL that allows the job-file contents to be retrieved. This operation will be removed in the future; it will be replaced with an operation that returns an absolute URL.
        Returns:
        Portion of URL, without a leading '/' character.
      • search

        SearchResultSet search​(String pattern)
        Search the entire job file for a pattern (including ? and *) from the beginning to the end, in a case insensitive way. This is equivalent to calling: search(pattern, 1L, -1L, SearchFile.WildCardCode + SearchFile.IgnoreCaseCode)
        Parameters:
        pattern - The pattern to search for.
        Returns:
        A SearchResultSet, from where you can get the individual SearchResults.
      • search

        SearchResultSet search​(String pattern,
                               long beginLine,
                               long endLine,
                               int options)
        Search the job file for a pattern.
        Parameters:
        pattern - The pattern to search for. If SearchFile.WildCardCode is in the options then ? matches any character and * matches any sequence of characters. For example, to search for "Hello *@example.com" case insensitively and using * as a wildcard in the entire JobFile, returning all matched lines in a SearchResultSet: JobFile.search("Hello *@example.com", 1L, -1L, SearchFile.IgnoreCaseCode + SearchFile.RangeResultCode + SearchFile.WildCardCode)
        beginLine - The line to start searching at: 0 or 1 mean beginning and -1 means end of file. Positive numbers are line number offsets from the beginning. Negative numbers are line number offsets from the end of the file. If SearchFile.ByteOffsetCode is included in the options then this is a byte offset starting at 0. A negative value is a byte offset from the end of the file. The line returned will start at or beyond the indicated byte offset, and will be a full line (assuming normal line lengths less than 1024.)
        endLine - The line to start searching at: 0 or 1 mean beginning and -1 means end of file. Positive numbers are line number offsets from the beginning. Negative numbers are line number offsets from the end of the file. If SearchFile.ByteOffsetCode is included in the options then this is a byte offset starting at 0. A negative value is a byte offset from the end of the file. The line returned will start at or beyond the indicated byte offset, and will be a full line (assuming normal line lengths less than 1024.)
        options - Search file options, any combination of SearchFile options. See the 'searchOptions' of JobFile.getInputStream
        Returns:
        A SearchResultSet, from where you can get the individual SearchResults.
      • updateFromLocalFile

        void updateFromLocalFile()
        Set the size and last modification time (and time zone) information from a local file. The size and last modification time will be set from the local file specified by the job's FileName attribute. This method assumes that the file is local. The time zone will be set based on the System process server.
      • updateFromLocalFile

        void updateFromLocalFile​(TimeZone timeZone)
        Set the size and last modification time (and time zone) information from a local file. The size and last modification time will be set from the local file specified by the job's FileName attribute. This method assumes that the file is local. The time zone will be set to the specified time zone.
        Parameters:
        timeZone - Time zone.
      • setOrder

        void setOrder​(Long fileOrder)
        Set the file order (model attribute FileOrder). The value must not be null, and be between JobFile.CUSTOMER_ORDER_START and JobFile.CUSTOMER_ORDER_END (inclusive). If the value is not in this range then a RuntimeException will be thrown. The file order must be set to a different value for each file and the value must come from the range allocated to customer files.
        Parameters:
        fileOrder - The file order.
      • setFileNameAutomatic

        void setFileNameAutomatic()
        Set the file name to an automatically generated local name. The name will be generated based on process server parameters and values from the job and job file. This should be called after setting the short name (Name) and file order.
      • setFileType

        void setFileType​(JobFileType type)
        Set the file type.
        Parameters:
        type - The type
      • setFormat

        void setFormat​(Format newFormat)
        Set the value for Format. This value is mandatory.
        Parameters:
        newFormat - is the object to set Format to. The default format for a job file is the format given to the JobDefinition If this is null, then the object cannot be persisted.
      • setOwnerSubject

        void setOwnerSubject​(Subject newOwnerSubject)
        Set the value for OwnerSubject. This value is optional.
        Parameters:
        newOwnerSubject - is the object to set OwnerSubject to. Job files associated with / input by the subject.