java.lang.Object
com.broadleafcommerce.data.tracking.core.messaging.search.domain.BatchIndexRequest
All Implemented Interfaces:
Serializable

public class BatchIndexRequest extends Object implements Serializable
Message object used to inform the solr index service of a large list of Indexable objects to index. Supported types are defined in BatchIndexableType.
Author:
Jeff Fischer
See Also:
  • Constructor Details

    • BatchIndexRequest

      public BatchIndexRequest(@NonNull @NonNull List<String> ids, @NonNull @NonNull BatchIndexableType batchIndexableType)
      This constructor is used to construct a BatchIndexRequest with a list of IDs that are to be indexed, and a String representation of the batch indexable type (e.g. 'PRODUCT'). This constructor GZip compresses the list of IDs and then Base64 encodes them for serialization so that IDs are not serialized as a list or array, but rather as a Base64 encoded, compressed string.
      Parameters:
      ids - A list of IDs to be (re)indexed
      batchIndexableType - The enum representation of a batch indexable type (e.g. BatchIndexableType.PRODUCT)
    • BatchIndexRequest

      public BatchIndexRequest(@NonNull @NonNull List<String> ids, @NonNull @NonNull String batchIndexableType)
      This constructor is used to construct a BatchIndexRequest with a list of IDs that are to be indexed, and a String representation of the batch indexable type (e.g. 'PRODUCT'). This constructor GZip compresses the list of IDs and then Base64 encodes them for serialization so that IDs are not serialized as a list or array, but rather as a Base64 encoded, compressed string.
      Parameters:
      ids - A list of IDs to be (re)indexed
      batchIndexableType - The name of a batch indexable type (e.g. 'PRODUCT')
    • BatchIndexRequest

      public BatchIndexRequest(@NonNull @NonNull String idPayload, @NonNull @NonNull String batchIndexableType)
      This constructor is required for JSON deserialization.
      Parameters:
      idPayload - The Base64 representation of a GZip List of Strings.
      batchIndexableType - The name of the batchIndexableType (e.g. 'PRODUCT')
  • Method Details

    • getIds

      public List<String> getIds()
      Returns a decompressed, decoded list of Strings. This is decoded from the idPayload. This value should not be serialized into JSON because the idPayload is already meant to be a representation of the IDs, except in a compressed format. Serializing the list of IDs would defeat the purpose of compressing them in the first place.
      Returns:
    • getIdPayload

      public String getIdPayload()
      The ids representing the items that should be indexed. This is really a Base64 encoded GZip representation of a List of Strings.
    • getBatchIndexableType

      public String getBatchIndexableType()
      The string representation of the valid BatchIndexableType
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object