com.sun.jini.fiddler
Class FiddlerAdminProxy

java.lang.Object
  extended by com.sun.jini.fiddler.FiddlerAdminProxy
All Implemented Interfaces:
DestroyAdmin, FiddlerAdmin, Serializable, JoinAdmin, ReferentUuid
Direct Known Subclasses:
FiddlerAdminProxy.ConstrainableFiddlerAdminProxy

 class FiddlerAdminProxy
extends Object
implements FiddlerAdmin, ReferentUuid, Serializable

This class is a proxy providing access to the methods of an implementation of the lookup discovery service which allow the administration of the service. Clients only see instances of this class via the FiddlerAdmin interface.

Author:
Sun Microsystems, Inc.

Nested Class Summary
(package private) static class FiddlerAdminProxy.ConstrainableFiddlerAdminProxy
          The constrainable version of the class FiddlerAdminProxy.
 
Field Summary
(package private)  Uuid proxyID
          The unique identifier assigned to the current instance of this proxy class by the lookup discovery service.
private static long serialVersionUID
           
(package private)  Fiddler server
          The reference through which communication occurs between the client-side and the server-side of the lookup discovery service
 
Constructor Summary
private FiddlerAdminProxy(Fiddler server, Uuid proxyID)
          Constructs a new instance of FiddlerAdminProxy.
 
Method Summary
 void addLookupAttributes(Entry[] attrSets)
          Add attribute sets to the current set of attributes associated with the lookup discovery service.
 void addLookupGroups(String[] groups)
          Add new names to the set consisting of the names of groups whose members are lookup services the lookup discovery service wishes to register with (join).
 void addLookupLocators(LookupLocator[] locators)
          Add a set of LookupLocator objects to the lookup discovery service's managed set of locators.
static FiddlerAdminProxy createAdminProxy(Fiddler server, Uuid proxyID)
          Public static factory method that creates and returns an instance of FiddlerAdminProxy.
 void destroy()
          Destroy the lookup discovery service, if possible, including its persistent storage.
 boolean equals(Object obj)
          For any instance of this class, indicates whether the object input to this method is equal to the current instance of this class; where equality of administrative proxies to a lookup discovery service is defined by reference equality.
 long getLeaseBound()
          Retrieves the least upper bound applied to all lease durations granted by the lookup discovery service.
 Entry[] getLookupAttributes()
          Get the current attribute sets for the lookup discovery service.
 String[] getLookupGroups()
          Get the names of the groups whose members are lookup services the lookup discovery services wishes to register with (join).
 LookupLocator[] getLookupLocators()
          Get the lookup discovery service's managed set of locators.
 int getPersistenceSnapshotThreshold()
          Retrieve the value of the size threshold of the snapshot; which is employed by the lookup discovery service in the test to determine whether or not to take a "snapshot" of the system state.
 float getPersistenceSnapshotWeight()
          Retrieve the weight factor applied by the lookup discovery service to the snapshot size during the test to determine whether or not to take a "snapshot" of the system state.
 Uuid getReferentUuid()
          Returns the universally unique identifier that has been assigned to the resource this proxy represents.
 int hashCode()
          For any instance of this class, returns the hashcode value generated by the hashCode method of the proxy ID associated with the current instance of this proxy.
 void modifyLookupAttributes(Entry[] attrSetTemplates, Entry[] attrSets)
          Modify the current set of attributes associated with the lookup discovery service.
private  void readObject(ObjectInputStream s)
          When an instance of this class is deserialized, this method is automatically invoked.
