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 Details

    • 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: ResourceCache
      Discards any cached value for key key.
      Specified by:
      invalidate in interface ResourceCache<URI>
      Parameters:
      uri - the key to remove in the cache.
    • invalidateAll

      public void invalidateAll()
      Description copied from interface: ResourceCache
      Discards all entries in the cache.
      Specified by:
      invalidateAll in interface ResourceCache<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 cached
      uri - the service provider URI
      Returns:
      the value of the globalConfigurationAware property, "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 URI
      serviceProvider - the service provider
      Since:
      3.1.0