net.jini.core.constraint
Class ServerAuthentication

java.lang.Object
  extended by net.jini.core.constraint.ServerAuthentication
All Implemented Interfaces:
Serializable, InvocationConstraint

public final class ServerAuthentication
extends Object
implements InvocationConstraint, Serializable

Represents a constraint on authentication of the server to the client.

Network authentication by a server (to a client) is implementation-specific, but typically is also scoped and controlled by a Subject. The server subject normally is contained in the Exporter used to export that remote object and is taken from the current thread when the exporter is constructed. However, a server might use one subject to control its local execution and a different subject to control its network authentication. A server generally must have permission (such as AuthenticationPermission) to authenticate itself to clients.

It is important to understand that specifying ServerAuthentication.YES as a requirement does not ensure that a server is to be trusted; it does ensure that the server authenticates itself as someone, but it does not ensure that the server authenticates itself as anyone in particular. Without knowing who the server authenticated itself as, there is no basis for actually trusting the server. The client generally needs to specify a ServerMinPrincipal requirement in addition, or else verify that the server has specified a satisfactory ServerMinPrincipal requirement for each of the methods that the client cares about.

Serialization for this class is guaranteed to produce instances that are comparable with ==.

Since:
2.0
Author:
Sun Microsystems, Inc.
See Also:
ServerMinPrincipal, AuthenticationPermission, Serialized Form

Field Summary
static ServerAuthentication NO
          Do not authenticate the server to the client, so that the server remains anonymous.
private static long serialVersionUID
           
private  boolean val
          true for YES, false for NO
static ServerAuthentication YES
          Authenticate the server to the client.
 
Constructor Summary
private ServerAuthentication(boolean val)
          Simple constructor.
 
Method Summary
private  Object readResolve()
          Canonicalize so that == can be used.
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

YES

public static final ServerAuthentication YES
Authenticate the server to the client. The mechanisms and credentials used to authenticate the server are not specified by this constraint.


NO

public static final ServerAuthentication NO
Do not authenticate the server to the client, so that the server remains anonymous.


val

private final boolean val
true for YES, false for NO

Constructor Detail

ServerAuthentication

private ServerAuthentication(boolean val)
Simple constructor.

Parameters:
val - true for YES, false for NO
Method Detail

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class Object

readResolve

private Object readResolve()
Canonicalize so that == can be used.



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