p2ps.group
Interface GroupService

All Known Implementing Classes:
GroupServiceImp

public interface GroupService

A service responsible for joining and creating peer groups.

Version:
$Revision: 295 $
Author:
Ian Wang

Method Summary
 AuthorizationMechanism getAuthorizationMechanism(java.lang.String type)
           
 java.lang.String[] getAuthorizationTypes()
           
 GroupAdvertisement getGroupAdvertisement()
           
 java.lang.String[] getGroupIDs()
           
 void init()
          Initializes the group service.
 void joinGroup(GroupAdvertisement groupad, Peer parent)
          Join the group specified in the advertisement.
 void registerAuthorizationMechanism(java.lang.String authtype, AuthorizationMechanism authmech)
          Registers an authorization mechanism for the specified authorization type
 void unregisterAuthorizationMechanism(java.lang.String authtype)
          Unregisters the authorization mechanism for the specified authorization type
 

Method Detail

joinGroup

public void joinGroup(GroupAdvertisement groupad,
                      Peer parent)
               throws UnknownAuthorizationMechanismException,
                      AuthorizationException,
                      InitializationException,
                      java.io.IOException
Join the group specified in the advertisement. Must be called before the group service is initialized

Throws:
UnknownAuthorizationMechanismException
AuthorizationException
InitializationException
java.io.IOException

init

public void init()
          throws InitializationException,
                 java.io.IOException
Initializes the group service.

Throws:
InitializationException
java.io.IOException

getGroupIDs

public java.lang.String[] getGroupIDs()
Returns:
the group id hierarchy for the current group (current group id at index 0)

getGroupAdvertisement

public GroupAdvertisement getGroupAdvertisement()
Returns:
an advertisement for the current group (or null if no group)

registerAuthorizationMechanism

public void registerAuthorizationMechanism(java.lang.String authtype,
                                           AuthorizationMechanism authmech)
Registers an authorization mechanism for the specified authorization type


unregisterAuthorizationMechanism

public void unregisterAuthorizationMechanism(java.lang.String authtype)
Unregisters the authorization mechanism for the specified authorization type


getAuthorizationMechanism

public AuthorizationMechanism getAuthorizationMechanism(java.lang.String type)
Returns:
the authorization mechanism for the specified type (or null if none)

getAuthorizationTypes

public java.lang.String[] getAuthorizationTypes()
Returns:
a list of the registered authorization types