org.metastatic.rsync.v2
Class Protocol

java.lang.Object
  |
  +--org.metastatic.rsync.v2.Protocol
All Implemented Interfaces:
Constants
Direct Known Subclasses:
Server

public class Protocol
extends Object
implements Constants


Field Summary
protected  LinkedList argv
           
protected  String challenge
           
protected  InetAddress client
           
protected  Configuration config
           
protected  boolean connected
           
protected  DuplexByteBuffer duplex
           
protected  CharsetEncoder encoder
           
protected  String error
           
protected  List fileList
           
protected  Map gids
           
protected  ByteBuffer inBuffer
           
protected  int inState
           
protected  Module module
           
protected  Map modules
          The module list.
protected  String motd
          The message-of-the-day.
protected  Options options
           
protected  ByteBuffer outBuffer
           
protected  int outState
           
protected  int remoteVersion
           
protected  String request
           
protected  String sid
          The unique session ID.
static String SPACES
           
protected  boolean start_glob
           
protected  int state
           
protected  Statistics stats
           
protected  boolean stats_module
           
protected  org.metastatic.rsync.v2.NonblockingTool tool
           
protected  Map uids
           
 
Fields inherited from interface org.metastatic.rsync.v2.Constants
_S_IFDIR, _S_IFLNK, _S_IFMT, _S_IFREG, AT_ERROR, BLOCK_LENGTH, CHUNK_SIZE, FLAG_DELETE, FLIST_RECEIVE_DONE, FLIST_RECEIVE_FILES, FLIST_RECEIVE_GIDS, FLIST_RECEIVE_UIDS, FLIST_SEND_DONE, FLIST_SEND_FILES, FLIST_SEND_GIDS, FLIST_SEND_UIDS, INPUT_MASK, LONG_NAME, MAX_PROTOCOL_VERSION, MAXPATHLEN, MIN_PROTOCOL_VERSION, OUTPUT_MASK, PROTOCOL_VERSION, RECV_RECEIVE_DELTAS, RECV_RECEIVE_INDEX, RECV_SEND_INDEX, RECV_SEND_SUMS, RECV_WAIT, RSYNCD_AUTHREQD, RSYNCD_EXIT, RSYNCD_GREETING, RSYNCD_OK, RSYNCD_PORT, SAME_DIR, SAME_GID, SAME_MODE, SAME_NAME, SAME_RDEV, SAME_TIME, SAME_UID, SENDER_DONE, SENDER_RECEIVE_INDEX, SENDER_RECEIVE_SUMS, SENDER_SEND_DELTAS, SENDER_SEND_FILE, SENDER_WAIT, SETUP_READ_AUTH, SETUP_READ_DONE, SETUP_READ_GREETING, SETUP_READ_MODULE, SETUP_READ_OPTIONS, SETUP_WRITE_CHALLENGE, SETUP_WRITE_DONE, SETUP_WRITE_ERROR, SETUP_WRITE_GREETING, SETUP_WRITE_MODULES, SETUP_WRITE_OK, SETUP_WRITE_WAIT, STATE_DONE, STATE_INPUT_DONE, STATE_OUTPUT_DONE, STATE_RECEIVE_EXCLUDE, STATE_RECEIVE_FLIST, STATE_RECEIVER, STATE_RECEIVER_INPUT, STATE_RECEIVER_OUTPUT, STATE_SEND_FLIST, STATE_SENDER, STATE_SENDER_INPUT, STATE_SENDER_OUTPUT, STATE_SETUP_PROTOCOL, SUM_LENGTH, URL_PREFIX
 
Constructor Summary
Protocol(String motd, Map modules, InetAddress client)
           
 
Method Summary
 boolean connectionFinished()
          Return whether or not this protocol's connection is finished.
 ByteBuffer getInputBuffer()
          Get the byte buffer for input coming over the socket.
 ByteBuffer getOutputBuffer()
          Get the byte buffer for output going over the socket.
 Statistics getStatistics()
           
protected  void setupInput()
          Continue setting up this session (version exchange, module, authentication).
protected  void setupOutput()
          The connection setup output.
 void updateInput()
          Signals that there is more input to be consumed.
 void updateOutput()
          Signals that there is space for output, and that more output bytes need to be placed in the output buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPACES

public static final String SPACES
See Also:
Constant Field Values

state

protected int state

inState

protected int inState

outState

protected int outState

sid

protected String sid
The unique session ID.


motd

protected String motd
The message-of-the-day.


modules

protected Map modules
The module list.


client

protected InetAddress client

inBuffer

protected ByteBuffer inBuffer

outBuffer

protected ByteBuffer outBuffer

duplex

protected DuplexByteBuffer duplex

encoder

protected CharsetEncoder encoder

remoteVersion

protected int remoteVersion

connected

protected boolean connected

module

protected Module module

error

protected String error

challenge

protected String challenge

argv

protected LinkedList argv

options

protected Options options

config

protected Configuration config

stats

protected Statistics stats

fileList

protected List fileList

uids

protected Map uids

gids

protected Map gids

stats_module

protected boolean stats_module

start_glob

protected boolean start_glob

request

protected String request

tool

protected org.metastatic.rsync.v2.NonblockingTool tool
Constructor Detail

Protocol

public Protocol(String motd,
                Map modules,
                InetAddress client)
Method Detail

getInputBuffer

public ByteBuffer getInputBuffer()
Get the byte buffer for input coming over the socket.

Returns:
The input buffer.

getOutputBuffer

public ByteBuffer getOutputBuffer()
Get the byte buffer for output going over the socket.

Returns:
The output buffer.

getStatistics

public Statistics getStatistics()

connectionFinished

public boolean connectionFinished()
Return whether or not this protocol's connection is finished.

Returns:
The connection state.

updateInput

public void updateInput()
Signals that there is more input to be consumed.


updateOutput

public void updateOutput()
Signals that there is space for output, and that more output bytes need to be placed in the output buffer.


setupInput

protected void setupInput()
Continue setting up this session (version exchange, module, authentication).


setupOutput

protected void setupOutput()
The connection setup output. Based on the current output state, this method fills the output buffer with the approriate info for the state.