Helix Server addresses, URIs, and properties

P4Java uses a URI string format to specify the network location of target Helix Servers. This URI string format is described in detail in the server factory documentation, but it always includes at least the server’s hostname and port number, and a scheme part that indicates a P4Java connection (for example, p4java://localhost:1666). Note that:

  • P4Java does not obtain default values from the execution environment or other sources for any part of the URI string. All non-optional parts of the URI must be filled in. (For example, P4Java does not attempt to retrieve the value of P4PORT from a Unix or Linux environment to complete a URL with a missing port number.)
  • P4Java’s factory methods allow you to pass properties into the IOptionsServer object in the server’s URI string as query parts that override any properties that are passed in through the normal properties parameter in the server factory getServer method. This feature is somewhat limited in that it doesn’t currently implement URI escape sequence parsing in the query string, but it can be very convenient for properties passing. See P4Java properties for an explanation.