Java Code Examples for com.alibaba.dubbo.registry.common.util.Tool#sortSimpleName()

The following examples show how to use com.alibaba.dubbo.registry.common.util.Tool#sortSimpleName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Loadbalances.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public void add(Map<String, Object> context) {
    String service = (String)context.get("service");
    if (service != null && service.length() > 0 && !service.contains("*")) {
        List<Provider> providerList = providerService.findByService(service);
        List<String> addressList = new ArrayList<String>();
        for(Provider provider : providerList){
            addressList.add(provider.getUrl().split("://")[1].split("/")[0]);
        }
        context.put("addressList", addressList);
        context.put("service", service);
        context.put("methods", CollectionUtils.sort(providerService.findMethodsByService(service)));
    } else {
        List<String> serviceList = Tool.sortSimpleName(providerService.findServices());
        context.put("serviceList", serviceList);
    }
    if(context.get("input") != null) context.put("input", context.get("input"));
}
 
Example 2
Source File: Weights.java    From dubbox with Apache License 2.0 6 votes vote down vote up
/**
 * load页面供新增操作
 * @param context
 */
public void add(Map<String, Object> context) {
    String service = (String)context.get("service");
    if (service != null && service.length() > 0 && !service.contains("*")) {
        List<Provider> providerList = providerService.findByService(service);
        List<String> addressList = new ArrayList<String>();
        for(Provider provider : providerList){
            addressList.add(provider.getUrl().split("://")[1].split("/")[0]);
        }
        context.put("addressList", addressList);
        context.put("service", service);
        context.put("methods", CollectionUtils.sort(providerService.findMethodsByService(service)));
    } else {
        List<String> serviceList = Tool.sortSimpleName(providerService.findServices());
        context.put("serviceList", serviceList);
    }
    if(context.get("input") != null) context.put("input", context.get("input"));
}
 
Example 3
Source File: Providers.java    From dubbox with Apache License 2.0 6 votes vote down vote up
/**
   * 装载新增服务页面,获取所有的服务名称
   * @param context
   */
  public void add(Long id, Map<String, Object> context) {
  	if (context.get("service") == null) {
  		List<String> serviceList = Tool.sortSimpleName(new ArrayList<String>(providerService.findServices()));
  		context.put("serviceList", serviceList);
  	}
if (id != null) {
	Provider p = providerService.findProvider(id);
       if (p != null) {
       	context.put("provider", p);
		String parameters = p.getParameters();
		if (parameters != null && parameters.length() > 0) {
			Map<String, String> map = StringUtils.parseQueryString(parameters);
			map.put("timestamp", String.valueOf(System.currentTimeMillis()));
			map.remove("pid");
			p.setParameters(StringUtils.toQueryString(map));
		}
	}
}
  }
 
Example 4
Source File: Loadbalances.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public void add(Map<String, Object> context) {
    String service = (String)context.get("service");
    if (service != null && service.length() > 0 && !service.contains("*")) {
        List<Provider> providerList = providerService.findByService(service);
        List<String> addressList = new ArrayList<String>();
        for(Provider provider : providerList){
            addressList.add(provider.getUrl().split("://")[1].split("/")[0]);
        }
        context.put("addressList", addressList);
        context.put("service", service);
        context.put("methods", CollectionUtils.sort(providerService.findMethodsByService(service)));
    } else {
        List<String> serviceList = Tool.sortSimpleName(providerService.findServices());
        context.put("serviceList", serviceList);
    }
    if(context.get("input") != null) context.put("input", context.get("input"));
}
 
Example 5
Source File: Weights.java    From dubbox with Apache License 2.0 6 votes vote down vote up
/**
 * load页面供新增操作
 * @param context
 */
