Java Code Examples for com.alibaba.dubbo.registry.common.domain.Provider#setUrl()
The following examples show how to use
com.alibaba.dubbo.registry.common.domain.Provider#setUrl() .
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: Providers.java From dubbox with Apache License 2.0 | 6 votes |
public boolean create(Provider provider, Map<String, Object> context) { String service = provider.getService(); if (!super.currentUser.hasServicePrivilege(service)) { context.put("message", getMessage("HaveNoServicePrivilege", service)); return false; } if (provider.getParameters() == null) { String url = provider.getUrl(); if (url != null) { int i = url.indexOf('?'); if (i > 0) { provider.setUrl(url.substring(0, i)); provider.setParameters(url.substring(i + 1)); } } } provider.setDynamic(false); // 页面上添加的一定是静态的Provider providerService.create(provider); return true; }
Example 2
Source File: SyncUtils.java From dubbox with Apache License 2.0 | 6 votes |
public static Provider url2Provider(Pair<Long, URL> pair) { if (pair == null) { return null; } Long id = pair.getKey(); URL url = pair.getValue(); if (url == null) return null; Provider p = new Provider(); p.setId(id); p.setService(url.getServiceKey()); p.setAddress(url.getAddress()); p.setApplication(url.getParameter(Constants.APPLICATION_KEY)); p.setUrl(url.toIdentityString()); p.setParameters(url.toParameterString()); p.setDynamic(url.getParameter("dynamic", true)); p.setEnabled(url.getParameter(Constants.ENABLED_KEY, true)); p.setWeight(url.getParameter(Constants.WEIGHT_KEY, Constants.DEFAULT_WEIGHT)); p.setUsername(url.getParameter("owner")); return p; }
Example 3
Source File: Providers.java From dubbox-hystrix with Apache License 2.0 | 6 votes |
public boolean create(Provider provider, Map<String, Object> context) { String service = provider.getService(); if (!super.currentUser.hasServicePrivilege(service)) { context.put("message", getMessage("HaveNoServicePrivilege", service)); return false; } if (provider.getParameters() == null) { String url = provider.getUrl(); if (url != null) { int i = url.indexOf('?'); if (i > 0) { provider.setUrl(url.substring(0, i)); provider.setParameters(url.substring(i + 1)); } } } provider.setDynamic(false); // 页面上添加的一定是静态的Provider providerService.create(provider); return true; }
Example 4
Source File: SyncUtils.java From dubbox-hystrix with Apache License 2.0 | 6 votes |
public static Provider url2Provider(Pair<Long, URL> pair) { if (pair == null) { return null; } Long id = pair.getKey(); URL url = pair.getValue(); if (url == null) return null; Provider p = new Provider(); p.setId(id); p.setService(url.getServiceKey()); p.setAddress(url.getAddress()); p.setApplication(url.getParameter(Constants.APPLICATION_KEY)); p.setUrl(url.toIdentityString()); p.setParameters(url.toParameterString()); p.setDynamic(url.getParameter("dynamic", true)); p.setEnabled(url.getParameter(Constants.ENABLED_KEY, true)); p.setWeight(url.getParameter(Constants.WEIGHT_KEY, Constants.DEFAULT_WEIGHT)); p.setUsername(url.getParameter("owner")); return p; }
Example 5
Source File: Providers.java From dubbo3 with Apache License 2.0 | 6 votes |
public boolean create(Provider provider, Map<String, Object> context) { String service = provider.getService(); if (!super.currentUser.hasServicePrivilege(service)) { context.put("message", getMessage("HaveNoServicePrivilege", service)); return false; } if (provider.getParameters() == null) { String url = provider.getUrl(); if (url != null) { int i = url.indexOf('?'); if (i > 0) { provider.setUrl(url.substring(0, i)); provider.setParameters(url.substring(i + 1)); } } } provider.setDynamic(false); // 页面上添加的一定是静态的Provider providerService.create(provider); return true; }
Example 6
Source File: SyncUtils.java From dubbo3 with Apache License 2.0 | 6 votes |
public static Provider url2Provider(Pair<Long, URL> pair) { if (pair == null) { return null; } Long id = pair.getKey(); URL url = pair.getValue(); if (url == null) return null; Provider p = new Provider(); p.setId(id); p.setService(url.getServiceKey()); p.setAddress(url.getAddress()); p.setApplication(url.getParameter(Constants.APPLICATION_KEY)); p.setUrl(url.toIdentityString()); p.setParameters(url.toParameterString()); p.setDynamic(url.getParameter("dynamic", true)); p.setEnabled(url.getParameter(Constants.ENABLED_KEY, true)); p.setWeight(url.getParameter(Constants.WEIGHT_KEY, Constants.DEFAULT_WEIGHT)); p.setUsername(url.getParameter("owner")); return p; }
Example 7
Source File: Providers.java From dubbox with Apache License 2.0 | 6 votes |
public boolean create(Provider provider, Map<String, Object> context) { String service = provider.getService(); if (!super.currentUser.hasServicePrivilege(service)) { context.put("message", getMessage("HaveNoServicePrivilege", service)); return false; } if (provider.getParameters() == null) { String url = provider.getUrl(); if (url != null) { int i = url.indexOf('?'); if (i > 0) { provider.setUrl(url.substring(0, i)); provider.setParameters(url.substring(i + 1)); } } } provider.setDynamic(false); // 页面上添加的一定是静态的Provider providerService.create(provider); return true; }
Example 8
Source File: SyncUtils.java From dubbox with Apache License 2.0 | 6 votes |
public static Provider url2Provider(Pair<Long, URL> pair) { if (pair == null) { return null; } Long id = pair.getKey(); URL url = pair.getValue(); if (url == null) return null; Provider p = new Provider(); p.setId(id); p.setService(url.getServiceKey()); p.setAddress(url.getAddress()); p.setApplication(url.getParameter(Constants.APPLICATION_KEY)); p.setUrl(url.toIdentityString()); p.setParameters(url.toParameterString()); p.setDynamic(url.getParameter("dynamic", true)); p.setEnabled(url.getParameter(Constants.ENABLED_KEY, true)); p.setWeight(url.getParameter(Constants.WEIGHT_KEY, Constants.DEFAULT_WEIGHT)); p.setUsername(url.getParameter("owner")); return p; }
Example 9
Source File: Providers.java From dubbox with Apache License 2.0 | 6 votes |
public boolean create(Provider provider, Map<String, Object> context) { String service = provider.getService(); if (!super.currentUser.hasServicePrivilege(service)) { context.put("message", getMessage("HaveNoServicePrivilege", service)); return false; } if (provider.getParameters() == null) { String url = provider.getUrl(); if (url != null) { int i = url.indexOf('?'); if (i > 0) { provider.setUrl(url.substring(0, i)); provider.setParameters(url.substring(i + 1)); } } } provider.setDynamic(false); // 页面上添加的一定是静态的Provider providerService.create(provider); return true; }
Example 10
Source File: SyncUtils.java From dubbox with Apache License 2.0 | 6 votes |
public static Provider url2Provider(Pair<Long, URL> pair) { if (pair == null) { return null; } Long id = pair.getKey(); URL url = pair.getValue(); if (url == null) return null; Provider p = new Provider(); p.setId(id); p.setService(url.getServiceKey()); p.setAddress(url.getAddress()); p.setApplication(url.getParameter(Constants.APPLICATION_KEY)); p.setUrl(url.toIdentityString()); p.setParameters(url.toParameterString()); p.setDynamic(url.getParameter("dynamic", true)); p.setEnabled(url.getParameter(Constants.ENABLED_KEY, true)); p.setWeight(url.getParameter(Constants.WEIGHT_KEY, Constants.DEFAULT_WEIGHT)); p.setUsername(url.getParameter("owner")); return p; }