class PipelineIdConverter implements ResponseIdConverter {

    @Override
    public Long getId(final BulkItemResponse response) {
        final String index = response.getIndex();
        if (pipelineIndexName.equals(index)) {
            return ResponseIdConverter.super.getId(response);
        }
        if (index.startsWith(pipelineCodeIndexPrefix)) {
            final String id = Utils.last(Arrays.asList(index.split("-")));
            return Long.parseLong(id);
        }
        throw new IllegalArgumentException(
                String.format("Cannot parse id for item {} index {}", response.getId(), index));
    }

}