public static String toRoutePath(GrpcURL url) { String name = url.getServiceInterface(); String group = url.getGroup(); return Constants.CONSUL_SERVICE_PRE + group + Constants.PATH_SEPARATOR + name; }
public String toIdentityString() { if (identity != null) { return identity; } return identity = buildString(true, false); // only return identity message, see the method "equals" and // "hashCode" }
public String toParameterString() { if (parameter != null) { return parameter; } return parameter = toParameterString(new String[0]); }
private static String toServicePath(GrpcURL url) { String name = url.getServiceInterface(); String group = url.getGroup(); return group + Constants.PATH_SEPARATOR + GrpcURL.encode(name); }
public Statistics(GrpcURL url){ this.url = url; this.application = url.getParameter(MonitorService.APPLICATION); this.service = url.getParameter(MonitorService.INTERFACE); this.method = url.getParameter(MonitorService.METHOD); this.group = url.getParameter(MonitorService.GROUP); this.version = url.getParameter(MonitorService.VERSION); this.client = url.getParameter(MonitorService.CONSUMER, url.getAddress()); this.server = url.getParameter(MonitorService.PROVIDER, url.getAddress()); }
public String getVersion() { String group = getParameter(Constants.VERSION_KEY, Constants.DEFAULT_VERSION); return group; }
@Override public String getServiceName() { return refUrl.getServiceInterface(); }
public GrpcURL setProtocol(String protocol) { return new GrpcURL(protocol, username, password, host, port, path, getParameters()); }
public RouterLookUper(GrpcURL url) { this.url = url; this.serviceKey = url.getServiceKey(); }
@Override protected RpcContext initialValue() { return new RpcContext(); } };
@Override public String toString() { return url.toString(); }
public String getGroup() { String group = getParameter(Constants.GROUP_KEY, Constants.DEFAULT_GROUP); return group; }
@Override public String getServiceName() { return refUrl.getServiceInterface(); }
public GrpcURL setPassword(String password) { return new GrpcURL(protocol, username, password, host, port, path, getParameters()); }
public String toFullString() { if (full != null) { return full; } return full = buildString(true, true); }
public String getServiceInterface() { return getParameter(Constants.INTERFACE_KEY, path); }
public GrpcURL setHost(String host) { return new GrpcURL(protocol, username, password, host, port, path, getParameters()); }
public String toString() { if (string != null) { return string; } return string = buildString(false, true); // no show username and password }
public String toIdentityString(String... parameters) { return buildString(true, false, parameters); // only return identity message, see the method "equals" and // "hashCode" }
public String toServiceString() { return buildString(true, false, true, true); }