Class DataHubDataFragment
java.lang.Object
com.hybris.datahub.core.services.impl.DataHubDataFragment
- All Implemented Interfaces:
ImpExFragment
A fragment containing data being loaded from the Data Hub
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds a line of the script to this block.booleanaddLine(String line, List<ImpExFragment> fragments) Adds a line of the script to this block.Reads back the content of this script block.Retrieves an input stream to read content of this fragment.protected DataHubFacadeRetrieves facade being used for communication with the Data Hub.Reads value of a specific header defined in this fragment.Reads headers present in this fragment.protected InputStreamgetUrl()Reads URL specified in this fragment.protected voidvalidateImpexHeader(String header, String macros)
-
Constructor Details
-
DataHubDataFragment
Instantiates this fragment.- Parameters:
daHub- implementation of the facade for communicating to the Data Hub.
-
-
Method Details
-
addLine
Description copied from interface:ImpExFragmentAdds a line of the script to this block.- Specified by:
addLinein interfaceImpExFragment- 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
Description copied from interface:ImpExFragmentAdds a line of the script to this block.- Specified by:
addLinein interfaceImpExFragment- 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
- Throws:
ImpExException
-
getImpexBody
- Throws:
IOException
-
getContent
Description copied from interface:ImpExFragmentReads back the content of this script block.- Specified by:
getContentin interfaceImpExFragment- 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
Description copied from interface:ImpExFragmentRetrieves an input stream to read content of this fragment.- Specified by:
getContentAsInputStreamin interfaceImpExFragment- Returns:
- an input stream to read content of this fragment.
- Throws:
IOException- if failed to create an input stream for the fragment content.
-
getDataHubFacade
Retrieves facade being used for communication with the Data Hub.- Returns:
- facade implementation.
-
getUrl
Reads URL specified in this fragment.- Returns:
- the URL to read data from.
-
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
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.
-