Package org.apache.avro.ipc.jetty

# Class HttpServer

java.lang.Object
org.apache.avro.ipc.jetty.HttpServer

All Implemented Interfaces:
  `org.apache.avro.ipc.Server`

public class HttpServer extends Object implements org.apache.avro.ipc.Server
An HTTP-based RPC `Server`.

## Constructor Summary

Constructors
Constructor
Description
`HttpServer(org.apache.avro.ipc.Responder responder, int port)`
Constructs a server to run on the named port.
`HttpServer(org.apache.avro.ipc.Responder responder, String bindAddress, int port)`
Constructs a server to run on the named port on the specified address.
`HttpServer(org.apache.avro.ipc.Responder responder, InetSocketAddress addr)`
Constructs a server to run on the named port on the specified address.
`HttpServer(org.apache.avro.ipc.Responder responder, org.eclipse.jetty.server.ConnectionFactory connectionFactory, String bindAddress, int port)`
Constructs a server to run with the given ConnectionFactory on the given address/port.
`HttpServer(org.apache.avro.ipc.Responder responder, org.eclipse.jetty.server.Connector connector)`
Deprecated.
- use the Constructors that take a ConnectionFactory
`HttpServer(org.apache.avro.ipc.ResponderServlet servlet, int port)`
Constructs a server to run on the named port.
`HttpServer(org.apache.avro.ipc.ResponderServlet servlet, String bindAddress, int port)`
Constructs a server to run on the named port on the specified address.
`HttpServer(org.apache.avro.ipc.ResponderServlet servlet, org.eclipse.jetty.server.ConnectionFactory connectionFactory, String bindAddress, int port)`
Constructs a server to run with the given ConnectionFactory on the given address/port.
`HttpServer(org.apache.avro.ipc.ResponderServlet servlet, org.eclipse.jetty.server.Connector connector)`
Deprecated.
- use the Constructors that take a ConnectionFactory

## Method Summary

Modifier and Type
Method
Description
`void`
`addConnector(org.eclipse.jetty.server.Connector connector)`
`void`
`close()`
`int`
`getPort()`
`void`
`join()`
`void`
`start()`
Start the server.

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

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

## Constructor Details

### HttpServer

public HttpServer(org.apache.avro.ipc.Responder responder, int port) throws IOException
Constructs a server to run on the named port.

Throws:
  `IOException`

### HttpServer

public HttpServer(org.apache.avro.ipc.ResponderServlet servlet, int port) throws IOException
Constructs a server to run on the named port.

Throws:
  `IOException`

### HttpServer

public HttpServer(org.apache.avro.ipc.Responder responder, InetSocketAddress addr) throws IOException
Constructs a server to run on the named port on the specified address.

Throws:
  `IOException`

### HttpServer

public HttpServer(org.apache.avro.ipc.Responder responder, String bindAddress, int port) throws IOException
Constructs a server to run on the named port on the specified address.

Throws:
  `IOException`

### HttpServer

public HttpServer(org.apache.avro.ipc.ResponderServlet servlet, String bindAddress, int port) throws IOException
Constructs a server to run on the named port on the specified address.

Throws:
  `IOException`

### HttpServer

public HttpServer(org.apache.avro.ipc.Responder responder, org.eclipse.jetty.server.ConnectionFactory connectionFactory, String bindAddress, int port) throws IOException
Constructs a server to run with the given ConnectionFactory on the given address/port.

Throws:
  `IOException`

### HttpServer

public HttpServer(org.apache.avro.ipc.ResponderServlet servlet, org.eclipse.jetty.server.ConnectionFactory connectionFactory, String bindAddress, int port) throws IOException
Constructs a server to run with the given ConnectionFactory on the given address/port.

Throws:
  `IOException`

### HttpServer

@Deprecated public HttpServer(org.apache.avro.ipc.ResponderServlet servlet, org.eclipse.jetty.server.Connector connector) throws IOException
Deprecated.
- use the Constructors that take a ConnectionFactory
Constructs a server to run with the given connector.

Throws:
  `IOException`

### HttpServer

@Deprecated public HttpServer(org.apache.avro.ipc.Responder responder, org.eclipse.jetty.server.Connector connector) throws IOException
Deprecated.
- use the Constructors that take a ConnectionFactory
Constructs a server to run with the given connector.

Throws:
  `IOException`

## Method Details

### addConnector

public void addConnector(org.eclipse.jetty.server.Connector connector)

### getPort

public int getPort()

Specified by:
  `getPort` in interface `org.apache.avro.ipc.Server`

### close

public void close()

Specified by:
  `close` in interface `org.apache.avro.ipc.Server`

### start

public void start()
Start the server.

Specified by:
  `start` in interface `org.apache.avro.ipc.Server`
Throws:
  `org.apache.avro.AvroRuntimeException` - if the underlying Jetty server throws any exception while starting.

### join

public void join() throws InterruptedException

Specified by:
  `join` in interface `org.apache.avro.ipc.Server`
Throws:
  `InterruptedException`