Class ServiceProviderCache
- java.lang.Object
-
- com.sodius.oslc.client.requests.cache.ServiceProviderCache
-
- All Implemented Interfaces:
ResourceCache<URI>
public class ServiceProviderCache extends Object implements ResourceCache<URI>
A cache holding Service Providers properties that are frequently used and rarely change.- Since:
- 1.11.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetGlobalConfigurationAware(OslcClient client, URI uri)Returns the value of the"http://jazz.net/xmlns/prod/jazz/process/1.0/globalConfigurationAware"property, which indicates the level of support of Jazz Global Configuration.static ServiceProviderCachegetInstance()Returns the cache singleton instanceOptional<Publisher>getPublisher(OslcClient client, URI uri)Returns the publisher of the given service provider.voidinvalidate(URI uri)Discards any cached value for keykey.voidinvalidateAll()Discards all entries in the cache.voidupdate(URI uri, ServiceProvider serviceProvider)Updates the cache with a new version of a service provider.
-
-
-
Method Detail
-
getInstance
public static ServiceProviderCache getInstance()
Returns the cache singleton instance- Returns:
- the cache shared instance.
-
invalidate
public void invalidate(URI uri)
Description copied from interface:ResourceCacheDiscards any cached value for keykey.- Specified by:
invalidatein interfaceResourceCache<URI>- Parameters:
uri- the key to remove in the cache.
-
invalidateAll
public void invalidateAll()
Description copied from interface:ResourceCacheDiscards all entries in the cache.- Specified by:
invalidateAllin interfaceResourceCache<URI>
-
getGlobalConfigurationAware
public String getGlobalConfigurationAware(OslcClient client, URI uri)
Returns the value of the"http://jazz.net/xmlns/prod/jazz/process/1.0/globalConfigurationAware"property, which indicates the level of support of Jazz Global Configuration.Value might be:
"yes": the application supports configurations and versioned artifacts."compatible": the application does not support configurations, but it can still link to or interact with versioned artifacts."no": the application has no support for configurations or versioning.
- Parameters:
client- the OSLC client to query the service provider in case it is not cacheduri- the service provider URI- Returns:
- the value of the
globalConfigurationAwareproperty,"no"if the property is not set.
-
getPublisher
public Optional<Publisher> getPublisher(OslcClient client, URI uri)
Returns the publisher of the given service provider.- Parameters:
client- the OSLC client to query the service provider in case it is not cached.uri- the service provider URI.- Returns:
- the service provider's publisher, or
Optional.empty()if the provider doesn't declare a Publisher resource. - Since:
- 1.14.0
-
update
public void update(URI uri, ServiceProvider serviceProvider)
Updates the cache with a new version of a service provider.This method should not need to be called in regular flows. It is automatically called when a resource is obtained using
GetServiceProvider.- Parameters:
uri- the service provider URIserviceProvider- the service provider- Since:
- 3.1.0
-
-