public void add(Map<String, Object> context) {
    String service = (String)context.get("service");
    if (service != null && service.length() > 0 && !service.contains("*")) {
        List<Provider> providerList = providerService.findByService(service);
        List<String> addressList = new ArrayList<String>();
        for(Provider provider : providerList){
            addressList.add(provider.getUrl().split("://")[1].split("/")[0]);
        }
        context.put("addressList", addressList);
        context.put("service", service);
        context.put("methods", CollectionUtils.sort(providerService.findMethodsByService(service)));
    } else {
        List<String> serviceList = Tool.sortSimpleName(providerService.findServices());
        context.put("serviceList", serviceList);
    }
    if(context.get("input") != null) context.put("input", context.get("input"));
}
 
Example 6
Source File: Loadbalances.java    From dubbox-hystrix with Apache License 2.0 6 votes vote down vote up
public void add(Map<String, Object> context) {
    String service = (String)context.get("service");
    if (service != null && service.length() > 0 && !service.contains("*")) {
        List<Provider> providerList = providerService.findByService(service);
        List<String> addressList = new ArrayList<String>();
        for(Provider provider : providerList){
            addressList.add(provider.getUrl().split("://")[1].split("/")[0]);
        }
        context.put("addressList", addressList);
        context.put("service", service);
        context.put("methods", CollectionUtils.sort(providerService.findMethodsByService(service)));
    } else {
        List<String> serviceList = Tool.sortSimpleName(providerService.findServices());
        context.put("serviceList", serviceList);
    }
    if(context.get("input") != null) context.put("input", context.get("input"));
}
 
Example 7
Source File: Providers.java    From dubbox-hystrix with Apache License 2.0 6 votes vote down vote up
/**
   * 装载新增服务页面,获取所有的服务名称
   * @param context
   */
  public void add(Long id, Map<String, Object> context) {
  	if (context.get("service") == null) {
  		List<String> serviceList = Tool.sortSimpleName(new ArrayList<String>(providerService.findServices()));
  		context.put("serviceList", serviceList);
  	}
if (id != null) {
	Provider p = providerService.findProvider(id);
       if (p != null) {
       	context.put("provider", p);
		String parameters = p.getParameters();
		if (parameters != null && parameters.length() > 0) {
			Map<String, String> map = StringUtils.parseQueryString(parameters);
			map.put("timestamp", String.valueOf(System.currentTimeMillis()));
			map.remove("pid");
			p.setParameters(StringUtils.toQueryString(map));
		}
	}
}
  }
 
Example 8
Source File: Routes.java    From dubbox-hystrix with Apache License 2.0 5 votes vote down vote up
/**
 * 载入新增路由页面
 * @param context
 */
public void add(Map<String, Object> context) {
    String service = (String)context.get("service");
    if (service != null && service.length() > 0 && !service.contains("*")) {
        context.put("service", service);
        context.put("methods", CollectionUtils.sort(new ArrayList<String>(providerService.findMethodsByService(service))));
    } else {
        List<String> serviceList = Tool.sortSimpleName(new ArrayList<String>(providerService.findServices()));
        context.put("serviceList", serviceList);
    }
    
    if(context.get("input") != null) context.put("input", context.get("input"));
    
}
 
Example 9
Source File: Routes.java    From dubbo3 with Apache License 2.0 5 votes vote down vote up
/**
 * 载入新增路由页面
 * @param context
 */
public void add(Map<String, Object> context) {
    String service = (String)context.get("service");
    if (service != null && service.length() > 0 && !service.contains("*")) {
        context.put("service", service);
        context.put("methods", CollectionUtils.sort(new ArrayList<String>(providerService.findMethodsByService(service))));
    } else {
        List<String> serviceList = Tool.sortSimpleName(new ArrayList<String>(providerService.findServices()));
        context.put("serviceList", serviceList);
    }
    
    if(context.get("input") != null) context.put("input", context.get("input"));
    
}
 
Example 10
Source File: Owners.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public void add(Map<String, Object> context) {
	String service = (String) context.get("service");
	if (service == null || service.length() == 0) {
           List<String> serviceList = Tool.sortSimpleName(new ArrayList<String>(providerService.findServices()));
           context.put("serviceList", serviceList);
       }
}
 
Example 11
Source File: Routes.java    From dubbox with Apache License 2.0 5 votes vote down vote up
/**
 * 载入新增路由页面
 * @param context
 */
public void add(Map<String, Object> context) {
    String service = (String)context.get("service");
    if (service != null && service.length() > 0 && !service.contains("*")) {
        context.put("service", service);
        context.put("methods", CollectionUtils.sort(new ArrayList<String>(providerService.findMethodsByService(service))));
    } else {
        List<String> serviceList = Tool.sortSimpleName(new ArrayList<String>(providerService.findServices()));
        context.put("serviceList", serviceList);
    }
    
    if(context.get("input") != null) context.put("input", context.get("input"));
    
}
 
Example 12
Source File: Owners.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public void add(Map<String, Object> context) {
	String service = (String) context.get("service");
	if (service == null || service.length() == 0) {
           List<String> serviceList = Tool.sortSimpleName(new ArrayList<String>(providerService.findServices()));
           context.put("serviceList", serviceList);
       }
}
 
Example 13
Source File: Routes.java    From dubbox with Apache License 2.0 5 votes vote down vote up
/**
 * 载入新增路由页面
 * @param context
 */
public void add(Map<String, Object> context) {
    String service = (String)context.get("service");
    if (service != null && service.length() > 0 && !service.contains("*")) {
        context.put("service", service);
        context.put("methods", CollectionUtils.sort(new ArrayList<String>(providerService.findMethodsByService(service))));
    } else {
        List<String> serviceList = Tool.sortSimpleName(new ArrayList<String>(providerService.findServices()));
        context.put("serviceList", serviceList);
    }
    
    if(context.get("input") != null) context.put("input", context.get("input"));
    
}
 
Example 14
Source File: Owners.java    From dubbox-hystrix with Apache License 2.0 5 votes vote down vote up
public void add(Map<String, Object> context) {
	String service = (String) context.get("service");
	if (service == null || service.length() == 0) {
           List<String> serviceList = Tool.sortSimpleName(new ArrayList<String>(providerService.findServices()));
           context.put("serviceList", serviceList);
       }
}
 
Example 15
Source File: Owners.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public void add(Map<String, Object> context) {
	String service = (String) context.get("service");
	if (service == null || service.length() == 0) {
           List<String> serviceList = Tool.sortSimpleName(new ArrayList<String>(providerService.findServices()));
           context.put("serviceList", serviceList);
       }
}
 
Example 16
Source File: Weights.java    From dubbox with Apache License 2.0 4 votes vote down vote up
/**
 * load页面供新增操作
 * @param context
 */
public void multiadd(Map<String, Object> context) {
    List<String> serviceList = Tool.sortSimpleName(providerService.findServices());
    context.put("serviceList", serviceList);
}
 
Example 17
Source File: Weights.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
/**
 * load页面供新增操作
 * @param context
 */
public void multiadd(Map<String, Object> context) {
    List<String> serviceList = Tool.sortSimpleName(providerService.findServices());
    context.put("serviceList", serviceList);
}
 
Example 18
Source File: Weights.java    From dubbox with Apache License 2.0 4 votes vote down vote up
/**
 * load页面供新增操作
 * @param context
 */
public void multiadd(Map<String, Object> context) {
    List<String> serviceList = Tool.sortSimpleName(providerService.findServices());
    context.put("serviceList", serviceList);
}
 
Example 19
Source File: Accesses.java    From dubbox with Apache License 2.0 4 votes vote down vote up
public void add(Map<String, Object> context) {
    List<String> serviceList = Tool.sortSimpleName(providerService.findServices());
    context.put("serviceList", serviceList);
}
 
Example 20
Source File: Accesses.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
public void add(Map<String, Object> context) {
    List<String> serviceList = Tool.sortSimpleName(providerService.findServices());
    context.put("serviceList", serviceList);
}