예제 #1
0
 static {
   try {
     // RFE: configurable
     clazz = Class.forName("com.sun.identity.entitlement.opensso.OpenSSOIndexStore");
   } catch (ClassNotFoundException e) {
     PolicyConstants.DEBUG.error("PrivilegeIndexStore.static<init>", e);
   }
 }
예제 #2
0
 /**
  * Returns an instance of the privilege index store.
  *
  * @param adminSubject Admin Subject who has the privilege to write to index datastore.
  * @param realm Realm Name.
  * @return an instance of the privilege index store.
  */
 public static PrivilegeIndexStore getInstance(Subject adminSubject, String realm) {
   if (clazz == null) {
     return null;
   }
   Class[] parameterTypes = {Subject.class, String.class};
   try {
     Constructor constructor = clazz.getConstructor(parameterTypes);
     Object[] args = {adminSubject, realm};
     return ((PrivilegeIndexStore) constructor.newInstance(args));
   } catch (InstantiationException ex) {
     PolicyConstants.DEBUG.error("PrivilegeIndexStore.getInstance", ex);
   } catch (IllegalAccessException ex) {
     PolicyConstants.DEBUG.error("PrivilegeIndexStore.getInstance", ex);
   } catch (IllegalArgumentException ex) {
     PolicyConstants.DEBUG.error("PrivilegeIndexStore.getInstance", ex);
   } catch (InvocationTargetException ex) {
     PolicyConstants.DEBUG.error("PrivilegeIndexStore.getInstance", ex);
   } catch (NoSuchMethodException ex) {
     PolicyConstants.DEBUG.error("PrivilegeIndexStore.getInstance", ex);
   } catch (SecurityException ex) {
     PolicyConstants.DEBUG.error("PrivilegeIndexStore.getInstance", ex);
   }
   return null;
 }