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

org.vertexium.elasticsearch5.ElasticsearchElement Maven / Gradle / Ivy

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

import com.google.common.collect.ImmutableSet;
import org.vertexium.*;
import org.vertexium.historicalEvent.HistoricalEvent;
import org.vertexium.historicalEvent.HistoricalEventId;
import org.vertexium.mutation.ExistingElementMutation;
import org.vertexium.query.QueryableIterable;

import java.util.stream.Stream;

public abstract class ElasticsearchElement extends ElementBase {
    private final Graph graph;
    private FetchHints fetchHints;
    private String id;
    private Authorizations authorizations;

    public ElasticsearchElement(
        Graph graph,
        String id,
        FetchHints fetchHints,
        Authorizations authorizations
    ) {
        this.id = id;
        this.graph = graph;
        this.fetchHints = fetchHints;
        this.authorizations = authorizations;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public Iterable getProperties() {
        throw new VertexiumNotSupportedException("getProperties is not supported");
    }

    @Override
    public Property getProperty(String name) {
        throw new VertexiumNotSupportedException("getProperty is not supported");
    }

    @Override
    public Object getPropertyValue(String name) {
        throw new VertexiumNotSupportedException("getPropertyValue is not supported");
    }

    @Override
    public Property getProperty(String key, String name) {
        throw new VertexiumNotSupportedException("getProperty is not supported");
    }

    @Override
    public Iterable getPropertyValues(String name) {
        throw new VertexiumNotSupportedException("getPropertyValues is not supported");
    }

    @Override
    public Iterable getPropertyValues(String key, String name) {
        throw new VertexiumNotSupportedException("getPropertyValues is not supported");
    }

    @Override
    public Object getPropertyValue(String key, String name) {
        throw new VertexiumNotSupportedException("getPropertyValue is not supported");
    }

    @Override
    public Object getPropertyValue(String name, int index) {
        throw new VertexiumNotSupportedException("getPropertyValue is not supported");
    }

    @Override
    public Object getPropertyValue(String key, String name, int index) {
        throw new VertexiumNotSupportedException("getPropertyValue is not supported");
    }

    @Override
    public Visibility getVisibility() {
        throw new VertexiumNotSupportedException("getVisibility is not supported");
    }

    @Override
    public long getTimestamp() {
        throw new VertexiumNotSupportedException("getTimestamp is not supported");
    }

    @Override
    public Stream getHistoricalEvents(
        HistoricalEventId after,
        HistoricalEventsFetchHints fetchHints,
        Authorizations authorizations
    ) {
        throw new VertexiumNotSupportedException("getHistoricalEvents is not supported");
    }

    @Override
    public  ExistingElementMutation prepareMutation() {
        throw new VertexiumNotSupportedException("prepareMutation is not supported");
    }

    @Override
    @Deprecated
    public void softDeleteProperty(String key, String name, Visibility visibility, Object eventData, Authorizations authorizations) {
        throw new VertexiumNotSupportedException("softDeleteProperty is not supported");
    }

    @Override
    public GraphWithSearchIndex getGraph() {
        return (GraphWithSearchIndex) graph;
    }

    @Override
    public Authorizations getAuthorizations() {
        return authorizations;
    }

    @Override
    @Deprecated
    public void markPropertyHidden(
        Property property,
        Long timestamp,
        Visibility visibility,
        Object data,
        Authorizations authorizations
    ) {
        throw new VertexiumNotSupportedException("markPropertyHidden is not supported");
    }

    @Override
    public boolean isHidden(Authorizations authorizations) {
        throw new VertexiumNotSupportedException("isHidden is not supported");
    }

    @Override
    public Iterable getHiddenVisibilities() {
        throw new VertexiumNotSupportedException("getHiddenVisibilities is not supported");
    }

    @Override
    public ImmutableSet getAdditionalVisibilities() {
        throw new VertexiumNotSupportedException("getAdditionalVisibilities is not supported");
    }

    @Override
    public ImmutableSet getExtendedDataTableNames() {
        throw new VertexiumNotSupportedException("getExtendedDataTableNames is not supported");
    }

    @Override
    public QueryableIterable getExtendedData(String tableName, FetchHints fetchHints) {
        throw new VertexiumNotSupportedException("getExtendedData is not supported");
    }

    @Override
    public FetchHints getFetchHints() {
        return fetchHints;
    }
}