5#ifndef GLACIER2_SESSION_HELPER_H
6#define GLACIER2_SESSION_HELPER_H
39#ifndef ICE_CPP11_MAPPING
94#ifndef ICE_CPP11_MAPPING
107#ifndef ICE_CPP11_MAPPING
142class SessionThreadCallback;
150#ifdef ICE_CPP11_MAPPING
151 :
public std::enable_shared_from_this<SessionFactoryHelper>
157 friend class SessionThreadCallback;
216 void setSecure(
bool);
218 bool getSecure() const;
297 Ice::InitializationData createInitData();
298 std::
string getRouterFinderStr();
299 int getPortInternal() const;
300 std::
string createProxyStr(const
Ice::Identity& ident);
301 void setDefaultProperties();
304 std::
string _routerHost;
305 Ice::Identity _identity;
306 std::
string _protocol;
309 Ice::InitializationData _initData;
311 std::map<std::
string, std::
string> _context;
#define ICE_DEFINE_PTR(TPtr, T)
Definition Config.h:377
#define ICE_DEPRECATED_API(msg)
Definition Config.h:217
#define GLACIER2_API
Definition PermissionsVerifierF.h:50
Allows an application to receive notification about events in the lifecycle of a Glacier2 session.
Definition SessionHelper.h:110
virtual ~SessionCallback()
virtual void disconnected(const SessionHelperPtr &session)=0
Called after the Glacier2 session is destroyed.
virtual void createdCommunicator(const SessionHelperPtr &session)=0
Called after successfully initializing a communicator.
virtual void connectFailed(const SessionHelperPtr &session, const Ice::Exception &ex)=0
Called if a failure occurred while attempting to establish a Glacier2 session.
virtual void connected(const SessionHelperPtr &session)=0
Called after successfully establishing the Glacier2 session.
Facilitates the creation of new Glacier2 sessions.
Definition SessionHelper.h:155
void setRouterHost(const std::string &host)
Sets the host name of the Glacier2 router.
SessionFactoryHelper(const Ice::InitializationData &initData, const SessionCallbackPtr &callback)
Use this constructor when you want to provide your own instance of InitializationData.
void setProtocol(const std::string &protocol)
Sets the Ice protocol used for communications with the Glacier2 router.
bool getUseCallbacks() const
Determines whether the session helper automatically creates an object adapter for callback servants.
Ice::InitializationData getInitializationData() const
Returns a copy of the InitializationData object that will be used during communicator initialization.
SessionHelperPtr connect()
Initializes a communicator, creates a Glacier2 session using SSL credentials, and returns a new Sessi...
std::string getRouterHost() const
Obtains the host name of the Glacier2 router.
SessionFactoryHelper(const Ice::PropertiesPtr &properties, const SessionCallbackPtr &callback)
This constructor is convenient when you want to supply an initial set of properties.
void setRouterIdentity(const Ice::Identity &identity)
Sets the object identity of the Glacier2 router.
int getPort() const
Obtains the port on which the Glacier2 router is listening.
std::string getProtocol() const
Obtains the Ice protocol used for communications with the Glacier2 router.
SessionFactoryHelper(const SessionCallbackPtr &callback)
This constructor is useful when your application has no other configuration requirements.
void setUseCallbacks(bool b)
Determines whether the session helper automatically creates an object adapter for callback servants.
void setConnectContext(const std::map< std::string, std::string > &context)
Sets the request context to be used when creating a session.
Ice::Identity getRouterIdentity() const
Obtains the object identity of the Glacier2 router.
void destroy()
Blocks until all background threads are terminated.
int getTimeout() const
Obtains the timeout in milliseconds for the connection to the Glacier2 router.
void setPort(int port)
Sets the port on which the Glacier2 router is listening.
void setTimeout(int timeout)
Sets the timeout in milliseconds for the connection to the Glacier2 router.
Encapsulates a Glacier2 session and provides much of the same functionality as Glacier2::Application ...
Definition SessionHelper.h:42
virtual bool isConnected() const =0
Determines whether the session is active.
virtual void destroy()=0
Initiates the destruction of the Glacier2 session, including the communicator created by the SessionH...
virtual Ice::ObjectPrxPtr addWithUUID(const Ice::ObjectPtr &servant)=0
Adds a servant to the callback object adapter using a UUID for the identity name.
virtual Ice::ObjectAdapterPtr objectAdapter()=0
Obtains the callback object adapter.
virtual SessionPrxPtr session() const =0
Obtains a proxy for the Glacier2 session.
virtual Ice::CommunicatorPtr communicator() const =0
Obtains the communicator created by the SessionHelper.
bool operator==(const SessionHelper &) const
virtual std::string categoryForClient() const =0
Obtains the category that must be used in the identities of all callback objects.
bool operator!=(const SessionHelper &) const
Definition PermissionsVerifier.h:524
::IceUtil::Handle< SessionHelper > SessionHelperPtr
Definition SessionHelper.h:100
::IceUtil::Handle< SessionFactoryHelper > SessionFactoryHelperPtr
Definition SessionHelper.h:315
const int GLACIER2_TCP_PORT
The IANA-registered port number for Glacier2 via TCP.
Definition SessionHelper.h:31
const int GLACIER2_SSL_PORT
The IANA-registered port number for Glacier2 via SSL.
Definition SessionHelper.h:29
::IceUtil::Handle< SessionCallback > SessionCallbackPtr
Definition SessionHelper.h:139
SessionPrx SessionPrxPtr
Definition Session.h:1521
Definition BuiltinSequences.h:113
IceInternal::Handle< Object > ObjectPtr
Definition ObjectF.h:21
::IceInternal::Handle< Properties > PropertiesPtr
Definition Properties.h:256
::IceInternal::Handle< ObjectAdapter > ObjectAdapterPtr
Definition ObjectAdapter.h:620
::IceInternal::Handle< Communicator > CommunicatorPtr
Definition Communicator.h:608
IceUtil::Exception Exception
Definition Exception.h:22
ObjectPrx ObjectPrxPtr
Definition ProxyF.h:48
The identity of an Ice object.
Definition Identity.h:144
Encapsulates data to initialize a communicator.
Definition Initialize.h:279