com.sun.jini.outrigger
Class AdminProxy

java.lang.Object
  extended by com.sun.jini.outrigger.AdminProxy
All Implemented Interfaces:
DestroyAdmin, JavaSpaceAdmin, Serializable, JoinAdmin, ReferentUuid
Direct Known Subclasses:
ConstrainableAdminProxy

 class AdminProxy
extends Object
implements JavaSpaceAdmin, ReferentUuid, Serializable

AdminProxy objects are connected to particular OutriggerServerImpls to implement the JavaSpaceAdmin interface for the server.

See Also:
JavaSpaceAdmin

Field Summary
(package private)  OutriggerAdmin admin
          Reference to the actual remote admin object.
private static boolean DEBUG
           
private static long serialVersionUID
           
(package private)  Uuid spaceUuid
          The Uuid that identifies the space this proxy is for
 
Fields inherited from interface com.sun.jini.outrigger.JavaSpaceAdmin
USE_DEFAULT
 
Constructor Summary
AdminProxy(OutriggerAdmin admin, Uuid spaceUuid)
          Create an AdminProxy for the given remote admin objects.
 
Method Summary
 void addLookupAttributes(Entry[] attrSets)
          Add attribute sets for the service.
 void addLookupGroups(String[] groups)
          Add new groups to the set to join.
 void addLookupLocators(LookupLocator[] locators)
          Add locators for specific new lookup services to join.
 AdminIterator contents(Entry tmpl, Transaction tr)
          Return an AdminIterator that will iterate over all the entries in the space that match the given template and are visible under the given transaction.
 AdminIterator contents(Entry tmpl, Transaction tr, int fetchSize)
          Return an AdminIterator that will iterate over all the entries in the space that match the given template and are visible under the given transaction.
 void destroy()
          Destroy the service, if possible, including its persistent storage.
 boolean equals(Object other)
           
 Entry[] getLookupAttributes()
          Get the current attribute sets for the service.
 String[] getLookupGroups()
          Get the list of groups to join.
 LookupLocator[] getLookupLocators()
          Get the list of locators of specific lookup services to join.
 Uuid getReferentUuid()
          Return the Uuid that has been assigned to the resource this proxy represents.
 int hashCode()
           
 void modifyLookupAttributes(Entry[] attrSetTemplates, Entry[] attrSets)
          Modify the current attribute sets, using the same semantics as ServiceRegistration.modifyAttributes.
private  void readObject(ObjectInputStream in)
          Read this object back and validate state.
private  void readObjectNoData()
          We should always have data in the stream, if this method gets called there is something wrong.
 void removeLookupGroups(String[] groups)
          Remove groups from the set to join.
 void removeLookupLocators(LookupLocator[] locators)
          Remove locators for specific lookup services from the set to join.
 void setLookupGroups(String[] groups)
          Replace the list of groups to join with a new list.
 void setLookupLocators(LookupLocator[] locators)
          Replace the list of locators of specific lookup services to join with a new list.
 JavaSpace space()
          Return the space that this administrative object governs.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

admin

final OutriggerAdmin admin
Reference to the actual remote admin object.


spaceUuid

final Uuid spaceUuid
The Uuid that identifies the space this proxy is for


DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values
Constructor Detail

AdminProxy

AdminProxy(OutriggerAdmin admin,
           Uuid spaceUuid)
Create an AdminProxy for the given remote admin objects.

Parameters:
admin - reference to remote server for the space.
spaceUuid - universal unique ID for the space.
Throws:
NullPointerException - if admin or spaceUuid is null.
Method Detail

readObject

private void readObject(ObjectInputStream in)
                 throws IOException,
                        ClassNotFoundException
Read this object back and validate state.

Throws:
IOException
ClassNotFoundException

readObjectNoData

private void readObjectNoData()
                       throws InvalidObjectException
We should always have data in the stream, if this method gets called there is something wrong.

Throws:
InvalidObjectException

space

public JavaSpace space()
                throws RemoteException
Description copied from interface: JavaSpaceAdmin
Return the space that this administrative object governs.

Specified by:
space in interface JavaSpaceAdmin
Throws:
RemoteException - if communications with the server is necessary and it can not be completed.

contents

public AdminIterator contents(Entry tmpl,
                              Transaction tr)
                       throws TransactionException,
                              RemoteException
Description copied from interface: JavaSpaceAdmin
Return an AdminIterator that will iterate over all the entries in the space that match the given template and are visible under the given transaction.

The interactions between other operations on the space and the returned iterator are undefined

Specified by:
contents in interface JavaSpaceAdmin
Parameters:
tmpl - The iterator should return only entries that match tmpl
tr - The iterator should return only entries that match this transaction
Throws:
TransactionException - if there is a problem with txn.
RemoteException - if communications with the server is necessary and it can not be completed.

contents

public AdminIterator contents(Entry tmpl,
                              Transaction tr,
                              int fetchSize)
                       throws TransactionException,
                              RemoteException
Description copied from interface: JavaSpaceAdmin
Return an AdminIterator that will iterate over all the entries in the space that match the given template and are visible under the given transaction.

The interactions between other operations on the space and the returned iterator are undefined

Specified by:
contents in interface JavaSpaceAdmin
Parameters:
tmpl - The iterator should return only entries that match tmpl
tr - The iterator should return only entries that match this transaction
fetchSize - advice on how many entries to fetch when the iterator has to go to the server for more entries.
Throws:
TransactionException - if there is a problem with txn.
RemoteException - if communications with the server is necessary and it can not be completed.

destroy

public void destroy()
             throws RemoteException
