Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.jini.lookup
Interface DiscoveryAdmin

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.

Method Summary
`void` | `addMemberGroups(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[]` | `getMemberGroups()` Returns an array consisting of the names of the groups in which the lookup service is a member.
`int` | `getUnicastPort()` Returns the port number on which the lookup service listens for unicast discovery queries.
`void` | `removeMemberGroups(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.
`void` | `setMemberGroups(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.
`void` | `setUnicastPort(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 Detail

### getMemberGroups

    public String[] getMemberGroups()
                             throws RemoteException

  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:
    `String` array 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

    public void addMemberGroups(String[] groups)
                         throws RemoteException

  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` - `String` array 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 either `null` is input to the `groups` parameter, or one or more of the elements of the `groups` parameter is `null`.

### removeMemberGroups

    public void removeMemberGroups(String[] groups)
                            throws RemoteException

  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` - `String` array 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 either `null` is input to the `groups` parameter, or one or more of the elements of the `groups` parameter is `null`.

### setMemberGroups

    public void setMemberGroups(String[] groups)
                         throws RemoteException

  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` - `String` array 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 either `null` is input to the `groups` parameter, or one or more of the elements of the `groups` parameter is `null`.

### getUnicastPort

    public int getUnicastPort()
                       throws RemoteException

  Returns the port number on which the lookup service listens for unicast discovery queries.

  Returns:
    an `int` representing 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

    public void setUnicastPort(int port)
                        throws IOException,
                               RemoteException

  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` - `int` representing 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 an `IOException` when socket allocation occurs.
    `RemoteException` - typically, this exception occurs when there is a communication failure between the client and the server.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Sun Microsystems, Inc. All rights reserved