Examples of ObservedCall


Examples of org.persvr.data.ObservedCall

   */
  static class ConnectionConflict extends Notification {

    @Override
    public ObservedCall getCall() {
      return new ObservedCall(ObjectId.idForString("root"),"connection-conflict",null,null);
    }
View Full Code Here

Examples of org.persvr.data.ObservedCall

      this.request = request;
    }
    public int sendNotification(Notification notification, Client connection,boolean first) throws IOException {
      String pathInfo = notification.getPathInfo();
      InnerResponse innerResponse = new InnerResponse(prefix + pathInfo);
        ObservedCall call = notification.getCall();
        innerResponse.setHeader("Event", call.getMethod());
        IndividualRequest request = connection.getIndividualRequest(null, response);
        request.setRequestedPath(pathInfo, Identification.idForString(pathInfo));
        Object target = call.getContent();
        String output;
      if (target == Scriptable.NOT_FOUND || target == Undefined.instance){
        innerResponse.setStatus(204);
        output ="";
      }
View Full Code Here

Examples of org.persvr.data.ObservedCall

      this.request = request;
    }

    public int sendNotification(Notification notification, Client connection,boolean first) throws IOException {
      String pathInfo = notification.getPathInfo();
        ObservedCall call = notification.getCall();
        response.setHeader("Event", call.getMethod());
        response.setHeader("Content-Location", prefix + pathInfo);
        IndividualRequest request = connection.getIndividualRequest(null, response);
        request.setRequestedPath(pathInfo, Identification.idForString(pathInfo));
//      target = PersevereServlet.handleRange(range, target, since,response);
      String output = request.serialize(call.getContent());
      response.setHeader("Last-Modified", "" + new Date()); // TODO: This should come from the transaction
        response.getOutputStream().print(output);
        response.getOutputStream().flush();
        return 0;
    }
View Full Code Here

Examples of org.persvr.data.ObservedCall

      this.request = request;
    }

    public int sendNotification(Notification notification, Client connection,boolean first) throws IOException {
      String pathInfo = notification.getPathInfo();
        ObservedCall call = notification.getCall();
        ServletOutputStream outStream = response.getOutputStream();
        outStream.print(first ? "[" : ",");
        outStream.print("{\"event\":"+JSON.quote(call.getMethod()) + ",\"source\":" + JSON.quote(prefix + pathInfo));
        IndividualRequest request = connection.getIndividualRequest(null, response);
        Client.registerThisConnection(request);
        request.setRequestedPath(pathInfo, Identification.idForString(pathInfo));
//      target = PersevereServlet.handleRange(range, target, since,response);
        Object content = call.getContent();
        if (content != Undefined.instance) {
          outStream.print(",\"result\":");
          try{
            DataSerializer.serialize(content, this.request.getHeader("Accept"), false);
          }
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.