Interface DataHubOutboundService

All Known Implementing Classes:
DefaultDataHubOutboundService

public interface DataHubOutboundService
A service for sending CSV formatted Raw Item data to a DataHub instance.

The Data Hub must be running the CSV Data Hub extension.

The URL location of the Data Hub must be configured in the hybris Core platform using the datahubadapter.datahuboutbound.url property in config/local.properties. ie. datahubadapter.datahuboutbound.url=http://{host}:{port}/datahub-webapp/v1

Dates are converted to UTC time zone and pattern formatted before sending to the Data Hub. The date format pattern can be specified by setting the datahubadapter.datahuboutbound.date.pattern property in config/local.properties. ie. datahubadapter.datahuboutbound.date.pattern=yyyy-MM-dd HH:mm:ss.S

Collection is not supported as a property of the Object or the value of a Map.Entry in a Map.

  • Method Details

    • sendToDataHub

      ResultData sendToDataHub(String feedName, String rawType, Object obj) throws DataHubOutboundException
      Sends the specified Object to the DataHub as a Raw Item in CSV format.

      > Collection are not supported as object properties and will be ignored. Properties with null values will be ignored.

      The object's property names are appended to the CSV header. The string value of the object's properties will be appended to the CSV body.

      Parameters:
      feedName - the name of the Data Feed
      rawType - the Raw Type to create in the DataHub
      obj - the object to send to Data Hub
      Returns:
      the result of the deletion
      Throws:
      DataHubCommunicationException - if communication with the Data Hub server failed
      DataHubOutboundException - if the Data Hub server was unable to successfully complete the export operation
    • sendToDataHub

      ResultData sendToDataHub(String rawType, Object obj) throws DataHubOutboundException
      Sends the specified Object to the DataHub as a Raw Item in CSV format.

      Collection are not supported as object properties and will be ignored. Properties with null values will be ignored.

      The object's property names are appended to the CSV header. The string value of the object's properties will be appended to the CSV body.

      The value of the feedName is defaulted to DEFAULT_FEED.

      Parameters:
      rawType - the Raw Type to create in the DataHub
      obj - the object to send to Data Hub
      Returns:
      the result of the deletion
      Throws:
      DataHubCommunicationException - if communication with the Data Hub server failed
      DataHubOutboundException - if the Data Hub server was unable to successfully complete the export operation
    • sendToDataHub

      ResultData sendToDataHub(String feedName, String rawType, Map<String,Object> objectMap) throws DataHubOutboundException
      Sends the specified Map to the DataHub as a Raw Item in CSV format.

      Collection are not supported as Map.Entry values and will be ignored.

      The Map keys are used as values in the CSV header. The string value of Map.Entry values will be used in the CSV body.

      Parameters:
      feedName - the name of the Data Feed
      rawType - the Raw Type to create in the DataHub
      objectMap - the Map of key/value pairs to send to Data Hub. The key represents the field name
      Returns:
      the result of the deletion
      Throws:
      DataHubCommunicationException - if communication with the Data Hub server failed
      DataHubOutboundException - if the Data Hub server was unable to successfully complete the export operation
    • sendToDataHub

      ResultData sendToDataHub(String rawType, Map<String,Object> objectMap) throws DataHubOutboundException
      Sends the specified Map to the DataHub as a Raw Item in CSV format.

      Collection are not supported as Map.Entry values and will be ignored.

      The value of the feedName is defaulted to DEFAULT_FEED.

      Parameters:
      rawType - the Raw Type to create in the DataHub
      objectMap - the Map of key/value pairs to send to Data Hub. The key represents the field name
      Returns:
      the result of the deletion
      Throws:
      DataHubCommunicationException - if communication with the Data Hub server failed
      DataHubOutboundException - if the Data Hub server was unable to successfully complete the export operation
    • sendToDataHub

      ResultData sendToDataHub(String feedName, String rawType, List<Map<String,Object>> objList) throws DataHubOutboundException
      Sends the specified List of Maps to the DataHub as Raw Items in CSV format.

      Collection are not supported as Map.Entry values and will be ignored.

      CSV header is populated using the keys from the first Map in the List. Each Map in the List should contain the same keys.

      Parameters:
      feedName - the name of the Data Feed
      rawType - the Raw Type to create in the DataHub
      objList - a List of Maps. Each Map represents one row of CSV data to send to Data Hub.
      Returns:
      the result of the deletion
      Throws:
      DataHubCommunicationException - if communication with the Data Hub server failed
      DataHubOutboundException - if the Data Hub server was unable to successfully complete the export operation
    • sendToDataHub

      ResultData sendToDataHub(String rawType, List<Map<String,Object>> objList) throws DataHubOutboundException
      Sends the specified List of Maps to the DataHub as Raw Items in CSV format.

      Collection are not supported as Map.Entry values and will be ignored.

      CSV header is populated using the keys from the first Map in the List. Each Map in the List should contain the same keys.

      The value of the feedName is defaulted to DEFAULT_FEED.

      Parameters:
      rawType - the Raw Type to create in the DataHub
      objList - a List of Maps. Each Map represents one row of CSV data to send to Data Hub.
      Returns:
      the result of the deletion
      Throws:
      DataHubCommunicationException - if communication with the Data Hub server failed
      DataHubOutboundException - if the Data Hub server was unable to successfully complete the export operation
    • deleteItem

      ResultData deleteItem(String poolName, String canonicalItemType, Map<String,String> keyFields) throws DataHubOutboundException
      Deletes item with an integration key comprised of the specified primary keys, of the type specified, in the pool specified on the Data Hub server
      Parameters:
      poolName - name of the data pool the item to be deleted resides in
      canonicalItemType - type code for the item to delete
      keyFields - map of primary key attribute names and values to uniquely identify the item to be deleted
      Returns:
      the result of the deletion
      Throws:
      DataHubCommunicationException - if communication with the Data Hub server failed
      DataHubOutboundException - if the Data Hub server was unable to successfully complete the export operation
    • deleteItem

      ResultData deleteItem(String canonicalItemType, Map<String,String> keyFields) throws DataHubOutboundException
      Deletes item with an integration key comprised of the specified primary keys, of the type specified, in the GLOBAL pool on the Data Hub server
      Parameters:
      canonicalItemType - type code for the item to delete
      keyFields - map of primary key attribute names and values to uniquely identify the item to be deleted
      Returns:
      the result of the deletion
      Throws:
      DataHubCommunicationException - if communication with the Data Hub server failed
      DataHubOutboundException - if the Data Hub server was unable to successfully complete the export operation
    • deleteByFeed

      ResultData deleteByFeed(String feedName, String rawItemType) throws DataHubOutboundException
      Deletes all items originating from the data feed and raw type specified
      Parameters:
      feedName - Name of the data feed the items originated from
      rawItemType - Name of the raw type the items originated from
      Returns:
      the result of the deletion
      Throws:
      DataHubCommunicationException - if communication with the Data Hub server failed
      DataHubOutboundException - if the Data Hub server was unable to successfully complete the export operation
    • deleteByFeed

      ResultData deleteByFeed(String rawItemType) throws DataHubOutboundException
      Deletes all items originating from the DEFAULT_FEED on the Data Hub server and raw type specified and the
      Parameters:
      rawItemType - Name of the raw type the items originated from
      Returns:
      the result of the deletion
      Throws:
      DataHubCommunicationException - if communication with the Data Hub server failed
      DataHubOutboundException - if the Data Hub server was unable to successfully complete the export operation
    • deleteByFeed

      ResultData deleteByFeed(String feedName, String rawItemType, Map<String,Object> objectMap) throws DataHubOutboundException
      Deletes all canonical items composed from the specified raw item.
      Parameters:
      feedName - Name of the data feed item originated from
      rawItemType - Name of the raw type the item originated from
      objectMap - map attribute values for the object to delete. The key in the map is the attribute name, the value is the attribute value. The map must contain at least all primary key attribute values.
      Returns:
      the result of the deletion
      Throws:
      DataHubCommunicationException - if communication with the Data Hub server failed
      DataHubOutboundException - if the Data Hub server was unable to successfully complete the export operation
    • deleteByFeed

      ResultData deleteByFeed(String rawItemType, Map<String,Object> objectMap) throws DataHubOutboundException
      Deletes all canonical items in the default data pool composed from the specified raw item.
      Parameters:
      rawItemType - Name of the raw type the item originated from
      objectMap - map attribute values for the object to delete. The key in the map is the attribute name, the value is the attribute value. The map must contain at least all primary key attribute values.
      Returns:
      the result of the deletion
      Throws:
      DataHubCommunicationException - if communication with the Data Hub server failed
      DataHubOutboundException - if the Data Hub server was unable to successfully complete the export operation