| java.lang.Object org.datashare.TreeView
TreeView | public class TreeView (Code) | | This class is run on the server and is responsible for maintaining our tree view of clients and
sessions/channels/consumers, and for issuing UpdateAvailableMsg objects to clients indicating
changes in our tree view. It makes calls back to the server when events warrent (such as a new
client has joined so the server is told about it so an UpdateAvailable object can be sent to all
registered listeners.
author: Charles Wood version: 1.0 |
TreeView | public TreeView(TreeViewServerInterface server)(Code) | | Constructor, performs no initialization
Parameters: server - the server instance that created this instance |
addChannel | public void addChannel(ChannelInfo channelInfo)(Code) | | adds the specified Channel to the parent Session and notifies listeners
|
addConsumer | public void addConsumer(ConsumerInfo consumerInfo)(Code) | | adds the specified Consumer to the specified Channel of the specified Session and notifies listeners
|
addSession | public void addSession(SessionInfo sessionInfo)(Code) | | adds the specified Session to the sessionNodes and notifies listeners
|
addSpecialClient | public void addSpecialClient(ClientInfo clientInfo)(Code) | | adds the specified Client to the ClientNodes and notifies listeners
|
addTreeListener | public boolean addTreeListener(ClientInfo clientInfo, SocketAdapter ts)(Code) | | calling this method will register the caller so that any subsequent tree updates
will be sent to the specified TreeViewListenerInterface. Note that for now,
a client may receive only their own class of sessions/clients updates, or all updates.
Parameters: clientInfo - the client of the commandStatus connection to be usedfor the update objects, must be previously registered with server. Parameters: ts - the socket that is to be used when sending TreeView datashareobjects, shouldcorrespond to a commandStatus connection on a client.Some of what is going on in this class might be better handled by a database,but we really don't want to force a user to have access to a database...and thefunctioning of this method is important.Note that clients should only be in treeViewListeners or treeViewAllListeners, not both.If a client is added to one, this method will remove them from the other.The type of clientClass that the client will be notified of will be only their ownclientClass, unless their ClientInfo has the seeAllTreeObjects flag set. |
getExternalArchivedNode | DefaultMutableTreeNode getExternalArchivedNode()(Code) | | Creates a node that show all the archived Sessions on the server, suitable for Serialization (for external use)
|
getExternalTreeNode | public DefaultMutableTreeNode getExternalTreeNode(ClientInfo clientInfo)(Code) | | returns the DefaultMutableTreeNode that contains DefaultObjectInfo objects, suitable for serializing
Parameters: clientInfo - contains information about the client that will be the tree, used tocustomize the tree for that client |
getTreeNode | public DefaultMutableTreeNode getTreeNode()(Code) | | returns the DefaultMutableTreeNode that represents the present state of our connections
|
removeChannel | public void removeChannel(ChannelInfo channelInfo)(Code) | | removes the specified Channel from the parent Session and notifies listeners
|
removeConsumer | public void removeConsumer(ConsumerInfo consumerInfo)(Code) | | removes the specified Consumer from the specified Channel of the specified Session and notifies listeners
|
removeSession | public void removeSession(SessionInfo sessionInfo)(Code) | | removes the specified Session from the sessionNodes and notifies listeners
|
removeSpecialClient | public void removeSpecialClient(ClientInfo clientInfo)(Code) | | removes the specified Client from the ClientNodes and notifies listeners
|
removeTreeListener | public boolean removeTreeListener(SocketAdapter ts)(Code) | | removes the specified TreeViewListener from both Admin and normal Client listeners
|
updateAvailable | public void updateAvailable(UpdateAvailableMsg msg, boolean adminOnly)(Code) | | Uses the commandStatus connection on the server to issue objects
to clients who have become TreeViewListeners, mainly used to send
UpdateAvailableMsg objects, but can send any datashare.object object.
Parameters: object - the serializable object to send to the registered TreeViewListeners Parameters: adminOnly - if true, this update is only sent to admin clients |
|
|