Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends

GridClientImpl Class Reference

#include <gridclientimpl.hpp>

Inheritance diagram for GridClientImpl:
GridClient GridClientProjectionListener

List of all members.

Classes

class  GridClientTopologyRefresher

Public Member Functions

 GridClientImpl (const GridClientConfiguration &cfg, std::shared_ptr< GridClientCommandExecutorPrivate > &exec)
virtual GridClientUuid id () const
virtual TGridClientDataPtr data ()
virtual TGridClientDataPtr data (const std::string &cacheName)
virtual TGridClientComputePtr compute ()
virtual void addTopologyListener (TGridClientTopologyListenerPtr lsnr)
virtual void removeTopologyListener (TGridClientTopologyListenerPtr lsnr)
virtual
TGridClientTopologyListenerListPtr 
topologyListeners () const
virtual void stop (bool waitCompletion=true)
void onNodeIoFailed (const GridClientNode &n)

Protected Types

typedef std::map< std::string,
std::shared_ptr
< GridClientDataProjectionImpl > > 
TDataPrjMap

Protected Member Functions

TGridClientSharedDataPtr getSharedData () const

Protected Attributes

std::shared_ptr
< GridClientComputeProjectionImpl > 
mainComputePrj
TDataPrjMap mainDataPrjs

Friends

class GridClientTopologyRefresher

Detailed Description

Client implementation.


Member Typedef Documentation

typedef std::map<std::string, std::shared_ptr<GridClientDataProjectionImpl> > GridClientImpl::TDataPrjMap [protected]

Typedef for link to the main data projection.


Constructor & Destructor Documentation

GridClientImpl::GridClientImpl ( const GridClientConfiguration &  cfg,
std::shared_ptr< GridClientCommandExecutorPrivate > &  exec 
)

Public constructor.

Parameters:
cfg Client configuration.
exec Executor of the commands.

Public constructor.


Member Function Documentation

virtual void GridClientImpl::addTopologyListener ( TGridClientTopologyListenerPtr  lsnr  )  [virtual]

Adds topology listener. Remote grid topology is refreshed every GridClientConfiguration#getTopologyRefreshFrequency() milliseconds. If any node was added or removed, a listener will be notified.

Parameters:
lsnr Listener to add.
virtual TGridClientComputePtr GridClientImpl::compute (  )  [virtual]

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.

Returns:
Default compute projection.
See also:
GridClientCompute
virtual TGridClientDataPtr GridClientImpl::data (  )  [virtual]

Gets a data projection for a default grid cache with null name.

Returns:
Data projection for grid cache with null name.
Exceptions:
GridClientException If client was closed.
virtual TGridClientDataPtr GridClientImpl::data ( const std::string &  cacheName  )  [virtual]

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.

Parameters:
cacheName Grid cache name for which data projection should be obtained.
Returns:
Data projection for grid cache with name cacheName.
Exceptions:
GridClientException If client was closed or no configuration with given name was provided.
TGridClientSharedDataPtr GridClientImpl::getSharedData (  )  const [inline, protected]

Returns the client shared data.

GridClientUuid GridClientImpl::id (  )  const [virtual]

Gets a unique client identifier. This identifier is generated by factory on client creation and used in identification and authentication procedure on server node.

Returns:
Generated client id.
void GridClientImpl::onNodeIoFailed ( const GridClientNode &  n  )  [virtual]
Parameters:
n Node.

Implements GridClientProjectionListener.

virtual void GridClientImpl::removeTopologyListener ( TGridClientTopologyListenerPtr  lsnr  )  [virtual]

Removes previously added topology listener.

Parameters:
lsnr Listener to remove.
virtual void GridClientImpl::stop ( bool  waitCompletion = true  )  [virtual]

Closes client.

Parameters:
waitCompletion If truewill wait for all pending requests to be proceeded.
virtual TGridClientTopologyListenerListPtr GridClientImpl::topologyListeners (  )  const [virtual]

Gets an unmodifiable snapshot of topology listeners list.

Returns:
List of topology listeners.

Friends And Related Function Documentation

friend class GridClientTopologyRefresher [friend]

GridClientTopologyRefresher may call non-public methods.


Member Data Documentation

The link to the main compute projection.

The link to the main data projection.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends