Package svs_core :: Package network :: Module clientuser :: Class GenericClient
[show private | hide private]
[frames | no frames]

Class GenericClient

Jellyable --+        
            |        
 Serializable --+    
                |    
    Referenceable --+
                    |
                   GenericClient

Known Subclasses:
ScriptableClient

GenericClient provides the basic client capabilities for SVS clients. It is able to connect to a cluster, retrieve data and disconnect from a cluster but little else.

Specialised client types extend from this class to provide more capabilities.

When talking to server, communicate with avatar. When talking to other clients, communicate with clusterGroup.

Callbacks from message to avatar start with 'avatarResult_'. Callbacks from message to clusterGroup start with 'groupResult_'.
Method Summary
  __init__(self, name, passwd)
  advertise(self, advertPacket)
Places advert for services on server.
  avatarResult_clearDepositedData(self, result)
Received result of clearDepositedData from avatar.
  avatarResult_depositData(self, result)
Receives result of depositData from avatar.
  avatarResult_joinClusterGroup(self, group)
Handles result of joinClusterGroup action.
  avatarResult_leaveCluster(self, result)
Handles result of leaveCluster action.
  avatarResult_notifyListeners(self, result)
Callback for notifyListeners method.
  avatarResult_retrieveOwnData(self, result)
Received result of retrieveOwnData from avatar.
  clearDepositedData(self, label)
Empties cache of data deposits held by avatar.
  clearLocalData(self, label)
Empties cache of data deposits held by client.
  connect(self, group, host, port)
Connect to server.
  depositData(self, dataPacket)
Sends data packet to avatar on server where it is cached for other clients to collect.
  disconnect(self)
Disconnect from cluster.
  errorMessage(self, text)
Handles error messages for client.
  getData(self, dataRequest)
Retrieves data from specified source on cluster, and performs 'callback' on receipt.
  getDataForLabel(self, dataRequest)
Allows speacialised handling of labelled data.
  getGroupMembers(self)
Retrieves a list of all clients currently connected to cluster group.
  getLocalData(self, label)
Retrieves local data from cache.
  getName(self)
Returns name of client.
  getProfileForClient(self, clientName)
Retrieves profile for specified client from server.
  groupResult_getClientList(self, result)
Handles receievd list of clients in group.
  groupResult_getData(self, result)
Receives result of getData from avatar.
  groupResult_getProfileForClient(self, commandResult)
Receives profile requested from other client.
  groupResult_listenTo(self, result)
Callback for listenTo method.
  groupResult_sendChatMessage(self, result)
Callback for sendChatMessage method.
  groupResult_sendData(self, result)
Receives result of sendData from avatar.
  groupResult_sendDataResult(self, result)
Receives result of sendDataResult from avatar.
  groupResult_startListeningToProcess(self, result)
Callback for listenTo method.
  groupResult_stopListeningTo(self, result)
Callback for stopListeningTo method.
  groupResult_stopListeningToProcess(self, result)
Callback for stopListeningTo method.
  handleDataPacket(self, dataPacket)
Handles data packet received from network.
  handleGroupMemberList(self, groupList)
Deals with received list of group members.
  handleProfileRequest(self, requester)
Responds notification of request for profile.
  handleReceivedProfile(self, profile)
Performs actions in response to profile receievd from another client.
  haveJoinedClusterGroup(self)
Called after a client has succesfully joined a cluster group.
  joinClusterGroup(self)
Client attempts to join cluster group.
  leaveCluster(self)
Client leaves cluster.
  logMessage(self, text)
Handles log messages for client.
  notifyListeners(self, dataPacket)
Forward data to listeners.
  remote_errorMessage(self, message)
Handles error message sent from client proxy on server.
  remote_getProfile(self)
Retrieves profile for cleint
  remote_handleDataRequest(self, dataRequest)
Responds to request for data from another client.
  remote_notify(self, notification)
Receives notification packets from other clients to which this has registered as listener.
  remote_profileRequested(self, requester)
Receives name of other client that has requested this client's profile.
  remote_receiveChatMessage(self, msgPacket)
Receives chat message from other clients.
  remote_receiveData(self, dataPacket)
Handles data sent from client proxy on server.
  remote_receiveDataResult(self, cmdResult)
Handles data sent, inside makeCommandResult, from client proxy on server.
  remote_statusMessage(self, message)
Handles status message sent from client proxy on server.
  remote_update(self, time)
Handles update sent from client proxy on server.
  result_connected(self, perspective)
Called by server when connection made.
  retrieveOwnData(self, dataRequest)
Collects previously deposited data packet from avatar.
  searchForCommands(self, commandList)
Queries server for clients responding to specified command names.
  searchForMethods(self, methodsList)
