Save This Page
Home » j2ssh-0.2.9-src » com.sshtools.j2ssh.transport » [javadoc | source]
com.sshtools.j2ssh.transport
public final class: SshMessageStore [javadoc | source]
java.lang.Object
   com.sshtools.j2ssh.transport.SshMessageStore

This class implements a message store that can be used to provide a blocking mechanism for transport protocol messages.

Constructor:
 public SshMessageStore() 
Method from com.sshtools.j2ssh.transport.SshMessageStore Summary:
addMessage,   addMessage,   addMessageListener,   breakWaiting,   close,   createMessage,   getMessage,   getMessage,   getMessage,   getMessage,   getRegisteredMessageIds,   hasMessages,   isClosed,   isRegisteredMessage,   nextMessage,   peekMessage,   peekMessage,   peekMessage,   peekMessage,   registerMessage,   removeMessage,   size
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sshtools.j2ssh.transport.SshMessageStore Detail:
 public  void addMessage(byte[] msgdata) throws MessageNotRegisteredException, InvalidMessageException 

    Adds a raw message to the store and processes the data into a registered message.

 public synchronized  void addMessage(SshMessage msg) throws MessageNotRegisteredException 

    Add a formed message to the store.

 public  void addMessageListener(SshMessageListener listener) 
 public synchronized  void breakWaiting() 
 public synchronized  void close() 

    Closes the store. This will cause any blocking operations on the message store to return.

 public SshMessage createMessage(byte[] msgdata) throws MessageNotRegisteredException, InvalidMessageException 

    Create a formed message from raw message data.

 public synchronized SshMessage getMessage(int[] messageIdFilter) throws InterruptedException, MessageStoreEOFException 

    Get a message from the store. This method will block until a message with an id matching the supplied filter arrives, or the message store closes. The message is removed from the store.

 public synchronized SshMessage getMessage(int messageId) throws InterruptedException, MessageStoreEOFException 

    Get a message from the store. This method will block until a message with an id matching the supplied id arrives, or the message store closes. The message is removed from the store.

 public synchronized SshMessage getMessage(int[] messageIdFilter,
    int timeout) throws MessageNotAvailableException, InterruptedException, MessageStoreEOFException 

    Get a message from the store. This method will block until a message with an id matching the supplied filter arrives, the specified timeout is reached or the message store closes. The message is removed from the store.

 public synchronized SshMessage getMessage(int messageId,
    int timeout) throws MessageNotAvailableException, InterruptedException, MessageStoreEOFException 

    Get a message from the store. This method will block until a message with an id matching the supplied id arrives,the specified timeout is reached or the message store closes. The message will be removed from the store.

 public Object[] getRegisteredMessageIds() 

    Returns an Object array (Integers) of the registered message ids.

 public boolean hasMessages() 

    Evaluate whether the store has any messages.

 public boolean isClosed() 

    Evaluate whether the message store is closed.

 public boolean isRegisteredMessage(Integer messageId) 

    Determines if the message id is a registered message of this store.

 public synchronized SshMessage nextMessage() throws InterruptedException, MessageStoreEOFException 

    Get the next message in the store or wait until a new message arrives. The message is removed from the store.

 public synchronized SshMessage peekMessage(int[] messageIdFilter) throws MessageNotAvailableException, InterruptedException, MessageStoreEOFException 

    Get a message from the store without removing or blocking if the message does not exist.

 public synchronized SshMessage peekMessage(int messageId) throws MessageNotAvailableException, InterruptedException, MessageStoreEOFException 

    Get a message from the store without removing it.

 public synchronized SshMessage peekMessage(int[] messageIdFilter,
    int timeout) throws MessageNotAvailableException, InterruptedException, MessageStoreEOFException 

    Get a message from the store without removing it; only blocking for the number of milliseconds specified in the timeout field. If timeout is zero, the method will not block.

 public synchronized SshMessage peekMessage(int messageId,
    int timeout) throws MessageNotAvailableException, InterruptedException, MessageStoreEOFException 

    Get a message from the store without removing it, only blocking for the number of milliseconds specified in the timeout field.

 public  void registerMessage(int messageId,
    Class implementor) 

    Register a message implementation with the store.

 public synchronized  void removeMessage(SshMessage msg) 

    Removes a message from the message store.

 public int size() 

    Returns the number of messages contained within this message store.