public interface JLupinLoadBalancer<INPUT,OUTPUT>
| Modifier and Type | Method and Description |
|---|---|
int |
getHowOftenCheckingServerInMillis() |
String |
getName()
Returns load balancer name.
|
Iterator<Socket> |
getOpenedSocketIteratorToAllMicroservicesByName(String microserviceName,
PortType portType) |
Socket |
getOpenSocket(String microserviceName,
PortType portType)
get proper socket based on current load balancer settings
|
int |
getServerAmountBasedOnServiceRepository(String microserviceName) |
OUTPUT |
sendAndReceiveWithoutSocketManaging(Socket clientSocket,
INPUT input)
send message by proper socket getting from
Socket getOpenSocket(PortType portType) throws JLupinNotConnectedWithServerException method
|
byte[] |
sendJLupinInputParameterAndGetOutputParameterAsByteArrayWithSocketManaging(String microserviceName,
byte[][] jlupinInputParameterAsByteArray,
PortType portType)
Send serialized
JLupinInputParameter to provided microservice to provided
port. |
void |
start()
Starts internal resources for load balancing.
|
void |
stop()
Stops internal resources for load balancing.
|
byte[] sendJLupinInputParameterAndGetOutputParameterAsByteArrayWithSocketManaging(String microserviceName, byte[][] jlupinInputParameterAsByteArray, PortType portType) throws JLupinLoadBalancerException, JLupinNotConnectedWithServerException
JLupinInputParameter to provided microservice to provided
port.microserviceName - name of microservice to handle onSuccessjlupinInputParameterAsByteArray - serialized JLupinInputParameterportType - type of port on which send dataJLupinOutputParameterJLupinLoadBalancerException - on execution errorJLupinNotConnectedWithServerException - on connection errorSocket getOpenSocket(String microserviceName, PortType portType) throws JLupinNotConnectedWithServerException, com.jlupin.interfaces.balancer.exception.JLupinNoAvailableServerToConnectException
microserviceName - portType - JLupinNotConnectedWithServerExceptioncom.jlupin.interfaces.balancer.exception.JLupinNoAvailableServerToConnectExceptionOUTPUT sendAndReceiveWithoutSocketManaging(Socket clientSocket, INPUT input) throws JLupinLoadBalancerException
clientSocket - input - JLupinLoadBalancerExceptionIterator<Socket> getOpenedSocketIteratorToAllMicroservicesByName(String microserviceName, PortType portType)
microserviceName - String getName()
void start()
void stop()
int getHowOftenCheckingServerInMillis()
int getServerAmountBasedOnServiceRepository(String microserviceName)