|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jgit.transport.RefAdvertiser
public abstract class RefAdvertiser
Support for the start of UploadPack
and ReceivePack
.
Nested Class Summary | |
---|---|
static class |
RefAdvertiser.PacketLineOutRefAdvertiser
Advertiser which frames lines in a PacketLineOut format. |
Constructor Summary | |
---|---|
RefAdvertiser()
|
Method Summary | |
---|---|
void |
advertiseCapability(String name)
Add one protocol capability to the initial advertisement. |
void |
advertiseHave(AnyObjectId id)
Advertise one object is available using the magic .have . |
void |
advertiseId(AnyObjectId id,
String refName)
Advertise one object under a specific name. |
protected abstract void |
end()
Mark the end of the advertisements. |
void |
init(Repository src)
Initialize this advertiser with a repository for peeling tags. |
boolean |
isEmpty()
|
Set<ObjectId> |
send(Map<String,Ref> refs)
Format an advertisement for the supplied refs. |
void |
setDerefTags(boolean deref)
Toggle tag peeling. |
protected abstract void |
writeOne(CharSequence line)
Write a single advertisement line. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RefAdvertiser()
Method Detail |
---|
public void init(Repository src)
src
- the repository to read from.public void setDerefTags(boolean deref)
This method must be invoked prior to any of the following:
deref
- true to show the dereferenced value of a tag as the special
ref $tag^{}
; false to omit it from the output.public void advertiseCapability(String name)
This method must be invoked prior to any of the following:
name
- the name of a single protocol capability supported by the
caller. The set of capabilities are sent to the client in the
advertisement, allowing the client to later selectively enable
features it recognizes.public Set<ObjectId> send(Map<String,Ref> refs) throws IOException
refs
- zero or more refs to format for the client. The collection is
sorted before display if necessary, and therefore may appear
in any order.
IOException
- the underlying output stream failed to write out an
advertisement record.public void advertiseHave(AnyObjectId id) throws IOException
.have
.
The magic .have
advertisement is not available for fetching by a
client, but can be used by a client when considering a delta base
candidate before transferring data in a push. Within the record created
by this method the ref name is simply the invalid string .have
.
id
- identity of the object that is assumed to exist.
IOException
- the underlying output stream failed to write out an
advertisement record.public boolean isEmpty()
public void advertiseId(AnyObjectId id, String refName) throws IOException
If the advertised object is a tag, this method does not advertise the peeled version of it.
id
- the object to advertise.refName
- name of the reference to advertise the object as, can be any
string not including the NUL byte.
IOException
- the underlying output stream failed to write out an
advertisement record.protected abstract void writeOne(CharSequence line) throws IOException
line
- the advertisement line to be written. The line always ends
with LF. Never null or the empty string.
IOException
- the underlying output stream failed to write out an
advertisement record.protected abstract void end() throws IOException
IOException
- the underlying output stream failed to write out an
advertisement record.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |