Examples of RoutingConfigMessage


Examples of org.sonatype.nexus.rest.model.RoutingConfigMessage

                                         final Variant variant)
      throws ResourceException
  {
    final MavenProxyRepository mavenProxyRepository = getMavenRepository(request, MavenProxyRepository.class);
    final DiscoveryConfig config = getManager().getRemoteDiscoveryConfig(mavenProxyRepository);
    final RoutingConfigMessage payload = new RoutingConfigMessage();
    payload.setDiscoveryEnabled(config.isEnabled());
    payload.setDiscoveryIntervalHours(Ints.saturatedCast(TimeUnit.MILLISECONDS.toHours(config.getDiscoveryInterval())));
    final RoutingConfigMessageWrapper responseNessage = new RoutingConfigMessageWrapper();
    responseNessage.setData(payload);
    return responseNessage;
  }
View Full Code Here

Examples of org.sonatype.nexus.rest.model.RoutingConfigMessage

  @Override
  public DiscoveryConfiguration getDiscoveryConfigurationFor(final String mavenProxyRepositoryId)
      throws IllegalArgumentException, NexusClientNotFoundException
  {
    try {
      final RoutingConfigMessage message =
          getNexusClient().serviceResource(routingConfigPath(mavenProxyRepositoryId)).get(
              RoutingConfigMessageWrapper.class).getData();
      return new DiscoveryConfiguration(message.isDiscoveryEnabled(), message.getDiscoveryIntervalHours());
    }
    catch (UniformInterfaceException e) {
      throw getNexusClient().convert(e);
    }
    catch (ClientHandlerException e) {
View Full Code Here

Examples of org.sonatype.nexus.rest.model.RoutingConfigMessage

  public void setDiscoveryConfigurationFor(final String mavenProxyRepositoryId,
                                           final DiscoveryConfiguration configuration)
      throws IllegalArgumentException, NexusClientNotFoundException
  {
    try {
      final RoutingConfigMessage message = new RoutingConfigMessage();
      message.setDiscoveryEnabled(configuration.isEnabled());
      message.setDiscoveryIntervalHours(configuration.getIntervalHours());
      final RoutingConfigMessageWrapper wrapper = new RoutingConfigMessageWrapper();
      wrapper.setData(message);
      getNexusClient().serviceResource(routingConfigPath(mavenProxyRepositoryId)).put(wrapper);
    }
    catch (UniformInterfaceException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.