Interface ClientFactory

  • All Known Implementing Classes:
    CharonFactory

    public interface ClientFactory
    The factory interface generates client instances
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String buildCacheKey​(ConsumedDestinationModel destination)
      Helper method to build cache key which holds client proxy.
      void clearCache()
      Remove all clients from the cache
      <T> T client​(java.lang.String cacheKey, java.lang.Class<T> clientType, java.util.Map<java.lang.String,​java.lang.String> clientConfig)
      Generates a client proxy for the given client type
      void inValidateCache​(java.lang.String key)
      Invalidate the cache for the given key
    • Method Detail

      • client

        <T> T client​(java.lang.String cacheKey,
                     java.lang.Class<T> clientType,
                     java.util.Map<java.lang.String,​java.lang.String> clientConfig)
        Generates a client proxy for the given client type
        Type Parameters:
        T - the type of the client
        Parameters:
        cacheKey - the id of the client
        clientType - the class of client type
        clientConfig - the map consist of configurations of client
        Returns:
        the client proxy
      • inValidateCache

        void inValidateCache​(java.lang.String key)
        Invalidate the cache for the given key
        Parameters:
        key - the key of client
      • clearCache

        void clearCache()
        Remove all clients from the cache
      • buildCacheKey

        java.lang.String buildCacheKey​(ConsumedDestinationModel destination)
        Helper method to build cache key which holds client proxy.
        Parameters:
        destination - consumed destination of the client
        Returns:
        cache key string