public class ProtocolV2HookChain extends java.lang.Object implements ProtocolV2Hook
ProtocolV2Hook that delegates to a list of
other hooks.
Hooks are run in the order passed to the constructor. If running a method on one hook throws an exception, execution of remaining hook methods is aborted.
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<? extends ProtocolV2Hook> |
hooks |
DEFAULT| Modifier | Constructor and Description |
|---|---|
private |
ProtocolV2HookChain(java.util.List<? extends ProtocolV2Hook> hooks) |
| Modifier and Type | Method and Description |
|---|---|
static ProtocolV2Hook |
newChain(java.util.List<? extends ProtocolV2Hook> hooks)
Create a new hook chaining the given hooks together.
|
void |
onCapabilities(CapabilitiesV2Request req) |
void |
onFetch(FetchV2Request req) |
void |
onLsRefs(LsRefsV2Request req) |
private final java.util.List<? extends ProtocolV2Hook> hooks
private ProtocolV2HookChain(java.util.List<? extends ProtocolV2Hook> hooks)
public static ProtocolV2Hook newChain(java.util.List<? extends ProtocolV2Hook> hooks)
hooks - hooks to execute, in order.public void onCapabilities(CapabilitiesV2Request req) throws ServiceMayNotContinueException
onCapabilities in interface ProtocolV2Hookreq - the capabilities requestServiceMayNotContinueException - abort; the message will be sent to the userpublic void onLsRefs(LsRefsV2Request req) throws ServiceMayNotContinueException
onLsRefs in interface ProtocolV2Hookreq - the ls-refs requestServiceMayNotContinueException - abort; the message will be sent to the userpublic void onFetch(FetchV2Request req) throws ServiceMayNotContinueException
onFetch in interface ProtocolV2Hookreq - the fetch requestServiceMayNotContinueException - abort; the message will be sent to the user