Package org.globus.gsi.gssapi.net
Class GssSocket
- java.lang.Object
-
- java.net.Socket
-
- org.globus.net.WrappedSocket
-
- org.globus.gsi.gssapi.net.GssSocket
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
GSIGssSocket
public abstract class GssSocket extends WrappedSocket
-
-
Field Summary
Fields Modifier and Type Field Description protected Authorizationauthorizationprotected booleanclientModeprotected GSSContextcontextstatic intGSI_MODEprotected InputStreaminprotected intmodeprotected OutputStreamoutstatic intSSL_MODE-
Fields inherited from class org.globus.net.WrappedSocket
socket
-
-
Constructor Summary
Constructors Constructor Description GssSocket(String host, int port, GSSContext context)GssSocket(Socket socket, GSSContext context)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidauthenticateClient()protected voidauthenticateServer()voidclose()Disposes of the context and closes the connectionAuthorizationgetAuthorization()booleangetClientMode()GSSContextgetContext()InputStreamgetInputStream()OutputStreamgetOutputStream()intgetWrapMode()protected abstract byte[]readToken()voidsetAuthorization(Authorization auth)voidsetUseClientMode(boolean clientMode)voidsetWrapMode(int mode)voidstartHandshake()protected abstract voidwriteToken(byte[] token)-
Methods inherited from class org.globus.net.WrappedSocket
getInetAddress, getKeepAlive, getLocalAddress, getLocalPort, getPort, getReceiveBufferSize, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getWrappedSocket, setKeepAlive, setReceiveBufferSize, setSendBufferSize, setSoLinger, setSoTimeout, setTcpNoDelay, shutdownInput, shutdownOutput, toString
-
Methods inherited from class java.net.Socket
bind, connect, connect, getChannel, getLocalSocketAddress, getOOBInline, getOption, getRemoteSocketAddress, getReuseAddress, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setOOBInline, setOption, setPerformancePreferences, setReuseAddress, setSocketImplFactory, setTrafficClass, supportedOptions
-
-
-
-
Field Detail
-
context
protected GSSContext context
-
clientMode
protected boolean clientMode
-
in
protected InputStream in
-
out
protected OutputStream out
-
authorization
protected Authorization authorization
-
SSL_MODE
public static final int SSL_MODE
- See Also:
- Constant Field Values
-
GSI_MODE
public static final int GSI_MODE
- See Also:
- Constant Field Values
-
mode
protected int mode
-
-
Constructor Detail
-
GssSocket
public GssSocket(String host, int port, GSSContext context) throws IOException
- Throws:
IOException
-
GssSocket
public GssSocket(Socket socket, GSSContext context)
-
-
Method Detail
-
setAuthorization
public void setAuthorization(Authorization auth)
-
getAuthorization
public Authorization getAuthorization()
-
setUseClientMode
public void setUseClientMode(boolean clientMode)
-
getClientMode
public boolean getClientMode()
-
setWrapMode
public void setWrapMode(int mode)
-
getWrapMode
public int getWrapMode()
-
getContext
public GSSContext getContext()
-
writeToken
protected abstract void writeToken(byte[] token) throws IOException- Throws:
IOException
-
readToken
protected abstract byte[] readToken() throws IOException- Throws:
IOException
-
authenticateClient
protected void authenticateClient() throws IOException, GSSException- Throws:
IOExceptionGSSException
-
authenticateServer
protected void authenticateServer() throws IOException, GSSException- Throws:
IOExceptionGSSException
-
startHandshake
public void startHandshake() throws IOException- Throws:
IOException
-
getOutputStream
public OutputStream getOutputStream() throws IOException
- Overrides:
getOutputStreamin classWrappedSocket- Throws:
IOException
-
getInputStream
public InputStream getInputStream() throws IOException
- Overrides:
getInputStreamin classWrappedSocket- Throws:
IOException
-
close
public void close() throws IOExceptionDisposes of the context and closes the connection- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classWrappedSocket- Throws:
IOException
-
-