Examples of DefaultPolicy


Examples of com.adito.policyframework.DefaultPolicy

     */
    public Resource createResource(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {
        SessionInfo sessionInfo = getSessionInfo(request);
        int selectedRealmId = sessionInfo.getRealmId();
        return new DefaultPolicy(selectedRealmId);
    }
View Full Code Here

Examples of com.adito.policyframework.DefaultPolicy

        assertEquals("Groups are correct", original.getAttachedGroups(), updated.getAttachedGroups());
    }

    @Override
    protected Policy getDefaultResource(int selectedRealmId) {
        return new DefaultPolicy(-1, "MyNewPolicy", "A test policy.", Policy.TYPE_NORMAL, Calendar.getInstance(), Calendar
                        .getInstance(), selectedRealmId);
    }
View Full Code Here

Examples of com.adito.policyframework.DefaultPolicy

        setResourceService(new ResourceServiceAdapter<Policy>(resourceType));
    }

    @Override
    protected Policy getDefaultResource(int selectedRealmId) {
        return new DefaultPolicy(-1, "MyNewPolicy", "A test policy.", Policy.TYPE_NORMAL, Calendar.getInstance(), Calendar
                        .getInstance(), selectedRealmId);
    }
View Full Code Here

Examples of com.adito.policyframework.DefaultPolicy

    try {
      try {
        ps.execute();
        int id = db.getLastInsertId(ps, "createPolicy.lastInsertId");
        ps.commit();
        return new DefaultPolicy(id, name, description, type, c, c, realmID);
      } finally {
        ps.releasePreparedStatement();
      }
    } catch (Exception e) {
      ps.rollback();
View Full Code Here

Examples of com.adito.policyframework.DefaultPolicy

        .getTime());
    Timestamp ad = rs.getTimestamp("date_amended");
    Calendar a = Calendar.getInstance();
    a.setTimeInMillis(ad == null ? System.currentTimeMillis() : ad
        .getTime());
    return new DefaultPolicy(rs.getInt("id"), rs.getString("policy_name"),
        rs.getString("policy_description"),
        rs.getInt("policy_type_id"), c, a, rs.getInt("realm_id"));
  }
View Full Code Here

Examples of com.hp.hpl.jena.gvs.security.DefaultPolicy

    sources.add(authorizationSource);
    GraphOverTime configGOT = store.getGraphOverTime(sources );
    //JenaUtil.getModelFromGraph(configGOT.getGraph(new Date())).write(System.out);
    Configuration.setConfiguration(new GVSConfiguration(configGOT,
        "gvs"));
    Policy.setPolicy(new DefaultPolicy(configGOT));
  }
View Full Code Here

Examples of com.hp.hpl.jena.gvs.security.DefaultPolicy

      trustedSources = newTrustedSources;
    }
    GraphOverTime trustedGOT = store.getGraphOverTime(trustedSources);
    Configuration.setConfiguration(new GVSConfiguration(trustedGOT,
        "GVS-Auth"));
    Policy.setPolicy(new DefaultPolicy(trustedGOT));
    Map<String, Handler> prefixHandlerMap = new HashMap<String, Handler>();
    Enumeration<URL> basePathURLEnum = GVSServerLauncher.class
        .getClassLoader().getResources("META-INF/web/application/");
    List<PathNode> nodeList = new ArrayList<PathNode>();
    while (basePathURLEnum.hasMoreElements()) {
View Full Code Here

Examples of com.hp.hpl.jena.gvs.security.DefaultPolicy

 
  public void testAuthorizedPut() throws Exception {
    //testing
    GraphOverTime trustedGOT = new MemoryStoreImpl().getGraphOverTime(new HashSet<Source>());
    Policy orig = Policy.getPolicy();
    Policy.setPolicy(new DefaultPolicy(trustedGOT));
    //Policy.setPolicy(orig);
    Policy.setPolicy(null);
    Policy.setPolicy(new NoRestrictionsPolicy());

    //
View Full Code Here

Examples of org.apache.harmony.security.fortress.DefaultPolicy

                        POLICY_PROVIDER));
        if (defaultClass == null) {
            //TODO log warning
            //System.err.println("No policy provider specified. Loading the "
            //           + DefaultPolicy.class.getName());
            return new DefaultPolicy();
        }

        // TODO accurate classloading
        return (Policy) AccessController.doPrivileged(new PrivilegedAction() {

            public Object run() {
                try {
                    return Class.forName(defaultClass, true,
                            ClassLoader.getSystemClassLoader()).newInstance();
                }
                catch (Exception e) {
                    //TODO log error
                    //System.err.println("Error loading policy provider <"
                    //                 + defaultClass + "> : " + e
                    //                 + "\nSwitching to the default "
                    //                 + DefaultPolicy.class.getName());
                    return new DefaultPolicy();
                }
            }
        });

    }
View Full Code Here

Examples of org.apache.harmony.security.fortress.DefaultPolicy

                        POLICY_PROVIDER));
        if (defaultClass == null) {
            //TODO log warning
            //System.err.println("No policy provider specified. Loading the "
            //           + DefaultPolicy.class.getName());
            return new DefaultPolicy();
        }

        // TODO accurate classloading
        return AccessController.doPrivileged(new PrivilegedAction<Policy>() {

            public Policy run() {
                try {
                    return (Policy) Class.forName(defaultClass, true,
                            ClassLoader.getSystemClassLoader()).newInstance();
                }
                catch (Exception e) {
                    //TODO log error
                    //System.err.println("Error loading policy provider <"
                    //                 + defaultClass + "> : " + e
                    //                 + "\nSwitching to the default "
                    //                 + DefaultPolicy.class.getName());
                    return new DefaultPolicy();
                }
            }
        });

    }
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.