Package com.volantis.map.common.param

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


     * @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

   
    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

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

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.