/** * Auth realm deleted. * It is called whenever a AuthRealmEvent with action of * AuthRealmEvent.ACTION_DELETE is received. * @throws AdminEventListenerException when the listener is unable to * process the event. */ public static void authRealmDeleted(AuthRealm instance) { try { //the listener firing has been unpredictable earlier //after a CLI delete the listener's were not firing in time //so we added explicit calls to this method from CLI //now with latest builds it looks like listeners also fire //causing a NoSuchRealmException if (!Realm.isValidRealm(instance.getName())) { return; } Realm.unloadInstance(instance.getName()); } catch (NoSuchRealmException ex) { throw new RuntimeException(ex); } }
/** * Auth realm deleted. * It is called whenever a AuthRealmEvent with action of * AuthRealmEvent.ACTION_DELETE is received. * @throws AdminEventListenerException when the listener is unable to * process the event. */ public static void authRealmDeleted(AuthRealm instance) { try { //the listener firing has been unpredictable earlier //after a CLI delete the listener's were not firing in time //so we added explicit calls to this method from CLI //now with latest builds it looks like listeners also fire //causing a NoSuchRealmException if (!Realm.isValidRealm(instance.getName())) { return; } Realm.unloadInstance(instance.getName()); } catch (NoSuchRealmException ex) { throw new RuntimeException(ex); } }
/** * This method is just a convenience wrapper for * <i>login(Subject, Class)</i> method. It will construct a * PasswordCredential class. * * @param String username * @param String password * @param String realmName the name of the realm to login into, if realmName * is null, we login into the default realm */ public static void login(String username, char[] password, String realmName){ if(realmName == null || !(Realm.isValidRealm(realmName))){ realmName = Realm.getDefaultRealm(); } final Subject fs = new Subject(); final PasswordCredential pc = new PasswordCredential(username, password, realmName); AppservAccessController.doPrivileged(new PrivilegedAction(){ public java.lang.Object run(){ fs.getPrivateCredentials().add(pc); return fs; } }); LoginContextDriver.login(fs, PasswordCredential.class); }
/** * This method is just a convenience wrapper for * <i>login(Subject, Class)</i> method. It will construct a * PasswordCredential class. * * @param String username * @param String password * @param String realmName the name of the realm to login into, if realmName * is null, we login into the default realm */ public static void login(String username, char[] password, String realmName){ if(realmName == null || !(Realm.isValidRealm(realmName))){ realmName = Realm.getDefaultRealm(); } final Subject fs = new Subject(); final PasswordCredential pc = new PasswordCredential(username, password, realmName); AppservAccessController.doPrivileged(new PrivilegedAction(){ public java.lang.Object run(){ fs.getPrivateCredentials().add(pc); return fs; } }); LoginContextDriver.login(fs, PasswordCredential.class); }
/** * Auth realm deleted. * It is called whenever a AuthRealmEvent with action of * AuthRealmEvent.ACTION_DELETE is received. * @throws AdminEventListenerException when the listener is unable to * process the event. */ public static void authRealmDeleted(Config config, AuthRealm instance) { try { //the listener firing has been unpredictable earlier //after a CLI delete the listener's were not firing in time //so we added explicit calls to this method from CLI //now with latest builds it looks like listeners also fire //causing a NoSuchRealmException if (!Realm.isValidRealm(config.getName(), instance.getName())) { return; } Realm.unloadInstance(config.getName(), instance.getName()); } catch (NoSuchRealmException ex) { throw new RuntimeException(ex); } }
/** * Auth realm deleted. * It is called whenever a AuthRealmEvent with action of * AuthRealmEvent.ACTION_DELETE is received. * @throws AdminEventListenerException when the listener is unable to * process the event. */ public static void authRealmDeleted(Config config, AuthRealm instance) { try { //the listener firing has been unpredictable earlier //after a CLI delete the listener's were not firing in time //so we added explicit calls to this method from CLI //now with latest builds it looks like listeners also fire //causing a NoSuchRealmException if (!Realm.isValidRealm(config.getName(), instance.getName())) { return; } Realm.unloadInstance(config.getName(), instance.getName()); } catch (NoSuchRealmException ex) { throw new RuntimeException(ex); } }
throws LoginException { if(realmName == null || !(Realm.isValidRealm(realmName))){ realmName = Realm.getDefaultRealm();
throws LoginException { if(realmName == null || !(Realm.isValidRealm(realmName))){ realmName = Realm.getDefaultRealm();