Class ResourceRegistryContextClientImpl
- java.lang.Object
-
- org.gcube.informationsystem.resourceregistry.api.request.BaseRequestInfo
-
- org.gcube.informationsystem.resourceregistry.contexts.ResourceRegistryContextClientImpl
-
- All Implemented Interfaces:
org.gcube.informationsystem.resourceregistry.api.request.RequestInfo,ResourceRegistryContextClient
public class ResourceRegistryContextClientImpl extends org.gcube.informationsystem.resourceregistry.api.request.BaseRequestInfo implements ResourceRegistryContextClient
- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringaddressprotected org.gcube.informationsystem.resourceregistry.api.contexts.ContextCachecontextCacheprotected org.gcube.informationsystem.resourceregistry.api.contexts.ContextCacheRenewalcontextCacheRenewalprotected Map<String,String>headers
-
Constructor Summary
Constructors Constructor Description ResourceRegistryContextClientImpl(String address)This client does not use the shared context cache because it is used by managers to manipulate contexts.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHeader(String name, String value)List<org.gcube.informationsystem.contexts.reference.entities.Context>all()Stringcreate(String context)org.gcube.informationsystem.contexts.reference.entities.Contextcreate(org.gcube.informationsystem.contexts.reference.entities.Context context)booleandelete(String uuid)booleandelete(UUID uuid)booleandelete(org.gcube.informationsystem.contexts.reference.entities.Context context)booleanexist(String uuid)booleanexist(UUID uuid)booleanexistFromServer(String uuid)List<org.gcube.informationsystem.contexts.reference.entities.Context>getAllContextFromServer()It reads all the contexts from server.protected List<org.gcube.informationsystem.contexts.reference.entities.Context>getAllContextFromServer(boolean includeMeta, Integer offset, Integer limit)org.gcube.informationsystem.resourceregistry.api.contexts.ContextCachegetContextCache()protected org.gcube.common.gxhttp.request.GXHTTPStringRequestgetGXHTTPStringRequest()protected StringinternalCreate(org.gcube.informationsystem.contexts.reference.entities.Context context)StringinternalUpdate(org.gcube.informationsystem.contexts.reference.entities.Context context)Stringread(String uuid)org.gcube.informationsystem.contexts.reference.entities.Contextread(UUID uuid)org.gcube.informationsystem.contexts.reference.entities.Contextread(org.gcube.informationsystem.contexts.reference.entities.Context context)org.gcube.informationsystem.contexts.reference.entities.ContextreadCurrentContext()StringreadFromServer(String uuid)Stringupdate(String context)org.gcube.informationsystem.contexts.reference.entities.Contextupdate(org.gcube.informationsystem.contexts.reference.entities.Context context)
-
-
-
Field Detail
-
address
protected final String address
-
contextCache
protected org.gcube.informationsystem.resourceregistry.api.contexts.ContextCache contextCache
-
contextCacheRenewal
protected org.gcube.informationsystem.resourceregistry.api.contexts.ContextCacheRenewal contextCacheRenewal
-
-
Constructor Detail
-
ResourceRegistryContextClientImpl
public ResourceRegistryContextClientImpl(String address)
This client does not use the shared context cache because it is used by managers to manipulate contexts. The shared cache has only minimal context information available to any users.- Parameters:
address-
-
-
Method Detail
-
addHeader
public void addHeader(String name, String value)
- Specified by:
addHeaderin interfaceResourceRegistryContextClient
-
getGXHTTPStringRequest
protected org.gcube.common.gxhttp.request.GXHTTPStringRequest getGXHTTPStringRequest()
-
getAllContextFromServer
public List<org.gcube.informationsystem.contexts.reference.entities.Context> getAllContextFromServer() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
It reads all the contexts from server. The cache used for contexts is bypassed and not updated.- Returns:
- All Contexts read from server
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getAllContextFromServer
protected List<org.gcube.informationsystem.contexts.reference.entities.Context> getAllContextFromServer(boolean includeMeta, Integer offset, Integer limit) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
all
public List<org.gcube.informationsystem.contexts.reference.entities.Context> all() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Specified by:
allin interfaceResourceRegistryContextClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getContextCache
public org.gcube.informationsystem.resourceregistry.api.contexts.ContextCache getContextCache()
- Specified by:
getContextCachein interfaceResourceRegistryContextClient
-
internalCreate
protected String internalCreate(org.gcube.informationsystem.contexts.reference.entities.Context context) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextAlreadyPresentException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextAlreadyPresentExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
create
public org.gcube.informationsystem.contexts.reference.entities.Context create(org.gcube.informationsystem.contexts.reference.entities.Context context) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextAlreadyPresentException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Specified by:
createin interfaceResourceRegistryContextClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextAlreadyPresentExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
create
public String create(String context) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextAlreadyPresentException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Specified by:
createin interfaceResourceRegistryContextClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextAlreadyPresentExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
existFromServer
public boolean existFromServer(String uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
exist
public boolean exist(String uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Specified by:
existin interfaceResourceRegistryContextClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
exist
public boolean exist(UUID uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Specified by:
existin interfaceResourceRegistryContextClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
read
public org.gcube.informationsystem.contexts.reference.entities.Context read(org.gcube.informationsystem.contexts.reference.entities.Context context) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Specified by:
readin interfaceResourceRegistryContextClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
read
public org.gcube.informationsystem.contexts.reference.entities.Context read(UUID uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Specified by:
readin interfaceResourceRegistryContextClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
readCurrentContext
public org.gcube.informationsystem.contexts.reference.entities.Context readCurrentContext() throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Specified by:
readCurrentContextin interfaceResourceRegistryContextClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
read
public String read(String uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Specified by:
readin interfaceResourceRegistryContextClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
readFromServer
public String readFromServer(String uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
internalUpdate
public String internalUpdate(org.gcube.informationsystem.contexts.reference.entities.Context context) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
update
public org.gcube.informationsystem.contexts.reference.entities.Context update(org.gcube.informationsystem.contexts.reference.entities.Context context) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Specified by:
updatein interfaceResourceRegistryContextClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
update
public String update(String context) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Specified by:
updatein interfaceResourceRegistryContextClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
delete
public boolean delete(org.gcube.informationsystem.contexts.reference.entities.Context context) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Specified by:
deletein interfaceResourceRegistryContextClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
delete
public boolean delete(UUID uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Specified by:
deletein interfaceResourceRegistryContextClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
delete
public boolean delete(String uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Specified by:
deletein interfaceResourceRegistryContextClient- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
-