Package org.apache.karaf.jaas.boot.principal

Examples of org.apache.karaf.jaas.boot.principal.RolePrincipal


    }

    @Test
    public void installCommand() throws Exception {
        String installOutput = executeCommand("osgi:install mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-lang/2.4_6",
                                              new RolePrincipal("admin"));
        System.out.println(installOutput);
        String listOutput = executeCommand("osgi:list | grep -i commons-lang");
        assertFalse(listOutput.isEmpty());
    }
View Full Code Here


        }
    }

    @Test
    public void startLevelCommand() throws Exception {
        String startLevelOutput = executeCommand("osgi:start-level", new RolePrincipal("viewer"));
        System.out.println(startLevelOutput);
        assertTrue(startLevelOutput.contains("100"));
    }
View Full Code Here

        assertTrue(startLevelOutput.contains("100"));
    }

    @Test
    public void shutdownCommand() throws Exception {
        System.out.println(executeCommand("osgi:shutdown -f", new RolePrincipal("admin")));
    }
View Full Code Here

                principals.add(new GroupPrincipal(infos[i].trim().substring(PropertiesBackingEngine.GROUP_PREFIX.length())));
                String groupInfo = (String) users.get(infos[i].trim());
                if (groupInfo != null) {
                    String[] roles = groupInfo.split(",");
                    for (int j = 1; j < roles.length; j++) {
                        principals.add(new RolePrincipal(roles[j].trim()));
                    }
                }
            } else {
                // it's an user reference
                principals.add(new RolePrincipal(infos[i].trim()));
            }
        }

        users.clear();
View Full Code Here

            roleStatement = connection.prepareStatement(roleQuery);
            roleStatement.setString(1, user);
            roleResultSet = roleStatement.executeQuery();
            while (roleResultSet.next()) {
                String role = roleResultSet.getString(1);
                principals.add(new RolePrincipal(role));
            }
        } catch (Exception ex) {
            throw new LoginException("Error has occured while retrieving credentials from database:" + ex.getMessage());
        } finally {
            try {
View Full Code Here

                    if (!result.contains(rp)) {
                        result.add(rp);
                    }
                }
            } else {
                RolePrincipal rp = new RolePrincipal(roleName);
                if (!result.contains(rp)) {
                    result.add(rp);
                }
            }
        }
View Full Code Here

                principals.add(new GroupPrincipal(infos[i].trim().substring(PropertiesBackingEngine.GROUP_PREFIX.length())));
                String groupInfo = (String) users.get(infos[i].trim());
                if (groupInfo != null) {
                    String[] roles = groupInfo.split(",");
                    for (int j = 1; j < roles.length; j++) {
                        principals.add(new RolePrincipal(roles[j].trim()));
                    }
                }
            } else {
                // it's an user reference
                principals.add(new RolePrincipal(infos[i].trim()));
            }
        }
       
        users.clear();
View Full Code Here

                    if (!result.contains(rp)) {
                        result.add(rp);
                    }
                }
            } else {
                RolePrincipal rp = new RolePrincipal(roleName);
                if (!result.contains(rp)) {
                    result.add(rp);
                }
            }
        }
View Full Code Here

                rolesResultSet = listRolesStatement.executeQuery();

                while (rolesResultSet.next()) {
                    String role = rolesResultSet.getString(1);
                    roles.add(new RolePrincipal(role));
                }

            } catch (SQLException e) {
                logger.error("Error executiong statement", e);
            } finally {
View Full Code Here

            ";jaas:grouproleadd " + managerGroup + " manager" +
            ";jaas:useradd " + viewerUser + " " + viewerUser +
            ";jaas:roleadd " + viewerUser + " viewer" +
            ";jaas:update" +
            ";jaas:manage --realm karaf" +
            ";jaas:users", new RolePrincipal("admin")));

        JMXConnector connector = getJMXConnector(viewerUser, viewerUser);
        MBeanServerConnection connection = connector.getMBeanServerConnection();
        ObjectName systemMBean = new ObjectName("org.apache.karaf:type=system,name=root");
View Full Code Here

TOP

Related Classes of org.apache.karaf.jaas.boot.principal.RolePrincipal

Copyright © 2018 www.massapicom. 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.