Package net.jini.lookup
Interface DiscoveryAdmin
- All Known Subinterfaces:
Registrar
- All Known Implementing Classes:
GigaRegistrar
public interface DiscoveryAdmin
Methods for controlling which groups a lookup service is a member of, and for controlling which
TCP port a lookup service uses for its lookup locator. Lookup services that implement the
Administrable interface should return an admin object that implements this interface.
- Author:
- Sun Microsystems, Inc.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddMemberGroups(String[] groups) Adds the given set of names to the set whose elements are the names of the groups in which the lookup service is currently a member.String[]Returns an array consisting of the names of the groups in which the lookup service is a member.intReturns the port number on which the lookup service listens for unicast discovery queries.voidremoveMemberGroups(String[] groups) Deletes the elements of the given set of names from the set whose elements are the names of the groups in which the lookup service is currently a member.voidsetMemberGroups(String[] groups) Replaces the set whose elements are the names of the groups in which the lookup service is currently a member with the given set of group names.voidsetUnicastPort(int port) Changes the number of the port on which the lookup service is currently listening for unicast discovery queries to the given port number.
-
Method Details
-
getMemberGroups
Returns an array consisting of the names of the groups in which the lookup service is a member. If the lookup service currently belongs to no groups, this method will return the empty array.- Returns:
Stringarray consisting of the names of the groups in which the lookup service is a member- Throws:
RemoteException- typically, this exception occurs when there is a communication failure between the client and the server.
-
addMemberGroups
Adds the given set of names to the set whose elements are the names of the groups in which the lookup service is currently a member. Elements in the input set that duplicate names of groups in which the lookup service is already a member will be ignored. If the empty array (NO_GROUPS) is input, this method takes no action.- Parameters:
groups-Stringarray consisting of the names of the new, additional groups in which the lookup service is to be a member.- Throws:
RemoteException- typically, this exception occurs when there is a communication failure between the client and the server.NullPointerException- this exception occurs when eithernullis input to thegroupsparameter, or one or more of the elements of thegroupsparameter isnull.
-
removeMemberGroups
Deletes the elements of the given set of names from the set whose elements are the names of the groups in which the lookup service is currently a member. Any element in the input set that is not a name of a group in which the lookup service is currently a member will be ignored. If the empty array (NO_GROUPS) is input, this method takes no action.- Parameters:
groups-Stringarray consisting of the names to remove from the set whose elements are the names of the groups in which the lookup service is currently a member.- Throws:
RemoteException- typically, this exception occurs when there is a communication failure between the client and the server.NullPointerException- this exception occurs when eithernullis input to thegroupsparameter, or one or more of the elements of thegroupsparameter isnull.
-
setMemberGroups
Replaces the set whose elements are the names of the groups in which the lookup service is currently a member with the given set of group names. Elements in the input set that duplicate other elements in the input set will be ignored. If the empty array (NO_GROUPS) is input, then the lookup service will be a member of no groups.- Parameters:
groups-Stringarray consisting of the names of the new groups in which the lookup service is to be a member.- Throws:
RemoteException- typically, this exception occurs when there is a communication failure between the client and the server.NullPointerException- this exception occurs when eithernullis input to thegroupsparameter, or one or more of the elements of thegroupsparameter isnull.
-
getUnicastPort
Returns the port number on which the lookup service listens for unicast discovery queries.- Returns:
- an
intrepresenting the port number on which the lookup service listens for unicast discovery queries. - Throws:
RemoteException- typically, this exception occurs when there is a communication failure between the client and the server.
-
setUnicastPort
Changes the number of the port on which the lookup service is currently listening for unicast discovery queries to the given port number. If a value of zero is input, then the lookup service will first try to listen on the standard unicast discovery port, but if that fails, the lookup service will listen on an arbitrary port.- Parameters:
port-intrepresenting the new port number on which the lookup service should listen for unicast discovery queries.- Throws:
IOException- because an invocation of this method will result in the re-initiation of the unicast discovery process, which can throw anIOExceptionwhen socket allocation occurs.RemoteException- typically, this exception occurs when there is a communication failure between the client and the server.
-