/** * This is used to acquire the body for this HTTP entity. This * will return a body which can be used to read the content of * the message, also if the request is multipart upload then all * of the parts are provided as <code>Part</code> objects. Each * part can then be read as an individual message. * * @return the body provided by the HTTP request message */ public Body getBody() { return entity.getBody(); }
/** * This provides the HTTP request header for the entity. This is * always populated and provides the details sent by the client * such as the target URI and the query if specified. Also this * can be used to determine the method and protocol version used. * * @return the header provided by the HTTP request message */ public Header getHeader() { return entity.getHeader(); }
/** * This is used to collect the data from a <code>Channel</code> * which is used to compose the entity. If at any stage there * are no ready bytes on the socket the selector provided can be * used to queue the collector until such time as the socket is * ready to read. Also, should the entity have completed reading * all required content it is handed to the selector as ready, * which processes the entity as a new client HTTP request. * * @param selector this is the selector used to queue this */ public void collect(Selector selector) throws IOException { while(cursor.isReady()) { if(entity.isFinished()) { break; } else { timer.set(); entity.consume(cursor); } } if(cursor.isOpen()) { if(entity.isFinished()) { trace.trace(REQUEST_READY); selector.ready(this); } else { trace.trace(READ_WAIT); selector.select(this); } } }
/** * The <code>Collector</code> object used to collect the data from * the underlying transport. In order to collect a body this must * be given an <code>Allocator</code> which is used to create an * internal buffer to store the consumed body. * * @param allocator this is the allocator used to buffer data * @param tracker this is the tracker used to create sessions * @param channel this is the channel used to read the data */ public Collector(Allocator allocator, Channel channel) { this.entity = new EntityConsumer(allocator, channel); this.timer = new Timer(MILLISECONDS); this.cursor = channel.getCursor(); this.trace = channel.getTrace(); this.channel = channel; }
/** * This is used to collect the data from a <code>Channel</code> * which is used to compose the entity. If at any stage there * are no ready bytes on the socket the controller provided can * be used to queue the collector until such time as the socket * is ready to read. Also, should the entity have completed reading * all required content it is handed to the controller as ready, * which processes the entity as a new client HTTP request. * * @param controller this is the controller used to queue this */ public void collect(Controller controller) throws IOException { while(cursor.isReady()) { if(entity.isFinished()) { break; } else { timer.set(); entity.consume(cursor); } } if(cursor.isOpen()) { if(entity.isFinished()) { trace.trace(REQUEST_READY); controller.ready(this); } else { trace.trace(READ_WAIT); controller.select(this); } } }
/** * The <code>RequestCollector</code> object used to collect the data * from the underlying transport. In order to collect a body this * must be given an <code>Allocator</code> which is used to create * an internal buffer to store the consumed body. * * @param allocator this is the allocator used to buffer data * @param tracker this is the tracker used to create sessions * @param channel this is the channel used to read the data */ public RequestCollector(Allocator allocator, Channel channel) { this.entity = new EntityConsumer(allocator, channel); this.timer = new Timer(MILLISECONDS); this.cursor = channel.getCursor(); this.trace = channel.getTrace(); this.channel = channel; }
/** * This is used to collect the data from a <code>Channel</code> * which is used to compose the entity. If at any stage there * are no ready bytes on the socket the controller provided can * be used to queue the collector until such time as the socket * is ready to read. Also, should the entity have completed reading * all required content it is handed to the controller as ready, * which processes the entity as a new client HTTP request. * * @param controller this is the controller used to queue this */ public void collect(Controller controller) throws IOException { while(cursor.isReady()) { if(entity.isFinished()) { break; } else { timer.set(); entity.consume(cursor); } } if(cursor.isOpen()) { if(entity.isFinished()) { trace.trace(REQUEST_READY); controller.ready(this); } else { trace.trace(READ_WAIT); controller.select(this); } } }
/** * This is used to acquire the body for this HTTP entity. This * will return a body which can be used to read the content of * the message, also if the request is multipart upload then all * of the parts are provided as <code>Part</code> objects. Each * part can then be read as an individual message. * * @return the body provided by the HTTP request message */ public Body getBody() { return entity.getBody(); }
/** * This provides the HTTP request header for the entity. This is * always populated and provides the details sent by the client * such as the target URI and the query if specified. Also this * can be used to determine the method and protocol version used. * * @return the header provided by the HTTP request message */ public Header getHeader() { return entity.getHeader(); }
/** * The <code>RequestCollector</code> object used to collect the data * from the underlying transport. In order to collect a body this * must be given an <code>Allocator</code> which is used to create * an internal buffer to store the consumed body. * * @param allocator this is the allocator used to buffer data * @param tracker this is the tracker used to create sessions * @param channel this is the channel used to read the data */ public RequestCollector(Allocator allocator, Channel channel) { this.entity = new EntityConsumer(allocator, channel); this.timer = new Timer(MILLISECONDS); this.cursor = channel.getCursor(); this.trace = channel.getTrace(); this.channel = channel; }
/** * This is used to acquire the body for this HTTP entity. This * will return a body which can be used to read the content of * the message, also if the request is multipart upload then all * of the parts are provided as <code>Part</code> objects. Each * part can then be read as an individual message. * * @return the body provided by the HTTP request message */ public Body getBody() { return entity.getBody(); }
/** * This provides the HTTP request header for the entity. This is * always populated and provides the details sent by the client * such as the target URI and the query if specified. Also this * can be used to determine the method and protocol version used. * * @return the header provided by the HTTP request message */ public Header getHeader() { return entity.getHeader(); }