Examples of JAASRealm


Examples of org.apache.karaf.jaas.config.JaasRealm

    protected Object doExecute() throws Exception {
        if (realmName == null && index <= 0 ) {
            System.err.println("A valid realm or the realm index need to be specified");
            return null;
        }
        JaasRealm oldRealm = (JaasRealm) this.session.get(JAAS_REALM);
        AppConfigurationEntry oldEntry = (AppConfigurationEntry) this.session.get(JAAS_ENTRY);

        if (oldRealm != null && !oldRealm.getName().equals(realmName) && !force) {
            System.err.println("Another realm is being edited.  Cancel / update first, or use the --force option");
        } else if (oldEntry != null && !oldEntry.getLoginModuleName().equals(moduleName) && !force) {
            System.err.println("Another module is being edited.  Cancel / update first, or use the --force option");
        } else {

            JaasRealm realm = findRealmByNameOrIndex(realmName, index);

            if (realm != null) {
                AppConfigurationEntry entry = findEntryByRealmAndName(realm, moduleName);

                if (entry != null) {
View Full Code Here

Examples of org.apache.karaf.jaas.config.JaasRealm

    protected Object doExecute() throws Exception {
        if (realmName == null && index <= 0) {
            System.err.println("A valid realm or the realm index need to be specified");
            return null;
        }
        JaasRealm oldRealm = (JaasRealm) this.session.get(JAAS_REALM);
        AppConfigurationEntry oldEntry = (AppConfigurationEntry) this.session.get(JAAS_ENTRY);

        if (oldRealm != null && !oldRealm.getName().equals(realmName) && !force) {
            System.err.println("Another JAAS Realm is being edited. Cancel/update first, or use the --force option.");
        } else if (oldEntry != null && !oldEntry.getLoginModuleName().equals(moduleName) && !force) {
            System.err.println("Another JAAS Login Module is being edited. Cancel/update first, or use the --force option.");
        } else {

            JaasRealm realm = null;
            AppConfigurationEntry entry = null;

            if (index > 0) {
                // user provided the index, get the realm AND entry from the index
                List<JaasRealm> realms = getRealms();
                if (realms != null && realms.size() > 0) {
                    int i = 1;
                    realms_loop: for (JaasRealm r : realms) {
                        AppConfigurationEntry[] entries = r.getEntries();

                        if (entries != null) {
                            for (int j = 0; j < entries.length; j++) {
                                if (i == index) {
                                    realm = r;
                                    entry = entries[j];
                                    break realms_loop;
                                }
                                i++;
                            }
                        }
                    }
                }
            } else {
                List<JaasRealm> realms = getRealms();
                if (realms != null && realms.size() > 0) {
                    for (JaasRealm r : realms) {
                        if (r.getName().equals(realmName)) {
                            realm = r;
                            break;
                        }
                    }

                }
                AppConfigurationEntry[] entries = realm.getEntries();
                if (entries != null) {
                    for (AppConfigurationEntry e : entries) {
                        String moduleClass = (String) e.getOptions().get(ProxyLoginModule.PROPERTY_MODULE);
                        if (moduleName == null) {
                            entry = e;
View Full Code Here

Examples of org.apache.karaf.jaas.config.JaasRealm

@Command(scope = "jaas", name = "update", description = "Apply pending modification on the edited JAAS Realm")
public class UpdateCommand extends JaasCommandSupport {

    @Override
    protected Object doExecute() throws Exception {
        JaasRealm realm = (JaasRealm) session.get(JAAS_REALM);
        AppConfigurationEntry entry = (AppConfigurationEntry) session.get(JAAS_ENTRY);

        if (realm == null || entry == null) {
            System.err.println("No JAAS Realm/Login Module selected");
            return null;
View Full Code Here

Examples of org.apache.karaf.jaas.config.JaasRealm

     *
     * @return
     * @throws Exception
     */
    protected Object doExecute() throws Exception {
        JaasRealm realm = (JaasRealm) session.get(JAAS_REALM);
        AppConfigurationEntry entry = (AppConfigurationEntry) session.get(JAAS_ENTRY);
        @SuppressWarnings("unchecked")
        Queue<JaasCommandSupport> commandQueue = (Queue<JaasCommandSupport>) session.get(JAAS_CMDS);

        if (realm != null && entry != null) {
View Full Code Here

Examples of org.apache.karaf.jaas.config.JaasRealm

@Command(scope = "jaas", name = "pending-list", description = "List the pending modification on the active JAAS Realm/Login Module")
public class ListPendingCommand extends JaasCommandSupport {

    @Override
    protected Object doExecute() throws Exception {
        JaasRealm realm = (JaasRealm) session.get(JAAS_REALM);
        AppConfigurationEntry entry = (AppConfigurationEntry) session.get(JAAS_ENTRY);
        @SuppressWarnings("unchecked")
        Queue<JaasCommandSupport> commandQueue = (Queue<JaasCommandSupport>) session.get(JAAS_CMDS);

        if (realm != null && entry != null) {
            String moduleClass = (String) entry.getOptions().get(ProxyLoginModule.PROPERTY_MODULE);
            System.out.println(String.format("JAAS Realm %s/JAAS Login Module %s", realm.getName(), moduleClass));

            if (commandQueue != null && !commandQueue.isEmpty()) {
                for (JaasCommandSupport command : commandQueue) {
                    System.out.println(command);
                }
View Full Code Here

Examples of org.apache.karaf.jaas.config.JaasRealm

    @Option(name = "--no-format", description = "Disable table rendered output", required = false, multiValued = false)
    boolean noFormat;

    @Override
    protected Object doExecute() throws Exception {
        JaasRealm realm = (JaasRealm) session.get(JAAS_REALM);
        AppConfigurationEntry entry = (AppConfigurationEntry) session.get(JAAS_ENTRY);

        if (realm == null || entry == null) {
            System.err.println("No JAAS Realm/Login Module has been selected");
            return null;
View Full Code Here

Examples of org.apache.karaf.jaas.config.JaasRealm

    private static final String OUTPUT_FORMAT = "%-20s %-20s";

    @Override
    protected Object doExecute() throws Exception {
        JaasRealm realm = (JaasRealm) session.get(JAAS_REALM);
        AppConfigurationEntry entry = (AppConfigurationEntry) session.get(JAAS_ENTRY);

        if (realm == null || entry == null) {
            System.err.println("No JAAS Realm / Module has been selected.");
            return null;
        }

        BackingEngine engine = backingEngineService.get(entry);

        if (engine == null) {
            System.err.println(String.format("Failed to resolve backing engine for realm:%s and moudle:%s", realm.getName(), entry.getLoginModuleName()));
            return null;
        }

        return doExecute(engine);
    }
View Full Code Here

Examples of org.apache.karaf.jaas.config.JaasRealm

    private static final String OUTPUT_FORMAT = "%-20s %-20s";

    @Override
    protected Object doExecute() throws Exception {
        JaasRealm realm = (JaasRealm) session.get(JAAS_REALM);
        AppConfigurationEntry entry = (AppConfigurationEntry) session.get(JAAS_ENTRY);

        if (realm == null || entry == null) {
            System.err.println("No JAAS Realm/Module has been selected");
            return null;
        }

        BackingEngine engine = backingEngineService.get(entry);

        if (engine == null) {
            System.err.println(String.format("Failed to resolve backing engine for realm %s and module %s", realm.getName(), entry.getLoginModuleName()));
            return null;
        }

        return doExecute(engine);
    }
View Full Code Here

Examples of org.apache.karaf.jaas.config.JaasRealm

@Command(scope = "jaas", name = "pending", description = "List the modification on the active realm/module")
public class ListPendingCommand extends JaasCommandSupport {

    @Override
    protected Object doExecute() throws Exception {
        JaasRealm realm = (JaasRealm) session.get(JAAS_REALM);
        AppConfigurationEntry entry = (AppConfigurationEntry) session.get(JAAS_ENTRY);
        Queue<JaasCommandSupport> commandQueue = (Queue<JaasCommandSupport>) session.get(JAAS_CMDS);

        if (realm != null && entry != null) {
            String moduleClass = (String) entry.getOptions().get(ProxyLoginModule.PROPERTY_MODULE);
            System.out.println(String.format("JAAS Realm %s / JAAS Module %s", realm.getName(), moduleClass));

            if (commandQueue != null && !commandQueue.isEmpty()) {
                for (JaasCommandSupport command : commandQueue) {
                    System.out.println(command);
                }
View Full Code Here

Examples of org.apache.karaf.jaas.config.JaasRealm

@Command(scope = "jaas", name = "pending", description = "Lists the modification on the active realm/module.")
public class ListPendingCommand extends JaasCommandSupport {

    @Override
    protected Object doExecute() throws Exception {
        JaasRealm realm = (JaasRealm) session.get(JAAS_REALM);
        AppConfigurationEntry entry = (AppConfigurationEntry) session.get(JAAS_ENTRY);
        Queue<JaasCommandSupport> commandQueue = (Queue<JaasCommandSupport>) session.get(JAAS_CMDS);

        if (realm != null && entry != null) {
            String moduleClass = (String) entry.getOptions().get(ProxyLoginModule.PROPERTY_MODULE);
            System.out.println(String.format("Jaas Realm:%s Jaas Module:%s", realm.getName(), moduleClass));

            if (commandQueue != null && !commandQueue.isEmpty()) {
                for (JaasCommandSupport command : commandQueue) {
                    System.out.println(command);
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.