class SslEndpointImpl extends Utilities implements ConnectionEndpoint
Modifier and Type | Class and Description |
---|---|
private static class |
SslEndpointImpl.ComparableConnectionContext
Used for sorting ConnectionContexts by preferences and suite order.
|
private static class |
SslEndpointImpl.ConnectionContextCache
Defines a structure to cache a ConnectionContexts for specific
constraints and client principals.
|
private static class |
SslEndpointImpl.ConnectionsIterator
Defines an iterator over active and idle connections which performs
error checking on connections.
|
private static class |
SslEndpointImpl.CopyOnRemoveList
A List that supports removing items by making a copy of the underlying
list.
|
private static class |
SslEndpointImpl.ExceptionOutboundRequestIterator
An outbound request iterator that throws an IOException or a
SecurityException.
|
Utilities.SSLContextInfo
Modifier and Type | Field and Description |
---|---|
private static int |
CACHE_SIZE
The size of the connection context cache.
|
private int |
cacheNext
Next index for a connectionContextCache miss; counts down, not up.
|
private SslEndpointImpl.ConnectionContextCache[] |
connectionContextCache
A cache for recently computed connection contexts.
|
(package private) ConnManager |
connectionManager
The connection manager for this endpoint or null if not yet set.
|
private static ConnManagerFactory |
connectionManagerFactory
The factory for default connection managers.
|
private static Map |
connectionMgrs
Weak key map that maps connection endpoints to weak references to the
associated ConnManager.
|
(package private) boolean |
disableSocketConnect
Whether to disable calling Socket.connect -- set when used by discovery
providers.
|
(package private) Endpoint |
endpoint
The associated endpoint.
|
(package private) static Logger |
logger
Client logger
|
(package private) int |
port
The server port.
|
(package private) String |
serverHost
The name of the server host.
|
(package private) SocketFactory |
socketFactory
The factory for creating sockets, or null to use default sockets.
|
ANY_KEY_ALGORITHM, clientLogger, DSA_KEY_ALGORITHM, getSubjectPermission, initLogger, INTEGRITY_PREFERRED, INTEGRITY_REQUIRED, RSA_KEY_ALGORITHM, serverLogger, UNKNOWN_PRINCIPAL
Constructor and Description |
---|
SslEndpointImpl(Endpoint endpoint,
String serverHost,
int port,
SocketFactory socketFactory)
Creates an instance of this class.
|
Modifier and Type | Method and Description |
---|---|
private static List |
checkAuthenticationPermissions(List contexts)
Removes the contexts for which the client does not have authentication
permission.
|
private void |
checkResolvePermission() |
private static List |
checkSubject(List contexts,
Subject clientSubject,
boolean constrainedServer,
InvocationConstraints constraints)
Returns a list of the contexts which are supported by principals and
credentials in the Subject.
|
private static List |
computeConnectionContexts(String[] suites,
Set clients,
Set servers,
InvocationConstraints constraints)
Computes a list of ConnectionContexts for the specified set of
suites, client and server principals, and constraints, sorted by
preferences and suite order.
|
Connection |
connect(OutboundRequestHandle handle)
Creates a new connection.
|
Connection |
connect(OutboundRequestHandle handle,
Collection active,
Collection idle)
Chooses a connection from existing connections.
|
private CallContext |
createCallContext(List contexts,
Subject clientSubject)
Convert connection contexts to a call context
|
boolean |
equals(Object object)
Two instances of this class are equal if they have the same actual
class; have the same values for server host and port; and have socket
factories that are either both null, or have the same actual class and
are equal.
|
(package private) String |
fieldsToString()
Returns a string representation of the fields of this object.
|
private CallContext |
getCallContext(InvocationConstraints constraints)
Returns a context for making a remote call with the specified
constraints and the current subject.
|
private List |
getConnectionContexts(InvocationConstraints constraints,
Set clientPrincipals)
Gets an unmodifiable list of the ConnectionContexts for the
specified constraints and client principals.
|
private ConnManager |
getConnectionManager()
Returns the connection manager for this endpoint.
|
private static Map |
getPublicCredentials(Subject subject)
Returns a map that maps each principal in the subject to a set of the
associated X.500 public credentials.
|
private static Boolean |
getSubjectPermitted()
Checks if the caller has permission to get the current subject,
returning Boolean.TRUE or FALSE.
|
int |
hashCode()
Returns a hash code value for this object.
|
(package private) OutboundRequestIterator |
newRequest(CallContext callContext)
Implements Endpoint.newRequest when the constraints are supported.
|
(package private) OutboundRequestIterator |
newRequest(InvocationConstraints constraints)
Implements Endpoint.newRequest
|
String |
toString()
Returns a string representation of this object.
|
checkValidity, contains, doesEncryption, doesServerAuthentication, equals, firstX509Cert, getCertFactory, getCipherAlgorithm, getClassName, getClientPrincipals, getClientPrincipals, getClientSSLContextInfo, getKeyAlgorithm, getKeyExchangeAlgorithm, getPermittedKeyAlgorithms, getServerPrincipals, getServerSSLContextInfo, getSupportedCipherSuites, hasStrongCipherAlgorithm, logThrow, maintainsIntegrity, permittedKeyAlgorithm, position, releaseClientSSLContextInfo, safeEquals, subjectString, toString
static final Logger logger
private static final Map connectionMgrs
private static final int CACHE_SIZE
private static final ConnManagerFactory connectionManagerFactory
final Endpoint endpoint
final String serverHost
final int port
final SocketFactory socketFactory
boolean disableSocketConnect
private SslEndpointImpl.ConnectionContextCache[] connectionContextCache
private int cacheNext
ConnManager connectionManager
SslEndpointImpl(Endpoint endpoint, String serverHost, int port, SocketFactory socketFactory)
public String toString()
final String fieldsToString()
public int hashCode()
public boolean equals(Object object)
final OutboundRequestIterator newRequest(InvocationConstraints constraints)
OutboundRequestIterator newRequest(CallContext callContext)
private ConnManager getConnectionManager()
private CallContext getCallContext(InvocationConstraints constraints) throws UnsupportedConstraintException
UnsupportedConstraintException
private CallContext createCallContext(List contexts, Subject clientSubject)
private static List checkSubject(List contexts, Subject clientSubject, boolean constrainedServer, InvocationConstraints constraints) throws UnsupportedConstraintException
UnsupportedConstraintException
private static Boolean getSubjectPermitted()
private static List checkAuthenticationPermissions(List contexts)
private static Map getPublicCredentials(Subject subject)
private List getConnectionContexts(InvocationConstraints constraints, Set clientPrincipals)
private static List computeConnectionContexts(String[] suites, Set clients, Set servers, InvocationConstraints constraints)
public Connection connect(OutboundRequestHandle handle) throws IOException
connect
in interface ConnectionEndpoint
handle
- the handle for the requestIOException
- if an I/O exception occurspublic Connection connect(OutboundRequestHandle handle, Collection active, Collection idle)
connect
in interface ConnectionEndpoint
handle
- the handle for the requestactive
- the connections with requests in progressidle
- the connections with no requests in progressnull
private void checkResolvePermission()
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.