Class DefaultDocumentsClient<T extends org.gcube.application.geoportal.common.model.document.Project>
- java.lang.Object
-
- org.gcube.application.geoportal.client.DefaultDocumentsClient<T>
-
- 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.
-
-
Constructor Summary
Constructors Constructor Description DefaultDocumentsClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TcreateNew(org.bson.Document toCreate)Creates the new.voiddeleteById(String id)Delete by id.voiddeleteById(String id, Boolean force)Delete by id.TdeleteFileSet(String id, String path, Boolean force, Boolean ignoreErrors)Delete file set.org.gcube.application.geoportal.common.model.document.ProjectdeleteRelation(org.gcube.application.geoportal.common.model.rest.DeleteRelationshipRequest request)Delete relation.TforceUnlock(String id)Force unlock.TgetById(String id)Gets the by id.org.gcube.application.geoportal.common.model.configuration.ConfigurationgetConfiguration()Gets the configuration.Class<T>getManagedClass()Gets the managed class.Iterator<org.gcube.application.geoportal.common.model.document.relationships.RelationshipNavigationObject>getRelationshipChain(String id, String relationId)Gets the relationship chain.Iterator<org.gcube.application.geoportal.common.model.document.relationships.RelationshipNavigationObject>getRelationshipChain(String id, String relationId, Boolean deep)Gets the relationship chain.TpatchDocument(String id, String path, org.bson.Document updatedDocument)Patch document.TperformStep(String id, org.gcube.application.geoportal.common.model.rest.StepExecutionRequest request)Perform step.Iterator<T>query(org.gcube.application.geoportal.common.model.rest.QueryRequest request)Query.<C> Iterator<C>queryForClass(org.gcube.application.geoportal.common.model.rest.QueryRequest request, Class<C> clazz)Query for class.StringqueryForJSON(org.gcube.application.geoportal.common.model.rest.QueryRequest request)Query for JSON.TregisterFileSet(String id, org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest req)Register file set.TsetAccessPolicy(String id, org.gcube.application.geoportal.common.model.document.access.Access toSet)Sets the access policy.org.gcube.application.geoportal.common.model.document.ProjectsetRelation(org.gcube.application.geoportal.common.model.rest.CreateRelationshipRequest request)Sets the relation.TupdateDocument(String id, org.bson.Document updatedDocument)Update document.
-
-
-
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
-
-
Method Detail
-
getManagedClass
public Class<T> getManagedClass()
Gets the managed class.- Specified by:
getManagedClassin interfaceorg.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:
createNewin interfaceorg.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:
deleteByIdin interfaceorg.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:
deleteByIdin interfaceorg.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>- Parameters:
id- the idforce- the force- Throws:
RemoteException- the remote exception
-
getById
public T getById(String id) throws RemoteException
Gets the by id.- Specified by:
getByIdin interfaceorg.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 RemoteExceptionGets the configuration.- Specified by:
getConfigurationin interfaceorg.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:
queryin interfaceorg.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:
queryForClassin interfaceorg.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 requestclazz- 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:
queryForJSONin interfaceorg.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:
performStepin interfaceorg.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>- Parameters:
id- the idrequest- 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:
registerFileSetin interfaceorg.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>- Parameters:
id- the idreq- the req- Returns:
- the t
- Throws:
RemoteException- the remote exceptionorg.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:
deleteFileSetin interfaceorg.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>- Parameters:
id- the idpath- the pathforce- the forceignoreErrors- the ignore errors- Returns:
- the t
- Throws:
RemoteException- the remote exception
-
forceUnlock
public T forceUnlock(String id) throws RemoteException
Force unlock.- Specified by:
forceUnlockin interfaceorg.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:
setAccessPolicyin interfaceorg.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>- Parameters:
id- the idtoSet- 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:
updateDocumentin interfaceorg.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>- Parameters:
id- the idupdatedDocument- 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:
patchDocumentin interfaceorg.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>- Parameters:
id- the idpath- the pathupdatedDocument- 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 RemoteExceptionSets the relation.- Specified by:
setRelationin interfaceorg.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 RemoteExceptionDelete relation.- Specified by:
deleteRelationin interfaceorg.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:
getRelationshipChainin interfaceorg.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>- Parameters:
id- the idrelationId- 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:
getRelationshipChainin interfaceorg.gcube.application.geoportal.common.rest.Projects<T extends org.gcube.application.geoportal.common.model.document.Project>- Parameters:
id- the idrelationId- the relation iddeep- the deep- Returns:
- the relationship chain
- Throws:
RemoteException- the remote exception
-
-