Package com.volantis.mcs.eclipse.core

Examples of com.volantis.mcs.eclipse.core.ResolvedDevicePolicy


                                POLICY_NAME_ATTRIBUTE);
                        if (policyElementName.equals(policyName)) {

                            // Retrieve the current policy and give it to the
                            // modifier,
                            ResolvedDevicePolicy rdp = context.
                                    getDeviceRepositoryAccessorManager().
                                    resolvePolicy(
                                            deviceName, policyName);

                            node.removeChangeListener(policiesElementListener);
View Full Code Here


     * fallback policy, cloning it and adding the clone to the current policies
     * element.
     */
    private void handleOverrideSelection() {
        // Retrieve and clone the current policy.
        ResolvedDevicePolicy resolvedDevicePolicy =
                context.getDeviceRepositoryAccessorManager().
                resolvePolicy(deviceName, policyName);

        ODOMElement policy = (ODOMElement) resolvedDevicePolicy.policy.clone();
        // If the clone already has a standard element then remove it.
View Full Code Here

            // Update the origin selector to reflect the new device element.
            updateOriginSelector();

            // Retrieve the current policy and give it to the modifier,
            ResolvedDevicePolicy rdp =
                    context.getDeviceRepositoryAccessorManager().
                    resolvePolicy(deviceName, policyName);
            modifier.setPolicy(rdp.policy);

            // Retrieve the policies element and manage its named policy with a
View Full Code Here

                return null;
            }

            // javadoc inherited
            public String getColumnText(Object o, int i) {
                ResolvedDevicePolicy resolvedPolicy = (ResolvedDevicePolicy) o;
                String columnText = null;
                String columnName = columnProperties[i];
                if (columnName.equals(NAME_COLUMN_NAME)) {
                    columnText = getPolicyName(resolvedPolicy.policy);
                } else if (columnName.equals(VALUE_COLUMN_NAME)) {
View Full Code Here

            // create a list of the resolved policies. We use a list because
            // the we do not know the number of resolved policies up front.
            // In theory all policies should be resolved, however if there
            // is a problem with a migration some policies may not be resolved.
            List resolvedPolicies = new ArrayList();
            ResolvedDevicePolicy resolvedPolicy;
            for (int i = 0; i < policiesToDisplay.length; i++) {
                resolvedPolicy = accessorManager.resolvePolicy(deviceName,
                        policiesToDisplay[i]);
                if (resolvedPolicy != null) {
                    resolvedPolicies.add(resolvedPolicy);
                }
            }
            // create the array that will be populated with the resolved
            // policies
            ResolvedDevicePolicy policies [] =
                    new ResolvedDevicePolicy[resolvedPolicies.size()];
            // populate and return the array
            return resolvedPolicies.toArray(policies);
        }
View Full Code Here

        /**
         * Override compare to sort against the specified columnName.
         */
        // rest of javadoc inherited
        public int compare(Viewer viewer, Object o1, Object o2) {
            ResolvedDevicePolicy resolved1 = (ResolvedDevicePolicy) o1;
            ResolvedDevicePolicy resolved2 = (ResolvedDevicePolicy) o2;

            int result = 0;
            if (columnName.equals(NAME_COLUMN_NAME)) {
                result = getPolicyName(resolved1.policy).
                        compareTo(getPolicyName(resolved2.policy));
View Full Code Here

                                new TestTransformerMetaFactory(),
                                new DefaultJDOMFactory(), false);


                // Beep for PC should be resolved from Master and should be false.
                ResolvedDevicePolicy policy = manager.resolvePolicy("PC", "beep");
                String policyValue = policy.policy.getAttributeValue("value");
                assertEquals("Expected PC beep policy to be false.",
                        "false", policyValue);
                assertEquals("Expected origin of PC beep policy to be Master.",
                        "Master", policy.deviceName);
View Full Code Here


                // fullpixelsx for PC should be resolved from Master as there is an
                // inherit element and so the value should be the inherited -1 rather than
                // the 800 defined as the value in PC.
                ResolvedDevicePolicy policy = manager.resolvePolicy("PC", "dvidcamera");
                String policyValue = policy.policy.getAttributeValue("value");
                assertEquals("Expected PC dvidcamera policy to be false.",
                        "false", policyValue);
                assertEquals("Expected origin of PC fullpixelsx policy to be Master.",
                        "Master", policy.deviceName);
View Full Code Here

                        factory.createPolicyValueModifier(shell, SWT.NONE,
                                policyName);
                controller = new PolicyController(policyName, selector,
                        modifier, null, context);

                final ResolvedDevicePolicy rdpOriginal =
                        deviceRAM.resolvePolicy(deviceName, policyName);

                // WebBox falls back to pixelsx from TV.
                assertEquals("WebBox does not inherit pixelsx from TV",
                        "TV", rdpOriginal.deviceName);

                controller.setDeviceName(deviceName);

                // Simulate changing from fallback to override by invoking the private
                // PolicyController#handleOverrideSelection method.
                try {
                    PrivateAccessor.invoke(controller,
                            "handleOverrideSelection", null, null);
                } catch (Throwable throwable) {
                    throw new Exception(throwable);
                }

                // Retrieve the updated policy.
                final ResolvedDevicePolicy rdpOverride =
                        deviceRAM.resolvePolicy(deviceName, policyName);

                // pixelsx is now overridden by Web-Box.
                assertEquals("WebBox does not override pixelsx from TV",
                        deviceName, rdpOverride.deviceName);
View Full Code Here

                final PolicyValueModifier modifier =
                        factory.createPolicyValueModifier(shell, SWT.NONE, policyName);
                controller = new PolicyController(policyName, selector,
                        modifier, null, context);

                final ResolvedDevicePolicy rdpOriginal =
                        deviceRAM.resolvePolicy(deviceName, policyName);

                // pixelsx is overridden by Microsoft-WebTV.
                assertEquals("Microsoft-WebTV does not override pixelsx",
                        deviceName, rdpOriginal.deviceName);

                controller.setDeviceName(deviceName);

                // Simulate changing from override to fallback by invoking the private
                // PolicyController#handleFallbackSelection method.
                try {
                    PrivateAccessor.invoke(controller,
                            "handleFallbackSelection", null, null);
                } catch (Throwable throwable) {
                    throw new Exception(throwable);
                }

                // Retrieve the updated policy.
                final ResolvedDevicePolicy rdpFallback =
                        deviceRAM.resolvePolicy(deviceName, policyName);

                // pixelsx was overridden by Microsoft-WebTV but now falls back to TV.
                assertEquals("Microsoft-WebTV does not inherit pixelsx from TV",
                        "TV", rdpFallback.deviceName);
View Full Code Here

TOP

Related Classes of com.volantis.mcs.eclipse.core.ResolvedDevicePolicy

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.