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

org.jnosql.artemis.graph.GraphEventPersistManager Maven / Gradle / Ivy

The newest version!
/*
 *  Copyright (c) 2017 Otávio Santana and others
 *   All rights reserved. This program and the accompanying materials
 *   are made available under the terms of the Eclipse Public License v1.0
 *   and Apache License v2.0 which accompanies this distribution.
 *   The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
 *   and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php.
 *
 *   You may elect to redistribute this code under either of these licenses.
 *
 *   Contributors:
 *
 *   Otavio Santana
 */
package org.jnosql.artemis.graph;


import org.apache.tinkerpop.gremlin.structure.Vertex;

/**
 * This interface represent the manager of events. When an entity be either saved or updated an event will be fired. This order gonna be:
 * 1) firePreEntity
 * 2) firePreGraphEntity
 * 3) firePreGraph
 * 4) firePostGraph
 * 5) firePostEntity
 * 6) firePostGraphEntity
 *
 * @see GraphWorkflow
 */
public interface GraphEventPersistManager {

    /**
     * Fire an event after the conversion of the entity to communication API model.
     *
     * @param entity the entity
     */
    void firePreGraph(Vertex entity);

    /**
     * Fire an event after the response from communication layer
     *
     * @param entity the entity
     */
    void firePostGraph(Vertex entity);

    /**
     * Fire an event once the method is called
     *
     * @param entity the entity
     * @param     the entity type
     */
     void firePreEntity(T entity);

    /**
     * Fire an event after convert the {@link Vertex},
     * from database response, to Entity.
     *
     * @param entity the entity
     * @param     the entity kind
     */
     void firePostEntity(T entity);


    /**
     * Fire an event once the method is called after firePreEntity
     *
     * @param entity the entity
     * @param     the entity type
     */
     void firePreGraphEntity(T entity);

    /**
     * Fire an event after firePostEntity
     *
     * @param entity the entity
     * @param     the entity kind
     */
     void firePostGraphEntity(T entity);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy