com.kuka.comm.net
Class NetConnectionConfigurator<C extends NetConnection>

java.lang.Object
  extended by com.kuka.comm.ConnectionConfigurator<C>
      extended by com.kuka.comm.net.NetConnectionConfigurator<C>
Type Parameters:
C - the connection type (e.g. TcpConnection or UdpConnection)
Direct Known Subclasses:
TcpConnectionConfigurator, UdpConnectionConfigurator

public abstract class NetConnectionConfigurator<C extends NetConnection>
extends ConnectionConfigurator<C>

An abstract factory base class to be used in the different network server classes (e.g. TcpServer or UdpServer).


Constructor Summary
NetConnectionConfigurator(Encoder<Object,ByteBuffer> encoder, Decoder<ByteBuffer,Object> decoder)
          Creates a new configurator with the corresponding encoder and decoder.
 
Method Summary
 void configure(C connection)
          Configures the connection with the parameters that has been set in the factory.
 ReconnectStrategy getAutoReconnectStrategy()
          Getter for the currently set ReconnectStrategy.
 Decoder<ByteBuffer,Object> getDecoder()
           
 Encoder<Object,ByteBuffer> getEncoder()
           
 int getInputBufferSize()
          Returns the input buffer size.
 int getOutputBufferSize()
           
 boolean isAutoReconnectStrategySet()
          Check if a ReconnectStrategy has been set.
 boolean isInputBufferSizeSet()
          Returns true of the input buffer size will be set.
 boolean isOutputBufferSizeSet()
          Returns true of the output buffer size will be set.
 void setAutoReconnectStrategy(ReconnectStrategy strategy)
          Setter to append an ReconnectStrategy to this Connection.
 void setInputBufferSize(int size)
           
 void setOutputBufferSize(int size)
          Sets the output buffer size.
 void unsetAutoReconnectStrategy()
          Clear all references to a ReconnectStrategy.
 void unsetInputBufferSize()
          Unsets the input buffer size.
 void unsetOutputBufferSize()
          Unsets the output buffer size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetConnectionConfigurator

public NetConnectionConfigurator(Encoder<Object,ByteBuffer> encoder,
                                 Decoder<ByteBuffer,Object> decoder)
Creates a new configurator with the corresponding encoder and decoder. The encoder and decoder may not both be null.

Parameters:
encoder - An encoder.
decoder - A decoder.
Method Detail

setAutoReconnectStrategy

public final void setAutoReconnectStrategy(ReconnectStrategy strategy)
Setter to append an ReconnectStrategy to this Connection.

Parameters:
strategy - The ReconnectStrategy to set.

unsetAutoReconnectStrategy

public final void unsetAutoReconnectStrategy()
Clear all references to a ReconnectStrategy.


isAutoReconnectStrategySet

public final boolean isAutoReconnectStrategySet()
Check if a ReconnectStrategy has been set.

Returns:
Boolean value stating if it has been set or not.

getAutoReconnectStrategy

public final ReconnectStrategy getAutoReconnectStrategy()
Getter for the currently set ReconnectStrategy. Will return null if no strategy has been set.

Returns:
The ReconnectStrategy or null, if no strategy has been set.

setInputBufferSize

public final void setInputBufferSize(int size)
Parameters:
size - the input buffer size in Byte

unsetInputBufferSize

public final void unsetInputBufferSize()
Unsets the input buffer size. The buffer size will not be set by the factory.


isInputBufferSizeSet

public final boolean isInputBufferSizeSet()
Returns true of the input buffer size will be set.

Returns:
true of the input buffer size will be set

getInputBufferSize

public final int getInputBufferSize()
Returns the input buffer size.

Returns:
the input buffer size

setOutputBufferSize

public final void setOutputBufferSize(int size)
Sets the output buffer size.

Parameters:
size - the output buffer size in Byte

unsetOutputBufferSize

public final void unsetOutputBufferSize()
Unsets the output buffer size. The buffer size will not be set by the factory.


isOutputBufferSizeSet

public final boolean isOutputBufferSizeSet()
Returns true of the output buffer size will be set.

Returns:
true of the output buffer size will be set

getOutputBufferSize

public final int getOutputBufferSize()
Returns:
the output buffer size

getEncoder

public final Encoder<Object,ByteBuffer> getEncoder()
Returns:
the encoder

getDecoder

public final Decoder<ByteBuffer,Object> getDecoder()
Returns:
the decoder

configure

public void configure(C connection)
Description copied from class: ConnectionConfigurator
Configures the connection with the parameters that has been set in the factory.

Specified by:
configure in class ConnectionConfigurator<C extends NetConnection>
Parameters:
connection - the connection to be configured


Copyright © 2019. All rights reserved.