private  void readObjectNoData()
          During deserialization of an instance of this class, if it is found that the stream contains no data, this method is automatically invoked.
 void removeLookupGroups(String[] groups)
          Remove a set of group names from lookup discovery service's managed set of groups (the set consisting of the names of groups whose members are lookup services the lookup discovery service wishes to join).
 void removeLookupLocators(LookupLocator[] locators)
          Remove a set of LookupLocator objects from the lookup discovery service's managed set of locators.
 void setLeaseBound(long newBound)
          Changes the least upper bound applied to all lease durations granted by the lookup discovery service.
 void setLookupGroups(String[] groups)
          Replace the lookup discovery service's managed set of groups with a new set of group names.
 void setLookupLocators(LookupLocator[] locators)
          Replace the lookup discovery service's managed set of locators with a new set of locators.
 void setPersistenceSnapshotThreshold(int threshold)
          Change the value of the size threshold of the snapshot; which is employed by the lookup discovery service in the test to determine whether or not to take a "snapshot" of the system state.
 void setPersistenceSnapshotWeight(float weight)
          Change the weight factor applied by the lookup discovery service to the snapshot size during the test to determine whether or not to take a "snapshot" of the system state.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

server

final Fiddler server
The reference through which communication occurs between the client-side and the server-side of the lookup discovery service


proxyID

final Uuid proxyID
The unique identifier assigned to the current instance of this proxy class by the lookup discovery service. This ID is used to determine equality between proxies.

Constructor Detail

FiddlerAdminProxy

private FiddlerAdminProxy(Fiddler server,
                          Uuid proxyID)
Constructs a new instance of FiddlerAdminProxy.

Parameters:
server - reference to the server object through which communication occurs between the client-side and server-side of the associated service
proxyID - the unique identifier assigned by the service to each instance of this proxy
Method Detail

createAdminProxy

public static FiddlerAdminProxy createAdminProxy(Fiddler server,
                                                 Uuid proxyID)
Public static factory method that creates and returns an instance of FiddlerAdminProxy. If the server associated with this proxy implements RemoteMethodControl, then the object returned by this method will also implement RemoteMethodControl.

Parameters:
server - reference to the server object through which communication occurs between the client-side and server-side of the associated service.
proxyID - the unique identifier assigned by the service to each instance of this proxy
Returns:
an instance of FiddlerAdminProxy that implements RemoteMethodControl if the given server does.

setLeaseBound

public void setLeaseBound(long newBound)
                   throws RemoteException
Changes the least upper bound applied to all lease durations granted by the lookup discovery service.

This method is a mechanism for an entity with the appropriate privileges to administratively change the value of the least upper bound that will be applied by the Fiddler implementation of the lookup discovery service when determining the duration to assign to the lease on a requested registration.

Specified by:
setLeaseBound in interface FiddlerAdmin
Parameters:
newBound - long value representing the new least upper bound (in milliseconds) on the set of all possible lease durations that may be granted
Throws:
RemoteException - typically, this exception occurs when there is a communication failure between the client and the lookup discovery service. When this exception does occur, the bound value may or may not have been changed successfully.
See Also:
FiddlerAdmin.setLeaseBound(long)

getLeaseBound

public long getLeaseBound()
                   throws RemoteException
Retrieves the least upper bound applied to all lease durations granted by the lookup discovery service.

Specified by:
getLeaseBound in interface FiddlerAdmin
Returns:
long value representing the current least upper bound (in milliseconds) on the set of all possible lease durations that may be granted
Throws:
RemoteException - typically, this exception occurs when there is a communication failure between the client and the lookup discovery service.
See Also:
FiddlerAdmin.setLeaseBound(long)

setPersistenceSnapshotWeight

public void setPersistenceSnapshotWeight(float weight)
                                  throws RemoteException
Change the weight factor applied by the lookup discovery service to the snapshot size during the test to determine whether or not to take a "snapshot" of the system state.

Specified by:
setPersistenceSnapshotWeight in interface FiddlerAdmin
Parameters:
weight - weight factor for snapshot size
Throws:
RemoteException - typically, this exception occurs when there is a communication failure between the client and the lookup discovery service. When this exception does occur, the weight factor may or may not have been changed successfully.
See Also:
FiddlerAdmin.setPersistenceSnapshotWeight(float)

getPersistenceSnapshotWeight

public float getPersistenceSnapshotWeight()
                                   throws RemoteException
Retrieve the weight factor applied by the lookup discovery service to the snapshot size during the test to determine whether or not to take a "snapshot" of the system state.

