Bug 244657 - [api] Need help integrating SSL socket based datatransfer with RSE
Summary: [api] Need help integrating SSL socket based datatransfer with RSE
Status: NEW
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: Future   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2008-08-20 02:58 EDT by Lavir the Whiolet CLA
Modified: 2008-10-15 14:39 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lavir the Whiolet CLA 2008-08-20 02:58:47 EDT
My application consists of server and client which transfer data via TCP/IP in own binary format. I want to make the client to be a plugin for Remote System Explorer tree. Also I need a connection to server to be secured via SSL. Please provide class with interface of "java.net.Socket" class.

If it's impossible to write such a class (some data is required, e. g., DStoreConnectorService object or RSE server is needed) then please also provide detailed instructions on how to extract this data for the class.
Comment 1 Lavir the Whiolet CLA 2008-08-20 03:07:05 EDT
If "java.net.Socket" is too hard to implement then this interface would be enough:

public interface RSESocket {
    void close() throws IOException;
    boolean isConnected();
    InputStream getInputStream() throws IOException;
    OutputStream getOutputStream() throws IOException;
}
Comment 2 Martin Oberhuber CLA 2008-08-22 05:34:46 EDT
If you have your own protocol and server for SSL-based communications already, you can integrate the client with RSE easily (no dstore needed, since that would be a different kind of protocol). I cannot see how we could create more of a framework for you, since your plugin is the only one which knows your protocol, so you will need to take care of the communications.

See the RSE Developer Documentation, the RSE Tutorial (which describes the "Team" example from the examples plugin), and the "Daytime" example from the RSE Examples plugin for how to create the integration. Looking at how the *.ftp.* plugins are implemented might also help.

If I'm misunderstanding you, please clarify. 
For now, I updated the summary, old value was:
Just SSL socket class is needed
Comment 3 Martin Oberhuber CLA 2008-08-22 05:40:21 EDT
Looking at comment #1, it seems that you would like the Connectorservice / Lifecycle related code for SSL Sockets factored out and available as API, is this what you want?

I'm not sure if such an API could be re-used for the dstore SSL connectivity easily, since we also want some fallback to non-SSL-communications if the SSL fails, and I'm not sure if that functionality can be provided in a generic way.

Assigning to DaveM for comments -- Dave, do you think that dstore/ssl things like the SSL lifecycle, Cert store, and related Preference page could be factored out as API and made available as a generic SSL connectivity layer independent of dstore?
Comment 4 Lavir the Whiolet CLA 2008-08-24 13:15:00 EDT
I want to create a plugin for RSE in the form of subsystem. The user will input connection assets using RSE's capabilities.

Next, I want to catch an event when user connects to the server. The event is wanted to be caught in a Java listener or in overridable Subsystem's method. In this method (or listener) I want to see accessible object of RSESocket class (e. g., accessible via "getSocket()" method) and a possibility to drop the connection with possibility to create my own message box. It would be great if such dropping will be possible via a method (e. g., "dropConnection()" for convenience; no exceptions are expected in this method).

The socket in this method is needed to be already connected, secured and authorized. Or the way to create such a socket is needed.

On the server side I would like to see one of following choices:

1. RSE server connects to my server via TCP/IP like an ordinary client and transfers all traffic from client directly to server and backward.

2. There is shared library (e. g., JAR with classes) where I have "RSEServerSocket" class. Its interface is required to be similar to "java.net.ServerSocket"'s one.

3. The most preferrable way: there is an overridable method in RSE miner where I can either get already connected socket or create server socket (and turn it into listening state of course). The socket is required to be bound to RSE's secure channel. That will allow me either run my server directly from RSE server or run my light server under credentials of the user which logins.

Currently I have choice #1 where socket is written as a huge wrapper around DStore connector services, managers, miners etc. My implementation is also not optimal: all traffic is split into 32K packets (internal buffer is used), encoded as hexadecimial string (2 times more service traffic) and transferred as DStore objects (Dstore object's wrapping service traffic). I want to transfer my bytes directly and with no any internal buffer.

In short: I want to create an "Remote System Explorer"'s tree plugin and to use SSL implementation of RSE in the form of simple socket classes (similar to java.net.* ones).