Examples of MutableParameters


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

                         uri.toString() + "'");
        }
        DefaultRequest request =
                new DefaultRequest("image.", ParameterNames.SOURCE_URL);

        MutableParameters parameters = (MutableParameters)request.getInputParams();

        if (extraParameters != null) {
            Iterator it = extraParameters.entrySet().iterator();
            while(it.hasNext()) {
                Map.Entry entry = (Map.Entry) it.next();
                parameters.setParameterValue((String) entry.getKey(), (String) entry.getValue());
            }
        }
       
        try {
            builder.build(uri, parameters);
View Full Code Here

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

                                                        int ImageSize)
        throws Exception {

        ResourceDescriptor descriptor = ResourceDescriptorFactory.getInstance().
            createDescriptor("an-external-id", "a-resource-type");
        MutableParameters params = descriptor.getInputParameters();
        params.setParameterValue(ParameterNames.SOURCE_IMAGE_MIME_TYPE, ImageMIMEType);
        params.setParameterValue("InputImageSize",
                                 Integer.toString(ImageSize));
        params.setParameterValue(ParameterNames.DEVICE_REPOSITORY_URL,
                                 getRepositoryURL());

        return descriptor;
    }
View Full Code Here

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

            timeToLive);

        // TODO later If there's an appropriate plugin, allow it to do post-processing of the parameters.
        // plugin.postProcess(outputParameters, device);

        MutableParameters callbackParameters = COMMON_FACTORY.createMutableParameters();
        Iterator processedParameters = descriptor.getOutputParameters().iterator();
        while (processedParameters.hasNext()) {
            Parameters.Entry entry = (Parameters.Entry) processedParameters.next();
            callbackParameters.setParameterValue(entry.getName(), entry.getValue());
        }
        String externalId = descriptor.getExternalID();
        externalIds.add(externalId);
        // base 64 can contain "/"
        externalId = externalId.replaceAll("/", "-");
        callbackParameters.setParameterValue(
            OUTPUT_URL_PARAMETER_NAME, urlPrefix + externalId);

        try {
            agentRequest.getResponseCallback().execute(callbackParameters);
        } catch (Exception e) {
View Full Code Here

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

        throws ParameterBuilderException,
        ResourceRetrieverException,
        MissingParameterException {
        Representation result;

        MutableParameters params =
            descriptor.getInputParameters();
       
        // Load the image.
        try {
            if (!srcURL.startsWith("http:")) {
                result = getLocalImage(srcURL);
            } else {
                result = getRemoteImage(srcURL, retriever, request);
            }

            if (result == null) {
                throw new ParameterBuilderException("Can't load input image");
            }

            //determine input image MIME type.
            String type = result.getFileType();
            params.setParameterValue(ParameterNames.SOURCE_IMAGE_MIME_TYPE, type);
        }catch (IOException ioe) {
            throw new ResourceRetrieverException(ioe);       
        }

        return result;
View Full Code Here

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

        }
        return is;
    }

    private MutableParameters createEnvParams() {
        MutableParameters params = CommonFactory.getInstance().createMutableParameters();

        String localRoot = context.getBundleContext().
                getProperty(BootConstants.CONTEXT_AREA);
        params.setParameterValue(ParameterNames.ENV_LOCAL_ROOT, localRoot);
       
        return params;
    }
View Full Code Here

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

     * @param request
     * @param uri
     * @throws XDIMEException
     */
    private void setHostAndPort(Request request, URI uri) throws XDIMEException {
        MutableParameters params = (MutableParameters) request.getInputParams();
        if (!params.containsName(ParameterNames.SOURCE_HOST)) {
            try {
                // generate an absolute URL to the asset. This allows us to
                // hijack the host and port.
                URL fakeUrl = pageContext.getAbsoluteURL(
                    new MarinerURL(uri.toString()), true);
                params.setParameterValue(ParameterNames.SOURCE_HOST, fakeUrl.getHost());
                int port = fakeUrl.getPort();
                port = port < 0 ? fakeUrl.getDefaultPort(): port;
                if (port >= 0) {
                    params.setParameterValue(
                        ParameterNames.SOURCE_PORT, Integer.toString(port));
                }
                String protocol = fakeUrl.getProtocol();
                if (protocol != null && !"".equals(protocol)) {
                    params.setParameterValue(ParameterNames.SOURCE_PROTOCOL, protocol);
                }
            } catch (MalformedURLException e) {
                throw new XDIMEException(e);
            }
        }
View Full Code Here

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

     * @param uri
     * @param pageContext - MarinerPageContext
     * @throws PAPIException
     */
    private void setHostAndPort(Request request, URI uri, MarinerPageContext pageContext) throws PAPIException {
        MutableParameters params = (MutableParameters) request.getInputParams();
        if (!params.containsName(ParameterNames.SOURCE_HOST)) {
            try {
                // generate an absolute URL to the asset. This allows us to
                // hijack the host and port.
                URL fakeUrl = pageContext.getAbsoluteURL(
                    new MarinerURL(uri.toString()), true);
                params.setParameterValue(ParameterNames.SOURCE_HOST, fakeUrl.getHost());
                int port = fakeUrl.getPort();
                port = port < 0 ? fakeUrl.getDefaultPort(): port;
                if (port >= 0) {
                    params.setParameterValue(
                        ParameterNames.SOURCE_PORT, Integer.toString(port));
                }
                String protocol = fakeUrl.getProtocol();
                if (protocol != null && !"".equals(protocol)) {
                    params.setParameterValue(ParameterNames.SOURCE_HOST, protocol);
                }
            } catch (MalformedURLException e) {
                throw new PAPIException(e);
            }
        }
View Full Code Here

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

   
    private void addMediaAgentExpectations(String transcodedUrl) {
        MediaAgentMock mediaAgentMock =
            new MediaAgentMock("media agent", expectations);
       
        final MutableParameters parameters = COMMON_FACTORY.createMutableParameters();
       
        parameters.setParameterValue(MediaAgent.OUTPUT_URL_PARAMETER_NAME,
                transcodedUrl);
       
        InternalDeviceMock internalDeviceMock =
            new InternalDeviceMock("internal device", expectations);
       
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.