Interface ClientCache

    • Method Detail

      • getQueryService

        QueryService getQueryService​(java.lang.String poolName)
        Return the QueryService for the named pool. The query operations performed using this QueryService will be executed on the servers that are associated with this pool.
        Parameters:
        poolName - the name of the pool
        Returns:
        the QueryService for the named pool
      • getLocalQueryService

        QueryService getLocalQueryService()
        Return a QueryService that queries the local state in the client cache. These queries will not be sent to a server.
        Returns:
        a QueryService that queries the local state in the client cache
      • close

        void close​(boolean keepalive)
        Terminates this object cache and releases all the resources. Calls Region.close() on each region in the cache. After this cache is closed, any further method call on this cache or any region object will throw CacheClosedException, unless otherwise noted.
        Parameters:
        keepalive - whether the server should keep the durable client's queues alive for the timeout period
        Throws:
        CacheClosedException - if the cache is already closed.
      • createClientRegionFactory

        <K,​V> ClientRegionFactory<K,​V> createClientRegionFactory​(ClientRegionShortcut shortcut)
        Create and return a client region factory that is initialized to create a region using the given predefined region attributes.
        Type Parameters:
        K - the type of keys in the region
        V - the type of values in the region
        Parameters:
        shortcut - the predefined region attributes to initialize the factory with.
        Returns:
        a factory that will produce a client region.
      • createClientRegionFactory

        <K,​V> ClientRegionFactory<K,​V> createClientRegionFactory​(java.lang.String regionAttributesId)
        Create and return a client region factory that is initialized to create a region using the given named region attributes.

        Named region attributes are defined in cache.xml by setting the name as the value of the id attribute on a region-attributes element.

        Type Parameters:
        K - the type of keys in the region
        V - the type of values in the region
        Parameters:
        regionAttributesId - the named region attributes to initialize the factory with.
        Returns:
        a factory that will produce a client region.
        Throws:
        java.lang.IllegalStateException - if named region attributes has not been defined.
      • readyForEvents

        void readyForEvents()
        Notifies the server that this durable client is ready to receive updates. This method is used by durable clients to notify servers that they are ready to receive updates. As soon as the server receives this message, it will forward updates to this client (if necessary).

        Durable clients must call this method after they are done creating regions and issuing interest registration requests.If it is called before then events will be lost.Any time a new Pool is created and regions have been added to it then this method needs to be called again.

        Throws:
        java.lang.IllegalStateException - if called by a non-durable client
      • createAuthenticatedView

        RegionService createAuthenticatedView​(java.util.Properties userSecurityProperties)
        Creates an authenticated cache view using the given user security properties on the client cache's default pool. Multiple views with different user properties can be created on a single client cache.

        Requires that multiuser-authentication to be set to true on the default pool.

        Applications must use this instance to do operations, when multiuser-authentication is set to true.

        Authenticated cache views are only allows to access proxy regions. The RegionService.getRegion(java.lang.String) method will throw IllegalStateException if an attempt is made to get a region that has local storage.

        Parameters:
        userSecurityProperties - the security properties of a user.
        Returns:
        the RegionService instance associated with a user and the given properties.
        Throws:
        java.lang.UnsupportedOperationException - when invoked with multiuser-authentication as false.
      • createAuthenticatedView

        RegionService createAuthenticatedView​(java.util.Properties userSecurityProperties,
                                              java.lang.String poolName)
        Creates an authenticated cache view using the given user security properties using the given pool to connect to servers. Requires that multiuser-authentication to be set to true on the given pool.

        See createAuthenticatedView(Properties) for more information on the returned cache view.

        Parameters:
        userSecurityProperties - the security properties of a user.
        poolName - - the pool that the users should be authenticated against.
        Returns:
        the RegionService instance associated with a user and the given properties.
      • getCurrentServers

        java.util.Set<java.net.InetSocketAddress> getCurrentServers()
        Returns a set of the servers to which this client is currently connected.
        Returns:
        a set of the servers to which this client is currently connected
        Since:
        GemFire 6.6
      • getDefaultPool

        Pool getDefaultPool()
        Returns the default server pool. If one or more non-default pools were configured, this may return null.
        Returns:
        the default server pool
        Since:
        GemFire 7.0
        See Also:
        Pool