org.apache.ignite.internal.util.ipc.loopback

## Class IpcServerTcpEndpoint

- java.lang.Object
- - org.apache.ignite.internal.util.ipc.loopback.IpcServerTcpEndpoint

All Implemented Interfaces:
  Closeable, AutoCloseable, IpcServerEndpoint

    public class IpcServerTcpEndpoint
    extends Object
    implements IpcServerEndpoint

Server loopback IPC endpoint.

### Field Summary

Fields
`static int` `DFLT_IPC_PORT` Default endpoint port number.

### Constructor Summary

Constructors
Constructor and Description
`IpcServerTcpEndpoint()`

### Method Summary

Methods
`IpcEndpoint` `accept()` Accepts client IPC connection.
`void` `close()` Closes server IPC.
`String` `getHost()` Gets host endpoint is bound to.
`int` `getPort()` Gets port endpoint is bound to.
`boolean` `isManagement()` Indicates if this endpoint is a management endpoint.
`void` `setHost(String host)` Sets host endpoint will be bound to.
`void` `setManagement(boolean mgmt)` Sets management property.
`void` `setPort(int port)` Sets port endpoint will be bound to.
`void` `setupConfiguration(Map<String,String> endpointCfg)` Sets configuration properties from the map.
`void` `start()` Starts configured endpoint implementation.
`String` `toString()`

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

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

### Field Detail

#### DFLT_IPC_PORT

    public static final int DFLT_IPC_PORT

Default endpoint port number.

See Also:
  Constant Field Values

### Constructor Detail

#### IpcServerTcpEndpoint

    public IpcServerTcpEndpoint()

### Method Detail

#### start

    public void start()
               throws IgniteCheckedException

Starts configured endpoint implementation.

Specified by:
  `start` in interface `IpcServerEndpoint`
Throws:
  `IgniteCheckedException` - If failed to start server endpoint.

#### accept

    public IpcEndpoint accept()
                       throws IgniteCheckedException

Accepts client IPC connection. After client connection is accepted, it can be used for IPC. This method will block until client connects to IPC server endpoint.

Specified by:
  `accept` in interface `IpcServerEndpoint`
Returns:
  Accepted client connection.
Throws:
  `IgniteCheckedException` - If accept failed and the endpoint is not usable anymore.

#### close

    public void close()

Closes server IPC. After IPC is closed, no further operations can be performed on this object.

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `IpcServerEndpoint`

#### getPort

    public int getPort()

Gets port endpoint is bound to. Endpoints who does not bind to any port should return -1.

Specified by:
  `getPort` in interface `IpcServerEndpoint`
Returns:
  Port number.

#### setPort

    public void setPort(int port)

Sets port endpoint will be bound to.

Parameters:
  `port` - Port number.

#### getHost

    public String getHost()

Gets host endpoint is bound to. Endpoints who does not bind to any port should return `null`.

Specified by:
  `getHost` in interface `IpcServerEndpoint`
Returns:
  Host.

#### setHost

    public void setHost(String host)

Sets host endpoint will be bound to.

Parameters:
  `host` - Host.

#### isManagement

    public boolean isManagement()

Indicates if this endpoint is a management endpoint.

Specified by:
  `isManagement` in interface `IpcServerEndpoint`
Returns:
  `true` if it's a management endpoint.

#### setManagement

    public void setManagement(boolean mgmt)

Sets management property.

Parameters:
  `mgmt` - flag.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### setupConfiguration

    public void setupConfiguration(Map<String,String> endpointCfg)
                            throws IgniteCheckedException

Sets configuration properties from the map.

Parameters:
  `endpointCfg` - Map of properties.
Throws:
  `IgniteCheckedException` - If invalid property name or value.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015