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

com.arangodb.ArangoVertexCollectionAsync Maven / Gradle / Ivy

/*
 * DISCLAIMER
 *
 * Copyright 2016 ArangoDB GmbH, Cologne, Germany
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Copyright holder is ArangoDB GmbH, Cologne, Germany
 */

package com.arangodb;

import java.util.concurrent.CompletableFuture;

import com.arangodb.entity.VertexEntity;
import com.arangodb.entity.VertexUpdateEntity;
import com.arangodb.model.DocumentReadOptions;
import com.arangodb.model.VertexCreateOptions;
import com.arangodb.model.VertexDeleteOptions;
import com.arangodb.model.VertexReplaceOptions;
import com.arangodb.model.VertexUpdateOptions;

/**
 * Interface for operations on ArangoDB vertex collection level.
 * 
 * @see API Documentation
 * @author Mark Vollmary
 */
public interface ArangoVertexCollectionAsync extends ArangoSerializationAccessor {

	/**
	 * The the handler of the named graph the edge collection is within
	 * 
	 * @return graph handler
	 */
	ArangoGraphAsync graph();

	/**
	 * The name of the edge collection
	 * 
	 * @return collection name
	 */
	String name();

	/**
	 * Removes a vertex collection from the graph and optionally deletes the collection, if it is not used in any other
	 * graph
	 * 
	 * @see API
	 *      Documentation
	 * @return void
	 */
	CompletableFuture drop();

	/**
	 * Creates a new vertex in the collection
	 * 
	 * @see API Documentation
	 * @param value
	 *            A representation of a single vertex (POJO, VPackSlice or String for Json)
	 * @return information about the vertex
	 */
	 CompletableFuture insertVertex(final T value);

	/**
	 * Creates a new vertex in the collection
	 * 
	 * @see API Documentation
	 * @param value
	 *            A representation of a single vertex (POJO, VPackSlice or String for Json)
	 * @param options
	 *            Additional options, can be null
	 * @return information about the vertex
	 */
	 CompletableFuture insertVertex(final T value, final VertexCreateOptions options);

	/**
	 * Fetches an existing vertex
	 * 
	 * @see API Documentation
	 * @param key
	 *            The key of the vertex
	 * @param type
	 *            The type of the vertex-document (POJO class, VPackSlice or String for Json)
	 * @return the vertex identified by the key
	 */
	 CompletableFuture getVertex(final String key, final Class type);

	/**
	 * Fetches an existing vertex
	 * 
	 * @see API Documentation
	 * @param key
	 *            The key of the vertex
	 * @param type
	 *            The type of the vertex-document (POJO class, VPackSlice or String for Json)
	 * @param options
	 *            Additional options, can be null
	 * @return the vertex identified by the key
	 */
	 CompletableFuture getVertex(final String key, final Class type, final DocumentReadOptions options);

	/**
	 * Replaces the vertex with key with the one in the body, provided there is such a vertex and no precondition is
	 * violated
	 * 
	 * @see API
	 *      Documentation
	 * @param key
	 *            The key of the vertex
	 * @param type
	 *            The type of the vertex-document (POJO class, VPackSlice or String for Json)
	 * @return information about the vertex
	 */
	 CompletableFuture replaceVertex(final String key, final T value);

	/**
	 * Replaces the vertex with key with the one in the body, provided there is such a vertex and no precondition is
	 * violated
	 * 
	 * @see API
	 *      Documentation
	 * @param key
	 *            The key of the vertex
	 * @param type
	 *            The type of the vertex-document (POJO class, VPackSlice or String for Json)
	 * @param options
	 *            Additional options, can be null
	 * @return information about the vertex
	 */
	 CompletableFuture replaceVertex(
		final String key,
		final T value,
		final VertexReplaceOptions options);

	/**
	 * Partially updates the vertex identified by document-key. The value must contain a document with the attributes to
	 * patch (the patch document). All attributes from the patch document will be added to the existing document if they
	 * do not yet exist, and overwritten in the existing document if they do exist there.
	 * 
	 * @see API Documentation
	 * @param key
	 *            The key of the vertex
	 * @param type
	 *            The type of the vertex-document (POJO class, VPackSlice or String for Json)
	 * @return information about the vertex
	 * @throws ArangoDBException
	 */
	 CompletableFuture updateVertex(final String key, final T value) throws ArangoDBException;

	/**
	 * Partially updates the vertex identified by document-key. The value must contain a document with the attributes to
	 * patch (the patch document). All attributes from the patch document will be added to the existing document if they
	 * do not yet exist, and overwritten in the existing document if they do exist there.
	 * 
	 * @see API Documentation
	 * @param key
	 *            The key of the vertex
	 * @param type
	 *            The type of the vertex-document (POJO class, VPackSlice or String for Json)
	 * @param options
	 *            Additional options, can be null
	 * @return information about the vertex
	 * @throws ArangoDBException
	 */
	 CompletableFuture updateVertex(
		final String key,
		final T value,
		final VertexUpdateOptions options) throws ArangoDBException;

	/**
	 * Removes a vertex
	 * 
	 * @see API Documentation
	 * @param key
	 *            The key of the vertex
	 */
	CompletableFuture deleteVertex(final String key);

	/**
	 * Removes a vertex
	 * 
	 * @see API Documentation
	 * @param key
	 *            The key of the vertex
	 * @param options
	 *            Additional options, can be null
	 */
	CompletableFuture deleteVertex(final String key, final VertexDeleteOptions options);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy