Package org.eclipse.jgit.transport
Class AbstractAdvertiseRefsHook
- java.lang.Object
-
- org.eclipse.jgit.transport.AbstractAdvertiseRefsHook
-
- All Implemented Interfaces:
AdvertiseRefsHook
public abstract class AbstractAdvertiseRefsHook extends Object implements AdvertiseRefsHook
Implementation ofAdvertiseRefsHook
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 Constructor Description AbstractAdvertiseRefsHook()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
advertiseRefs(ReceivePack receivePack)
Advertise refs for receive-pack.void
advertiseRefs(UploadPack uploadPack)
Advertise refs for upload-pack.protected Set<ObjectId>
getAdvertisedHaves(Repository repository, RevWalk revWalk)
Get the additional haves to advertise.protected abstract Map<String,Ref>
getAdvertisedRefs(Repository repository, RevWalk revWalk)
Get the refs to advertise.
-
-
-
Method Detail
-
advertiseRefs
public void advertiseRefs(UploadPack uploadPack) throws ServiceMayNotContinueException
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
public void advertiseRefs(ReceivePack receivePack) throws IOException
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.IOException
-
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.
-
-