Package com.launchdarkly.eventsource
Class FaultEvent
- java.lang.Object
-
- com.launchdarkly.eventsource.FaultEvent
-
- All Implemented Interfaces:
StreamEvent
public final class FaultEvent extends java.lang.Object implements StreamEvent
Describes a failure in the stream.When an error occurs, if the configured
ErrorStrategyreturnsErrorStrategy.Action.CONTINUE,EventSource.readAnyEvent()andEventSource.anyEvents()will return a FaultEvent. Otherwise, the error would instead be thrown as aStreamException.If you receive a FaultEvent, the EventSource is now in an inactive state since either a connection attempt has failed or an existing connection has been closed. EventSource will attempt to reconnect if you either call
EventSource.start()or simply continue reading events after this point.- Since:
- 4.0.0
- See Also:
StartedEvent
-
-
Constructor Summary
Constructors Constructor Description FaultEvent(StreamException cause)Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)StreamExceptiongetCause()Returns aStreamExceptiondescribing the cause of the failure.inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
FaultEvent
public FaultEvent(StreamException cause)
Creates an instance.- Parameters:
cause- the cause of the failure
-
-
Method Detail
-
getCause
public StreamException getCause()
Returns aStreamExceptiondescribing the cause of the failure.- Returns:
- the cause of the failure
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-