com.sun.jini.reggie
Class ProxyVerifier

java.lang.Object
  extended by com.sun.jini.reggie.ProxyVerifier
All Implemented Interfaces:
Serializable, TrustVerifier

final class ProxyVerifier
extends Object
implements TrustVerifier, Serializable

Trust verifier for smart proxies used by Reggie.

Author:
Sun Microsystems, Inc.

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.jini.security.TrustVerifier
TrustVerifier.Context
 
Field Summary
private  ServiceID registrarID
          The registrar's service ID, used for comparison with registrar service IDs extracted from smart proxies to verify.
private static long serialVersionUID
           
private  RemoteMethodControl server
          Canonical service reference, used for comparison with inner server references extracted from smart proxies to verify.
 
Constructor Summary
ProxyVerifier(Registrar server, ServiceID registrarID)
          Constructs proxy verifier which compares server references extracted from smart proxies with the given canonical server reference, which must implement both RemoteMethodControl and TrustEquivalence.
 
Method Summary
 boolean isTrustedObject(Object obj, TrustVerifier.Context ctx)
          Returns true if the given object is a trusted proxy, or false otherwise.
private  void readObject(ObjectInputStream in)
          Reads the default serializable field value for this instance, followed by the registrar's service ID encoded as specified by the ServiceID.writeBytes method.
private  void writeObject(ObjectOutputStream out)
          Writes the default serializable field value for this instance, followed by the registrar's service ID encoded as specified by the ServiceID.writeBytes method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

server

private final RemoteMethodControl server
Canonical service reference, used for comparison with inner server references extracted from smart proxies to verify.


registrarID

private transient ServiceID registrarID
The registrar's service ID, used for comparison with registrar service IDs extracted from smart proxies to verify.

Constructor Detail

ProxyVerifier

ProxyVerifier(Registrar server,
              ServiceID registrarID)
Constructs proxy verifier which compares server references extracted from smart proxies with the given canonical server reference, which must implement both RemoteMethodControl and TrustEquivalence. For proxies which contain a copy of the registrar's service ID, that copy is compared against the given service ID to ensure consistency.

Method Detail

isTrustedObject

public boolean isTrustedObject(Object obj,
                               TrustVerifier.Context ctx)
                        throws RemoteException
Returns true if the given object is a trusted proxy, or false otherwise. The given object is trusted if it is trust equivalent to the canonical server reference carried by this trust verifier, or if it is an instance of one of Reggie's constrainable smart proxy classes, and all component proxies it contains are trusted, and its inner server reference is trust equivalent to the canonical server reference, and its inner copy of the registrar's service ID (if it has one) is equal to the service ID carried by this verifier.

Specified by:
isTrustedObject in interface TrustVerifier
Parameters:
obj - the object in which to verify trust
ctx - the trust verifier context, to aid in verification of the specified object and its components
Returns:
true if the specified object is known to be trusted to correctly implement its contract; false otherwise
Throws:
RemoteException - if a communication-related exception occurs

writeObject

private void writeObject(ObjectOutputStream out)
                  throws IOException
Writes the default serializable field value for this instance, followed by the registrar's service ID encoded as specified by the ServiceID.writeBytes method.

Throws:
IOException

readObject

private void readObject(ObjectInputStream in)
                 throws IOException,
                        ClassNotFoundException
Reads the default serializable field value for this instance, followed by the registrar's service ID encoded as specified by the ServiceID.writeBytes method. Verifies that the deserialized registrar reference implements both RemoteMethodControl and TrustEquivalence.

Throws:
IOException
ClassNotFoundException


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