com.pcbsys.nirvana.client.p2p.com.pcbsys.nirvana.client.p2p.nServiceFactory Class Reference

A ServiceFactory is used to create both client and server services. More...

Inherits com::pcbsys::nirvana::client::Observable.


Public Member Functions

void close ()
 Closes all currently openned services and disconnects from the Realm server.
nService connectToService (nServiceInfo serviceInfo, long timeout)
 Connects to the given service defined in the nServiceInfo and will wait for the timeout specified for the remote service to respond.
nService connectToService (nServiceInfo serviceInfo)
 Given an nServiceInfo object this constructs an nService object which can then be used to communicate with a remote service.
nServerService createEventService (string name, string description, long accessMask)
 Given a name and a description, this call constructs a new event service and advertises the new service on the realm.
nServerService createEventService (string name, string description)
 Given a name and a description, this call constructs a new event service and advertises the new service on the realm.
nServerService createStreamService (string name, string description)
 Given a name and a description, this call constructs a new stream service and advertises the new service on the realm.
nServiceInfo findService (string serviceName)
 Locates the information about the specified service.
IEnumerator< nServiceInfogetAllServices (long timeout)
 Returns an IEnumerator of all known services.
IEnumerator< nServiceInfogetAllServices ()
 Returns an IEnumerator of all known services.
bool isConnected ()
 If the factory has a connection to the Realm Server or not.
 nServiceFactory (nSessionAttributes sessionAttrib, string username)
 Contructs a P2P Service Factory instance on the realm specified by the session attributes.
 nServiceFactory (nSessionAttributes sessionAttrib)
 Contructs a P2P Service Factory instance on the realm specified by the session attributes.
 nServiceFactory (nSession aSession)
 Construct a P2P Service Factory re-using an existing nSession object.

Detailed Description

A ServiceFactory is used to create both client and server services.

Constructor & Destructor Documentation

com.pcbsys.nirvana.client.p2p.com.pcbsys.nirvana.client.p2p.nServiceFactory.nServiceFactory ( nSession  aSession  ) 

Construct a P2P Service Factory re-using an existing nSession object.

Parameters:
aSession the session to re-use
Exceptions:
nBaseClientException thrown if there are any problems connecting to the services on the specific realm

com.pcbsys.nirvana.client.p2p.com.pcbsys.nirvana.client.p2p.nServiceFactory.nServiceFactory ( nSessionAttributes  sessionAttrib  ) 

Contructs a P2P Service Factory instance on the realm specified by the session attributes.

Parameters:
sessionAttrib The SessionAttributes that reference the desired Realm
Exceptions:
nBaseClientException If unable to communicate with the realm

com.pcbsys.nirvana.client.p2p.com.pcbsys.nirvana.client.p2p.nServiceFactory.nServiceFactory ( nSessionAttributes  sessionAttrib,
string  username 
)

Contructs a P2P Service Factory instance on the realm specified by the session attributes.

Parameters:
sessionAttrib The SessionAttributes that reference the desired Realm
username The username to supply to the realm server
Exceptions:
nBaseClientException If unable to communicate with the realm


Member Function Documentation

void com.pcbsys.nirvana.client.p2p.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.com.pcbsys.nirvana.client.p2p.nServiceFactory.connectToService ( nServiceInfo  serviceInfo,
long  timeout 
)

Connects to the given service defined in the nServiceInfo and will wait for the timeout specified for the remote service to respond.

Parameters:
serviceInfo An nServiceInfo that contains the information regarding the service to connect to
timeout A time in milliseconds to wait for the service to come on-line
Returns:
nService A Service object connected to the remote service
Exceptions:
Exception 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

nService com.pcbsys.nirvana.client.p2p.com.pcbsys.nirvana.client.p2p.nServiceFactory.connectToService ( nServiceInfo  serviceInfo  ) 

Given an nServiceInfo object this constructs an nService object which can then be used to communicate with a remote service.

Parameters:
serviceInfo An nServiceInfo that contains the information regarding the service to connect to
Returns:
nService A Service object connected to the remote service
Exceptions:
Exception 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.com.pcbsys.nirvana.client.p2p.nServiceFactory.createEventService ( string  name,
string  description,
long  accessMask 
)

Given a name and a description, this call constructs a new event service and advertises the new service on the realm.

Parameters:
name Name of the service to create
description A String detailing what this service is
accessMask The long value representing the initial security mask for the service
Returns:
Returns an nEventService
Exceptions:
nBaseClientException If an exception occured locally, see the message for further information
nEventService

nServerService com.pcbsys.nirvana.client.p2p.com.pcbsys.nirvana.client.p2p.nServiceFactory.createEventService ( string  name,
string  description 
)

Given a name and a description, this call constructs a new event service and advertises the new service on the realm.

Parameters:
name Name of the service to create
description A String detailing what this service is
Returns:
Returns an nEventService
Exceptions:
nBaseClientException If an exception occured locally, see the message for further information
nEventService

nServerService com.pcbsys.nirvana.client.p2p.com.pcbsys.nirvana.client.p2p.nServiceFactory.createStreamService ( string  name,
string  description 
)

Given a name and a description, this call constructs a new stream service and advertises the new service on the realm.

Parameters:
name Name of the service to create
description A String detailing what this service is
Returns:
Returns an nStreamService
Exceptions:
nBaseClientException If an exception occured locally, see the message for further information
nStreamService

nServiceInfo com.pcbsys.nirvana.client.p2p.com.pcbsys.nirvana.client.p2p.nServiceFactory.findService ( string  serviceName  ) 

Locates the information about the specified service.

Parameters:
serviceName The name of the service to find the nServiceInfo about
Returns:
ServiceInfo
nServiceInfo
Exceptions:
nIllegalArgumentException if the service name is null or illegal

IEnumerator<nServiceInfo> com.pcbsys.nirvana.client.p2p.com.pcbsys.nirvana.client.p2p.nServiceFactory.getAllServices ( long  timeout  ) 

Returns an IEnumerator of all known services.

Returns:
Returns an IEnumerator of all the services.

Parameters:
timeout Specifies how long to wait (in milliseconds) for any newly constructed services
Returns:

IEnumerator<nServiceInfo> com.pcbsys.nirvana.client.p2p.com.pcbsys.nirvana.client.p2p.nServiceFactory.getAllServices (  ) 

Returns an IEnumerator of all known services.

Returns:
Returns an IEnumerator of all the services.

bool com.pcbsys.nirvana.client.p2p.com.pcbsys.nirvana.client.p2p.nServiceFactory.isConnected (  ) 

If the factory has a connection to the Realm Server or not.

Returns:
bool indicating the connection status