Specified by:
getPersistenceSnapshotWeight in interface FiddlerAdmin
Returns:
float value corresponding to the weight factor for snapshot size
Throws:
RemoteException - typically, this exception occurs when there is a communication failure between the client and the lookup discovery service.
See Also:
FiddlerAdmin.getPersistenceSnapshotWeight()

setPersistenceSnapshotThreshold

public void setPersistenceSnapshotThreshold(int threshold)
                                     throws RemoteException
Change the value of the size threshold of the snapshot; which is employed by the lookup discovery service in the test to determine whether or not to take a "snapshot" of the system state.

Specified by:
setPersistenceSnapshotThreshold in interface FiddlerAdmin
Parameters:
threshold - size threshold for taking a snapshot
Throws:
RemoteException - typically, this exception occurs when there is a communication failure between the client and the lookup discovery service. When this exception does occur, the threshold may or may not have been changed successfully.
See Also:
FiddlerAdmin.setPersistenceSnapshotThreshold(int)

getPersistenceSnapshotThreshold

public int getPersistenceSnapshotThreshold()
                                    throws RemoteException
Retrieve the value of the size threshold of the snapshot; which is employed by the lookup discovery service in the test to determine whether or not to take a "snapshot" of the system state.

Specified by:
getPersistenceSnapshotThreshold in interface FiddlerAdmin
Returns:
int value corresponding to the size threshold of the snapshot
Throws:
RemoteException - typically, this exception occurs when there is a communication failure between the client and the lookup discovery service.
See Also:
FiddlerAdmin.getPersistenceSnapshotThreshold()

getLookupAttributes

public Entry[] getLookupAttributes()
                            throws RemoteException
Get the current attribute sets for the lookup discovery service.

Specified by:
getLookupAttributes in interface JoinAdmin
Returns:
array of net.jini.core.entry.Entry containing the current attribute sets for the lookup discovery service
Throws:
RemoteException - typically, this exception occurs when there is a communication failure between the client and the lookup discovery service.
See Also:
JoinAdmin.getLookupAttributes()

addLookupAttributes

public void addLookupAttributes(Entry[] attrSets)
                         throws RemoteException
Add attribute sets to the current set of attributes associated with the lookup discovery service. The resulting set will be used for all future registrations with lookup services. The new attribute sets are also added to the lookup discovery service's attributes on each lookup service with which the lookup discovery service is currently registered.

Specified by:
addLookupAttributes in interface JoinAdmin
Parameters:
attrSets - array of net.jini.core.entry.Entry containing the attribute sets to add
Throws:
RemoteException - typically, this exception occurs when there is a communication failure between the client and the lookup discovery service. When this exception does occur, the attributes may or may not have been added successfully.
See Also:
JoinAdmin.addLookupAttributes(net.jini.core.entry.Entry[])

modifyLookupAttributes

public void modifyLookupAttributes(Entry[] attrSetTemplates,
                                   Entry[] attrSets)
                            throws RemoteException
Modify the current set of attributes associated with the lookup discovery service. The resulting set will be used for all future registrations with lookup services. The same modifications are also made to the lookup discovery service's attributes on each lookup service with which the lookup discovery service is currently registered.

Specified by:
modifyLookupAttributes in interface JoinAdmin
Parameters:
attrSetTemplates - array of net.jini.core.entry.Entry containing the templates for matching attribute sets
attrSets - array of net.jini.core.entry.Entry containing the modifications to make to matching sets
Throws:
RemoteException - typically, this exception occurs when there is a communication failure between the client and the lookup discovery service. When this exception does occur, the attributes may or may not have been modified successfully.
See Also:
JoinAdmin.modifyLookupAttributes(net.jini.core.entry.Entry[], net.jini.core.entry.Entry[])

getLookupGroups

public String[] getLookupGroups()
                         throws RemoteException
Get the names of the groups whose members are lookup services the lookup discovery services wishes to register with (join).

Specified by:
getLookupGroups in interface JoinAdmin
Returns:
String array containing the names of the groups whose members are lookup services the lookup discovery service wishes to join.

