Package com.adito.policyframework

Examples of com.adito.policyframework.Policy


        int id = (int)reader.readInt();
        Tunnel resource = (Tunnel)TunnelPlugin.SSL_TUNNEL_RESOURCE_TYPE.getResourceById(id);
        if (resource == null) {
          throw new Exception("No resource with ID " + id);
        }
        Policy policy = LaunchSessionManager.getLaunchRequestPolicy(null, agent.getSession(), resource);
        if (resource.sessionPasswordRequired(agent.getSession())) {
          // TODO: prompt user for credentials through agent!
          return true;
        } else {
          LaunchSession launchSession = LaunchSessionFactory.getInstance().createLaunchSession(agent.getSession(),
View Full Code Here


           
            List<BundleActionMessage> tunnelFailures = new ArrayList<BundleActionMessage>();
            for (Tunnel tunnel : tunnels) {
                if (tunnel.isAutoStart()) {
                    try {
                        Policy policy = PolicyDatabaseFactory.getInstance().getGrantingPolicyForUser(session.getUser(), tunnel);
                        LaunchSession launchSession = LaunchSessionFactory.getInstance().createLaunchSession(session, tunnel, policy);
                        startTunnel(launchSession);
                    } catch (TunnelException tne) {
                        log.error("failed to start tunnel: '" + tunnel + "'", tne);
                        tunnelFailures.add(tne.getBundleActionMessage());
View Full Code Here

        int id = (int)reader.readInt();
        Resource resource = ApplicationsPlugin.APPLICATION_SHORTCUT_RESOURCE_TYPE.getResourceById(id);
        if (resource == null) {
          throw new Exception("No resource with ID " + id);
        }
        Policy policy = LaunchSessionManager.getLaunchRequestPolicy(null, agent.getSession(), resource);
        if (resource.sessionPasswordRequired(agent.getSession())) {
          // TODO: prompt user for credentials through agent!
          return true;
        } else {
          LaunchSession launchSession = LaunchSessionFactory.getInstance().createLaunchSession(agent.getSession(),
View Full Code Here

        OutputStream out = response.getOutputStream();
        PrintWriter pw = new PrintWriter(new OutputStreamWriter(out));
        pw.print(processed);
        pw.flush();

        Policy pol = PolicyDatabaseFactory.getInstance().getGrantingPolicyForUser(launchSession.getSession().getUser(), shortcut);
        CoreServlet.getServlet().fireCoreEvent(new ResourceAccessEvent(this, ApplicationShortcutEventConstants.APPLICATION_SHORTCUT_LAUNCHED, shortcut, pol, launchSession.getSession(), CoreEvent.STATE_SUCCESSFUL)
        .addAttribute(CoreAttributeConstants.EVENT_ATTR_APPLICATION_NAME, app.getName())
        .addAttribute(CoreAttributeConstants.EVENT_ATTR_APPLICATION_ID, shortcut.getApplication()));
        //////////////////////////////////////////////
       
View Full Code Here

    private void sendByPolicy(MessageSender sender, Recipient recipient) throws Exception, UserDatabaseException {
        UserDatabase userDatabase = UserDatabaseManager.getInstance().getUserDatabase(recipient.getRealmName());
        PolicyDatabase policyDatabase = PolicyDatabaseFactory.getInstance();
        Realm realm = userDatabase.getRealm();
        Policy policy = policyDatabase.getPolicyByName(recipient.getRecipientAlias(), realm.getResourceId());
        int everyonePolicyId = policyDatabase.getEveryonePolicyIDForRealm(realm);
       
        if (everyonePolicyId == policy.getResourceId()) {
            sendToPrincipals(sender, userDatabase, userDatabase.allRoles());
            sendToPrincipals(sender, userDatabase, userDatabase.allUsers());
        } else {
            List<Principal> principals = policyDatabase.getPrincipalsGrantedPolicy(policy, realm);
            sendToPrincipals(sender, userDatabase, principals);
View Full Code Here

                }
            }

            // Add any schemes that are available to anyone
            Realm realm = UserDatabaseManager.getInstance().getDefaultRealm();
            Policy p = PolicyDatabaseFactory.getInstance().getPolicy(PolicyDatabaseFactory.getInstance()
                .getEveryonePolicyIDForRealm(realm));
            for (AuthenticationScheme scheme : schemes) {
                if (PolicyDatabaseFactory.getInstance().isResourceAttachedToPolicy(scheme, p, realm)) {
                    authSchemes.add(scheme);
                }
View Full Code Here

TOP

Related Classes of com.adito.policyframework.Policy

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.