@NotThreadSafe public abstract class SbcEvent extends org.apache.kafka.queue.EventQueue.FailureLoggingEvent
Modifier and Type | Class and Description |
---|---|
protected static class |
SbcEvent.SbcEventHandlerResult
A simple class to represent the success/failure of event handlers.
|
Modifier and Type | Field and Description |
---|---|
protected SbcContext |
eventContext |
protected static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
SbcEvent(SbcContext context) |
Modifier and Type | Method and Description |
---|---|
protected abstract SbcEvent.SbcEventHandlerResult |
handleEvent()
The "business logic" of an SbcEvent.
|
protected org.slf4j.event.Level |
logLevel()
Denotes the log level that will be used to log any common logs as part of this event processing.
|
String |
name()
The name of the event.
|
protected abstract void |
respondToClient(org.apache.kafka.common.requests.ApiError error,
SbcEvent.SbcEventHandlerResult result)
This method is invoked when an operation completes (the
SbcEvent.SbcEventHandlerResult does not indicate that any resources are needed
to continue. |
void |
run()
Concrete, final implementation of Event.run().
|
String |
toString()
A simple toString which just returns the name of the event.
|
protected static final org.slf4j.Logger LOG
protected SbcContext eventContext
public SbcEvent(SbcContext context)
public String name()
@Nonnull protected abstract SbcEvent.SbcEventHandlerResult handleEvent() throws Exception
Exception
protected abstract void respondToClient(org.apache.kafka.common.requests.ApiError error, SbcEvent.SbcEventHandlerResult result)
SbcEvent.SbcEventHandlerResult
does not indicate that any resources are needed
to continue. Events which need to respond to clients via a client callback will respond here.error
- the ApiError value for success or failure. handleEvent operations which completed normally will have a result of ApiError.NONE.result
- The SbcEventHandlerResult which was returned from handleEvent()
}.public final void run() throws InterruptedException
handleEvent()
.InterruptedException
protected org.slf4j.event.Level logLevel()
public String toString()
toString
in class org.apache.kafka.queue.EventQueue.FailureLoggingEvent