Class EntityStoreManagerImpl

  • All Implemented Interfaces:
    io.vertigo.core.node.component.Activeable, io.vertigo.core.node.component.Component, io.vertigo.core.node.component.CoreComponent, io.vertigo.core.node.component.Manager, io.vertigo.core.node.definition.DefinitionProvider, io.vertigo.core.node.definition.SimpleDefinitionProvider, EntityStoreManager

    public final class EntityStoreManagerImpl
    extends Object
    implements EntityStoreManager, io.vertigo.core.node.component.Activeable, io.vertigo.core.node.definition.SimpleDefinitionProvider
    Implementation of DataStore.
    Author:
    pchretien
    • Constructor Detail

      • EntityStoreManagerImpl

        @Inject
        public EntityStoreManagerImpl​(CacheManager cacheManager,
                                      VTransactionManager transactionManager,
                                      EventBusManager eventBusManager,
                                      TaskManager taskManager,
                                      List<EntityStorePlugin> entityStorePlugins)
        Constructor
        Parameters:
        entityStoreManager - storeManager
        transactionManager - transactionManager
        eventBusManager - eventBusManager
        dataStoreConfig - dataStoreConfig
    • Method Detail

      • start

        public void start()
        Specified by:
        start in interface io.vertigo.core.node.component.Activeable
      • stop

        public void stop()
        Specified by:
        stop in interface io.vertigo.core.node.component.Activeable
      • readOneForUpdate

        public <E extends Entity> E readOneForUpdate​(UID<E> uri)
        Loads and marks element for update, and ensure non concurrency. Fire an update event for this uid on eventbus after commit.
        Specified by:
        readOneForUpdate in interface EntityStoreManager
        Type Parameters:
        E - the type of entity
        Parameters:
        uri - UID of object
        Returns:
        object to update
      • create

        public <E extends Entity> E create​(E entity)
        Create an object. No object with the same id must have been created previously.
        Specified by:
        create in interface EntityStoreManager
        Parameters:
        entity - the entity to create
        Returns:
        the created object
      • update

        public void update​(Entity entity)
        Update an object. This object must have an id.
        Specified by:
        update in interface EntityStoreManager
        Parameters:
        entity - the entity to update
      • delete

        public void delete​(UID<? extends Entity> uri)
        Destruction d'un objet persistant par son UID.
        Specified by:
        delete in interface EntityStoreManager
        Parameters:
        uri - UID de l'objet à supprimer
      • readOne

        public <E extends Entity> E readOne​(UID<E> uri)
        Récupération d'un objet persistant par son UID. Lorsque l'objet est en lecture seule il est possible d'accéder au objets partagés. (Liste de référence par ex) L'objet doit exister.
        Specified by:
        readOne in interface EntityStoreManager
        Type Parameters:
        E - the type of entity
        Parameters:
        uri - UID de l'object
        Returns:
        object récupéré NOT NULL
      • findAll

        public <E extends EntityDtList<E> findAll​(DtListURI uri)
        Récupération d'une liste identifiée par son UID.
        Specified by:
        findAll in interface EntityStoreManager
        Type Parameters:
        E - the type of entity
        Parameters:
        uri - UID de la collection à récupérer
        Returns:
        DtList DTC
      • count

        public int count​(DtDefinition dtDefinition)
        Nombre d'éléments présents dans le sysème de persistance.
        Specified by:
        count in interface EntityStoreManager
        Parameters:
        dtDefinition - Définition de DT
        Returns:
        Nombre d'éléments.
      • find

        public <E extends EntityDtList<E> find​(DtDefinition dtDefinition,
                                                 Criteria<E> criteria,
                                                 DtListState dtListState)
        Returns a list identified by criteria
        Specified by:
        find in interface EntityStoreManager
        Parameters:
        dtDefinition - the list definition
        criteria - criteria
        dtListState - request state : sort, top, offset
        Returns:
        list
      • provideDefinitions

        public List<? extends io.vertigo.core.node.definition.Definition> provideDefinitions​(io.vertigo.core.node.definition.DefinitionSpace definitionSpace)
        Specified by:
        provideDefinitions in interface io.vertigo.core.node.definition.SimpleDefinitionProvider
      • getBrokerNN

        public BrokerNN getBrokerNN()
        Return the a dedicated object that handles NN associations
        Specified by:
        getBrokerNN in interface EntityStoreManager
        Returns:
        the handler for NN Associations
      • sort

        public <D extends DtObjectDtList<D> sort​(DtList<D> list,
                                                   String fieldName,
                                                   boolean desc)
        Sorts a list from a column.
        Specified by:
        sort in interface EntityStoreManager
        Parameters:
        list - the list to sort
        fieldName - the field name
        desc - if the sotr is desc
        Returns:
        the sorted list