public class GuavaResourceMetadataCache extends Object implements ResourceMetadataCache
| Constructor and Description |
|---|
GuavaResourceMetadataCache(long maxSize,
com.codahale.metrics.MetricRegistry registry) |
| Modifier and Type | Method and Description |
|---|---|
com.google.common.base.Optional<ResourceMetadata> |
get(org.opennms.newts.api.Context context,
org.opennms.newts.api.Resource resourceId)
Returns an
Optional of the ResourceMetadata for context and
resource, or Optional.absent() if one does not exist. |
void |
merge(org.opennms.newts.api.Context context,
org.opennms.newts.api.Resource resource,
ResourceMetadata metadata)
Merges the contents of a
ResourceMetadata with the cached instance corresponding to
context and resource. |
@Inject
public GuavaResourceMetadataCache(@Named(value="search.resourceMetadata.maxCacheEntries")
long maxSize,
com.codahale.metrics.MetricRegistry registry)
public com.google.common.base.Optional<ResourceMetadata> get(org.opennms.newts.api.Context context, org.opennms.newts.api.Resource resourceId)
ResourceMetadataCacheOptional of the ResourceMetadata for context and
resource, or Optional.absent() if one does not exist.get in interface ResourceMetadataCachecontext - application context of the resource metadataresourceId - the resourcecontext and resourcepublic void merge(org.opennms.newts.api.Context context,
org.opennms.newts.api.Resource resource,
ResourceMetadata metadata)
ResourceMetadataCacheResourceMetadata with the cached instance corresponding to
context and resource. If no such ResourceMetadata instance
exists, the supplied value is stored as-is.merge in interface ResourceMetadataCachecontext - application context of the resource metadataresource - the resourcemetadata - metadata associated with the resourceCopyright © 2015. All rights reserved.