Class ResourceRegistryContextClientImpl
- java.lang.Object
-
- org.gcube.informationsystem.resourceregistry.contexts.ResourceRegistryContextClientImpl
-
- All Implemented Interfaces:
ResourceRegistryContextClient
public class ResourceRegistryContextClientImpl extends Object 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)ResourceRegistryContextClientImpl(String address, boolean sharedContextCache)
-
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)protected List<org.gcube.informationsystem.contexts.reference.entities.Context>getAllContextFromServer()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
-
-
Method Detail
-
addHeader
public void addHeader(String name, String value)
- Specified by:
addHeaderin interfaceResourceRegistryContextClient
-
getGXHTTPStringRequest
protected org.gcube.common.gxhttp.request.GXHTTPStringRequest getGXHTTPStringRequest()
-
getAllContextFromServer
protected List<org.gcube.informationsystem.contexts.reference.entities.Context> getAllContextFromServer() 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
-
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
-
-