Package org.eclipse.jgit.transport
Class AbstractAdvertiseRefsHook
java.lang.Object
org.eclipse.jgit.transport.AbstractAdvertiseRefsHook
- All Implemented Interfaces:
AdvertiseRefsHook
Implementation of
AdvertiseRefsHook
that advertises the same refs for
upload-pack and receive-pack.- Since:
- 2.0
-
Field Summary
Fields inherited from interface org.eclipse.jgit.transport.AdvertiseRefsHook
DEFAULT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
advertiseRefs
(ReceivePack receivePack) Advertise refs for receive-pack.void
advertiseRefs
(UploadPack uploadPack) Advertise refs for upload-pack.getAdvertisedHaves
(Repository repository, RevWalk revWalk) Get the additional haves to advertise.getAdvertisedRefs
(Repository repository, RevWalk revWalk) Get the refs to advertise.
-
Constructor Details
-
AbstractAdvertiseRefsHook
public AbstractAdvertiseRefsHook()
-
-
Method Details
-
advertiseRefs
Advertise refs for upload-pack.- Specified by:
advertiseRefs
in interfaceAdvertiseRefsHook
- Parameters:
uploadPack
- instance on which to callUploadPack.setAdvertisedRefs(java.util.Map)
if necessary.- Throws:
ServiceMayNotContinueException
- abort; the message will be sent to the user.
-
advertiseRefs
Advertise refs for receive-pack.- Specified by:
advertiseRefs
in interfaceAdvertiseRefsHook
- Parameters:
receivePack
- instance on which to callReceivePack.setAdvertisedRefs(java.util.Map,java.util.Set)
if necessary.- Throws:
ServiceMayNotContinueException
- abort; the message will be sent to the user.
-
getAdvertisedRefs
protected abstract Map<String,Ref> getAdvertisedRefs(Repository repository, RevWalk revWalk) throws ServiceMayNotContinueException Get the refs to advertise.- Parameters:
repository
- repository instance.revWalk
- open rev walk on the repository.- Returns:
- set of refs to advertise.
- Throws:
ServiceMayNotContinueException
- abort; the message will be sent to the user.
-
getAdvertisedHaves
protected Set<ObjectId> getAdvertisedHaves(Repository repository, RevWalk revWalk) throws ServiceMayNotContinueException Get the additional haves to advertise.- Parameters:
repository
- repository instance.revWalk
- open rev walk on the repository.- Returns:
- set of additional haves; see
ReceivePack.getAdvertisedObjects()
. - Throws:
ServiceMayNotContinueException
- abort; the message will be sent to the user.
-