Examples of PolicyType


Examples of aim.domain.policy.PolicyType

    private EntityManager entityManager;

    @Test
    @Ignore("Multithread test")
    public void testCreatePolicy() {
        final PolicyType policiesType = new PolicyType("House", "House policy descrip.");
        final PolicySeries serie1 = new PolicySeries("DOM");
        policiesType.getTypeSeries().add(serie1);
        serie1.setPolicyType(policiesType);
        entityManager.persist(policiesType);

        final Collection<BlankPolicyDTO> policies = new ArrayList<BlankPolicyDTO>();
        policies.add(new BlankPolicyDTO(serie1, 1, 200));
View Full Code Here

Examples of com.volantis.mcs.devices.policy.types.PolicyType

        try {
            PolicyDescriptor descriptor =
                    policyDescriptorAccessor.getPolicyDescriptor(
                            policyName, Locale.getDefault());
            if (descriptor != null) {
                PolicyType type = descriptor.getPolicyType();
                if (type instanceof StructurePolicyType) {
                    value = createStructuredPolicyValue(device, policyName,
                            (StructurePolicyType) type);
                } else {
                    try {
View Full Code Here

Examples of com.volantis.mcs.devices.policy.types.PolicyType

            try {
                String fieldName = (String) i.next();
                String fullName = policyName + "." + fieldName;

                SimplePolicyValue fieldValue = null;
                PolicyType fieldType = (PolicyType) fieldTypes.get(fieldName);
                if (!(fieldType instanceof SimplePolicyType)) {
                    throw new IllegalStateException(
                            "Can only have simple types inside a structured type");
                }
                // Extract the policy value as a string.
View Full Code Here

Examples of com.volantis.mcs.devices.policy.types.PolicyType

            // Test the retrieval of a policy descriptor from VMTYPES
            int id = populateWithSimpleTypes(0);
            policyDescriptor = accessor.retrievePolicyDescriptor(
                    connection, "Policy1", locale);
            assertNotNull("Policy Descriptor should be found", policyDescriptor);
            PolicyType policyType = policyDescriptor.getPolicyType();
            assertTrue("Type should match",
                    policyType instanceof BooleanPolicyType);
            assertEquals("PolicyDescName1",
                policyDescriptor.getPolicyDescriptiveName());
            assertEquals("PolicyHelp1", policyDescriptor.getPolicyHelp());
View Full Code Here

Examples of com.volantis.mcs.devices.policy.types.PolicyType

                createTables(conn);

                DefaultPolicyDescriptor descriptor =
                        new DefaultPolicyDescriptor();
                descriptor.setCategory("category");
                PolicyType type = new DefaultBooleanPolicyType();
                descriptor.setPolicyType(type);

                accessor.addPolicyDescriptor(connection, "boolean", descriptor);

                // Check the database contents
View Full Code Here

Examples of com.volantis.mcs.devices.policy.types.PolicyType

                createTables(conn);

                DefaultPolicyDescriptor descriptor =
                        new DefaultPolicyDescriptor();
                descriptor.setCategory("category");
                PolicyType type = new DefaultRangePolicyType(1, 100);
                descriptor.setPolicyType(type);
                accessor.addPolicyDescriptor(connection, "range", descriptor);

                // Check the database contents
                checkPolicyTypeRow(conn, null, "range", 0, 0);
View Full Code Here

Examples of com.volantis.mcs.devices.policy.types.PolicyType

                policyTypeCount+=2;
                typesCount+=2;
                checkCounts(conn);

                // ordered set
                PolicyType oset = new DefaultUnorderedSetPolicyType(
                                new DefaultBooleanPolicyType());
                descriptor.setPolicyType(oset);
                accessor.addPolicyDescriptor(connection, "oset1", descriptor);
                accessor.addPolicyDescriptor(connection, "oset2", descriptor);
                policyTypeCount+=2;
                typesCount+=4;
                typesSetCount+=2;
                checkCounts(conn);

                // unordered set
                descriptor.setCategory("category3");
                PolicyType uset = new DefaultUnorderedSetPolicyType(
                                new DefaultIntPolicyType());
                descriptor.setPolicyType(uset);
                accessor.addPolicyDescriptor(connection, "uset1", descriptor);
                accessor.addPolicyDescriptor(connection, "uset2", descriptor);
                policyCategoryCount+=1;
View Full Code Here

Examples of com.volantis.mcs.devices.policy.types.PolicyType

                        policyName));
            }

            // OK, we have the type, so create the descriptor for it.
            PolicyTypeCreator creator = new PolicyTypeCreator();
            PolicyType policyType = creator.calculate(type);
            descriptor.setPolicyType(policyType);
        }

        // And return the completed object
        return descriptor;
View Full Code Here

Examples of com.volantis.mcs.devices.policy.types.PolicyType

                int type = rs.getInt(1);
                int typeID = rs.getInt(2);
                // Close the result set.
                rs.close();

                PolicyType policyType = getPolicyType(
                        jdbcConnection, projectName, type, typeID);

                descriptor = new DefaultPolicyDescriptor();
                descriptor.setPolicyType(policyType);
            }
View Full Code Here

Examples of com.volantis.mcs.devices.policy.types.PolicyType

                                     String projectName,
                                     int typeID,
                                     int typeInstanceID)
            throws RepositoryException {

        PolicyType policyType = null;
        switch (typeID) {
            case BOOLEAN_TYPE_ID:
                policyType = new DefaultBooleanPolicyType();
                break;
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.