- com
- pcbsys
- nirvana
- client
- p2p
- nServiceFactory
A ServiceFactory is used to create both client and server services. More...
#include <nServiceFactory.h>
Inherits Observable.
Public Member Functions | |
void | close () |
Closes all currently openned services and disconnects from the Realm server. More... | |
nService * | connectToService (nServiceInfo *pServiceInfo, long timeout=-1) |
Given an nServiceInfo object this constructs an nService object which can then be used to communicate with a remote service. More... | |
nServerService * | createEventService (const std::string &name, const std::string &description, long accessMask=-1) |
Given a name and a description, this call constructs a new event service and advertises the new service on the realm. More... | |
nServerService * | createStreamService (const std::string &name, const std::string &description, long accessMask=-1) |
Given a name and a description, this call constructs a new stream service and advertises the new service on the realm. More... | |
nServiceInfo * | findService (const std::string &serviceName) |
Locates the information about the specified service. More... | |
std::list< nServiceInfo * > * | getAllServices () |
Returns a list of all known services. More... | |
std::list< nServiceInfo * > * | getAllServices (long timeout) |
Returns a list of all known services. More... | |
bool | isConnected () |
If the factory has a connection to the Realm Server or not. More... | |
nServiceFactory (nSessionAttributes *pSessionAttrib, const std::string &username="") | |
Contructs a P2P Service Factory instance on the realm specified by the session attributes. More... | |
nServiceFactory (nSession *pSession) | |
Construct a P2P Service Factory re-using an existing nSession object. More... | |
A ServiceFactory is used to create both client and server services.
com::pcbsys::nirvana::client::p2p::nServiceFactory::nServiceFactory | ( | nSessionAttributes * | pSessionAttrib, |
const std::string & | username = "" |
||
) |
Contructs a P2P Service Factory instance on the realm specified by the session attributes.
*pSessionAttrib | The SessionAttributes that reference the desired Realm |
username | The username to supply to the realm server |
nBaseClientException | If unable to communicate with the realm |
com::pcbsys::nirvana::client::p2p::nServiceFactory::nServiceFactory | ( | nSession * | pSession | ) |
Construct a P2P Service Factory re-using an existing nSession object.
*pSession | the session to re-use |
nBaseClientException | thrown if there are any problems connecting to the services on the specific realm |
void com::pcbsys::nirvana::client::p2p::nServiceFactory::close | ( | ) |
Closes all currently openned services and disconnects from the Realm server.
This should be done as the last thing.
nService* com::pcbsys::nirvana::client::p2p::nServiceFactory::connectToService | ( | nServiceInfo * | pServiceInfo, |
long | timeout = -1 |
||
) |
Given an nServiceInfo object this constructs an nService object which can then be used to communicate with a remote service.
*pServiceInfo | An nServiceInfo that contains the information regarding the service to connect to |
timeout | Maximum time in milliseconds to attempt to connect to the service |
IOException | if unable to communicate with the remote service, see the message for further information |
nBaseClientException | If an exception occured locally, see the message for further information |
nServerService* com::pcbsys::nirvana::client::p2p::nServiceFactory::createEventService | ( | const std::string & | name, |
const std::string & | description, | ||
long | accessMask = -1 |
||
) |
Given a name and a description, this call constructs a new event service and advertises the new service on the realm.
name | Name of the service to create |
description | A String detailing what this service is |
accessMask | the default acl permissions for the service |
nBaseClientException | If an exception occured locally, see the message for further information |
nServerService* com::pcbsys::nirvana::client::p2p::nServiceFactory::createStreamService | ( | const std::string & | name, |
const std::string & | description, | ||
long | accessMask = -1 |
||
) |
Given a name and a description, this call constructs a new stream service and advertises the new service on the realm.
name | Name of the service to create |
description | A String detailing what this service is |
accessMask | the default acl permissions for the service |
nBaseClientException | If an exception occured locally, see the message for further information |
nServiceInfo* com::pcbsys::nirvana::client::p2p::nServiceFactory::findService | ( | const std::string & | serviceName | ) |
Locates the information about the specified service.
serviceName | The name of the service to find the nServiceInfo about |
nIllegalArgumentException | if the service name is null or illegal |
std::list<nServiceInfo*>* com::pcbsys::nirvana::client::p2p::nServiceFactory::getAllServices | ( | ) |
Returns a list of all known services.
std::list<nServiceInfo*>* com::pcbsys::nirvana::client::p2p::nServiceFactory::getAllServices | ( | long | timeout | ) |
Returns a list of all known services.
timeout | Time to wait before first service arrives. |
bool com::pcbsys::nirvana::client::p2p::nServiceFactory::isConnected | ( | ) |
If the factory has a connection to the Realm Server or not.