Class CommonGrpcClient
- java.lang.Object
-
- es.bsc.dataclay.communication.grpc.clients.CommonGrpcClient
-
public final class CommonGrpcClient extends Object
Class containing common methods for GRPC clients.
-
-
Field Summary
Fields Modifier and Type Field Description protected static boolean
DEBUG_ENABLED
Indicates if debug is enabled.static io.grpc.Metadata.Key<String>
SERVICE_ALIAS_HEADER_KEY
Custom header key.
-
Constructor Summary
Constructors Constructor Description CommonGrpcClient(String hostName)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finishClientConnections()
Finish client connections.DataServiceAPI
getDataServiceAPI(String targetIP, int targetPort)
Get a Netty DataService APILogicModuleAPI
getLogicModuleAPI(String targetIP, int targetPort)
Get a Netty Logic Module APIvoid
registerPendingObjects()
Wait to process all pending objects.void
waitAndProcessAllAsyncRequests()
Wait to process all async requests.
-
-
-
Field Detail
-
DEBUG_ENABLED
protected static final boolean DEBUG_ENABLED
Indicates if debug is enabled.
-
SERVICE_ALIAS_HEADER_KEY
public static final io.grpc.Metadata.Key<String> SERVICE_ALIAS_HEADER_KEY
Custom header key.
-
-
Constructor Detail
-
CommonGrpcClient
public CommonGrpcClient(String hostName) throws InterruptedException
Constructor.- Parameters:
hostName
- Name of the origin host- Throws:
InterruptedException
- If connection was interrupted
-
-
Method Detail
-
getLogicModuleAPI
public LogicModuleAPI getLogicModuleAPI(String targetIP, int targetPort) throws InterruptedException
Get a Netty Logic Module API- Parameters:
targetIP
- IP of the servertargetPort
- Port of the server- Returns:
- A new TCPLogicModuleAPI
- Throws:
InterruptedException
- If connection was interrupted
-
getDataServiceAPI
public DataServiceAPI getDataServiceAPI(String targetIP, int targetPort) throws InterruptedException
Get a Netty DataService API- Parameters:
targetIP
- IP of the servertargetPort
- Port of the server- Returns:
- A new DataServiceAPI
- Throws:
InterruptedException
- If connection was interrupted
-
finishClientConnections
public void finishClientConnections()
Finish client connections.
-
waitAndProcessAllAsyncRequests
public void waitAndProcessAllAsyncRequests()
Wait to process all async requests.
-
registerPendingObjects
public void registerPendingObjects()
Wait to process all pending objects.
-
-