If the array returned is empty, the lookup discovery service is configured to join no groups. If null is returned, the lookup discovery service is configured to join all groups.

Throws:
RemoteException - typically, this exception occurs when there is a communication failure between the client and the lookup discovery service.
See Also:
JoinAdmin.getLookupGroups()

addLookupGroups

public void addLookupGroups(String[] groups)
                     throws RemoteException
Add new names to the set consisting of the names of groups whose members are lookup services the lookup discovery service wishes to register with (join). Any lookup services belonging to the new groups that the lookup discovery service has not yet registered with, will be discovered and joined.

Specified by:
addLookupGroups in interface JoinAdmin
Parameters:
groups - String array containing the names of the groups to add
Throws:
RemoteException - typically, this exception occurs when there is a communication failure between the client and the lookup discovery service. When this exception does occur, the group names may or may not have been added successfully.
See Also:
JoinAdmin.addLookupGroups(java.lang.String[])

removeLookupGroups

public void removeLookupGroups(String[] groups)
                        throws RemoteException
Remove a set of group names from lookup discovery service's managed set of groups (the set consisting of the names of groups whose members are lookup services the lookup discovery service wishes to join). Any leases granted to the lookup discovery service by lookup services that are not members of the groups whose names remain in the managed set will be cancelled at those lookup services.

Specified by:
removeLookupGroups in interface JoinAdmin
Parameters:
groups - String array containing the names of the groups to remove
Throws:
RemoteException - typically, this exception occurs when there is a communication failure between the client and the lookup discovery service. When this exception does occur, the group names may or may not have been removed successfully.
See Also:
JoinAdmin.removeLookupGroups(java.lang.String[])

setLookupGroups

public void setLookupGroups(String[] groups)
                     throws RemoteException
Replace the lookup discovery service's managed set of groups with a new set of group names. Any leases granted to the lookup discovery service by lookup services that are not members of the groups whose names are in the new managed set will be cancelled at those lookup services. Lookup services that are members of groups reflected in the new managed set will be discovered and joined.

Specified by:
setLookupGroups in interface JoinAdmin
Parameters:
groups - String array containing the names of the new groups
Throws:
RemoteException - typically, this exception occurs when there is a communication failure between the client and the lookup discovery service. When this exception does occur, the group names may or may not have been replaced successfully.
See Also:
JoinAdmin.setLookupGroups(java.lang.String[])

getLookupLocators

public LookupLocator[] getLookupLocators()
                                  throws RemoteException
Get the lookup discovery service's managed set of locators. The managed set of locators is the set of LookupLocator objects corresponding to the specific lookup services with which the lookup discovery service wishes to register (join).

Specified by:
getLookupLocators in interface JoinAdmin
Returns:
array of objects of type net.jini.core.discovery.LookupLocator, each of which corresponds to a specific lookup service the lookup discovery service wishes to join.
Throws:
RemoteException - typically, this exception occurs when there is a communication failure between the client and the lookup discovery service.
See Also:
JoinAdmin.getLookupLocators()

addLookupLocators

public void addLookupLocators(LookupLocator[] locators)
                       throws RemoteException
Add a set of LookupLocator objects to the lookup discovery service's managed set of locators. The managed set of locators is the set of LookupLocator objects corresponding to the specific lookup services with which the lookup discovery service wishes to register (join).

Any lookup services corresponding to the new locators that the lookup discovery service has not yet joined, will be discovered and joined.

Specified by:
addLookupLocators in interface JoinAdmin
Parameters:
locators - array of net.jini.core.discovery.LookupLocator objects to add to the managed set of locators
Throws:
RemoteException - typically, this exception occurs when there is a communication failure between the client and the lookup discovery service. When this exception does occur, the new locators may or may not have been added successfully.
See Also:
JoinAdmin.addLookupLocators(net.jini.core.discovery.LookupLocator[])

removeLookupLocators

public void removeLookupLocators(LookupLocator[] locators)
                          throws RemoteException
