Examples of Reply


Examples of org.w3c.jigsaw.http.Reply

     * @exception ResourceException If the resource got a fatal error.
     */
    public ReplyInterface perform(RequestInterface req)
  throws ProtocolException, ResourceException
    {
  Reply        reply  = (Reply) performFrames(req);
  if (reply != null)
      return reply;
  Request request = (Request) req;
  httpd    server = (httpd) getServer();
  String     host = request.getHost();
  request.setState(Request.ORIG_URL_STATE, request.getURL());
  request.setState(JigsawRequestDispatcher.REQUEST_URI_P,
       getRequestURI(request));
  request.setState(JigsawRequestDispatcher.QUERY_STRING_P,
       request.getQueryString());
  request.setState(JigsawRequestDispatcher.SERVLET_PATH_P, getURLPath());
  try {
      String target = null;
      if (request.hasQueryString())
    target = getTarget()+"?"+request.getQueryString();
      else
    target = getTarget();

      if (host == null) {
    request.setURL(new URL(server.getURL(), target));
      } else {
    int ic = host.indexOf(':');
    // we will take care of '[' later (ipv6 address)
    if ( ic < 0 ) {
        request.setURL(new URL(server.getURL().getProtocol(),
             host, target));
    } else {
        request.setURL(new URL(server.getURL().getProtocol(),
             host.substring(0, ic),
             Integer.parseInt(
                 host.substring(ic+1)),
             target));
    }
      }
      request.setInternal(true);
  } catch (MalformedURLException ex) {
      Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR);
      error.setContent("<html><head><title>Server Error</title>"+
           "</head><body><h1>Server misconfigured</h1>"+
           "<p>The resource <b>"+getIdentifier()+"</b>"+
           "has an invalid target attribute : <p><b>"+
           getTarget()+"</b></body></html>");     
      throw new HTTPException (error);
View Full Code Here

Examples of org.w3c.jigsaw.http.Reply

    public Reply execute(SSIFrame ssiframe,
       Request request,
       ArrayDictionary parameters,
       Dictionary variables)
    {
  Reply reply =
      ssiframe.createCommandReply(request,HTTP.OK) ;

  reply.setContent("[SSIFrame: unknown command \""+badCommand+"\"]");
 
  return reply ;
    }
View Full Code Here

Examples of org.w3c.jigsaw.http.Reply

    public boolean checkConnection() {
  return getBoolean(ATTR_CONNECTION, false);
    }

    private ReplyInterface modifyHeaders(ReplyInterface rep) {
  Reply reply = (Reply) rep;
  String hname = getHeaderName();
  if ( hname != null ) {
      String hvalue = getHeaderValue();
      if ( hvalue == null ) {
    reply.removeHeader(hname);
      } else {
    reply.setValue(hname, hvalue);
      }
      if ( checkNoCache() )
    reply.addNoCache(hname);
      if ( checkConnection() )
    reply.addConnection(hname);
  }
  return null;
    }
View Full Code Here

Examples of org.w3c.www.protocol.http.Reply

      Request req = http.createRequest();
      req.setMethod("LOAD-ROOT");
      req.setURL(server);
      req.setValue("TE","gzip");
      // Run that request:
      Reply rep = runRequest(req);
      // Decode the reply:
      root = reader.readResource(server, null, getInputStream(rep));
  } catch (RemoteAccessException ex) {
      if (debug)
    ex.printStackTrace();
View Full Code Here

Examples of org.woped.editor.controller.bpel.Reply

                }
                if (transitions[i].getToolspecificArray(j)
                    .isSetReply()) {
                  TReply reply = transitions[i]
                      .getToolspecificArray(j).getReply();
                  Reply bpel = new Reply(reply.getName(),
                      reply.getPartnerLink(), reply
                          .getOperation(), reply
                          .getVariable());
                  map.setBpeldata(bpel);
                }
View Full Code Here

Examples of redis.netty.Reply

