|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jini.jeri.ssl.Utilities
net.jini.jeri.ssl.ConnectionContext
final class ConnectionContext
Records information about a connection used for a remote call and determines whether the connection could support specific constraints.
Does not support heterogeneous constraint alternatives. As a result, callers can be assured that the choice of possible principals or of Integrity.YES is independent of the suites, insuring that those items can be picked before negotiating the cipher suite.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.jini.jeri.ssl.Utilities |
---|
Utilities.SSLContextInfo |
Field Summary | |
---|---|
(package private) String |
cipherSuite
The cipher suite |
(package private) Principal |
client
The client principal, or null for an anonymous client |
private static ClientMinPrincipalType |
clientMinPrincipalType
The ClientMinPrincipalType supported by the provider. |
private boolean |
clientSide
Whether the connection is being considered on the client side, which does not support relative time constraints. |
private long |
connectionTime
The absolute connection time, or Long.MAX_VALUE if not specified |
private boolean |
integrity
Whether codebase integrity should be enforced |
private static long |
INTEGRITY
Constraints supported with codebase integrity |
private boolean |
integrityPreferred
Whether the preferences specify Integrity.YES |
private boolean |
integrityRequired
Whether the requirements specify Integrity.YES |
private static long |
NOT_SUPPORTED
Constraints not supported |
private boolean |
notSupported
Set to true if the principals and cipher suite conflict |
private static long |
OK
Constraints supported, without integrity or connection timeout |
private int |
preferences
The number of preferences satisfied |
(package private) Principal |
server
The server principal, or null for an anonymous server |
Fields inherited from class net.jini.jeri.ssl.Utilities |
---|
ANY_KEY_ALGORITHM, clientLogger, DSA_KEY_ALGORITHM, getSubjectPermission, initLogger, INTEGRITY_PREFERRED, INTEGRITY_REQUIRED, RSA_KEY_ALGORITHM, serverLogger, UNKNOWN_PRINCIPAL |
Constructor Summary | |
---|---|
private |
ConnectionContext(String cipherSuite,
Principal client,
Principal server,
boolean integrity,
boolean clientSide)
Creates an instance of this class. |
Method Summary | |
---|---|
(package private) void |
fieldsToString(StringBuffer sb)
|
(package private) long |
getConnectionTime()
Returns the absolute time when the connection should be completed, or Long.MAX_VALUE for no limit. |
(package private) static ConnectionContext |
getInstance(String cipherSuite,
Principal client,
Principal server,
boolean integrity,
boolean clientSide,
InvocationConstraints constraints)
Creates an instance that represents using the specified cipher suite, client and server principals, whether to guarantee codebase integrity, and constraints. |
(package private) boolean |
getIntegrityPreferred()
Returns whether integrity is preferred. |
(package private) boolean |
getIntegrityRequired()
Returns whether integrity is required. |
(package private) int |
getPreferences()
Returns the number of preferences that can be satisfied. |
private static long |
ok(boolean ok)
Returns OK if the argument is true, else NOT_SUPPORTED. |
private long |
supported(ConstraintAlternatives constraint)
Checks if the constraint alternatives are supported, returning NOT_SUPPORTED if the elements have different types or none are supported, INTEGRITY if the elements are instances of Integrity, the largest connection time if the elements are instances of ConnectionAbsoluteTime, and otherwise OK. |
private long |
supported(InvocationConstraint constraint)
Checks if the constraint is supported, returning NOT_SUPPORTED if it is not supported, INTEGRITY if the constraint is Integrity.YES or constraint alternatives with elements of type Integrity, the connection time if the constraint is an instance of ConnectionAbsoluteTime or constraint alternatives of them, and otherwise OK. |
private boolean |
supported(InvocationConstraints constraints)
Checks if the specified constraints are supported, computing integrityRequired, integrityPreferred, connectionTime and preferences as a side effect. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long OK
private static final long INTEGRITY
private static final long NOT_SUPPORTED
private static final ClientMinPrincipalType clientMinPrincipalType
final String cipherSuite
final Principal client
final Principal server
private final boolean integrity
private final boolean clientSide
private boolean notSupported
private boolean integrityRequired
private boolean integrityPreferred
private long connectionTime
private int preferences
Constructor Detail |
---|
private ConnectionContext(String cipherSuite, Principal client, Principal server, boolean integrity, boolean clientSide)
Method Detail |
---|
static ConnectionContext getInstance(String cipherSuite, Principal client, Principal server, boolean integrity, boolean clientSide, InvocationConstraints constraints)
public String toString()
toString
in class Object
void fieldsToString(StringBuffer sb)
boolean getIntegrityRequired()
boolean getIntegrityPreferred()
long getConnectionTime()
int getPreferences()
private boolean supported(InvocationConstraints constraints)
private long supported(InvocationConstraint constraint)
private static long ok(boolean ok)
private long supported(ConstraintAlternatives constraint)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |