public static URL buildUrl ( ConsulService service ) { URL url = null ; if ( url == null ) { Map < String , String > params = new HashMap < String , String > ( ) ; //String group = service.getName(); //params.put(URLParamType.group.getName(), group); //params.put(URLParamType.nodeType.getName(), Constants.NODE_TYPE_SERVICE); if ( ! service . getTags ( ) . isEmpty ( ) ) { params . put ( URLParamType . environment . getName ( ) , service . getTags ( ) . get ( 0 ) ) ; } url = new URLImpl ( ConsulConstants . DEFAULT_PROTOCOL , service . getAddress ( ) , service . getPort ( ) , ConsulUtils . getPathFromServiceId ( service . getId ( ) ) , params ) ; } return url ; }
build url from service