Description copied from interface: DestroyAdmin
Destroy the service, if possible, including its persistent storage. This method should (in effect) spawn a separate thread to do the actual work asynchronously, and make a reasonable attempt to let this remote call return successfully. As such, a successful return from this method does not mean that the service has been destroyed. Although the service should make a reasonable attempt to let this remote call return successfully, the service must not wait indefinitely for other (in-progress and subsequent) remote calls to finish before proceeding to destroy itself. Once this method has been called, the service can, but need not, reject all other (in-progress and subsequent) remote calls to the service.

Specified by:
destroy in interface DestroyAdmin
Throws:
RemoteException

getLookupAttributes

public Entry[] getLookupAttributes()
                            throws RemoteException
Description copied from interface: JoinAdmin
Get the current attribute sets for the service.

Specified by:
getLookupAttributes in interface JoinAdmin
Returns:
the current attribute sets for the service
Throws:
RemoteException

addLookupAttributes

public void addLookupAttributes(Entry[] attrSets)
                         throws RemoteException
Description copied from interface: JoinAdmin
Add attribute sets for the service. The resulting set will be used for all future joins. The attribute sets are also added to all currently-joined lookup services.

Specified by:
addLookupAttributes in interface JoinAdmin
Parameters:
attrSets - the attribute sets to add
Throws:
RemoteException

modifyLookupAttributes

public void modifyLookupAttributes(Entry[] attrSetTemplates,
                                   Entry[] attrSets)
                            throws RemoteException
Description copied from interface: JoinAdmin
Modify the current attribute sets, using the same semantics as ServiceRegistration.modifyAttributes. The resulting set will be used for all future joins. The same modifications are also made to all currently-joined lookup services.

Specified by:
modifyLookupAttributes in interface JoinAdmin
Parameters:
attrSetTemplates - the templates for matching attribute sets
attrSets - the modifications to make to matching sets
Throws:
RemoteException
See Also:
ServiceRegistration.modifyAttributes(net.jini.core.entry.Entry[], net.jini.core.entry.Entry[])

getLookupGroups

public String[] getLookupGroups()
                         throws RemoteException
Description copied from interface: JoinAdmin
Get the list of groups to join. An empty array means the service joins no groups (as opposed to "all" groups).

Specified by:
getLookupGroups in interface JoinAdmin
Returns:
an array of groups to join. An empty array means the service joins no groups (as opposed to "all" groups).
Throws:
RemoteException
See Also:
JoinAdmin.setLookupGroups(java.lang.String[])

addLookupGroups

public void addLookupGroups(String[] groups)
                     throws RemoteException
Description copied from interface: JoinAdmin
Add new groups to the set to join. Lookup services in the new groups will be discovered and joined.

Specified by:
addLookupGroups in interface JoinAdmin
Parameters:
groups - groups to join
Throws:
RemoteException
See Also:
JoinAdmin.removeLookupGroups(java.lang.String[])

removeLookupGroups

public void removeLookupGroups(String[] groups)
                        throws RemoteException
Description copied from interface: JoinAdmin
Remove groups from the set to join. Leases are cancelled at lookup services that are not members of any of the remaining groups.

Specified by:
removeLookupGroups in interface JoinAdmin
Parameters:
groups - groups to leave
Throws:
RemoteException
See Also:
JoinAdmin.addLookupGroups(java.lang.String[])

setLookupGroups

public void setLookupGroups(String[] groups)
                     throws RemoteException
Description copied from interface: JoinAdmin
Replace the list of groups to join with a new list. Leases are cancelled at lookup services that are not members of any of the new groups. Lookup services in the new groups will be discovered and joined.

Specified by:
setLookupGroups in interface JoinAdmin
Parameters:
groups - groups to join
Throws:
RemoteException
See Also:
JoinAdmin.getLookupGroups()

getLookupLocators

public LookupLocator[] getLookupLocators()
                                  throws RemoteException
Description copied from interface: JoinAdmin
Get the list of locators of specific lookup services to join.

Specified by:
getLookupLocators in interface JoinAdmin
Returns:
the list of locators of specific lookup services to join
Throws:
RemoteException
See Also:
JoinAdmin.setLookupLocators(net.jini.core.discovery.LookupLocator[])

addLookupLocators

public void addLookupLocators(LookupLocator[] locators)
                       throws RemoteException
Description copied from interface: JoinAdmin
Add locators for specific new lookup services to join. The new lookup services will be discovered and joined.

Specified by:
addLookupLocators in interface JoinAdmin
Parameters:
locators - locators of specific lookup services to join
Throws:
RemoteException
See Also:
JoinAdmin.removeLookupLocators(net.jini.core.discovery.LookupLocator[])

removeLookupLocators

public void removeLookupLocators(LookupLocator[] locators)
                          throws RemoteException
Description copied from interface: JoinAdmin
Remove locators for specific lookup services from the set to join. Any leases held at the lookup services are cancelled.

Specified by:
removeLookupLocators in interface JoinAdmin
Parameters:
locators - locators of specific lookup services to leave
Throws:
RemoteException
See Also:
JoinAdmin.addLookupLocators(net.jini.core.discovery.LookupLocator[])

setLookupLocators

public void setLookupLocators(LookupLocator[] locators)
                       throws RemoteException
Description copied from interface: JoinAdmin
Replace the list of locators of specific lookup services to join with a new list. Leases are cancelled at lookup services that were in the old list but are not in the new list. Any new lookup services will be discovered and joined.

Specified by:
setLookupLocators in interface JoinAdmin
Parameters:
locators - locators of specific lookup services to join
Throws:
RemoteException
See Also:
JoinAdmin.getLookupLocators()

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getReferentUuid

public Uuid getReferentUuid()
Description copied from interface: ReferentUuid
Return the Uuid that has been assigned to the resource this proxy represents.

Specified by:
getReferentUuid in interface ReferentUuid
Returns:
the Uuid associated with the resource this proxy represents. Will not return null.


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