Managing a Cache in a Secure System

When you create your cache in a secure system, you provide credentials to the connection process for authentication by already-running, secure members. Clients connect to secure servers. Peers are authenticated by secure locators or peer members.

Follow these steps in addition to the steps for implementing security implementation for your peer, server, and client members. See Managing a Peer or Server Cache and Managing a Client Cache.
  1. To create your cache:
    1. Add any necessary security properties to the, to configure vFabric GemFire for your particular security implementation. Examples:
    2. When you create your cache, pass any properties required by your security implementation to the cache factory create call by using one of these methods:
      • ClientCacheFactory or CacheFactory set methods. Example:
        ClientCache clientCache = new ClientCacheFactory()
        	.set("security-username", username)
        	.set("security-password", password)
      • Properties object passed to the ClientCacheFactory or CacheFactory create method. These are usually properties of a sensitive nature that you do not want to put inside the file. Example:
        Properties properties = new Properties();
        properties.setProperty("security-username", username);
        properties.setProperty("security-password", password);
        Cache cache = new CacheFactory(properties).create();
        Note: Properties passed to a cache creation method override any settings in
  2. Close your cache when you are done using the close method of your Cache or ClientCache instance. Example: