Package com.volantis.map.agent

Examples of com.volantis.map.agent.Request


     */
    private void processRequest(AgentRequest agentRequest) {
        Parameters inputParameters = descriptorStore.createParameters();
        ParameterNames outputParameters = descriptorStore.createParameterNames();

        final Request request = agentRequest.getRequest();
        final com.volantis.map.common.param.Parameters inputParams =
            request.getInputParams();
        final Iterator requestInputParams = inputParams.getParameterNames();
        try {
            while (requestInputParams.hasNext()) {
                String paramName = (String) requestInputParams.next();
                inputParameters.setParameterValue(
                    paramName, inputParams.getParameterValue(paramName));
            }
        } catch (MissingParameterException e) {
            // this is not expected as we iterate through the parameter names
            throw new UndeclaredThrowableException(e);
        }

        Iterator requestOutputParams = request.getOutputParams().iterator();
        while (requestOutputParams.hasNext()) {
            String paramName = (String) requestOutputParams.next();
            outputParameters.setName(paramName);
        }

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

        ResourceDescriptor descriptor = descriptorStore.createDescriptor(
            request.getResourceType(), inputParameters, outputParameters,
            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) {
            LOGGER.warn("error-executing-response-callback", request.getSourceURL(),e);
        }
    }
View Full Code Here


                }catch(URISyntaxException e){
                    throw new XDIMEException(e);
                }

                // Create MediaAgent request based on old-style transcoder URI.
                Request request = pageContext.getMediaAgentRequestFactory()
                    .createRequestFromICSURI(uri);
                setHostAndPort(request, uri);
                // Create MediaAgent response callback.
                MAPResponseCallback callback = new MAPResponseCallbackXDIME2(
                    objectAttribute,
View Full Code Here

            if (pageContext.getSupportedImages().length() > 0) {
                extraParameters.put(ParameterNames.SUPPORTED_IMAGES, pageContext.getSupportedImages());               
            }

            // Create MediaAgent request based on old-style transcoder URI. 
            Request request = pageContext.getMediaAgentRequestFactory()
                    .createRequestFromICSURI(finalURI, extraParameters);
       
            // Create MediaAgent response callback.
            MAPResponseCallback callback = new MAPResponseCallbackXDIME2(
                    objectAttribute,
View Full Code Here

            URI absoluteURI = new URI(pageContext.getAbsoluteURL(
                new MarinerURL(objectAttribute.getSrc()), true).toExternalForm());
            // use resovled absolute uri from now on

            RequestFactory factory = pageContext.getMediaAgentRequestFactory();
            Request request = factory.createRequest(
                objectAttribute.getSrcType(), absoluteURI, inputParameters);
       
            MAPResponseCallback callback =
                new MAPResponseCallbackXDIME2(objectAttribute,
                    MAPResponseCallback.createURLRewriter(pageContext, PageURLType.OBJECT));
View Full Code Here

            URI absoluteURI = new URI(pageContext.getAbsoluteURL(
                new MarinerURL(objectAttribute.getSrc()), true).toExternalForm());

            // use resovled absolute uri from now on
            RequestFactory factory = pageContext.getMediaAgentRequestFactory();
            Request request = factory.createRequest(
                objectAttribute.getSrcType(), absoluteURI, inputParameters);
       
            MAPResponseCallback callback =
                new MAPResponseCallbackXDIME2(objectAttribute,
                    MAPResponseCallback.createURLRewriter(pageContext, PageURLType.OBJECT));
View Full Code Here

                            }catch(URISyntaxException e){
                                throw new PAPIException(e);
                            }

                            // Create MediaAgent request based on old-style transcoder URI.
                            Request request = pageContext.getMediaAgentRequestFactory()
                                .createRequestFromICSURI(uri);

                            setHostAndPort(request, uri, pageContext);

                            // Create MediaAgent response callback.
View Full Code Here

TOP

Related Classes of com.volantis.map.agent.Request

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.