Queries server for clients responding to specified method names.
  searchForServices(self, serviceList)
Queries server for clients providing specified services.
  searchForUsers(self, serviceList)
Queries server for clients using specified services.
  searchProfiles(self, profileRequest)
Generic handler for searching client profiles.
  sendChatMessage(self, msgPacket)
Sends chat message to other clients.
  sendData(self, dataPacket)
Sends data to another client.
  sendDataResult(self, dataResult)
Sends data to another client.
  sendHttpRequest(self, url, method)
Sends HTTP request to specified URL.
  setWorker(self, worker)
Add delegate class for handling work tasks on client.
  shutdown(self, result)
Called by the server when it shuts down.
  startListeningTo(self, sourceClient, listenFor)
Register as listener with another client.
  startListeningToProcess(self, listenFor)
Register as listener to network processes.
  statusMessage(self, text)
Handles status messages for client.
  stopListeningTo(self, sourceClient, listenFor)
De-register as listener with another client.
  stopListeningToProcess(self, listenFor)
De-register as listener to network processes.
  storeLocalData(self, dataPacket)
Stores local data in cache.
    Inherited from Referenceable
  jellyFor(self, jellier)
(internal)
  remoteMessageReceived(self, broker, message, args, kw)
A remote message has been received.
    Inherited from Serializable
  processUniqueID(self)
Return an ID which uniquely represents this object for this process.
    Inherited from Jellyable
  getStateFor(self, jellier)

Instance Variable Summary
object avatar: proxy class for cluster supplied by server
string clientName: name for client (uses class name as default)
string clientPassword: password for client (uses class signature as default)
string clusterGroupName: name of cluster group
dict dataCache: store for temporary data
boolean logging: flag to turn logging output on and off
ClientProfile profile: client profile
object worker: plugin class for handling specialised processes

Class Variable Summary
    Inherited from Referenceable
