org.safehaus.triplesec.guardian
Class ApplicationPolicyFactory

java.lang.Object
  extended by org.safehaus.triplesec.guardian.ApplicationPolicyFactory

public abstract class ApplicationPolicyFactory
extends java.lang.Object

Connects to ApplicationPolicy and manages ConnectionDrivers.

Version:
$Rev: 68 $, $Date: 2005-08-28 10:08:31 -0400 (Sun, 28 Aug 2005) $
Author:
Trustin Lee

Field Summary
static java.lang.String RETRY_COUNT
          A property key that specifies the maxinum number of retries in case of connection failure in newInstance(String, Properties).
static java.lang.String RETRY_DELAY
          A property key that specified the delay in seconds between connection retries in newInstance(String, Properties).
 
Constructor Summary
ApplicationPolicyFactory()
           
 
Method Summary
static boolean deregisterDriver(java.lang.Class driverClass)
          Deregisters all ConnectionDrivers of the specified driverClass type.
static ApplicationPolicy newInstance(java.lang.String urls, java.util.Properties info)
          Connects to the ApplicationPolicy with the specified urls and extra connection info using an appropriate ConnectionDriver.
static boolean registerDriver(ConnectionDriver driver)
          Registers a ConnectionDriver with this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RETRY_COUNT

public static final java.lang.String RETRY_COUNT
A property key that specifies the maxinum number of retries in case of connection failure in newInstance(String, Properties).


RETRY_DELAY

public static final java.lang.String RETRY_DELAY
A property key that specified the delay in seconds between connection retries in newInstance(String, Properties).

Constructor Detail

ApplicationPolicyFactory

public ApplicationPolicyFactory()
Method Detail

registerDriver

public static boolean registerDriver(ConnectionDriver driver)
Registers a ConnectionDriver with this factory.

Parameters:
driver - the ConnectionDriver being registered
Returns:
true if and only if the driver is registered

deregisterDriver

public static boolean deregisterDriver(java.lang.Class driverClass)
Deregisters all ConnectionDrivers of the specified driverClass type.

Parameters:
driverClass - the type of ConnectionDrivers to deregister
Returns:
true if and only if any drivers are deregistered

newInstance

public static ApplicationPolicy newInstance(java.lang.String urls,
                                            java.util.Properties info)
                                     throws GuardianException
Connects to the ApplicationPolicy with the specified urls and extra connection info using an appropriate ConnectionDriver.

URLs are separated by whitespace characters. This operation tries the specified URLs in random order to distribute server-side load.

Parameters:
urls - the whitespace-separated URLs of the ApplicationPolicy
info - the extra information to pass to ConnectionDriver
Returns:
the connected store
Throws:
GuardianException - if failed to connect to the store