java.rmi.transport
Interface SecureClientConnection

All Known Subinterfaces:
SecureReusableClientConnection

public interface SecureClientConnection

Defines a transport-neutral interface to established client-side connections for secure remote calls. In the case of TCP, a connection is usually a wrapper around an instance of (or an instance of a subclass of) java.net.Socket.

Since:
1.4

Method Summary
 void close()
          Closes the connection.
 java.io.InputStream getInputStream()
          Returns an input stream for the connection.
 java.io.OutputStream getOutputStream()
          Returns an output stream for the connection.
 javax.security.auth.Subject getServerSubject()
          Returns the authenticated identity of the server as a read-only instance, or null if the server has not been authenticated.
 void writeCallData(SecureCallContext context, java.io.ObjectOutputStream stream)
          Writes to the specified stream any per-call data required by the connection for a remote call with the specified context.
 

Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Returns an input stream for the connection.
Returns:
an input stream for the connection
Throws:
java.io.IOException - if an I/O exception occurs

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Returns an output stream for the connection.
Returns:
an output stream for the connection
Throws:
java.io.IOException - if an I/O exception occurs

getServerSubject

public javax.security.auth.Subject getServerSubject()
Returns the authenticated identity of the server as a read-only instance, or null if the server has not been authenticated.
Returns:
the authenticated identity of the server as a read-only instance, or null if the server has not been authenticated

writeCallData

public void writeCallData(SecureCallContext context,
                          java.io.ObjectOutputStream stream)
                   throws java.io.IOException
Writes to the specified stream any per-call data required by the connection for a remote call with the specified context. This method typically does nothing unless the provider supports delegation, in which case this method might write information about whether delegation is in force for this call and, if it is, any associated delegation credentials and/or constraints.

There can be multiple remote calls taking place concurrently over this connection, and the specified stream may be buffering and multiplexing the data from different calls into this connection's underlying output stream. As such, this method can only write data to the specified stream, and cannot read any data from the connection's underlying input stream. If this connection's underlying protocol conflicts with these requirements, then the connection should implement SecureReusableClientConnection and perform any necessary data transfer in the switchConstraints method of that interface instead.

Parameters:
context - the remote call context
stream - the output stream
Throws:
java.io.IOException - if an I/O exception occurs
NullPointerException - if any parameter is null
java.lang.IllegalArgumentException - if the specified context was not created by an endpoint equal to the endpoint used to open this connection

close

public void close()
           throws java.io.IOException
Closes the connection.
Throws:
java.io.IOException - if an I/O exception occurs


Copyright © 2000 Sun Microsystems, Inc. All rights reserved