*/
public class ReplyTest {
  @Test
  public void testReadWrite() throws IOException {
    ChannelBuffer os;
    Reply receive;
    RedisDecoder redisDecoder = new RedisDecoder();
    {
      os = ChannelBuffers.dynamicBuffer();
      String message = "OK";
      new StatusReply(message).write(os);
      receive = redisDecoder.receive(os);
      assertTrue(receive instanceof StatusReply);
      assertEquals(message, receive.data());
    }
    {
      os = ChannelBuffers.dynamicBuffer();
      String message = "OK";
      new ErrorReply(message).write(os);
      receive = redisDecoder.receive(os);
      assertTrue(receive instanceof ErrorReply);
      assertEquals(message, receive.data());
    }
    {
      os = ChannelBuffers.dynamicBuffer();
      String message = "OK";
      new BulkReply(ChannelBuffers.wrappedBuffer(message.getBytes())).write(os);
      receive = redisDecoder.receive(os);
      assertTrue(receive instanceof BulkReply);
      assertEquals(message, ((ChannelBuffer)receive.data()).toString(Charsets.US_ASCII));
    }
    {
      os = ChannelBuffers.dynamicBuffer();
      long integer = 999;
      new IntegerReply(integer).write(os);
      receive = redisDecoder.receive(os);
      assertTrue(receive instanceof IntegerReply);
      assertEquals(integer, receive.data());
    }
    {
      os = ChannelBuffers.dynamicBuffer();
      String message = "OK";
      long integer = 999;
      new MultiBulkReply(new Reply[] {
              new StatusReply(message),
              new ErrorReply(message),
              new MultiBulkReply(new Reply[] { new StatusReply(message)}),
              new BulkReply(ChannelBuffers.wrappedBuffer(message.getBytes())),
              new IntegerReply(integer)}).write(os);
      receive = redisDecoder.receive(os);
      assertTrue(receive instanceof MultiBulkReply);
      Reply[] data = (Reply[]) receive.data();
      assertEquals(message, data[0].data());
      assertEquals(message, data[1].data());
      assertTrue(data[2] instanceof MultiBulkReply);
      Reply[] data2 = (Reply[]) data[2].data();
      assertEquals(message, data2[0].data());
View Full Code Here

Examples of redis.netty4.Reply

*/
public class ReplyTest {
  @Test
  public void testReadWrite() throws IOException {
    ByteBuf os;
    Reply receive;
    RedisReplyDecoder redisDecoder = new RedisReplyDecoder(false);
    {
      os = Unpooled.buffer();
      String message = "OK";
      new StatusReply(message).write(os);
      receive = redisDecoder.receive(os);
      assertTrue(receive instanceof StatusReply);
      assertEquals(message, receive.data());
    }
    {
      os = Unpooled.buffer();
      String message = "OK";
      new ErrorReply(message).write(os);
      receive = redisDecoder.receive(os);
      assertTrue(receive instanceof ErrorReply);
      assertEquals(message, receive.data());
    }
    {
      os = Unpooled.buffer();
      String message = "OK";
      new BulkReply(Unpooled.wrappedBuffer(message.getBytes())).write(os);
      receive = redisDecoder.receive(os);
      assertTrue(receive instanceof BulkReply);
      assertEquals(message, ((ByteBuf)receive.data()).toString(Charsets.US_ASCII));
    }
    {
      os = Unpooled.buffer();
      long integer = 999;
      new IntegerReply(integer).write(os);
      receive = redisDecoder.receive(os);
      assertTrue(receive instanceof IntegerReply);
      assertEquals(integer, receive.data());
    }
    {
      os = Unpooled.buffer();
      String message = "OK";
      long integer = 999;
      new MultiBulkReply(new Reply[] {
              new StatusReply(message),
              new ErrorReply(message),
              new MultiBulkReply(new Reply[] { new StatusReply(message)}),
              new BulkReply(Unpooled.wrappedBuffer(message.getBytes())),
              new IntegerReply(integer)}).write(os);
      receive = redisDecoder.receive(os);
      assertTrue(receive instanceof MultiBulkReply);
      Reply[] data = (Reply[]) receive.data();
      assertEquals(message, data[0].data());
      assertEquals(message, data[1].data());
      assertTrue(data[2] instanceof MultiBulkReply);
      Reply[] data2 = (Reply[]) data[2].data();
      assertEquals(message, data2[0].data());
View Full Code Here

Examples of redis.reply.Reply

*/
public class ReplyTest {
  @Test
  public void testReadWrite() throws IOException {
    ByteArrayOutputStream os;
    Reply receive;
    {
      os = new ByteArrayOutputStream();
      String message = "OK";
      new StatusReply(message).write(os);
      receive = RedisProtocol.receive(new ByteArrayInputStream(os.toByteArray()));
      assertTrue(receive instanceof StatusReply);
      assertEquals(message, receive.data());
    }
    {
      os = new ByteArrayOutputStream();
      String message = "OK";
      new ErrorReply(message).write(os);
      receive = RedisProtocol.receive(new ByteArrayInputStream(os.toByteArray()));
      assertTrue(receive instanceof ErrorReply);
      assertEquals(message, receive.data());
    }
    {
      os = new ByteArrayOutputStream();
      String message = "OK";
      new BulkReply(message.getBytes()).write(os);
      receive = RedisProtocol.receive(new ByteArrayInputStream(os.toByteArray()));
      assertTrue(receive instanceof BulkReply);
      assertEquals(message, new String((byte[]) receive.data()));
    }
    {
      os = new ByteArrayOutputStream();
      long integer = 999;
      new IntegerReply(integer).write(os);
      receive = RedisProtocol.receive(new ByteArrayInputStream(os.toByteArray()));
      assertTrue(receive instanceof IntegerReply);
      assertEquals(integer, receive.data());
    }
    {
      os = new ByteArrayOutputStream();
      String message = "OK";
      long integer = 999;
      new MultiBulkReply(new Reply[] {
              new StatusReply(message),
              new ErrorReply(message),
              new MultiBulkReply(new Reply[] { new StatusReply(message)}),
              new BulkReply(message.getBytes()),
              new IntegerReply(integer)}).write(os);
      receive = RedisProtocol.receive(new ByteArrayInputStream(os.toByteArray()));
      assertTrue(receive instanceof MultiBulkReply);
      Reply[] data = (Reply[]) receive.data();
      assertEquals(message, data[0].data());
      assertEquals(message, data[1].data());
      assertTrue(data[2] instanceof MultiBulkReply);
      Reply[] data2 = (Reply[]) data[2].data();
      assertEquals(message, data2[0].data());
View Full Code Here

Examples of se.rupy.http.Reply

  public static class Back extends Service {
    public String path() { return "/ping"; }
    public void filter(Event event) throws Event, Exception {
      try {
        new In(event);
        Reply reply = event.reply();
        reply.type("text/xml");
        Output out = reply.output();
        out.println("<?xml version=\"1.0\"?>");
        out.println("<methodResponse>");
        out.println("  <params>");
        out.println("    <param>");
        out.println("      <value>");
View Full Code Here

Examples of wbbs.domain.Reply

        ensureLoginAction();

        Topic topic = topicService.findTopic(topicId);
        notNull(topic, "主题不存在");
        Reply reply = new Reply();
        reply.topicId = topicId;
        reply.content = range(notNull(trim(content)), 1, 4000, "回复不能为空且最长4000个字");
        reply.authorId = loginUser.id;
        reply.postDate = new Timestamp(System.currentTimeMillis());
        topicService.insertReply(topicId, reply);
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.