Class DefaultDocumentsClient<T extends org.gcube.application.geoportal.common.model.document.Project>

  • All Implemented Interfaces:
    org.gcube.application.geoportal.common.rest.Projects<T>

    public class DefaultDocumentsClient<T extends org.gcube.application.geoportal.common.model.document.Project>
    extends Object
    implements org.gcube.application.geoportal.common.rest.Projects<T>
    Instantiates a new default documents client.
    • Field Detail

      • delegate

        @NonNull
        protected final @NonNull org.gcube.common.clients.delegates.ProxyDelegate<javax.ws.rs.client.WebTarget> delegate
      • profileID

        @NonNull
        protected final @NonNull String profileID
      • managedClass

        @NonNull
        protected final @NonNull Class<T extends org.gcube.application.geoportal.common.model.document.Project> managedClass
    • Constructor Detail

      • DefaultDocumentsClient

        public DefaultDocumentsClient()
    • Method Detail

      • getManagedClass

        public Class<T> getManagedClass()
        Gets the managed class.
        Specified by:
        getManagedClass in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Returns:
        the managed class
      • createNew

        public T createNew​(org.bson.Document toCreate)
                    throws RemoteException
        Creates the new.
        Specified by:
        createNew in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Parameters:
        toCreate - the to create
        Returns:
        the t
        Throws:
        RemoteException - the remote exception
      • deleteById

        public void deleteById​(String id)
                        throws RemoteException
        Delete by id.
        Specified by:
        deleteById in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Parameters:
        id - the id
        Throws:
        RemoteException - the remote exception
      • deleteById

        public void deleteById​(String id,
                               Boolean force)
                        throws RemoteException
        Delete by id.
        Specified by:
        deleteById in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Parameters:
        id - the id
        force - the force
        Throws:
        RemoteException - the remote exception
      • getById

        public T getById​(String id)
                  throws RemoteException
        Gets the by id.
        Specified by:
        getById in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Parameters:
        id - the id
        Returns:
        the by id
        Throws:
        RemoteException - the remote exception
      • getConfiguration

        public org.gcube.application.geoportal.common.model.configuration.Configuration getConfiguration()
                                                                                                  throws RemoteException
        Gets the configuration.
        Specified by:
        getConfiguration in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Returns:
        the configuration
        Throws:
        RemoteException - the remote exception
      • query

        public Iterator<T> query​(org.gcube.application.geoportal.common.model.rest.QueryRequest request)
                          throws RemoteException
        Query.
        Specified by:
        query in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Parameters:
        request - the request
        Returns:
        the iterator
        Throws:
        RemoteException - the remote exception
      • queryForClass

        public <C> Iterator<C> queryForClass​(org.gcube.application.geoportal.common.model.rest.QueryRequest request,
                                             Class<C> clazz)
                                      throws RemoteException
        Query for class.
        Specified by:
        queryForClass in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Type Parameters:
        C - the generic type
        Parameters:
        request - the request
        clazz - the clazz
        Returns:
        the iterator
        Throws:
        RemoteException - the remote exception
      • queryForJSON

        public String queryForJSON​(org.gcube.application.geoportal.common.model.rest.QueryRequest request)
                            throws RemoteException
        Query for JSON.
        Specified by:
        queryForJSON in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Parameters:
        request - the request
        Returns:
        the string
        Throws:
        RemoteException - the remote exception
      • performStep

        public T performStep​(String id,
                             org.gcube.application.geoportal.common.model.rest.StepExecutionRequest request)
                      throws RemoteException
        Perform step.
        Specified by:
        performStep in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Parameters:
        id - the id
        request - the request
        Returns:
        the t
        Throws:
        RemoteException - the remote exception
      • registerFileSet

        public T registerFileSet​(String id,
                                 org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest req)
                          throws RemoteException,
                                 org.gcube.application.geoportal.common.faults.InvalidRequestException
        Register file set.
        Specified by:
        registerFileSet in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Parameters:
        id - the id
        req - the req
        Returns:
        the t
        Throws:
        RemoteException - the remote exception
        org.gcube.application.geoportal.common.faults.InvalidRequestException - the invalid request exception
      • deleteFileSet

        public T deleteFileSet​(String id,
                               String path,
                               Boolean force,
                               Boolean ignoreErrors)
                        throws RemoteException
        Delete file set.
        Specified by:
        deleteFileSet in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Parameters:
        id - the id
        path - the path
        force - the force
        ignoreErrors - the ignore errors
        Returns:
        the t
        Throws:
        RemoteException - the remote exception
      • forceUnlock

        public T forceUnlock​(String id)
                      throws RemoteException
        Force unlock.
        Specified by:
        forceUnlock in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Parameters:
        id - the id
        Returns:
        the t
        Throws:
        RemoteException - the remote exception
      • setAccessPolicy

        public T setAccessPolicy​(String id,
                                 org.gcube.application.geoportal.common.model.document.access.Access toSet)
                          throws RemoteException
        Sets the access policy.
        Specified by:
        setAccessPolicy in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Parameters:
        id - the id
        toSet - the to set
        Returns:
        the t
        Throws:
        RemoteException - the remote exception
      • updateDocument

        public T updateDocument​(String id,
                                org.bson.Document updatedDocument)
                         throws RemoteException
        Update document.
        Specified by:
        updateDocument in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Parameters:
        id - the id
        updatedDocument - the updated document
        Returns:
        the t
        Throws:
        RemoteException - the remote exception
      • patchDocument

        public T patchDocument​(String id,
                               String path,
                               org.bson.Document updatedDocument)
                        throws RemoteException
        Patch document. Added by Francesco Mangiacrapa
        Specified by:
        patchDocument in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Parameters:
        id - the id
        path - the path
        updatedDocument - the updated document
        Returns:
        the t
        Throws:
        RemoteException - the remote exception
      • setRelation

        public org.gcube.application.geoportal.common.model.document.Project setRelation​(org.gcube.application.geoportal.common.model.rest.CreateRelationshipRequest request)
                                                                                  throws RemoteException
        Sets the relation.
        Specified by:
        setRelation in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Parameters:
        request - the request
        Returns:
        the project
        Throws:
        RemoteException - the remote exception
      • deleteRelation

        public org.gcube.application.geoportal.common.model.document.Project deleteRelation​(org.gcube.application.geoportal.common.model.rest.DeleteRelationshipRequest request)
                                                                                     throws RemoteException
        Delete relation.
        Specified by:
        deleteRelation in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Parameters:
        request - the request
        Returns:
        the project
        Throws:
        RemoteException - the remote exception
      • getRelationshipChain

        public Iterator<org.gcube.application.geoportal.common.model.document.relationships.RelationshipNavigationObject> getRelationshipChain​(String id,
                                                                                                                                               String relationId)
                                                                                                                                        throws RemoteException
        Gets the relationship chain.
        Specified by:
        getRelationshipChain in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Parameters:
        id - the id
        relationId - the relation id
        Returns:
        the relationship chain
        Throws:
        RemoteException - the remote exception
      • getRelationshipChain

        public Iterator<org.gcube.application.geoportal.common.model.document.relationships.RelationshipNavigationObject> getRelationshipChain​(String id,
                                                                                                                                               String relationId,
                                                                                                                                               Boolean deep)
                                                                                                                                        throws RemoteException
        Gets the relationship chain.
        Specified by:
        getRelationshipChain in interface org.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>
        Parameters:
        id - the id
        relationId - the relation id
        deep - the deep
        Returns:
        the relationship chain
        Throws:
        RemoteException - the remote exception