Class DataHubDataFragment

java.lang.Object
com.hybris.datahub.core.services.impl.DataHubDataFragment
All Implemented Interfaces:
ImpExFragment

public class DataHubDataFragment extends Object implements ImpExFragment
A fragment containing data being loaded from the Data Hub
  • Constructor Details

    • DataHubDataFragment

      public DataHubDataFragment(DataHubFacade daHub)
      Instantiates this fragment.
      Parameters:
      daHub - implementation of the facade for communicating to the Data Hub.
  • Method Details

    • addLine

      public boolean addLine(String line)
      Description copied from interface: ImpExFragment
      Adds a line of the script to this block.
      Specified by:
      addLine in interface ImpExFragment
      Parameters:
      line - a line of script text
      Returns:
      true, if the line is added; false, if the line does not belong to this block.
    • addLine

      public boolean addLine(String line, List<ImpExFragment> fragments)
      Description copied from interface: ImpExFragment
      Adds a line of the script to this block.
      Specified by:
      addLine in interface ImpExFragment
      Parameters:
      line - a line of script text
      Returns:
      true, if the line is added; false, if the line does not belong to this block.
    • validateImpexHeader

      protected void validateImpexHeader(String header, String macros) throws ImpExException
      Throws:
      ImpExException
    • getImpexBody

      protected InputStream getImpexBody() throws IOException
      Throws:
      IOException
    • getContent

      public String getContent() throws IOException
      Description copied from interface: ImpExFragment
      Reads back the content of this script block.
      Specified by:
      getContent in interface ImpExFragment
      Returns:
      content of this script block or an empty string, if this block is empty.
      Throws:
      IOException - if failed to read this fragment content.
    • getContentAsInputStream

      public InputStream getContentAsInputStream() throws IOException
      Description copied from interface: ImpExFragment
      Retrieves an input stream to read content of this fragment.
      Specified by:
      getContentAsInputStream in interface ImpExFragment
      Returns:
      an input stream to read content of this fragment.
      Throws:
      IOException - if failed to create an input stream for the fragment content.
    • getDataHubFacade

      protected DataHubFacade getDataHubFacade()
      Retrieves facade being used for communication with the Data Hub.
      Returns:
      facade implementation.
    • getUrl

      public String getUrl()
      Reads URL specified in this fragment.
      Returns:
      the URL to read data from.
    • getHeaders

      public Map<String,String> getHeaders()
      Reads headers present in this fragment.
      Returns:
      a map of the HTTP headers to pass to the Integration Layer; an empty map, if no headers defined in this fragment.
    • getHeader

      public String getHeader(String header)
      Reads value of a specific header defined in this fragment.
      Parameters:
      header - name of the header to read.
      Returns:
      value of the specified header or null, if the specified header is not defined in this fragment.