Remote System Explorer DataStore
Release 1.0

org.eclipse.dstore.core.util
Class Sender

java.lang.Object
  extended byorg.eclipse.dstore.core.util.Sender
All Implemented Interfaces:
ISender

public class Sender
extends Object
implements ISender

This class is used for sending data to a socket in the DataStore communication layer.


Constructor Summary
Sender(Socket socket, DataStore dataStore)
          Constructor
 
Method Summary
 void requestClass(DataElement classRequest)
          Requests a class from the client
 void sendAppendFile(DataElement objectRoot, byte[] bytes, int size, boolean binary)
          Sends the bytes of a file through the socket to be appended to a file on the other end
 void sendClass(DataElement classElement)
          Sends a class through the socket
 void sendDocument(DataElement objectRoot, int depth)
          Sends a DataStore tree of data through the socket
 void sendDocument(String document)
          Sends a string through the socket
 void sendFile(DataElement objectRoot, byte[] bytes, int size, boolean binary)
          Sends the bytes of a file through the socket
 void sendKeepAliveConfirmation(DataElement document)
           
 void sendKeepAliveRequest(DataElement document)
           
 void sendRemoteClassRunnable(DataElement objectRoot, IRemoteClassInstance runnable)
           
 Socket socket()
          Returns the associated socket
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sender

public Sender(Socket socket,
              DataStore dataStore)
Constructor

Parameters:
socket - the associated socket
dataStore - the associated DataStore
Method Detail

socket

public Socket socket()
Returns the associated socket

Returns:
the socket

sendDocument

public void sendDocument(String document)
Sends a string through the socket

Specified by:
sendDocument in interface ISender
Parameters:
document - the string to send

sendFile

public void sendFile(DataElement objectRoot,
                     byte[] bytes,
                     int size,
                     boolean binary)
Sends the bytes of a file through the socket

Parameters:
objectRoot - the object representing the file to send
bytes - the bytes to send over the socket
size - the number of bytes to send over the socket
binary - indicates whether to send the bytes and binary or text

sendClass

public void sendClass(DataElement classElement)
Sends a class through the socket

Parameters:
classElement - the object representing the class to send

sendAppendFile

public void sendAppendFile(DataElement objectRoot,
                           byte[] bytes,
                           int size,
                           boolean binary)
Sends the bytes of a file through the socket to be appended to a file on the other end

Parameters:
objectRoot - the object representing the file to send
bytes - the bytes to send over the socket
size - the number of bytes to send over the socket
binary - indicates whether to send the bytes and binary or text

sendDocument

public void sendDocument(DataElement objectRoot,
                         int depth)
Sends a DataStore tree of data through the socket

Specified by:
sendDocument in interface ISender
Parameters:
objectRoot - the root of the tree to send
depth - the depth of the tree to send

requestClass

public void requestClass(DataElement classRequest)
Requests a class from the client


sendRemoteClassRunnable

public void sendRemoteClassRunnable(DataElement objectRoot,
                                    IRemoteClassInstance runnable)

sendKeepAliveRequest

public void sendKeepAliveRequest(DataElement document)

sendKeepAliveConfirmation

public void sendKeepAliveConfirmation(DataElement document)

Remote System Explorer DataStore
Release 1.0

Guidelines for using DataStore APIs.