Class FirstWant

  • public class FirstWant
    extends Object
    In the pack negotiation phase (protocol v0/v1), the client sends a list of wants. The first "want" line is special, as it (can) have a list of capabilities appended. E.g. "want oid cap1 cap2 cap3" Do not confuse this line with the first one in the reference advertisement, which is sent by the server, looks like "b8f7c471373b8583ced0025cfad8c9916c484b76 HEAD\0 cap1 cap2 cap3" and is parsed by the BasePackConnection.readAdvertisedRefs method. This class parses the input want line and holds the results: the actual want line and the capabilities.
    • Method Detail

      • fromLine

        public static FirstWant fromLine​(String line)
                                  throws PackProtocolException
        Parse the first want line in the protocol v0/v1 pack negotiation.
        line - line from the client.
        an instance of FirstWant
        PackProtocolException - if the line doesn't follow the protocol format.
      • getLine

        public String getLine()
        non-capabilities part of the line.
      • getCapabilities

        public Set<String> getCapabilities()
        capabilities parsed from the line as an immutable set (excluding agent).
      • getAgent

        public String getAgent()
        client user agent parsed from the line.