Package org.sonatype.nexus.rest.model

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


  public static RemoteConnectionSettings convert(GlobalRemoteConnectionSettings settings) {
    if (settings == null) {
      return null;
    }

    RemoteConnectionSettings result = new RemoteConnectionSettings();

    result.setConnectionTimeout(settings.getConnectionTimeout() / 1000);

    result.setRetrievalRetryCount(settings.getRetrievalRetryCount());

    result.setQueryString(settings.getQueryString());

    result.setUserAgentString(settings.getUserAgentCustomizationString());

    return result;
  }
View Full Code Here


  public static RemoteConnectionSettings convert(CRemoteConnectionSettings settings) {
    if (settings == null) {
      return null;
    }

    RemoteConnectionSettings result = new RemoteConnectionSettings();

    result.setConnectionTimeout(settings.getConnectionTimeout() / 1000);

    result.setRetrievalRetryCount(settings.getRetrievalRetryCount());

    result.setQueryString(settings.getQueryString());

    result.setUserAgentString(settings.getUserAgentCustomizationString());

    return result;
  }
View Full Code Here

            getNexusEmailer().setSMTPSystemEmailAddress(
                new Address(settings.getSystemEmailAddress().trim()));
          }

          if (resource.getGlobalConnectionSettings() != null) {
            RemoteConnectionSettings s = resource.getGlobalConnectionSettings();

            getGlobalRemoteConnectionSettings().setConnectionTimeout(s.getConnectionTimeout() * 1000);

            getGlobalRemoteConnectionSettings().setRetrievalRetryCount(s.getRetrievalRetryCount());

            getGlobalRemoteConnectionSettings().setQueryString(s.getQueryString());

            getGlobalRemoteConnectionSettings().setUserAgentCustomizationString(s.getUserAgentString());
          }

          setGlobalProxySettings(resource.getRemoteProxySettings(), getGlobalRemoteProxySettings());

          getNexusConfiguration().setRealms(resource.getSecurityRealms());
View Full Code Here

    // Assert.assertEquals( "passphrase", resultAuth.getPassphrase() );
    Assert.assertEquals(AbstractNexusPlexusResource.PASSWORD_PLACE_HOLDER, resultAuth.getPassword());
    // Assert.assertEquals( "privateKey", resultAuth.getPrivateKey() );
    Assert.assertEquals("username", resultAuth.getUsername());

    RemoteConnectionSettings resultCon = result.getRemoteStorage().getConnectionSettings();

    Assert.assertEquals(123, resultCon.getConnectionTimeout());
    Assert.assertEquals("queryString", resultCon.getQueryString());
    Assert.assertEquals(321, resultCon.getRetrievalRetryCount());
    Assert.assertEquals("userAgentString", resultCon.getUserAgentString());

    // NEXUS-1994 override local storage should be null
    Assert.assertNull(result.getOverrideLocalStorageUrl());
    Assert.assertTrue(StringUtils.isNotEmpty(result.getDefaultLocalStorageUrl()));
  }
View Full Code Here

    authSettings.setNtlmDomain("ntlmDomain-new");
    authSettings.setNtlmHost("ntlmHost-new");
    authSettings.setPassword("password-new");
    authSettings.setUsername("username-new");

    RemoteConnectionSettings connectionSettings = originalResource.getRemoteStorage().getConnectionSettings();
    connectionSettings.setConnectionTimeout(1232);
    connectionSettings.setQueryString("queryString-new");
    connectionSettings.setRetrievalRetryCount(3212);
    connectionSettings.setUserAgentString("userAgentString-new");

    RepositoryPlexusResource plexusResource =
        (RepositoryPlexusResource) this.lookup(PlexusResource.class, RepositoryPlexusResource.class.getName());

    Request request = buildRequest();
    Response response = new Response(request);

    request.getAttributes().put(AbstractRepositoryPlexusResource.REPOSITORY_ID_KEY, originalResource.getId());

    RepositoryResourceResponse repoRequest = new RepositoryResourceResponse();
    repoRequest.setData(originalResource);

    RepositoryResourceResponse repoResponse =
        (RepositoryResourceResponse) plexusResource.put(null, request, response, repoRequest);
    RepositoryProxyResource result = (RepositoryProxyResource) repoResponse.getData();

    //
    // now check
    //

    Assert.assertEquals("test-id", result.getId());
    // Assert.assertEquals( true, result.isAllowWrite() );
    Assert.assertEquals(2, result.getArtifactMaxAge());
    Assert.assertEquals(true, result.isBrowseable());
    Assert.assertEquals(ChecksumPolicy.STRICT.name(), result.getChecksumPolicy());
    Assert.assertEquals(true, result.isDownloadRemoteIndexes());

    Assert.assertEquals(true, result.isExposed());
    Assert.assertEquals("maven2", result.getFormat());
    Assert.assertEquals(false, result.isIndexable());
    Assert.assertEquals(23, result.getMetadataMaxAge());
    Assert.assertEquals(Integer.valueOf(234), result.getItemMaxAge());
    Assert.assertEquals("test-name", result.getName());
    Assert.assertEquals(11, result.getNotFoundCacheTTL());
    Assert.assertEquals("maven2", result.getProvider());
    Assert.assertEquals(RepositoryPolicy.RELEASE.name(), result.getRepoPolicy());
    Assert.assertEquals("proxy", result.getRepoType());

    Assert.assertEquals("http://foo-new.com/", result.getRemoteStorage().getRemoteStorageUrl());

    AuthenticationSettings resultAuth = result.getRemoteStorage().getAuthentication();

    Assert.assertEquals("ntlmDomain-new", resultAuth.getNtlmDomain());
    Assert.assertEquals("ntlmHost-new", resultAuth.getNtlmHost());
    // Assert.assertEquals( "passphrase-new", resultAuth.getPassphrase() );
    Assert.assertEquals(AbstractNexusPlexusResource.PASSWORD_PLACE_HOLDER, resultAuth.getPassword());
    // Assert.assertEquals( "privateKey-new", resultAuth.getPrivateKey() );
    Assert.assertEquals("username-new", resultAuth.getUsername());

    RemoteConnectionSettings resultCon = result.getRemoteStorage().getConnectionSettings();

    Assert.assertEquals(1232, resultCon.getConnectionTimeout());
    Assert.assertEquals("queryString-new", resultCon.getQueryString());
    Assert.assertEquals(3212, resultCon.getRetrievalRetryCount());
    Assert.assertEquals("userAgentString-new", resultCon.getUserAgentString());

    // NEXUS-1994 override local storage should be null
    Assert.assertNull(result.getOverrideLocalStorageUrl());
    Assert.assertTrue(StringUtils.isNotEmpty(result.getDefaultLocalStorageUrl()));
View Full Code Here

    authSettings.setNtlmDomain("ntlmDomain");
    authSettings.setNtlmHost("ntlmHost");
    authSettings.setPassword("password");
    authSettings.setUsername("username");

    RemoteConnectionSettings connectionSettings = new RemoteConnectionSettings();
    remoteStorage.setConnectionSettings(connectionSettings);
    connectionSettings.setConnectionTimeout(123);
    connectionSettings.setQueryString("queryString");
    connectionSettings.setRetrievalRetryCount(321);
    connectionSettings.setUserAgentString("userAgentString");

    RepositoryListPlexusResource plexusResource =
        (RepositoryListPlexusResource) this.lookup(PlexusResource.class, RepositoryListPlexusResource.class.getName());

    Request request = buildRequest();
View Full Code Here

    auth.setPassword("password");
    auth.setUsername("username");

    remoteStorage.setAuthentication(auth);

    RemoteConnectionSettings connection = new RemoteConnectionSettings();
    connection.setConnectionTimeout(50);
    connection.setQueryString("querystring");
    connection.setRetrievalRetryCount(5);
    connection.setUserAgentString("useragent");

    remoteStorage.setConnectionSettings(connection);

    repo.setRemoteStorage(remoteStorage);
View Full Code Here

    auth.setPassword("password");
    auth.setUsername("username");

    remoteStorage.setAuthentication(auth);

    RemoteConnectionSettings connection = new RemoteConnectionSettings();
    connection.setConnectionTimeout(50);
    connection.setQueryString("querystring");
    connection.setRetrievalRetryCount(5);
    connection.setUserAgentString("useragent");

    remoteStorage.setConnectionSettings(connection);

    repo.setRemoteStorage(remoteStorage);
View Full Code Here

    RestApiSettings restSet = new RestApiSettings();
    restSet.setBaseUrl("baseUrl");
    restSet.setForceBaseUrl(false);
    resource.setGlobalRestApiSettings(restSet);

    RemoteConnectionSettings connSet = new RemoteConnectionSettings();
    connSet.setConnectionTimeout(2);
    connSet.setQueryString("queryString");
    connSet.setRetrievalRetryCount(6);
    connSet.setUserAgentString("userAgentString");
    resource.setGlobalConnectionSettings(connSet);

    RemoteHttpProxySettingsDTO proxyHttpSet = new RemoteHttpProxySettingsDTO();
    proxyHttpSet.setProxyHostname("proxyHostname1");
    proxyHttpSet.setProxyPort(78);
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.rest.model.RemoteConnectionSettings

Copyright © 2018 www.massapicom. 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.