net.jini.jeri.kerberos
Class KerberosUtil.Connection

java.lang.Object
  extended by net.jini.jeri.kerberos.KerberosUtil.Connection
Direct Known Subclasses:
KerberosEndpoint.ConnectionImpl, KerberosServerEndpoint.ServerConnectionImpl
Enclosing class:
KerberosUtil

static class KerberosUtil.Connection
extends Object

Connection class serves as the parent of connection classes defined in both client and server end point classes.


Field Summary
(package private)  KerberosPrincipal clientPrincipal
          client principal of this connection
protected  Logger connectionLogger
          logger of the connection
protected  DataInputStream dis
          Input stream provided by the underlying socket
protected  boolean doDelegation
          If this field is set to true, the initiator's credentials will be delegated to the acceptor during GSS context establishment.
protected  boolean doEncryption
          Boolean to indicate whether traffic will be encrypted
protected  DataOutputStream dos
          Output stream provided by the underlying socket
protected  GSSContext gssContext
          GSSContext instance used by this connection, it is initialized in child class
protected static int INTEGRITY_QOP
           
protected static int PRIVACY_QOP
           
protected  Socket sock
          TCP socket used by this connection
 
Constructor Summary
KerberosUtil.Connection(Socket sock)
          Construct a connection object.
 
Method Summary
 void close()
          Close the connection
(package private)  void flush()
          Flush the output stream used for send.
(package private)  byte[] read()
          Block until a complete GSS token has been received, unwrap it, and return its content.
(package private)  void write(byte[] buf, int offset, int len)
          Wrap the content of the buffer into a GSS token and write it out to the underlying socket.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTEGRITY_QOP

protected static final int INTEGRITY_QOP
See Also:
Constant Field Values

PRIVACY_QOP

protected static final int PRIVACY_QOP
See Also:
Constant Field Values

sock

protected final Socket sock
TCP socket used by this connection


dis

protected DataInputStream dis
Input stream provided by the underlying socket


dos

protected DataOutputStream dos
Output stream provided by the underlying socket


clientPrincipal

KerberosPrincipal clientPrincipal
client principal of this connection


gssContext

protected GSSContext gssContext
GSSContext instance used by this connection, it is initialized in child class


doEncryption

protected boolean doEncryption
Boolean to indicate whether traffic will be encrypted


doDelegation

protected boolean doDelegation
If this field is set to true, the initiator's credentials will be delegated to the acceptor during GSS context establishment.


connectionLogger

protected Logger connectionLogger
logger of the connection

Constructor Detail

KerberosUtil.Connection

KerberosUtil.Connection(Socket sock)
                  throws IOException
Construct a connection object.

Parameters:
sock - underlying socket used by this connection
Throws:
IOException
Method Detail

close

public void close()
Close the connection


write

void write(byte[] buf,
           int offset,
           int len)
     throws IOException
Wrap the content of the buffer into a GSS token and write it out to the underlying socket.

Parameters:
buf - the buffer whose content will be send out
offset - offset marks the start of the content to be sent out
len - number of bytes to be sent out
Throws:
IOException - if problems encountered

flush

void flush()
     throws IOException
Flush the output stream used for send.

Throws:
IOException

read

byte[] read()
      throws IOException
Block until a complete GSS token has been received, unwrap it, and return its content.

Returns:
byte array of the unwrapped GSS token
Throws:
IOException - if problems encountered


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.