Jagger
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
com.griddynamics.jagger.invoker.v2.JHttpEndpoint.JHttpEndpoint ( URI  uri)

Parses given uri and sets JHttpEndpoint#protocol, JHttpEndpoint#hostname and JHttpEndpoint#port fields.

Parameters
uriURI to parse

Definition at line 55 of file JHttpEndpoint.java.

Referenced by com.griddynamics.jagger.invoker.v2.JHttpEndpoint.copyOf().

55  {
56  try {
57  URL url = uri.toURL();
58  } catch (MalformedURLException e) {
59  throw new IllegalArgumentException(e);
60  }
61 
62  if (equalsIgnoreCase(uri.getScheme(), HTTP.name())) {
63  this.protocol = HTTP;
64  this.port = HttpURL.DEFAULT_PORT;
65  } else if (equalsIgnoreCase(uri.getScheme(), HTTPS.name())) {
66  this.protocol = HTTPS;
67  this.port = HttpsURL.DEFAULT_PORT;
68  } else {
69  throw new IllegalArgumentException(format("Protocol of uri '%s' is unsupported!", uri));
70  }
71 
72  this.hostname = uri.getHost();
73  if (uri.getPort() > 0) {
74  this.port = uri.getPort();
75  }
76  }

Here is the caller graph for this function: