Class ServerContextCache
- java.lang.Object
-
- org.gcube.informationsystem.resourceregistry.api.contexts.ContextCache
-
- org.gcube.informationsystem.resourceregistry.contexts.ServerContextCache
-
public class ServerContextCache extends org.gcube.informationsystem.resourceregistry.api.contexts.ContextCache- Author:
- Luca Frosini (ISTI - CNR) TODO find a distributed solution
-
-
Field Summary
Fields Modifier and Type Field Description protected List<org.gcube.informationsystem.contexts.reference.entities.Context>contextsBasicInfoprotected List<org.gcube.informationsystem.contexts.reference.entities.Context>contextsMetaPrivacyprotected booleanincludeMetaprotected static ServerContextCachesingletonprotected Map<UUID,org.gcube.informationsystem.contexts.reference.entities.Context>uuidToContextBasicInfoprotected Map<UUID,org.gcube.informationsystem.contexts.reference.entities.Context>uuidToContextMetaPrivacy
-
Constructor Summary
Constructors Constructor Description ServerContextCache()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanCache()protected voidcleanCache(Calendar now)org.gcube.informationsystem.contexts.reference.entities.ContextgetContextByUUID(UUID uuid)org.gcube.informationsystem.contexts.reference.entities.ContextgetContextByUUIDFullInfo(UUID uuid)USer internally to the service to get info such as stateList<org.gcube.informationsystem.contexts.reference.entities.Context>getContexts()org.gcube.informationsystem.contexts.reference.entities.ContextgetFullInfoContextByUUID(UUID uuid)List<org.gcube.informationsystem.contexts.reference.entities.Context>getFullInfoContexts()static ServerContextCachegetInstance()protected org.gcube.informationsystem.model.reference.properties.MetadatagetMetadataForPrivacy(org.gcube.com.fasterxml.jackson.databind.ObjectMapper objectMapper, org.gcube.informationsystem.model.reference.properties.Metadata metadata)voidinitContextCacheRenewal()booleanisIncludeMeta()protected voidsetContexts(Calendar calendar, List<org.gcube.informationsystem.contexts.reference.entities.Context> contexts)voidsetIncludeMeta(boolean includeMeta)-
Methods inherited from class org.gcube.informationsystem.resourceregistry.api.contexts.ContextCache
getContextByFullName, getContextByUUID, getContextCacheRenewal, getContextFullName, getContextFullNameByUUID, getContextFullNameByUUID, getContextFullNameToUUIDAssociation, getContextsTree, getUUIDByFullName, getUUIDToContextFullNameAssociation, refreshContextsIfNeeded, renew, setContextCacheRenewal, setContexts, setExpiringTimeout
-
-
-
-
Field Detail
-
contextsMetaPrivacy
protected List<org.gcube.informationsystem.contexts.reference.entities.Context> contextsMetaPrivacy
-
uuidToContextMetaPrivacy
protected Map<UUID,org.gcube.informationsystem.contexts.reference.entities.Context> uuidToContextMetaPrivacy
-
contextsBasicInfo
protected List<org.gcube.informationsystem.contexts.reference.entities.Context> contextsBasicInfo
-
uuidToContextBasicInfo
protected Map<UUID,org.gcube.informationsystem.contexts.reference.entities.Context> uuidToContextBasicInfo
-
includeMeta
protected boolean includeMeta
-
singleton
protected static ServerContextCache singleton
-
-
Method Detail
-
getInstance
public static ServerContextCache getInstance()
-
cleanCache
public void cleanCache()
- Overrides:
cleanCachein classorg.gcube.informationsystem.resourceregistry.api.contexts.ContextCache
-
cleanCache
protected void cleanCache(Calendar now)
- Overrides:
cleanCachein classorg.gcube.informationsystem.resourceregistry.api.contexts.ContextCache
-
isIncludeMeta
public boolean isIncludeMeta()
-
setIncludeMeta
public void setIncludeMeta(boolean includeMeta)
-
initContextCacheRenewal
public void initContextCacheRenewal()
-
getContexts
public List<org.gcube.informationsystem.contexts.reference.entities.Context> getContexts() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Overrides:
getContextsin classorg.gcube.informationsystem.resourceregistry.api.contexts.ContextCache- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getFullInfoContexts
public List<org.gcube.informationsystem.contexts.reference.entities.Context> getFullInfoContexts() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getFullInfoContextByUUID
public org.gcube.informationsystem.contexts.reference.entities.Context getFullInfoContextByUUID(UUID uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getContextByUUID
public org.gcube.informationsystem.contexts.reference.entities.Context getContextByUUID(UUID uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
- Overrides:
getContextByUUIDin classorg.gcube.informationsystem.resourceregistry.api.contexts.ContextCache- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getContextByUUIDFullInfo
public org.gcube.informationsystem.contexts.reference.entities.Context getContextByUUIDFullInfo(UUID uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
USer internally to the service to get info such as state- Parameters:
uuid-- Returns:
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getMetadataForPrivacy
protected org.gcube.informationsystem.model.reference.properties.Metadata getMetadataForPrivacy(org.gcube.com.fasterxml.jackson.databind.ObjectMapper objectMapper, org.gcube.informationsystem.model.reference.properties.Metadata metadata)
-
-