Package org.eclipse.jgit.transport
Class ProtocolV2HookChain
- java.lang.Object
-
- org.eclipse.jgit.transport.ProtocolV2HookChain
-
- All Implemented Interfaces:
ProtocolV2Hook
public class ProtocolV2HookChain extends 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.
- Since:
- 5.5
-
-
Field Summary
-
Fields inherited from interface org.eclipse.jgit.transport.ProtocolV2Hook
DEFAULT
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ProtocolV2Hook
newChain(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)
void
onObjectInfo(ObjectInfoRequest req)
-
-
-
Method Detail
-
newChain
public static ProtocolV2Hook newChain(List<? extends ProtocolV2Hook> hooks)
Create a new hook chaining the given hooks together.- Parameters:
hooks
- hooks to execute, in order.- Returns:
- a new hook chain of the given hooks.
-
onCapabilities
public void onCapabilities(CapabilitiesV2Request req) throws ServiceMayNotContinueException
- Specified by:
onCapabilities
in interfaceProtocolV2Hook
- Parameters:
req
- the capabilities request- Throws:
ServiceMayNotContinueException
- abort; the message will be sent to the user
-
onLsRefs
public void onLsRefs(LsRefsV2Request req) throws ServiceMayNotContinueException
- Specified by:
onLsRefs
in interfaceProtocolV2Hook
- Parameters:
req
- the ls-refs request- Throws:
ServiceMayNotContinueException
- abort; the message will be sent to the user
-
onFetch
public void onFetch(FetchV2Request req) throws ServiceMayNotContinueException
- Specified by:
onFetch
in interfaceProtocolV2Hook
- Parameters:
req
- the fetch request- Throws:
ServiceMayNotContinueException
- abort; the message will be sent to the user
-
onObjectInfo
public void onObjectInfo(ObjectInfoRequest req) throws ServiceMayNotContinueException
- Specified by:
onObjectInfo
in interfaceProtocolV2Hook
- Parameters:
req
- the object-info request- Throws:
ServiceMayNotContinueException
- abort; the message will be sent to the user
-
-