### php.java.bridge

# Class Request

- `java.lang.Object`

- `php.java.bridge.Request`

Implemented Interfaces:
  IDocHandler

`public class Request`
`extends java.lang.Object`
`implements IDocHandler`

This class is used to handle requests from the frontent.

Author:
  jostb

## Field Summary

`Response`

`response`
  The current response handle or null.

## Constructor Summary

`Request(JavaBridge bridge)`
  Creates an empty request object.

## Method Summary

`void`

`begin(ParserTag[] tag)`

`void`

`end(ParserString[] string)`

`void`

`handleOneRequest()`
  Start handling requests until EOF.

`void`

`handleRequests()`
  Start handling requests until EOF.

`boolean`

`init(java.io.InputStream in, java.io.OutputStream out)`
  This method must be called with the current input and output streams.

### Methods inherited from class java.lang.Object

`equals`, `getClass`, `hashCode`, `notify`, `notifyAll`, `toString`, `wait`, `wait`, `wait`

## Field Details

### response

    public Response response

> The current response handle or null. There is only one response handle for each request object. `response.reset()` or `response.flush()` must be called at the end of each packet.

## Constructor Details

### Request

    public Request(JavaBridge bridge)

> Creates an empty request object.

> Parameters:
>   `bridge` - The bridge instance.

> See Also:
>   `init(InputStream,OutputStream)`

## Method Details

### begin

    public void begin(ParserTag[] tag)

### end

    public void end(ParserString[] string)

### handleOneRequest

    public void handleOneRequest()
                throws java.io.IOException

> Start handling requests until EOF. Creates a response object and handles only the first packet. All following packets are discarded.

> Throws:
>   `java.io.IOException` -

### handleRequests

    public void handleRequests()
                throws java.io.IOException

> Start handling requests until EOF. Creates a response object and handles all packets.

> Throws:
>   `java.io.IOException` -

### init

    public boolean init(java.io.InputStream in,
                        java.io.OutputStream out)
                throws java.io.IOException

> This method must be called with the current input and output streams. It reads the protocol header and initializes the request object.

> Parameters:
>   `in` - The input stream.
>   `out` - The output stream.

> Returns:
>   true if the protocol header was valid, false otherwise.

> Throws:
>   `java.io.IOException` -