Examples of HttpRedirect


Examples of com.dyn.client.v3.traffic.domain.redirect.HttpRedirect

   }

   @SuppressWarnings("unchecked")
   @Override
   public <R extends HttpRequest> R bindToRequest(R request, Object arg) {
      HttpRedirect in = HttpRedirect.class.cast(checkNotNull(arg, "redirect to create"));
      URI path = uriBuilder(request.getEndpoint()).build(in.getDelegate());
      return (R) request.toBuilder()
                        .endpoint(path)
                        .payload(json.toJson(ImmutableMap.of(
                            "code", in.getCode(), "keep_uri", in.getKeepUri(), "url", in.getUrl()))).build();
   }
View Full Code Here

Examples of com.dyn.client.v3.traffic.domain.redirect.HttpRedirect

   }

   @SuppressWarnings("unchecked")
   @Override
   public <R extends HttpRequest> R bindToRequest(R request, Object arg) {
      HttpRedirect in = HttpRedirect.class.cast(checkNotNull(arg, "redirect to create"));
      URI path = uriBuilder(request.getEndpoint()).build(in.getDelegate());
      return (R) request.toBuilder()
                        .endpoint(path)
                        .payload(json.toJson(ImmutableMap.of(
                            "code", in.getCode(), "keep_uri", in.getKeepUri(), "url", in.getUrl()))).build();
   }
View Full Code Here

Examples of com.dyn.client.v3.traffic.domain.redirect.HttpRedirect

      checkNotNull(zone.getFQDN(), "FQDN cannot be null for a Zone: %s", zone);
      checkNotNull(zone.getSerial(), "Serial cannot be null for a Zone: %s", zone);
   }

   private void getAndVerifyRedirect(String redirectName, int code, String keepUri, String url) {
      HttpRedirect redirect = api.getHttpRedirectApiForZone(fqdn).getHttpRedirect(redirectName);
      checkNotNull(redirect, "redirect was null for Zone: %s", fqdn);
      assertEquals(redirect.getFqdn(), redirectName);
      assertEquals(redirect.getCode(), code);
      assertEquals(redirect.getKeepUri(), keepUri);
      assertEquals(redirect.getUrl(), url);
   }
View Full Code Here

Examples of com.dyn.client.v3.traffic.domain.redirect.HttpRedirect

      Thread.sleep(3000); // FIXME - figure out delays
      getAndVerifyRedirect(redirectName, 302, "Y", "http://foo.com/");
      Job job = api().scheduleDelete(redirectName);
      assertEquals(job.getStatus(), Status.SUCCESS);
      assertEquals(api.getJob(job.getId()), job);
      HttpRedirect redirect = api.getHttpRedirectApiForZone(fqdn).getHttpRedirect(redirectName);
      checkState(redirect == null, "redirect was now null for Zone: %s", fqdn);
   }
View Full Code Here

Examples of com.sun.grizzly.config.dom.HttpRedirect

        }

        try {
            ConfigSupport.apply(new SingleConfigCode<Protocol>() {
                public Object run(Protocol param) throws TransactionFailure {
                    HttpRedirect httpRedirect = param.createChild(HttpRedirect.class);
                    httpRedirect.setPort(port);
                    httpRedirect.setSecure(secure);
                    param.setHttpRedirect(httpRedirect);
                    return httpRedirect;
                }
            }, protocol);
        } catch (TransactionFailure e) {
View Full Code Here

Examples of org.apache.excalibur.instrument.manager.http.server.HTTPRedirect

                // Starting with Java 1.4, encode takes an encoding, but this needs to
                //  work with 1.3.   Use our own version.
                String iName = URLCoder.encode( name.substring( 0,  pos ),
                    InstrumentManagerHTTPConnector.ENCODING );
               
                throw new HTTPRedirect( "instrument.html?name=" + iName );
            }
            else
            {
                throw new HTTPRedirect( "instrumentable.html" );
            }
        }
       
        int width = getIntegerParameter( parameters, "width", m_width );
        width = Math.max( 1, Math.min( 2048, width ) );
View Full Code Here

Examples of org.apache.excalibur.instrument.manager.http.server.HTTPRedirect

       
        System.gc();
       
        long newMemory = getMemory();
       
        throw new HTTPRedirect(
            "instrument-manager.html?oldMemory=" + oldMemory + "&newMemory=" + newMemory );
    }
View Full Code Here

Examples of org.apache.excalibur.instrument.manager.http.server.HTTPRedirect

        }
       
        if ( path.indexOf( '/', 1 ) >= 0 )
        {
            // Found a slash after the base, so we are in a subdirectory.
            throw new HTTPRedirect( "../instrument-manager.html" );
        }
        else
        {
            throw new HTTPRedirect( "instrument-manager.html" );
        }
    }
View Full Code Here

Examples of org.apache.excalibur.instrument.manager.http.server.HTTPRedirect

        {
            // Sample no longer exists, go back to the parent instrument.
            int pos = name.lastIndexOf( '.' );
            if ( pos >= 0 )
            {
                throw new HTTPRedirect(
                    "instrument.html?name=" + urlEncode( name.substring( 0,  pos ) ) );
            }
            else
            {
                throw new HTTPRedirect( "instrument-manager.html" );
            }
        }
        String chart = getParameter( parameters, "chart", null );
       
        InstrumentSampleSnapshot snapshot = desc.getSnapshot();
View Full Code Here

Examples of org.apache.excalibur.instrument.manager.http.server.HTTPRedirect

        {
            // Sample no longer exists, go back to the parent instrument.
            int pos = name.lastIndexOf( '.' );
            if ( pos >= 0 )
            {
                throw new HTTPRedirect(
                    "instrumentable.html?name=" + urlEncode( name.substring( 0,  pos ) ) );
            }
            else
            {
                throw new HTTPRedirect( "instrument-manager.html" );
            }
        }
       
        String type;
        StringBuffer types = new StringBuffer();
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.