コード例 #1
0
  public void updateProvider(Provider provider) {
    Long id = provider.getId();
    if (id == null) {
      throw new IllegalStateException("no provider id");
    }

    URL oldProvider = findProviderUrl(id);
    if (oldProvider == null) {
      throw new IllegalStateException("Provider was changed!");
    }
    URL newProvider = provider.toUrl();

    registryService.unregister(oldProvider);
    registryService.register(newProvider);
  }
コード例 #2
0
 public void create(Provider provider) {
   URL url = provider.toUrl();
   registryService.register(url);
 }