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

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

Inheritance diagram for com.pcbsys.nirvana.client.p2p.nServiceFactory:
com.pcbsys.nirvana.client.Observable

Public Member Functions

void close ()
 Closes all currently openned services and disconnects from the Realm server. More...
 
nService connectToService (nServiceInfo serviceInfo)
 Given an nServiceInfo object this constructs an nService object which can then be used to communicate with a remote service. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
nServiceInfo findService (string serviceName)
 Locates the information about the specified service. More...
 
IEnumerator< nServiceInfogetAllServices ()
 Returns an IEnumerator of all known services. More...
 
IEnumerator< nServiceInfogetAllServices (long timeout)
 Returns an IEnumerator of all known services. More...
 
bool isConnected ()
 If the factory has a connection to the Realm Server or not. More...
 
 nServiceFactory (nSession aSession)
 Construct a P2P Service Factory re-using an existing nSession object More...
 
 nServiceFactory (nSessionAttributes sessionAttrib)
 Contructs a P2P Service Factory instance on the realm specified by the session attributes. More...
 
 nServiceFactory (nSessionAttributes sessionAttrib, string username)
 Contructs a P2P Service Factory instance on the realm specified by the session attributes. More...
 
- Public Member Functions inherited from com.pcbsys.nirvana.client.Observable
void addObserver (IObserver o)
 Adds an observer to the set of observers for this object, provided that it is not the same as some observer already in the set. More...
 
int countObservers ()
 Returns the number of observers of this Observable object. More...
 
void deleteObserver (IObserver o)
 Deletes an observer from the set of observers of this object. More...
 
void deleteObservers ()
 Clears the observer list so that this object no longer has any observers. More...
 
bool hasChanged ()
 Tests if this object has changed. More...
 
void notifyObservers ()
 If this object has changed, as indicated by the hasChanged method, then notify all of its observers and then call the clearChanged method to indicate that this object has no longer changed. More...
 
void notifyObservers (Object arg)
 If this object has changed, as indicated by the More...
 
 Observable ()
 Construct an Observable with zero Observers. More...
 

Additional Inherited Members

- Protected Member Functions inherited from com.pcbsys.nirvana.client.Observable
void clearChanged ()
 Indicates that this object has no longer changed, or that it has already notified all of its observers of its most recent change, so that the hasChanged method will now return false. More...
 
void setChanged ()
 Marks this Observable object as having been changed; the hasChanged method will now return true. More...
 

Detailed Description

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

Constructor & Destructor Documentation

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

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

Parameters
aSessionthe session to re-use
Exceptions
nBaseClientExceptionthrown if there are any problems connecting to the services on the specific realm
com.pcbsys.nirvana.client.p2p.nServiceFactory.nServiceFactory ( nSessionAttributes  sessionAttrib)

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

Parameters
sessionAttribThe SessionAttributes that reference the desired Realm
Exceptions
nBaseClientExceptionIf unable to communicate with the realm
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
sessionAttribThe SessionAttributes that reference the desired Realm
usernameThe username to supply to the realm server
Exceptions
nBaseClientExceptionIf unable to communicate with the realm

Member Function Documentation

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  serviceInfo)

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

Parameters
serviceInfoAn nServiceInfo that contains the information regarding the service to connect to
Returns
nService A Service object connected to the remote service
Exceptions
Exceptionif unable to communicate with the remote service, see the message for further information
nBaseClientExceptionIf an exception occured locally, see the message for further information
nService 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
serviceInfoAn nServiceInfo that contains the information regarding the service to connect to
timeoutA time in milliseconds to wait for the service to come on-line
Returns
nService A Service object connected to the remote service
Exceptions
Exceptionif unable to communicate with the remote service, see the message for further information
nBaseClientExceptionIf an exception occured locally, see the message for further information
nServerService 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
nameName of the service to create
descriptionA String detailing what this service is
Returns
Returns an nEventService
Exceptions
nBaseClientExceptionIf an exception occured locally, see the message for further information

nEventService

nServerService 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
nameName of the service to create
descriptionA String detailing what this service is
accessMaskThe long value representing the initial security mask for the service
Returns
Returns an nEventService
Exceptions
nBaseClientExceptionIf an exception occured locally, see the message for further information

nEventService

nServerService 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
nameName of the service to create
descriptionA String detailing what this service is
Returns
Returns an nStreamService
Exceptions
nBaseClientExceptionIf an exception occured locally, see the message for further information

nStreamService

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

Locates the information about the specified service.

Parameters
serviceNameThe name of the service to find the nServiceInfo about
Returns
ServiceInfo

nServiceInfo

Exceptions
nIllegalArgumentExceptionif the service name is null or illegal
IEnumerator<nServiceInfo> com.pcbsys.nirvana.client.p2p.nServiceFactory.getAllServices ( )

Returns an IEnumerator of all known services.

Returns
Returns an IEnumerator of all the services.
IEnumerator<nServiceInfo> 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
timeoutSpecifies how long to wait (in milliseconds) for any newly constructed services
Returns
bool 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