Package com.volantis.map.common.param

Examples of com.volantis.map.common.param.Parameters


            w.write("<html><head>");
            w.write(descriptor.getExternalID()+"\n");
            w.write("</head><body>");
            w.write("<p>" + descriptor.getResourceType() +"</p>");
            w.write("---- parameters ----");
            Parameters p = descriptor.getInputParameters();
            Iterator it = p.getParameterNames();
            while (it.hasNext()) {
                String name = (String) it.next();
                w.write("<p>");
                w.write(name);
                w.write("=");
                w.write(p.getParameterValue(name));
                w.write("\n</p>");
            }
            w.write("</body></html>");
            result = Result.SUCCESS;
        }
View Full Code Here


        request.addOutputParameterName("outputParamName1");
        final ResponseCallbackStub responseCallback =
            new ResponseCallbackStub();
        agent.requestURL(request, responseCallback);

        Parameters outputParams = responseCallback.getParameters();
        assertFalse(outputParams.getParameterNames().hasNext());

        final Map expectedOutputParams = new HashMap();
        expectedOutputParams.put(
            "outputParamName1", "value-of-outputParamName1");
        expectedOutputParams.put(
View Full Code Here

        final ResponseCallbackStub responseCallback =
            new ResponseCallbackStub();
        final AgentRequestId requestId =
            agent.requestURL(request, responseCallback);

        Parameters outputParams = responseCallback.getParameters();
        assertFalse(outputParams.getParameterNames().hasNext());

        final Map expectedOutputParams = new HashMap();
        expectedOutputParams.put(
            "outputParamName1", "value-of-outputParamName1");
        expectedOutputParams.put(
View Full Code Here

        final ResponseCallbackStub responseCallback =
            new ResponseCallbackStub();
        final AgentRequestId requestId =
            agent.requestURL(request, responseCallback);

        Parameters outputParams = responseCallback.getParameters();
        assertFalse(outputParams.getParameterNames().hasNext());

        final Map expectedOutputParams = new HashMap();
        expectedOutputParams.put(
            "outputParamName1", "value-of-outputParamName1");
        expectedOutputParams.put(
View Full Code Here

        final ResponseCallbackStub responseCallback =
            new ResponseCallbackStub();
        final AgentRequestId requestId =
            agent.requestURL(request, responseCallback);

        Parameters outputParams = responseCallback.getParameters();
        assertFalse(outputParams.getParameterNames().hasNext());

        final Map expectedOutputParams = new HashMap();
        expectedOutputParams.put(
            "outputParamName1", "value-of-outputParamName1");
        expectedOutputParams.put(
View Full Code Here

    private void checkExpectedOutputParameters(
                final ResponseCallbackStub responseCallback,
                final Map expectedOutputParams)
            throws MissingParameterException {

        Parameters outputParams;
        outputParams = responseCallback.getParameters();
        for (Iterator iter = outputParams.getParameterNames(); iter.hasNext(); ) {
            final String name = (String) iter.next();
            final String value = outputParams.getParameterValue(name);
            final String expectedValue =
                (String) expectedOutputParams.remove(name);
            assertEquals(expectedValue, value);
        }
        assertTrue(expectedOutputParams.isEmpty());
View Full Code Here

        PreservationParamsBuilder ppb = new PreservationParamsBuilder();

        // override the default repository url with nothing
        ResourceDescriptor descriptor = createResourceDescriptor("image/jpeg",
                                                                 2000);
        Parameters params = descriptor.getInputParameters();
        HttpServletRequest request = createHttpRequest("TestDevice/");

        ppb.process(request, descriptor);

        assertFalse("MaxImageSize shouldn't have been changed ",
                    params.containsName(ParameterNames.MAX_IMAGE_SIZE));
        assertFalse("DestinationFormatRule shouldn't have been changed",
                    params.containsName(ParameterNames.DESTINATION_FORMAT_RULE));
    }
View Full Code Here

     */
    public void process(HttpServletRequest request,
                        ResourceDescriptor descritptor) throws ParameterBuilderException {

        try {
            Parameters params = descritptor.getInputParameters();

            if (params.containsName(ParameterNames.SUPPORTED_IMAGES)) {

                RulesWithPolicies preservedRule = (RulesWithPolicies) FORMAT_RULES_TABLE
                        .get(params.getParameterValue(ParameterNames.SOURCE_IMAGE_MIME_TYPE));

                if (preservedRule == null) {
                    LOGGER.warn("content-type-not-supported", params.getParameterValue(ParameterNames.SOURCE_IMAGE_MIME_TYPE));
                    return;
                }

                String [] supportedTypes = params.getParameterValue(ParameterNames.SUPPORTED_IMAGES).split(",");
                for (int i = 0; i < supportedTypes.length; i++) {
                    if(preservedRule.getPolicy().startsWith(supportedTypes[i].toLowerCase())) {
                        ((MutableParameters)params).removeParameterValue(ParameterNames.DESTINATION_FORMAT_RULE);
                    }
                }
View Full Code Here

TOP

Related Classes of com.volantis.map.common.param.Parameters

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.