@Test public void testRegister() throws Exception { client.register(Instances.newInstances(3)); }
public void register(final Set<Instance> instances) { try { Preconditions.checkArgument(!CollectionUtils.isEmpty(instances), "instances"); final RegisterRequest request = new RegisterRequest(Lists.newArrayList(instances)); final RegisterResponse response = this.request(RestPaths.REGISTRY_REGISTER_FULL_PATH, request, RegisterResponse.class); if (ResponseStatusUtil.isFail(response.getResponseStatus())) { _logger.error("register instances failed. Response:" + JacksonJsonSerializer.INSTANCE.serialize(response)); } else if (ResponseStatusUtil.isPartialFail(response.getResponseStatus())) { _logger.warn("register instances patial failed. Response:" + JacksonJsonSerializer.INSTANCE.serialize(response)); } logEvent(response.getResponseStatus(), "registry", "register"); } catch (final Throwable e) { _logger.warn("register instances failed", e); logEvent("registry", "register"); } }
ArtemisRegistryHttpClient extends ArtemisHttpClient { public void register(final Set<Instance> instances) { try { Preconditions.checkArgument(!CollectionUtils.isEmpty(instances), "instances"); final RegisterRequest request = new RegisterRequest(Lists.newArrayList(instances)); final RegisterResponse response = this.request(RestPaths.REGISTRY_REGISTER_FULL_PATH, request, RegisterResponse.class); if (ResponseStatusUtil.isFail(response.getResponseStatus())) { _logger.error("register instances failed. Response:" + JacksonJsonSerializer.INSTANCE.serialize(response)); } else if (ResponseStatusUtil.isPartialFail(response.getResponseStatus())) { _logger.warn("register instances patial failed. Response:" + JacksonJsonSerializer.INSTANCE.serialize(response)); } logEvent(response.getResponseStatus(), "registry", "register"); } catch (final Throwable e) { _logger.warn("register instances failed", e); logEvent("registry", "register"); } } }
ArtemisRegistryHttpClient extends ArtemisHttpClient { public void register(final Set<Instance> instances) { try { Preconditions.checkArgument(!CollectionUtils.isEmpty(instances), "instances"); final RegisterRequest request = new RegisterRequest(Lists.newArrayList(instances)); final RegisterResponse response = this.request(RestPaths.REGISTRY_REGISTER_FULL_PATH, request, RegisterResponse.class); if (ResponseStatusUtil.isFail(response.getResponseStatus())) { _logger.error("register instances failed. Response:" + JacksonJsonSerializer.INSTANCE.serialize(response)); } else if (ResponseStatusUtil.isPartialFail(response.getResponseStatus())) { _logger.warn("register instances patial failed. Response:" + JacksonJsonSerializer.INSTANCE.serialize(response)); } logEvent(response.getResponseStatus(), "registry", "register"); } catch (final Throwable e) { _logger.warn("register instances failed", e); logEvent("registry", "register"); } } ArtemisRegistryHttpClient(final ArtemisClientConfig config); }
ArtemisRegistryHttpClient extends ArtemisHttpClient { public void register(final Set<Instance> instances) { try { Preconditions.checkArgument(!CollectionUtils.isEmpty(instances), "instances"); final RegisterRequest request = new RegisterRequest(Lists.newArrayList(instances)); final RegisterResponse response = this.request(RestPaths.REGISTRY_REGISTER_FULL_PATH, request, RegisterResponse.class); if (ResponseStatusUtil.isFail(response.getResponseStatus())) { _logger.error("register instances failed. Response:" + JacksonJsonSerializer.INSTANCE.serialize(response)); } else if (ResponseStatusUtil.isPartialFail(response.getResponseStatus())) { _logger.warn("register instances patial failed. Response:" + JacksonJsonSerializer.INSTANCE.serialize(response)); } logEvent(response.getResponseStatus(), "registry", "register"); } catch (final Throwable e) { _logger.warn("register instances failed", e); logEvent("registry", "register"); } } ArtemisRegistryHttpClient(final ArtemisClientConfig config); void register(final Set<Instance> instances); void unregister(final Set<Instance> instances); }
ArtemisRegistryHttpClient extends ArtemisHttpClient { public void register(final Set<Instance> instances) { try { Preconditions.checkArgument(!CollectionUtils.isEmpty(instances), "instances"); final RegisterRequest request = new RegisterRequest(Lists.newArrayList(instances)); final RegisterResponse response = this.request(RestPaths.REGISTRY_REGISTER_FULL_PATH, request, RegisterResponse.class); if (ResponseStatusUtil.isFail(response.getResponseStatus())) { _logger.error("register instances failed. Response:" + JacksonJsonSerializer.INSTANCE.serialize(response)); } else if (ResponseStatusUtil.isPartialFail(response.getResponseStatus())) { _logger.warn("register instances patial failed. Response:" + JacksonJsonSerializer.INSTANCE.serialize(response)); } logEvent(response.getResponseStatus(), "registry", "register"); } catch (final Throwable e) { _logger.warn("register instances failed", e); logEvent("registry", "register"); } } ArtemisRegistryHttpClient(final ArtemisClientConfig config); void register(final Set<Instance> instances); void unregister(final Set<Instance> instances);  }