Package org.sonatype.nexus.rest.model

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


    if (proxy == null) {
      proxy = new RemoteProxySettingsDTO();
      resource.setRemoteProxySettings(proxy);
    }

    proxy.setHttpProxySettings(new RemoteHttpProxySettingsDTO());
    proxy.getHttpProxySettings().setProxyHostname("http://somejunkproxyurl");
    proxy.getHttpProxySettings().setProxyPort(555);

    proxy.getNonProxyHosts().clear();
    proxy.addNonProxyHost("localhost");
View Full Code Here


      throws Exception
  {
    GlobalConfigurationResource settings = SettingsMessageUtil.getCurrentSettings();

    settings.setRemoteProxySettings(new RemoteProxySettingsDTO());
    settings.getRemoteProxySettings().setHttpProxySettings(new RemoteHttpProxySettingsDTO());
    settings.getRemoteProxySettings().getHttpProxySettings().setProxyHostname("proxyHost");
    settings.getRemoteProxySettings().getHttpProxySettings().setProxyPort(3211);
    settings.getRemoteProxySettings().addNonProxyHost("foo");
    settings.getRemoteProxySettings().addNonProxyHost("bar");
View Full Code Here

      throws Exception
  {
    GlobalConfigurationResource settings = SettingsMessageUtil.getCurrentSettings();

    settings.setRemoteProxySettings(new RemoteProxySettingsDTO());
    settings.getRemoteProxySettings().setHttpProxySettings(new RemoteHttpProxySettingsDTO());
    settings.getRemoteProxySettings().getHttpProxySettings().setProxyHostname("proxyHost");
    settings.getRemoteProxySettings().getHttpProxySettings().setProxyPort(3211);
    settings.getRemoteProxySettings().addNonProxyHost("");
    settings.getRemoteProxySettings().addNonProxyHost("foo");
    settings.getRemoteProxySettings().addNonProxyHost(null);
View Full Code Here

      throws Exception
  {
    GlobalConfigurationResource settings = SettingsMessageUtil.getCurrentSettings();

    settings.setRemoteProxySettings(new RemoteProxySettingsDTO());
    settings.getRemoteProxySettings().setHttpProxySettings(new RemoteHttpProxySettingsDTO());
    settings.getRemoteProxySettings().getHttpProxySettings().setProxyHostname("proxyHost");
    settings.getRemoteProxySettings().getHttpProxySettings().setProxyPort(3211);
    settings.getRemoteProxySettings().getNonProxyHosts().clear();

    Assert.assertEquals(204, SettingsMessageUtil.save(settings).getCode());
View Full Code Here

  private void enableGlobalHttpProxy()
      throws IOException
  {
    final RemoteProxySettingsDTO settings = config().remoteProxySettings().settings();

    settings.setHttpProxySettings(new RemoteHttpProxySettingsDTO());
    settings.getHttpProxySettings().setProxyHostname("localhost");
    settings.getHttpProxySettings().setProxyPort(globalHttpProxy.getPort());

    config().remoteProxySettings().save();
  }
View Full Code Here

  private void enableGlobalHttpsProxy()
      throws IOException
  {
    final RemoteProxySettingsDTO settings = config().remoteProxySettings().settings();

    settings.setHttpsProxySettings(new RemoteHttpProxySettingsDTO());
    settings.getHttpsProxySettings().setProxyHostname("localhost");
    settings.getHttpsProxySettings().setProxyPort(globalHttpsProxy.getPort());

    config().remoteProxySettings().save();
  }
View Full Code Here

  public static RemoteHttpProxySettingsDTO convert(RemoteHttpProxySettings settings) {
    if (settings == null) {
      return null;
    }

    final RemoteHttpProxySettingsDTO result = new RemoteHttpProxySettingsDTO();

    result.setProxyHostname(settings.getHostname());

    result.setProxyPort(settings.getPort());

    result.setAuthentication(convert(settings.getProxyAuthentication()));

    return result;
  }
View Full Code Here

  public static RemoteHttpProxySettingsDTO convert(CRemoteHttpProxySettings settings) {
    if (settings == null) {
      return null;
    }

    final RemoteHttpProxySettingsDTO result = new RemoteHttpProxySettingsDTO();

    result.setProxyHostname(settings.getProxyHostname());

    result.setProxyPort(settings.getProxyPort());

    result.setAuthentication(convert(settings.getAuthentication()));

    return result;
  }
View Full Code Here

    connSet.setQueryString("queryString");
    connSet.setRetrievalRetryCount(6);
    connSet.setUserAgentString("userAgentString");
    resource.setGlobalConnectionSettings(connSet);

    RemoteHttpProxySettingsDTO proxyHttpSet = new RemoteHttpProxySettingsDTO();
    proxyHttpSet.setProxyHostname("proxyHostname1");
    proxyHttpSet.setProxyPort(78);
    AuthenticationSettings authSet = new AuthenticationSettings();
    authSet.setNtlmDomain("ntlmDomain1");
    authSet.setNtlmHost("ntlmHost1");
    authSet.setPassword("password1");
    authSet.setUsername("username1");
    proxyHttpSet.setAuthentication(authSet);

    RemoteHttpProxySettingsDTO proxyHttpsSet = new RemoteHttpProxySettingsDTO();
    proxyHttpsSet.setProxyHostname("proxyHostname2");
    proxyHttpsSet.setProxyPort(87);
    AuthenticationSettings httpsAuthSet = new AuthenticationSettings();
    httpsAuthSet.setNtlmDomain("ntlmDomain2");
    httpsAuthSet.setNtlmHost("ntlmHost2");
    httpsAuthSet.setPassword("password2");
    httpsAuthSet.setUsername("username2");
    proxyHttpsSet.setAuthentication(httpsAuthSet);

    RemoteProxySettingsDTO proxySet = new RemoteProxySettingsDTO();
    proxySet.setHttpProxySettings(proxyHttpSet);
    proxySet.setHttpsProxySettings(proxyHttpsSet);
View Full Code Here

    final RemoteProxy underTest = createJerseyHttpProxy();
    final RemoteProxySettingsDTO settings = underTest.settings();

    assertThat(settings, is(notNullValue()));

    settings.setHttpProxySettings(new RemoteHttpProxySettingsDTO());
    settings.getHttpProxySettings().setProxyHostname("bar");

    settings.setHttpsProxySettings(new RemoteHttpProxySettingsDTO());
    settings.getHttpsProxySettings().setProxyHostname("car");

    settings.addNonProxyHost("foo");

    underTest.save();
View Full Code Here

TOP

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

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.