Interface MongoManagerI<T>

  • Type Parameters:
    T - the generic type
    All Known Implementing Classes:
    ProfiledMongoManager

    public interface MongoManagerI<T>
    The Interface MongoManagerI.
    Author:
    Fabio Sinibaldi, maintainer: Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it Apr 18, 2023
    • Method Detail

      • registerNew

        T registerNew​(org.bson.Document toRegister)
               throws IOException,
                      org.gcube.application.cms.plugins.faults.StepException,
                      org.gcube.application.cms.plugins.faults.EventException,
                      org.gcube.application.cms.implementations.faults.InvalidUserRoleException
        Register new.
        Parameters:
        toRegister - the to register
        Returns:
        the t
        Throws:
        IOException - Signals that an I/O exception has occurred.
        org.gcube.application.cms.plugins.faults.StepException - the step exception
        org.gcube.application.cms.plugins.faults.EventException - the event exception
        org.gcube.application.cms.implementations.faults.InvalidUserRoleException - the invalid user role exception
      • update

        T update​(String id,
                 org.bson.Document toSetDocument)
          throws IOException,
                 org.gcube.application.cms.plugins.faults.StepException,
                 org.gcube.application.cms.plugins.faults.EventException,
                 org.gcube.application.cms.implementations.faults.ProjectLockedException,
                 org.gcube.application.cms.implementations.faults.ProjectNotFoundException,
                 org.gcube.application.cms.implementations.faults.InvalidLockException,
                 org.gcube.application.cms.implementations.faults.InvalidUserRoleException,
                 org.gcube.application.cms.implementations.faults.UnauthorizedAccess
        Update.
        Parameters:
        id - the id
        toSetDocument - the to set document
        Returns:
        the t
        Throws:
        IOException - Signals that an I/O exception has occurred.
        org.gcube.application.cms.plugins.faults.StepException - the step exception
        org.gcube.application.cms.plugins.faults.EventException - the event exception
        org.gcube.application.cms.implementations.faults.ProjectLockedException - the project locked exception
        org.gcube.application.cms.implementations.faults.ProjectNotFoundException - the project not found exception
        org.gcube.application.cms.implementations.faults.InvalidLockException - the invalid lock exception
        org.gcube.application.cms.implementations.faults.InvalidUserRoleException - the invalid user role exception
        org.gcube.application.cms.implementations.faults.UnauthorizedAccess - the unauthorized access
      • patch

        T patch​(String id,
                org.bson.Document toSet)
         throws IOException,
                org.gcube.application.cms.plugins.faults.EventException,
                org.gcube.application.cms.implementations.faults.ProjectLockedException,
                org.gcube.application.cms.implementations.faults.ProjectNotFoundException,
                org.gcube.application.cms.implementations.faults.InvalidLockException,
                org.gcube.application.cms.implementations.faults.InvalidUserRoleException,
                org.gcube.application.cms.implementations.faults.UnauthorizedAccess
        Patch.
        Parameters:
        id - the id
        toSet - the to set
        Returns:
        the t
        Throws:
        IOException - Signals that an I/O exception has occurred.
        org.gcube.application.cms.plugins.faults.EventException - the event exception
        org.gcube.application.cms.implementations.faults.ProjectLockedException - the project locked exception
        org.gcube.application.cms.implementations.faults.ProjectNotFoundException - the project not found exception
        org.gcube.application.cms.implementations.faults.InvalidLockException - the invalid lock exception
        org.gcube.application.cms.implementations.faults.InvalidUserRoleException - the invalid user role exception
        org.gcube.application.cms.implementations.faults.UnauthorizedAccess - the unauthorized access
      • setRelation

        T setRelation​(String id,
                      String relation,
                      String targetUCD,
                      String targetId)
               throws IOException,
                      org.gcube.application.cms.plugins.faults.StepException,
                      org.gcube.application.cms.plugins.faults.EventException,
                      org.gcube.application.cms.implementations.faults.ProjectLockedException,
                      org.gcube.application.cms.implementations.faults.ProjectNotFoundException,
                      org.gcube.application.cms.implementations.faults.InvalidLockException,
                      org.gcube.application.cms.implementations.faults.InvalidUserRoleException,
                      org.gcube.application.cms.implementations.faults.UnauthorizedAccess,
                      org.gcube.application.cms.implementations.faults.RegistrationException,
                      org.gcube.application.geoportal.common.model.rest.ConfigurationException
        Sets the relation.
        Parameters:
        id - the id
        relation - the relation
        targetUCD - the target UCD
        targetId - the target id
        Returns:
        the t
        Throws:
        IOException - Signals that an I/O exception has occurred.
        org.gcube.application.cms.plugins.faults.StepException - the step exception
        org.gcube.application.cms.plugins.faults.EventException - the event exception
        org.gcube.application.cms.implementations.faults.ProjectLockedException - the project locked exception
        org.gcube.application.cms.implementations.faults.ProjectNotFoundException - the project not found exception
        org.gcube.application.cms.implementations.faults.InvalidLockException - the invalid lock exception
        org.gcube.application.cms.implementations.faults.InvalidUserRoleException - the invalid user role exception
        org.gcube.application.cms.implementations.faults.UnauthorizedAccess - the unauthorized access
        org.gcube.application.cms.implementations.faults.RegistrationException - the registration exception
        org.gcube.application.geoportal.common.model.rest.ConfigurationException - the configuration exception
      • deleteRelation

        T deleteRelation​(String id,
                         String relation,
                         String targetUCD,
                         String targetId)
                  throws IOException,
                         org.gcube.application.cms.plugins.faults.StepException,
                         org.gcube.application.cms.plugins.faults.EventException,
                         org.gcube.application.cms.implementations.faults.ProjectLockedException,
                         org.gcube.application.cms.implementations.faults.ProjectNotFoundException,
                         org.gcube.application.cms.implementations.faults.InvalidLockException,
                         org.gcube.application.cms.implementations.faults.InvalidUserRoleException,
                         org.gcube.application.cms.implementations.faults.UnauthorizedAccess,
                         org.gcube.application.cms.implementations.faults.RegistrationException,
                         org.gcube.application.geoportal.common.model.rest.ConfigurationException
        Delete relation.
        Parameters:
        id - the id
        relation - the relation
        targetUCD - the target UCD
        targetId - the target id
        Returns:
        the t
        Throws:
        IOException - Signals that an I/O exception has occurred.
        org.gcube.application.cms.plugins.faults.StepException - the step exception
        org.gcube.application.cms.plugins.faults.EventException - the event exception
        org.gcube.application.cms.implementations.faults.ProjectLockedException - the project locked exception
        org.gcube.application.cms.implementations.faults.ProjectNotFoundException - the project not found exception
        org.gcube.application.cms.implementations.faults.InvalidLockException - the invalid lock exception
        org.gcube.application.cms.implementations.faults.InvalidUserRoleException - the invalid user role exception
        org.gcube.application.cms.implementations.faults.UnauthorizedAccess - the unauthorized access
        org.gcube.application.cms.implementations.faults.RegistrationException - the registration exception
        org.gcube.application.geoportal.common.model.rest.ConfigurationException - the configuration exception
      • delete

        void delete​(String id,
                    boolean force)
             throws org.gcube.application.cms.implementations.faults.DeletionException,
                    org.gcube.application.cms.implementations.faults.InvalidUserRoleException,
                    org.gcube.application.cms.implementations.faults.ProjectLockedException,
                    org.gcube.application.cms.implementations.faults.ProjectNotFoundException,
                    org.gcube.application.cms.implementations.faults.UnauthorizedAccess,
                    com.fasterxml.jackson.core.JsonProcessingException,
                    org.gcube.application.cms.implementations.faults.InvalidLockException
        Delete.
        Parameters:
        id - the id
        force - the force
        Throws:
        org.gcube.application.cms.implementations.faults.DeletionException - the deletion exception
        org.gcube.application.cms.implementations.faults.InvalidUserRoleException - the invalid user role exception
        org.gcube.application.cms.implementations.faults.ProjectLockedException - the project locked exception
        org.gcube.application.cms.implementations.faults.ProjectNotFoundException - the project not found exception
        org.gcube.application.cms.implementations.faults.UnauthorizedAccess - the unauthorized access
        com.fasterxml.jackson.core.JsonProcessingException - the json processing exception
        org.gcube.application.cms.implementations.faults.InvalidLockException - the invalid lock exception
      • getByID

        T getByID​(String id)
           throws IOException,
                  org.gcube.application.cms.implementations.faults.ProjectNotFoundException,
                  org.gcube.application.cms.implementations.faults.InvalidUserRoleException,
                  org.gcube.application.cms.implementations.faults.UnauthorizedAccess
        Gets the by ID.
        Parameters:
        id - the id
        Returns:
        the by ID
        Throws:
        IOException - Signals that an I/O exception has occurred.
        org.gcube.application.cms.implementations.faults.ProjectNotFoundException - the project not found exception
        org.gcube.application.cms.implementations.faults.InvalidUserRoleException - the invalid user role exception
        org.gcube.application.cms.implementations.faults.UnauthorizedAccess - the unauthorized access
      • query

        Iterable<org.bson.Document> query​(org.gcube.application.geoportal.common.model.rest.QueryRequest request)
                                   throws org.gcube.application.cms.implementations.faults.InvalidUserRoleException
        Query.
        Parameters:
        request - the request
        Returns:
        the iterable
        Throws:
        org.gcube.application.cms.implementations.faults.InvalidUserRoleException - the invalid user role exception
      • filter

        Iterable<T> filter​(org.gcube.application.geoportal.common.model.rest.QueryRequest request)
                    throws org.gcube.application.cms.implementations.faults.InvalidUserRoleException
        Filter.
        Parameters:
        request - the request
        Returns:
        the iterable
        Throws:
        org.gcube.application.cms.implementations.faults.InvalidUserRoleException - the invalid user role exception
      • performStep

        T performStep​(String id,
                      String step,
                      org.bson.Document options)
               throws IOException,
                      org.gcube.application.cms.plugins.faults.StepException,
                      org.gcube.application.cms.implementations.faults.ProjectLockedException,
                      org.gcube.application.cms.implementations.faults.ProjectNotFoundException,
                      org.gcube.application.cms.implementations.faults.InvalidLockException,
                      org.gcube.application.cms.implementations.faults.InvalidUserRoleException,
                      org.gcube.application.cms.implementations.faults.UnauthorizedAccess,
                      org.gcube.application.geoportal.common.model.rest.ConfigurationException,
                      org.gcube.application.cms.plugins.faults.InsufficientPrivileges
        Perform step.
        Parameters:
        id - the id
        step - the step
        options - the options
        Returns:
        the t
        Throws:
        IOException - Signals that an I/O exception has occurred.
        org.gcube.application.cms.plugins.faults.StepException - the step exception
        org.gcube.application.cms.implementations.faults.ProjectLockedException - the project locked exception
        org.gcube.application.cms.implementations.faults.ProjectNotFoundException - the project not found exception
        org.gcube.application.cms.implementations.faults.InvalidLockException - the invalid lock exception
        org.gcube.application.cms.implementations.faults.InvalidUserRoleException - the invalid user role exception
        org.gcube.application.cms.implementations.faults.UnauthorizedAccess - the unauthorized access
        org.gcube.application.geoportal.common.model.rest.ConfigurationException - the configuration exception
        org.gcube.application.cms.plugins.faults.InsufficientPrivileges - the insufficient privileges
      • registerFileSet

        T registerFileSet​(String id,
                          org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest request)
                   throws org.gcube.application.geoportal.common.model.rest.ConfigurationException,
                          org.gcube.common.storagehub.model.exceptions.StorageHubException,
                          org.gcube.application.geoportal.common.faults.StorageException,
                          org.gcube.application.cms.plugins.faults.StepException,
                          com.fasterxml.jackson.core.JsonProcessingException,
                          org.gcube.application.cms.implementations.faults.DeletionException,
                          org.gcube.application.cms.plugins.faults.EventException,
                          org.gcube.application.cms.implementations.faults.ProjectLockedException,
                          org.gcube.application.cms.implementations.faults.ProjectNotFoundException,
                          org.gcube.application.cms.implementations.faults.InvalidLockException,
                          org.gcube.application.cms.implementations.faults.InvalidUserRoleException,
                          org.gcube.application.cms.implementations.faults.UnauthorizedAccess
        Register file set.
        Parameters:
        id - the id
        request - the request
        Returns:
        the t
        Throws:
        org.gcube.application.geoportal.common.model.rest.ConfigurationException - the configuration exception
        org.gcube.common.storagehub.model.exceptions.StorageHubException - the storage hub exception
        org.gcube.application.geoportal.common.faults.StorageException - the storage exception
        org.gcube.application.cms.plugins.faults.StepException - the step exception
        com.fasterxml.jackson.core.JsonProcessingException - the json processing exception
        org.gcube.application.cms.implementations.faults.DeletionException - the deletion exception
        org.gcube.application.cms.plugins.faults.EventException - the event exception
        org.gcube.application.cms.implementations.faults.ProjectLockedException - the project locked exception
        org.gcube.application.cms.implementations.faults.ProjectNotFoundException - the project not found exception
        org.gcube.application.cms.implementations.faults.InvalidLockException - the invalid lock exception
        org.gcube.application.cms.implementations.faults.InvalidUserRoleException - the invalid user role exception
        org.gcube.application.cms.implementations.faults.UnauthorizedAccess - the unauthorized access
      • deleteFileSet

        T deleteFileSet​(String id,
                        String path,
                        Boolean force,
                        Boolean ignore_errors)
                 throws org.gcube.application.geoportal.common.model.rest.ConfigurationException,
                        org.gcube.common.storagehub.model.exceptions.StorageHubException,
                        com.fasterxml.jackson.core.JsonProcessingException,
                        org.gcube.application.cms.implementations.faults.DeletionException,
                        org.gcube.application.cms.plugins.faults.EventException,
                        org.gcube.application.cms.implementations.faults.ProjectLockedException,
                        org.gcube.application.cms.implementations.faults.ProjectNotFoundException,
                        org.gcube.application.cms.implementations.faults.InvalidLockException,
                        org.gcube.application.cms.implementations.faults.InvalidUserRoleException,
                        org.gcube.application.cms.implementations.faults.UnauthorizedAccess
        Delete file set.
        Parameters:
        id - the id
        destination - the destination
        force - the force
        ignore_errors - the ignore errors
        Returns:
        the t
        Throws:
        org.gcube.application.geoportal.common.model.rest.ConfigurationException - the configuration exception
        org.gcube.common.storagehub.model.exceptions.StorageHubException - the storage hub exception
        org.gcube.application.geoportal.common.faults.StorageException - the storage exception
        org.gcube.application.cms.plugins.faults.StepException - the step exception
        com.fasterxml.jackson.core.JsonProcessingException - the json processing exception
        org.gcube.application.cms.implementations.faults.DeletionException - the deletion exception
        org.gcube.application.cms.plugins.faults.EventException - the event exception
        org.gcube.application.cms.implementations.faults.ProjectLockedException - the project locked exception
        org.gcube.application.cms.implementations.faults.ProjectNotFoundException - the project not found exception
        org.gcube.application.cms.implementations.faults.InvalidLockException - the invalid lock exception
        org.gcube.application.cms.implementations.faults.InvalidUserRoleException - the invalid user role exception
        org.gcube.application.cms.implementations.faults.UnauthorizedAccess - the unauthorized access
      • forceUnlock

        T forceUnlock​(String id)
               throws org.gcube.application.cms.implementations.faults.InvalidUserRoleException,
                      org.gcube.application.cms.implementations.faults.ProjectNotFoundException,
                      org.gcube.application.cms.implementations.faults.UnauthorizedAccess,
                      com.fasterxml.jackson.core.JsonProcessingException,
                      org.gcube.application.cms.implementations.faults.InvalidLockException
        Force unlock.
        Parameters:
        id - the id
        Returns:
        the t
        Throws:
        org.gcube.application.cms.implementations.faults.InvalidUserRoleException - the invalid user role exception
        org.gcube.application.cms.implementations.faults.ProjectNotFoundException - the project not found exception
        org.gcube.application.cms.implementations.faults.UnauthorizedAccess - the unauthorized access
        com.fasterxml.jackson.core.JsonProcessingException - the json processing exception
        org.gcube.application.cms.implementations.faults.InvalidLockException - the invalid lock exception
      • setAccessPolicy

        T setAccessPolicy​(String id,
                          org.gcube.application.geoportal.common.model.document.access.Access access)
                   throws org.gcube.application.cms.implementations.faults.InvalidUserRoleException,
                          org.gcube.application.cms.implementations.faults.ProjectLockedException,
                          org.gcube.application.cms.implementations.faults.ProjectNotFoundException,
                          org.gcube.application.cms.implementations.faults.UnauthorizedAccess,
                          com.fasterxml.jackson.core.JsonProcessingException,
                          org.gcube.application.cms.implementations.faults.InvalidLockException,
                          org.gcube.application.cms.plugins.faults.EventException
        Sets the access policy.
        Parameters:
        id - the id
        access - the access
        Returns:
        the t
        Throws:
        org.gcube.application.cms.implementations.faults.InvalidUserRoleException - the invalid user role exception
        org.gcube.application.cms.implementations.faults.ProjectLockedException - the project locked exception
        org.gcube.application.cms.implementations.faults.ProjectNotFoundException - the project not found exception
        org.gcube.application.cms.implementations.faults.UnauthorizedAccess - the unauthorized access
        com.fasterxml.jackson.core.JsonProcessingException - the json processing exception
        org.gcube.application.cms.implementations.faults.InvalidLockException - the invalid lock exception
        org.gcube.application.cms.plugins.faults.EventException - the event exception
      • getConfiguration

        org.gcube.application.geoportal.common.model.configuration.Configuration getConfiguration()
                                                                                           throws org.gcube.application.geoportal.common.model.rest.ConfigurationException
        Gets the configuration.
        Returns:
        the configuration
        Throws:
        org.gcube.application.geoportal.common.model.rest.ConfigurationException - the configuration exception