Package org.hyperledger.fabric.sdk
Class EventHub
- java.lang.Object
 - 
- org.hyperledger.fabric.sdk.EventHub
 
 
- 
- All Implemented Interfaces:
 java.io.Serializable
public class EventHub extends java.lang.Object implements java.io.SerializableClass to manage fabric events.Feeds Channel event queues with events
- See Also:
 - Serialized Form
 
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceEventHub.EventHubDisconnectedEventhub disconnection notification interface 
- 
Field Summary
Fields Modifier and Type Field Description protected EventHub.EventHubDisconnecteddisconnectedHandlerDefault reconnect event hub implementation. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinalize()longgetConnectedTime()Get last connect time.longgetDisconnectedTime()Get disconnected time.longgetLastConnectedAttempt()Get last attempt time to connect the event hub.java.lang.StringgetName()Event hub namejava.util.PropertiesgetProperties()Event hub propertiesjava.lang.StringgetUrl()Get the GRPC URL used to connect.booleanisConnected()Is event hub connected.EventHub.EventHubDisconnectedsetEventHubDisconnectedHandler(EventHub.EventHubDisconnected newEventHubDisconnectedHandler)Set class to handle Event hub disconnectsvoidshutdown()java.lang.StringtoString() 
 - 
 
- 
- 
Field Detail
- 
disconnectedHandler
protected transient EventHub.EventHubDisconnected disconnectedHandler
Default reconnect event hub implementation. Applications are free to replace 
 - 
 
- 
Method Detail
- 
getDisconnectedTime
public long getDisconnectedTime()
Get disconnected time.- Returns:
 - Time in milli seconds disconnect occurred. Zero if never disconnected
 
 
- 
isConnected
public boolean isConnected()
Is event hub connected.- Returns:
 - boolean if true event hub is connected.
 
 
- 
getConnectedTime
public long getConnectedTime()
Get last connect time.- Returns:
 - Time in milli seconds the event hub last connected. Zero if never connected.
 
 
- 
getLastConnectedAttempt
public long getLastConnectedAttempt()
Get last attempt time to connect the event hub.- Returns:
 - Last attempt time to connect the event hub in milli seconds. Zero when never attempted.
 
 
- 
getName
public java.lang.String getName()
Event hub name- Returns:
 - event hub name
 
 
- 
getProperties
public java.util.Properties getProperties()
Event hub properties- Returns:
 - Event hub properties
 - See Also:
 HFClient.newEventHub(String, String, Properties)
 
- 
getUrl
public java.lang.String getUrl()
Get the GRPC URL used to connect.- Returns:
 - GRPC URL.
 
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
- 
shutdown
public void shutdown()
 
- 
setEventHubDisconnectedHandler
public EventHub.EventHubDisconnected setEventHubDisconnectedHandler(EventHub.EventHubDisconnected newEventHubDisconnectedHandler)
Set class to handle Event hub disconnects- Parameters:
 newEventHubDisconnectedHandler- New handler to replace. If set to null no retry will take place.- Returns:
 - the old handler.
 
 
- 
finalize
public void finalize() throws java.lang.Throwable- Overrides:
 finalizein classjava.lang.Object- Throws:
 java.lang.Throwable
 
 - 
 
 -