Wildfire 3.2.4 Javadoc

org.jivesoftware.wildfire.sasl
Class AbstractAuthorizationProvider

java.lang.Object
  extended by org.jivesoftware.wildfire.sasl.AbstractAuthorizationProvider
All Implemented Interfaces:
AuthorizationProvider
Direct Known Subclasses:
DefaultAuthorizationProvider, LdapAuthorizationProvider, UnixK5LoginProvider

public abstract class AbstractAuthorizationProvider
extends Object
implements AuthorizationProvider

Provider for authorization. Unlike the AbstractAuthorizationPolicy class, this is intended for classes that need a more "heavyweight" solution, often that requires consulting some storage or external entity about each specific case. This class allows individual mappings between authenticated principals and usernames, and if the storage mechanism allows it, management of those mappings. Users that wish to integrate with their own authorization system must extend this class and implement the AuthorizationProvider interface then register the class with Wildfire in the wildfire.xml file. An entry in that file would look like the following:

   <provider>
     <authorizationpolicy>
       <classlist>com.foo.auth.CustomPolicyProvider</classlist>
     </authorizationpolicy>
   </provider>

Author:
Jay Kline

Constructor Summary
AbstractAuthorizationProvider()
           
 
Method Summary
abstract  void addAuthorized(String username, Collection<String> principals)
          Add a Collection of users authorized to use the named user.
abstract  void addAuthorized(String username, String principal)
          Add a single authorized principal to use the named user.
abstract  boolean authorize(String username, String principal)
          Returns true if the principal is explicity authorized to the JID
abstract  String description()
          Returns a description of the Policy
abstract  Collection<String> getAuthorized(String username)
          Returns a String Collection of principals that are authorized to use the named user.
abstract  boolean isWritable()
          Returns true if this AuthorizationProvider supports changing the list of authorized principals for users.
abstract  String name()
          Returns the short name of the Policy
abstract  void setAuthorized(String username, Collection<String> principals)
          Set the users authorized to use the named user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAuthorizationProvider

public AbstractAuthorizationProvider()
Method Detail

authorize

public abstract boolean authorize(String username,
                                  String principal)
Returns true if the principal is explicity authorized to the JID

Specified by:
authorize in interface AuthorizationProvider
Parameters:
username - The username requested.
principal - The principal requesting the username.
Returns:
true is the user is authorized to be principal

getAuthorized

public abstract Collection<String> getAuthorized(String username)
Returns a String Collection of principals that are authorized to use the named user.

Parameters:
username - The username.
Returns:
A String Collection of principals that are authorized.

isWritable

public abstract boolean isWritable()
Returns true if this AuthorizationProvider supports changing the list of authorized principals for users.

Returns:
true if updating the list of authorized principals is supported by this AuthorizationProvider.

addAuthorized

public abstract void addAuthorized(String username,
                                   String principal)
                            throws UnsupportedOperationException
Add a single authorized principal to use the named user.

Parameters:
username - The username.
principal - The principal authorized to use the named user.
Throws:
UnsupportedOperationException - If this AuthorizationProvider cannot be updated.

addAuthorized

public abstract void addAuthorized(String username,
                                   Collection<String> principals)
                            throws UnsupportedOperationException
Add a Collection of users authorized to use the named user.

Parameters:
username - The username.
principals - The Collection of principals authorized to use the named user.
Throws:
UnsupportedOperationException - If this AuthorizationProvider cannot be updated.

setAuthorized

public abstract void setAuthorized(String username,
                                   Collection<String> principals)
                            throws UnsupportedOperationException
Set the users authorized to use the named user. All existing principals listed will be removed.

Parameters:
username - The username.
principals - The Collection of principals authorized to use the named user.
Throws:
UnsupportedOperationException - If this AuthorizationProvider cannot be updated.

name

public abstract String name()
Returns the short name of the Policy

Returns:
The short name of the Policy

description

public abstract String description()
Returns a description of the Policy

Returns:
The description of the Policy.

Wildfire 3.2.4 Javadoc

Copyright © 2003-2007 Jive Software.