Package org.cspoker.common.api.shared.http

Examples of org.cspoker.common.api.shared.http.HTTPResponse


   
    HTTPRequest request =  new HTTPRequest(queue);
   
    marschaller.marshal(request, output);
   
    HTTPResponse response = new HTTPResponse();
    response.addActionResult(new ActionPerformedEvent<Void>(action1,null));
    response.addActionResult(new ActionPerformedEvent<Void>(action2,null));
   
    Queue<ServerEvent> equeue = new LinkedList<ServerEvent>();
    equeue.add(new HoldemTableTreeEventWrapper(tid, new BetEvent(new PlayerId(5),25)));
    response.addEvents(equeue);
   
    marschaller.marshal(response, output);

    output = new File(baseDir,"http.xml");
   
View Full Code Here


      }
     
      Unmarshaller um = AllHTTPJAXBContexts.context.createUnmarshaller();
      HTTPRequest request = (HTTPRequest) um.unmarshal(new InputSource(http.getRequestBody()));

      HTTPResponse response = request.performRequest(state.getLeft(), state.getRight());

      StringWriter xml = new StringWriter();
      Marshaller m = AllHTTPJAXBContexts.context.createMarshaller();
      m.setProperty(Marshaller.JAXB_FRAGMENT, true);
      m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
View Full Code Here

            + buffer.toString());
        logger.error(e);
        throwRemoteExceptions(request, e.getMessage());
      }
      Unmarshaller unmarshaller = AllHTTPJAXBContexts.context.createUnmarshaller();
      HTTPResponse response = (HTTPResponse)unmarshaller.unmarshal(connection.getInputStream());

      for(ServerEvent event:response.getEvents()){
        eventListener.onServerEvent(event);
      }
      for(ActionEvent<?> event:response.getActionResults()){
        eventListener.onActionPerformed(event);
      }
    } catch (ProtocolException exception) {
      close(in);
      throwRemoteExceptions(request,exception.getMessage());
View Full Code Here

TOP

Related Classes of org.cspoker.common.api.shared.http.HTTPResponse

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.