java.rmi.activation
Class SecureActivationID

java.lang.Object
  |
  +--java.rmi.activation.ActivationID
        |
        +--java.rmi.activation.SecureActivationID
All Implemented Interfaces:
RemoteSecurity, java.io.Serializable

public class SecureActivationID
extends java.rmi.activation.ActivationID
implements RemoteSecurity

A secure subclass of ActivationID that implements the RemoteSecurity interface by delegating to the contained activator.

This class exists as a convenience for secure activation system daemon implementations, to avoid requiring all such implementations to make code available for dynamic download to clients.

Since:
1.4
See Also:
Serialized Form

Inner Class Summary
static class SecureActivationID.Verifier
          A ProxyTrust.Verifier for SecureActivationID instances.
 
Fields inherited from class java.rmi.activation.ActivationID
activator, uid
 
Constructor Summary
SecureActivationID(java.rmi.activation.Activator activator)
          Creates a secure activation identifier containing the specified remote object activator.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares two activation ids for content equality.
 boolean equalsIgnoreConstraints(java.lang.Object obj)
          Returns true if the two proxies are equal, ignoring both client and server security constraints; returns false otherwise.
 SecurityConstraints getClientConstraints()
          Returns the current client constraints, as a non-null instance.
 SecurityConstraints getServerConstraints(java.lang.String name, java.lang.Class[] parameterTypes)
          Returns the server's constraints for the specified method as a non-null instance.
 javax.security.auth.Subject getServerSubject()
          Connects to the server as if a remote call were to be performed (with security constraints being applied in the normal way), and returns the authenticated identity of the server as a read-only instance, or null if the server has not been authenticated.
 RemoteSecurity setClientConstraints(SecurityConstraints constraints)
          Returns a new copy of this proxy with the specified client constraints attached.
 
Methods inherited from class java.rmi.activation.ActivationID
activate, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecureActivationID

public SecureActivationID(java.rmi.activation.Activator activator)
Creates a secure activation identifier containing the specified remote object activator.
Parameters:
activator - the activator
Throws:
java.lang.IllegalArgumentException - if the specified activator does not implement both RemoteSecurity and ProxyTrust
Method Detail

setClientConstraints

public RemoteSecurity setClientConstraints(SecurityConstraints constraints)
Returns a new copy of this proxy with the specified client constraints attached. These constraints completely replace (in the copy) any current client constraints attached to the proxy. The original proxy is not modified. If null is specified, an empty constraints instance is used instead.

The specified client constraints are attached by calling setClientConstraints on the contained activator.

Specified by:
setClientConstraints in interface RemoteSecurity
Following copied from interface: java.rmi.RemoteSecurity
Parameters:
constraints - client constraints, or null
Returns:
a new copy of this proxy with the specified client constraints

getClientConstraints

public SecurityConstraints getClientConstraints()
Description copied from interface: RemoteSecurity
Returns the current client constraints, as a non-null instance.
Specified by:
getClientConstraints in interface RemoteSecurity
Following copied from interface: java.rmi.RemoteSecurity
Returns:
the current client constraints, as a non-null instance

getServerConstraints

public SecurityConstraints getServerConstraints(java.lang.String name,
                                                java.lang.Class[] parameterTypes)
                                         throws java.lang.NoSuchMethodException,
                                                java.rmi.RemoteException
Returns the server's constraints for the specified method as a non-null instance. The values can vary with the remote method, so the particular method must be specified by giving the method name and parameter types. The value of parameterTypes can be null, which is treated the same as an empty array.

This method simply delegates to the getServerConstraints method of the contained activator.

Specified by:
getServerConstraints in interface RemoteSecurity
Following copied from interface: java.rmi.RemoteSecurity
Parameters:
methodName - the name of the remote method
parameterTypes - the formal parameter types of the remote method, in declared order
Returns:
the server's constraints for the specified method as a non-null instance
Throws:
java.lang.NoSuchMethodException - if the specified method does not exist
NullPointerException - if methodName is null or any element of parameterTypes is null
java.lang.IllegalArgumentException - if the specified method exists but is not a remote method and is not the getServerSubject method of this interface
java.rmi.RemoteException - if a communication-related exception occurs

getServerSubject

public javax.security.auth.Subject getServerSubject()
                                             throws java.rmi.RemoteException
Description copied from interface: RemoteSecurity
Connects to the server as if a remote call were to be performed (with security constraints being applied in the normal way), and returns the authenticated identity of the server as a read-only instance, or null if the server has not been authenticated. Note that checking the authenticated identity of the server obtained from calling this method is no guarantee that the server will correctly authenticate itself in any future calls. Although a client might not specify a ServerMinPrincipal requirement when calling this method, a client generally needs to specify a ServerMinPrincipal requirement for other methods when server authentication is needed, or else verify that the server has specified a satisfactory ServerMinPrincipal requirement for each of the methods that the client cares about. This method can be used to obtain principals with which to create such a ServerMinPrincipal requirement.
Specified by:
getServerSubject in interface RemoteSecurity
Following copied from interface: java.rmi.RemoteSecurity
Returns:
the authenticated identity of the server as a read-only instance, or null if the server has not been authenticated
Throws:
java.rmi.RemoteException - if a communication-related exception occurs

equalsIgnoreConstraints

public boolean equalsIgnoreConstraints(java.lang.Object obj)
Description copied from interface: RemoteSecurity
Returns true if the two proxies are equal, ignoring both client and server security constraints; returns false otherwise. For stubs, this method simply checks that the two stubs are for the same remote object.
Specified by:
equalsIgnoreConstraints in interface RemoteSecurity
Following copied from interface: java.rmi.RemoteSecurity
Parameters:
obj - the proxy object with which to compare
Returns:
true if the two proxies are equal, ignoring both client and server security constraints; false otherwise

equals

public boolean equals(java.lang.Object obj)
Description copied from class: java.rmi.activation.ActivationID
Compares two activation ids for content equality. Returns true if both of the following conditions are true: 1) the unique identifiers equivalent (by content), and 2) the activator specified in each identifier refers to the same remote object.
Overrides:
equals in class java.rmi.activation.ActivationID
Following copied from class: java.rmi.activation.ActivationID
Parameters:
obj - the Object to compare with
Returns:
true if these Objects are equal; false otherwise.
See Also:
Hashtable


Copyright © 2000 Sun Microsystems, Inc. All rights reserved