Package com.adito.boot

Examples of com.adito.boot.PropertyClass


        }
    }

    @SuppressWarnings("deprecation")
    private void setValidationString(String validationString) {
        PropertyClass propertyClass = PropertyClassManager.getInstance().getPropertyClass(RealmProperties.NAME);
        PropertyDefinition usernameProperty = propertyClass.getDefinition("activeDirectory.serviceAccountUsername");
        usernameProperty.setValidationString(validationString);
    }
View Full Code Here


        if (definition.getTypeMeta().equals("true")) {
            int portInt = Integer.parseInt(value);
            // now open a server socket to the port to ensure that it is
            // available if the property has a true value for its meta data, and
            // if the value has changed
            PropertyClass propertyClass = definition.getPropertyClass();
            AbstractPropertyKey propertyKey = new AbstractPropertyKey(definition.getName(), propertyClass.getName());
            int oldValue = propertyClass.retrievePropertyInt(propertyKey);
            if (oldValue != portInt) {
                try {
                    ServerSocket socket = new ServerSocket(portInt);
                    socket.close();
                } catch (Exception e) {
View Full Code Here

    }
   
    @Test
    public void registerPropertyDefinitions() {      
        Assert.assertNotNull(PropertyClassManager.getInstance().getPropertyClass(MEMORY));
        PropertyClass propertyClass = PropertyClassManager.getInstance().getPropertyClass(MEMORY);
        Assert.assertTrue(!propertyClass.isDefinitionExists("con1"));
        propertyClass.registerPropertyDefinition(new DefaultPropertyDefinition(
            DefaultPropertyDefinition.TYPE_BOOLEAN,
            "con1", "on,off", 10, "true"50, true));
        Assert.assertTrue(propertyClass.isDefinitionExists("con1"));
    }
View Full Code Here

    }
   
    @Test
    public void deregisterPropertyDefinitions() {      
        Assert.assertNotNull(PropertyClassManager.getInstance().getPropertyClass(MEMORY));
        PropertyClass propertyClass = PropertyClassManager.getInstance().getPropertyClass(MEMORY);
        propertyClass.deregisterPropertyDefinition("con1");
        Assert.assertTrue(!propertyClass.isDefinitionExists("con1"));
    }
View Full Code Here

    }

  @Override
  public String processReplacementVariable(Pattern pattern, Matcher matcher, String replacementPattern, String type, String key) throws Exception {
    if (type.equalsIgnoreCase("attr") || type.equals("userAttributes")) {
            PropertyClass propertyClass = PropertyClassManager.getInstance().getPropertyClass(UserAttributes.NAME);
            AttributeDefinition def = (AttributeDefinition) propertyClass.getDefinition(key);
            if (def == null) {
                VariableReplacement.log.warn("Invalid user attribute '" + key + "'");
                return null;
            } else {
                String val = Property.getProperty(new UserAttributeKey(username, key, realm));
View Full Code Here

    }

  @Override
  public String processReplacementVariable(Pattern pattern, Matcher matcher, String replacementPattern, String type, String key) throws Exception {
    if (type.equalsIgnoreCase(PolicyAttributes.NAME)) {
            PropertyClass propertyClass = PropertyClassManager.getInstance().getPropertyClass(type);
            AttributeDefinition def = (AttributeDefinition) propertyClass.getDefinition(key);
            if (def == null) {
                VariableReplacement.log.warn("Invalid policy attribute '" + key + "'");
                return null;
            } else {
                return Property.getProperty(new PolicyAttributeKey(policy.getResourceId(), key));
View Full Code Here

     * @throws Exception
     */
    public ActionForward resetPrivateKey(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
        User user = (User) request.getSession().getAttribute(Constants.EDITING_ITEM);
        PolicyUtil.checkPermission(PolicyConstants.ACCOUNTS_AND_GROUPS_RESOURCE_TYPE, PolicyConstants.PERM_CREATE_EDIT_AND_ASSIGN, request);
        PropertyClass propertyClass = PropertyClassManager.getInstance().getPropertyClass(UserAttributes.NAME);
        /* We must delete all confidential attribute values */
        for (PropertyDefinition propertyDefinition : propertyClass.getDefinitions()) {
            AttributeDefinition attributeDefinition = (AttributeDefinition) propertyDefinition;
            if (attributeDefinition.getVisibility() == AttributeDefinition.USER_CONFIDENTIAL_ATTRIBUTE) {
                Property.setProperty(new UserAttributeKey(user, attributeDefinition.getName()), (String) null, getSessionInfo(request));
            }
        }
View Full Code Here

            }
        } else if (type.equalsIgnoreCase("attr") || type.equals(UserAttributes.NAME)) {
            if (sessionInfo == null) {
                return null;
            }
            PropertyClass propertyClass = PropertyClassManager.getInstance().getPropertyClass(UserAttributes.NAME);
            AttributeDefinition def = (AttributeDefinition) propertyClass.getDefinition(key);
            if (def == null) {
                VariableReplacement.log.warn("Invalid user attribute '" + key + "'");
                return null;
            } else {
                return Property.getProperty(new UserAttributeKey(sessionInfo.getUser(), key));
View Full Code Here

            }
            String propertyClassName = request.getParameter("propertyClass");
            if(propertyClassName == null) {
                throw new Exception("Help for property source requires a propertyClass parameter.");
            }
            PropertyClass propertyClass = PropertyClassManager.getInstance().getPropertyClass(propertyClassName);
            if(propertyClass == null) {
                throw new Exception("Invalid property class.");
            }
            PropertyDefinition def = propertyClass.getDefinition(name);
            if(def == null) {
                throw new Exception("No property definition with name of " + name);
            }
            else{
                // set the label and description from the messages resources if they have any.
View Full Code Here

        JDBCPreparedStatement ps = db.getStatement("loadAttributeDefinitions.select");
        ResultSet rs = ps.executeQuery();
        try {
            while (rs.next()) {
                String propertyClassName = rs.getString("property_class");
                PropertyClass ua = PropertyClassManager.getInstance().getPropertyClass(propertyClassName);
                if (ua == null) {
                    log.warn("Found user attribute '" + rs.getString("name")
                        + "' with a property class of '"
                        + propertyClassName
                        + "'. This property class does not exist. Perhaps a plugin has been uninstalled?");
                } else {
                    ua.registerPropertyDefinition(new DefaultAttributeDefinition(rs.getInt("type"),
                                    rs.getString("name"),
                                    rs.getString("type_meta"),
                                    rs.getInt("category"),
                                    rs.getString("category_label"),
                                    rs.getString("default_value"),
View Full Code Here

TOP

Related Classes of com.adito.boot.PropertyClass

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.