All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.vertexium.elasticsearch5.bulk.UpdateBulkItem Maven / Gradle / Ivy

There is a newer version: 4.10.0
Show newest version
package org.vertexium.elasticsearch5.bulk;

import org.elasticsearch.action.update.UpdateRequest;
import org.vertexium.ElementLocation;

public class UpdateBulkItem extends BulkItem {
    private final String extendedDataTableName;
    private final String extendedDataRowId;

    public UpdateBulkItem(
        ElementLocation elementLocation,
        UpdateRequest updateRequest
    ) {
        this(elementLocation, null, null, updateRequest);
    }

    public UpdateBulkItem(
        ElementLocation elementLocation,
        String extendedDataTableName,
        String extendedDataRowId,
        UpdateRequest updateRequest
    ) {
        super(updateRequest.index(), elementLocation, updateRequest);
        this.extendedDataTableName = extendedDataTableName;
        this.extendedDataRowId = extendedDataRowId;
    }

    public ElementLocation getElementLocation() {
        return (ElementLocation) getElementId();
    }

    public String getExtendedDataTableName() {
        return extendedDataTableName;
    }

    public String getExtendedDataRowId() {
        return extendedDataRowId;
    }

    @Override
    public String toString() {
        return String.format(
            "%s {%s:%s%s}",
            UpdateBulkItem.class.getSimpleName(),
            getElementId().getElementType(),
            getElementId().getId(),
            getExtendedDataTableName() == null ? "" : String.format(" (%s:%s)", getExtendedDataTableName(), getExtendedDataRowId())
        );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy