Package org.eclipse.jgit.transport
Class OperationResult
java.lang.Object
org.eclipse.jgit.transport.OperationResult
- Direct Known Subclasses:
FetchResult
,PushResult
Class holding result of operation on remote repository. This includes refs
advertised by remote repo and local tracking refs updates.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) StringBuilder
(package private) String
(package private) final SortedMap
<String, TrackingRefUpdate> (package private) URIish
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
(package private) void
addMessages
(String msg) final Ref
getAdvertisedRef
(String name) Get a single advertised ref by name.Get the complete list of refs advertised by the remote.Get the additional messages, if any, returned by the remote process.Get the user agent advertised by the peer server, if available.getTrackingRefUpdate
(String localName) Get the status for a specific local tracking ref update.Get the status of all local tracking refs that were updated.getURI()
Get the URI this result came from.(package private) void
setAdvertisedRefs
(URIish u, Map<String, Ref> ar)
-
Field Details
-
advertisedRefs
-
uri
URIish uri -
updates
-
messageBuffer
StringBuilder messageBuffer -
peerUserAgent
String peerUserAgent
-
-
Constructor Details
-
OperationResult
public OperationResult()
-
-
Method Details
-
getURI
Get the URI this result came from.Each transport instance connects to at most one URI at any point in time.
- Returns:
- the URI describing the location of the remote repository.
-
getAdvertisedRefs
Get the complete list of refs advertised by the remote.The returned refs may appear in any order. If the caller needs these to be sorted, they should be copied into a new array or List and then sorted by the caller as necessary.
- Returns:
- available/advertised refs. Never null. Not modifiable. The collection can be empty if the remote side has no refs (it is an empty/newly created repository).
-
getAdvertisedRef
Get a single advertised ref by name.The name supplied should be valid ref name. To get a peeled value for a ref (aka
refs/tags/v1.0^{}
) use the base name (without the^{}
suffix) and look at the peeled object id.- Parameters:
name
- name of the ref to obtain.- Returns:
- the requested ref; null if the remote did not advertise this ref.
-
getTrackingRefUpdates
Get the status of all local tracking refs that were updated.- Returns:
- unmodifiable collection of local updates. Never null. Empty if there were no local tracking refs updated.
-
getTrackingRefUpdate
Get the status for a specific local tracking ref update.- Parameters:
localName
- name of the local ref (e.g. "refs/remotes/origin/master").- Returns:
- status of the local ref; null if this local ref was not touched during this operation.
-
setAdvertisedRefs
-
add
-
getMessages
Get the additional messages, if any, returned by the remote process.These messages are most likely informational or error messages, sent by the remote peer, to help the end-user correct any problems that may have prevented the operation from completing successfully. Application UIs should try to show these in an appropriate context.
- Returns:
- the messages returned by the remote, most likely terminated by a newline (LF) character. The empty string is returned if the remote produced no additional messages.
-
addMessages
-
getPeerUserAgent
Get the user agent advertised by the peer server, if available.- Returns:
- advertised user agent, e.g.
"JGit/4.0"
. Null if the peer did not advertise version information. - Since:
- 4.0
-