edu.jhu.cnds.Frugal
Class Administrator

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--edu.jhu.cnds.Frugal.Administrator

public class Administrator
extends java.rmi.server.UnicastRemoteObject
implements net.jini.core.entry.Entry, edu.jhu.cnds.Frugal.Administrator.RemoteUnicastAdmin

A class for handling common administrative chores.
Derived from the BasicUnicastAdmin class by W Keith Edwards.

Version:
2.0
Author:
R. Sean Borgstrom
See Also:
Serialized Form

Field Summary
protected  FrugalServiceRemote Ministry
          The Frugal Service (either a Frugal resource or a Frugal manager) associated with this object.
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
protected Administrator(FrugalServiceRemote Ministry)
          Constructs a new instance of the Administrator class linked to a particular Frugal Service.
 
Method Summary
 void addLookupAttributes(net.jini.core.entry.Entry[] duties)
          Adds new lookup attributes to the relevant Frugal Service.
 void addLookupGroups(java.lang.String[] holdings)
          Adds lookup groups to the list associated with the relevant Frugal Service's JoinManager.
 void addLookupLocators(net.jini.core.discovery.LookupLocator[] infOffices)
          Informs the relevant Frugal Service of new lookup locators, representing lookup services it should try to connect to.
 void destroy()
          Kills the Frugal Service associated with this administrative object.
 net.jini.core.entry.Entry[] getLookupAttributes()
          Returns the lookup attributes for the relevant Frugal Service.
 java.lang.String[] getLookupGroups()
          Returns the list of lookup groups for the relevant Frugal Service.
 net.jini.core.discovery.LookupLocator[] getLookupLocators()
          Returns the locators for the list of lookup services the relevant Frugal Service connects to.
 java.lang.String getStorageLocation()
          Returns the storage location for the persistent data associated with the relevant Frugal Service.
 void modifyLookupAttributes(net.jini.core.entry.Entry[] manifesto, net.jini.core.entry.Entry[] duties)
          Changes the lookup attributes for the relevant Frugal Service, as per ServiceRegistration.modifyAttributes().
 void removeLookupGroups(java.lang.String[] holdings)
          Removes lookup groups from the list associated with the relevant Frugal Service.
 void removeLookupLocators(net.jini.core.discovery.LookupLocator[] infOffices)
          Tells the relevant Frugal Service to cease connecting to the lookup services corresponding to the locators provided.
 void setLookupGroups(java.lang.String[] holdings)
          Sets the list of lookup groups associated with the relevant Frugal Service.
 void setLookupLocators(net.jini.core.discovery.LookupLocator[] infOffices)
          Changes the list of lookup services the relevant Frugal Service tries to connect to.
 void setStorageLocation(java.lang.String office)
          Sets the storage location for the persistent data associated with the relevant Frugal Service.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

Ministry

protected FrugalServiceRemote Ministry
The Frugal Service (either a Frugal resource or a Frugal manager) associated with this object.
Constructor Detail

Administrator

protected Administrator(FrugalServiceRemote Ministry)
                 throws java.rmi.RemoteException
Constructs a new instance of the Administrator class linked to a particular Frugal Service.
Method Detail

destroy

public void destroy()
Kills the Frugal Service associated with this administrative object.

setStorageLocation

public void setStorageLocation(java.lang.String office)
                        throws java.rmi.RemoteException
Sets the storage location for the persistent data associated with the relevant Frugal Service.
Parameters:
office - The new storage location.

getStorageLocation

public java.lang.String getStorageLocation()
Returns the storage location for the persistent data associated with the relevant Frugal Service.
Returns:
A File.toString() describing the storage location

getLookupAttributes

public net.jini.core.entry.Entry[] getLookupAttributes()
Returns the lookup attributes for the relevant Frugal Service.
Returns:
A JoinManager.getAttributes() array of Entries.

addLookupAttributes

public void addLookupAttributes(net.jini.core.entry.Entry[] duties)
                         throws java.rmi.RemoteException
Adds new lookup attributes to the relevant Frugal Service.
Parameters:
duties - New information about the Frugal Service's responsibilities.

modifyLookupAttributes

public void modifyLookupAttributes(net.jini.core.entry.Entry[] manifesto,
                                   net.jini.core.entry.Entry[] duties)
                            throws java.rmi.RemoteException
Changes the lookup attributes for the relevant Frugal Service, as per ServiceRegistration.modifyAttributes().
Parameters:
manifesto - The templates for new duties.
duties - New information about the Frugal Service's responsibilities.

getLookupGroups

public java.lang.String[] getLookupGroups()
Returns the list of lookup groups for the relevant Frugal Service.
Returns:
A JoinManager.getGroups() list of lookup groups.

addLookupGroups

public void addLookupGroups(java.lang.String[] holdings)
                     throws java.rmi.RemoteException
Adds lookup groups to the list associated with the relevant Frugal Service's JoinManager.
Parameters:
holdings - A list of new lookup groups, conceptually "managed" by this Service if it is a Frugal Manager and "served" if it is a resource.

removeLookupGroups

public void removeLookupGroups(java.lang.String[] holdings)
                        throws java.rmi.RemoteException
Removes lookup groups from the list associated with the relevant Frugal Service.
Parameters:
holdings - A list of lookup groups no longer conceptually "managed" by this Service if it is a Frugal Manager or "served" if it is a resource.

setLookupGroups

public void setLookupGroups(java.lang.String[] holdings)
                     throws java.rmi.RemoteException
Sets the list of lookup groups associated with the relevant Frugal Service.
Parameters:
holdings - A list of the lookup groups conceptually "managed" by this Service if it is a Frugal Manager and "served" if it is a resource.

getLookupLocators

public net.jini.core.discovery.LookupLocator[] getLookupLocators()
                                                          throws java.rmi.RemoteException
Returns the locators for the list of lookup services the relevant Frugal Service connects to.
Returns:
A JoinManager.getLocators() list of lookup locators.

addLookupLocators

public void addLookupLocators(net.jini.core.discovery.LookupLocator[] infOffices)
                       throws java.rmi.RemoteException
Informs the relevant Frugal Service of new lookup locators, representing lookup services it should try to connect to.
Parameters:
infOffices - The new lookup locators.

removeLookupLocators

public void removeLookupLocators(net.jini.core.discovery.LookupLocator[] infOffices)
                          throws java.rmi.RemoteException
Tells the relevant Frugal Service to cease connecting to the lookup services corresponding to the locators provided.
Parameters:
infOffices - Locators for the lookup services it should no longer connect to.

setLookupLocators

public void setLookupLocators(net.jini.core.discovery.LookupLocator[] infOffices)
                       throws java.rmi.RemoteException
Changes the list of lookup services the relevant Frugal Service tries to connect to.
Parameters:
infOffices - Locators for the lookup services it should now try exclusively to connect to.