Class GridRouterClientImpl

    • Method Detail

      • stop

        public void stop​(boolean wait)
        Closes client.
        Parameters:
        wait - If true will wait for all pending requests to be proceeded.
      • id

        public UUID id()
        Gets a unique client identifier. This identifier is generated by factory on client creation and used in identification and authentication procedure on server node.
        Specified by:
        id in interface GridClient
        Returns:
        Generated client id.
      • data

        public GridClientData data​(String cacheName)
                            throws GridClientException
        Gets a data projection for grid cache with name cacheName. If no data configuration with given name was provided at client startup, an exception will be thrown.
        Specified by:
        data in interface GridClient
        Parameters:
        cacheName - Grid cache name for which data projection should be obtained.
        Returns:
        Data projection for grid cache with name cacheName.
        Throws:
        GridClientException - If client was closed or no configuration with given name was provided.
      • compute

        public GridClientCompute compute()
        Gets a default compute projection. Default compute projection will include all nodes in remote grid. Selection of node that will be connected to perform operations will be done according to GridClientLoadBalancer provided in client configuration or according to affinity if projection call involves affinity key.

        More restricted projection configurations may be created with GridClientCompute methods.

        Specified by:
        compute in interface GridClient
        Returns:
        Default compute projection.
        See Also:
        GridClientCompute
      • connected

        public boolean connected()
        Indicates whether client is connected to remote Grid. In other words it allow to determine if client is able to communicate with Grid right now. If it can't all methods on Compute and Data projections throw GridClientDisconnectedException.

        Connection status is updated in background together with topology update. See GridClientConfiguration.getTopologyRefreshFrequency() for more details on how background topology update works.

        Note that due to asynchronous nature of topology update and connectivity detection this method gives no guarantees for subsequent calls for projections methods. It can be used only fo diagnostic and monitoring purposes.

        Specified by:
        connected in interface GridClient
        Returns:
        Whether client is connected to remote Grid.