Implements __implemented__ = <implementedBy twisted.spread.flavors....
_implementsTuple __implements__ = (<MetaInterface twisted.spread.interfac...
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...
NoneType perspective = None                                                                  
    Inherited from Jellyable
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...

Method Details

advertise(self, advertPacket)

Places advert for services on server.

avatarResult_clearDepositedData(self, result)

Received result of clearDepositedData from avatar.

avatarResult_depositData(self, result)

Receives result of depositData from avatar.

avatarResult_joinClusterGroup(self, group)

Handles result of joinClusterGroup action.

avatarResult_leaveCluster(self, result)

Handles result of leaveCluster action.
Parameters:
result - result packet
           (type=dict)

avatarResult_notifyListeners(self, result)

Callback for notifyListeners method.

avatarResult_retrieveOwnData(self, result)

Received result of retrieveOwnData from avatar.

clearDepositedData(self, label=None)

Empties cache of data deposits held by avatar.

Uses avatarResult_clearDepositedData as callback.

clearLocalData(self, label=None)

Empties cache of data deposits held by client.

If a label is specified then only data stored under that label is removed.

connect(self, group, host, port)

Connect to server.
Parameters:
group - name of group
           (type=string)
host - name of server host
           (type=string)
port - server port number
           (type=integer)

depositData(self, dataPacket)

Sends data packet to avatar on server where it is cached for other clients to collect.

disconnect(self)

Disconnect from cluster.

errorMessage(self, text)

Handles error messages for client. This should be overridden by implementing classes.
Parameters:
text - message
           (type=string)

getData(self, dataRequest)

Retrieves data from specified source on cluster, and performs 'callback' on receipt.

This method may often be used by delegate worker classes.

Uses groupResult_getData as callback.

getDataForLabel(self, dataRequest)

Allows speacialised handling of labelled data.

This can be overridden by extending classes to provide custom methods for providing requested data.

getGroupMembers(self)

Retrieves a list of all clients currently connected to cluster group.

getLocalData(self, label=None)

Retrieves local data from cache.

getName(self)

Returns name of client.

getProfileForClient(self, clientName)

Retrieves profile for specified client from server.

groupResult_getClientList(self, result)

Handles receievd list of clients in group.
Parameters:
result - result packet
           (type=dict)

groupResult_getData(self, result)

Receives result of getData from avatar.

groupResult_getProfileForClient(self, commandResult)

Receives profile requested from other client.

groupResult_listenTo(self, result)

Callback for listenTo method.

groupResult_sendChatMessage(self, result)

Callback for sendChatMessage method.

groupResult_sendData(self, result)

Receives result of sendData from avatar.

groupResult_sendDataResult(self, result)

Receives result of sendDataResult from avatar.

groupResult_startListeningToProcess(self, result)

Callback for listenTo method.

groupResult_stopListeningTo(self, result)

Callback for stopListeningTo method.

groupResult_stopListeningToProcess(self, result)

Callback for stopListeningTo method.

handleDataPacket(self, dataPacket)

Handles data packet received from network.

handleGroupMemberList(self, groupList)

Deals with received list of group members.

This can be overridden by implementing clients.

handleProfileRequest(self, requester)

Responds notification of request for profile.

handleReceivedProfile(self, profile)

Performs actions in response to profile receievd from another client.

This should be overidden to provide desired functionality for extending clients.

haveJoinedClusterGroup(self)

Called after a client has succesfully joined a cluster group.

This does nothing by itself but can be overidden by extending clients to handle any actions necessary at this point.

joinClusterGroup(self)

Client attempts to join cluster group. If succesful, it will be added to a list of similar client types also currently connected.

This list is returned in the callback method joinClusterResult.

leaveCluster(self)

Client leaves cluster. On the server side it will be removed from the list of clients it was previously grouped with.

This list is returned in the callback method leaveClusterResult.

logMessage(self, text)

Handles log messages for client. Log messages can be turned on and off.

This should be overridden by implementing classes.
Parameters:
text - message
           (type=string)

notifyListeners(self, dataPacket)

Forward data to listeners.

Uses avatarResult_notifyListeners as callback.

remote_errorMessage(self, message)

Handles error message sent from client proxy on server.
Parameters:
message - message from proxy
           (type=string)

remote_getProfile(self)

Retrieves profile for cleint

remote_handleDataRequest(self, dataRequest)

Responds to request for data from another client.

remote_notify(self, notification)

Receives notification packets from other clients to which this has registered as listener.

remote_profileRequested(self, requester)

Receives name of other client that has requested this client's profile.

remote_receiveChatMessage(self, msgPacket)

Receives chat message from other clients.

remote_receiveData(self, dataPacket)

Handles data sent from client proxy on server.
Parameters:
dataPacket - data from simulation
           (type=DataPacket)

remote_receiveDataResult(self, cmdResult)

Handles data sent, inside makeCommandResult, from client proxy on server.
Parameters:
cmdResult - data result from other client
           (type=makeCommandResult)

remote_statusMessage(self, message)

Handles status message sent from client proxy on server.
Parameters:
message - message from proxy
           (type=string)

remote_update(self, time)

Handles update sent from client proxy on server.
Parameters:
time - current simulation time
           (type=list)

result_connected(self, perspective)

Called by server when connection made.

This passes a perspective object. This is a reference to the server connection which is used for invoking remote calls on the server.
Parameters:
perspective - reference to server connection
           (type=object)

retrieveOwnData(self, dataRequest)

Collects previously deposited data packet from avatar. Uses avatarResult_retrieveOwnData as callback.

searchForCommands(self, commandList)

Queries server for clients responding to specified command names.

searchForMethods(self, methodsList)

Queries server for clients responding to specified method names.

searchForServices(self, serviceList)

Queries server for clients providing specified services.

searchForUsers(self, serviceList)

Queries server for clients using specified services.

searchProfiles(self, profileRequest)

Generic handler for searching client profiles.

sendChatMessage(self, msgPacket)

Sends chat message to other clients.

sendData(self, dataPacket)

Sends data to another client.

Uses groupResult_sendData as callback.

sendDataResult(self, dataResult)

Sends data to another client.

Uses groupResult_sendData as callback.

sendHttpRequest(self, url, method=None)

Sends HTTP request to specified URL.

setWorker(self, worker)

Add delegate class for handling work tasks on client.

shutdown(self, result)

Called by the server when it shuts down.

startListeningTo(self, sourceClient, listenFor=None)

Register as listener with another client.

startListeningToProcess(self, listenFor)

Register as listener to network processes.

statusMessage(self, text)

Handles status messages for client. This should be overridden by implementing classes.
Parameters:
text - message
           (type=string)

stopListeningTo(self, sourceClient, listenFor=None)

De-register as listener with another client.

stopListeningToProcess(self, listenFor)

De-register as listener to network processes.

storeLocalData(self, dataPacket)

Stores local data in cache.

Data is stored as DataPacket.

Instance Variable Details

avatar

proxy class for cluster supplied by server
Type:
object

clientName

name for client (uses class name as default)
Type:
string

clientPassword

password for client (uses class signature as default)
Type:
string

clusterGroupName

name of cluster group
Type:
string

dataCache

store for temporary data
Type:
dict

logging

flag to turn logging output on and off
Type:
boolean

profile

client profile
Type:
ClientProfile

worker

plugin class for handling specialised processes
Type:
object

Generated by Epydoc 2.1 on Thu Oct 20 15:30:28 2005 http://epydoc.sf.net