Class DataHubImpExResourceFactory

  • All Implemented Interfaces:
    ImpExResourceFactory

    public class DataHubImpExResourceFactory
    extends java.lang.Object
    implements ImpExResourceFactory
    An implementation of the ImpEx resource factory for creating Data Hub specific impex resources.
    • Constructor Detail

      • DataHubImpExResourceFactory

        public DataHubImpExResourceFactory()
    • Method Detail

      • createScriptStream

        protected java.io.InputStream createScriptStream​(ItemImportTaskData ctx)
                                                  throws ImpExException
        Creates an input stream to read the final ImpEx script content, which includes the data, because the original script does not contain actual data.
        Throws:
        ImpExException - if the script is invalid or reading failed.
      • extractFragments

        protected java.util.List<ImpExFragment> extractFragments​(ItemImportTaskData ctx)
                                                          throws ImpExException
        Reads ImpEx script from the input stream and splits it into the logical fragments based on the script content.
        Parameters:
        ctx - a data object containing ImpEx data and errors
        Returns:
        a fragments of the script in the same order as they appear in the script or an empty list, if there is nothing in the input stream
        Throws:
        ImpExException - if the script is invalid or reading failed.
      • getFragmentReader

        protected FragmentReader getFragmentReader()
        Retrieves the fragment reader to be used by this factory for reading the ImpEx script.
        Returns:
        a reader to be used.
      • setFragmentReader

        public void setFragmentReader​(FragmentReader r)
        Specifies a reader to use for reading the ImpEx script.
        Parameters:
        r - a reader to use.