Remove a set of LookupLocator objects from the lookup discovery service's managed set of locators. The managed set of locators is the set of LookupLocator objects corresponding to the specific lookup services with which the lookup discovery service wishes to register (join).

Note that any leases granted to the lookup discovery service by lookup services that do not correspond to any of the locators remaining in the managed set will be cancelled at those lookup services.

Specified by:
removeLookupLocators in interface JoinAdmin
Parameters:
locators - array of net.jini.core.discovery.LookupLocator objects to remove from the managed set of locators
Throws:
RemoteException - typically, this exception occurs when there is a communication failure between the client and the lookup discovery service. When this exception does occur, the new locators may or may not have been removed successfully.
See Also:
JoinAdmin.removeLookupLocators(net.jini.core.discovery.LookupLocator[])

setLookupLocators

public void setLookupLocators(LookupLocator[] locators)
                       throws RemoteException
Replace the lookup discovery service's managed set of locators with a new set of locators. The managed set of locators is the set of LookupLocator objects corresponding to the specific lookup services with which the lookup discovery service wishes to register (join).

Note that any leases granted to the lookup discovery service by lookup services whose corresponding locator is removed from the managed set will be cancelled at those lookup services. The lookup services corresponding to the new locators in the managed set will be discovered and joined.

Specified by:
setLookupLocators in interface JoinAdmin
Parameters:
locators - array of net.jini.core.discovery.LookupLocator objects with which to replace the current managed set of locators remove from the managed set of locators
Throws:
RemoteException - typically, this exception occurs when there is a communication failure between the client and the lookup discovery service. When this exception does occur, the locators in the managed set may or may not have been replaced successfully.
See Also:
JoinAdmin.setLookupLocators(net.jini.core.discovery.LookupLocator[])

getReferentUuid

public Uuid getReferentUuid()
Returns the universally unique identifier that has been assigned to the resource this proxy represents.

Specified by:
getReferentUuid in interface ReferentUuid
Returns:
the instance of Uuid that is associated with the resource this proxy represents. This method will not return null.
See Also:
ReferentUuid

destroy

public void destroy()
             throws RemoteException
Destroy the lookup discovery service, if possible, including its persistent storage. This method will typically spawn a separate thread to do the actual work asynchronously, so a successful return from this method usually does not mean that the service has been destroyed.

Specified by:
destroy in interface DestroyAdmin
Throws:
RemoteException - typically, this exception occurs when there is a communication failure between the client and the lookup discovery service. When this exception does occur, the lookup discovery service may or may not have been successfully destroyed.
See Also:
DestroyAdmin.destroy()

hashCode

public int hashCode()
For any instance of this class, returns the hashcode value generated by the hashCode method of the proxy ID associated with the current instance of this proxy.

Overrides:
hashCode in class Object
Returns:
int value representing the hashcode for an instance of this class.

equals

public boolean equals(Object obj)
For any instance of this class, indicates whether the object input to this method is equal to the current instance of this class; where equality of administrative proxies to a lookup discovery service is defined by reference equality. That is, two proxies are equal if they reference (are proxies to) the same backend server.

Overrides:
equals in class Object
Parameters:
obj - reference to the object that is to be compared to the object on which this method is invoked.
Returns:
true if the object input is referentially equal to the object on which this method is invoked; false otherwise.

readObject

private void readObject(ObjectInputStream s)
                 throws IOException,
                        ClassNotFoundException
When an instance of this class is deserialized, this method is automatically invoked. This implementation of this method validates the state of the deserialized instance.

Throws:
InvalidObjectException - if the state of the deserialized instance of this class is found to be invalid.
IOException
ClassNotFoundException

readObjectNoData

private void readObjectNoData()
                       throws InvalidObjectException
During deserialization of an instance of this class, if it is found that the stream contains no data, this method is automatically invoked. Because it is expected that the stream should always contain data, this implementation of this method simply declares that something must be wrong.

Throws:
InvalidObjectException - to indicate that there was no data in the stream during deserialization of an instance of this class; declaring that something is wrong.
InvalidObjectException


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