Examples of ProxyRepository


Examples of org.apache.jackrabbit.commons.repository.ProxyRepository

        Map helper = new BeanMap(test.getField("helper").get(null));
        final Repository repository =
            (Repository) helper.get("repository");
        final Credentials superuser =
            (Credentials) helper.get("superuserCredentials");
        return new ProxyRepository(new RepositoryFactory() {

            public Repository getRepository() throws RepositoryException {
                return repository;
            }
View Full Code Here

Examples of org.apache.jackrabbit.commons.repository.ProxyRepository

        Map helper = new BeanMap(test.getField("helper").get(null));
        final Repository repository =
            (Repository) helper.get("repository");
        final Credentials superuser =
            (Credentials) helper.get("superuserCredentials");
        return new ProxyRepository(new RepositoryFactory() {

            public Repository getRepository() throws RepositoryException {
                return repository;
            }
View Full Code Here

Examples of org.apache.jackrabbit.commons.repository.ProxyRepository

     * @throws ServletException
     */
    public void init() throws ServletException {
        getServletContext().setAttribute(
                getAttributeName(),
                new ProxyRepository() {
                    @Override
                    protected Repository getRepository()
                            throws RepositoryException {
                        return AbstractRepositoryServlet.this.getRepository();
                    }
View Full Code Here

Examples of org.apache.jackrabbit.commons.repository.ProxyRepository

     * @throws ServletException if the factory could not be retrieved
     */
    public void init() throws ServletException {
        getServletContext().setAttribute(
                getAttributeName(),
                new ProxyRepository(getRepositoryFactory()));
    }
View Full Code Here

Examples of org.apache.jackrabbit.commons.repository.ProxyRepository

     * @throws ServletException if the factory could not be retrieved
     */
    public void init() throws ServletException {
        getServletContext().setAttribute(
                getAttributeName(),
                new ProxyRepository(getRepositoryFactory()));
    }
View Full Code Here

Examples of org.apache.jackrabbit.commons.repository.ProxyRepository

     * @throws ServletException if the factory could not be retrieved
     */
    public void init() throws ServletException {
        getServletContext().setAttribute(
                getAttributeName(),
                new ProxyRepository() {
                    @Override
                    protected Repository getRepository()
                            throws RepositoryException {
                        return AbstractRepositoryServlet.this.getRepository();
                    }
View Full Code Here

Examples of org.sonatype.nexus.client.core.subsystem.repository.ProxyRepository

  public void createNonMaven2RepoWithDefaultValues() {
    final String id = uniqueName("nxcm5131");

    doCreateNxcm5131Repo(id);

    ProxyRepository repository = repositories().get(id);

    assertThat(repository.id(), is(id));
    assertThat(repository.name(), is(id));

    assertThat(repository.itemMaxAge(), is(1440));

    assertThat(repository.isExposed(), is(false));
    assertThat(repository.isAutoBlocking(), is(true));
  }
View Full Code Here

Examples of org.sonatype.nexus.proxy.repository.ProxyRepository

      throws ConfigurationException
  {
    super.doApplyConfiguration(repository, configuration, coreConfiguration);

    if (repository.getRepositoryKind().isFacetAvailable(ProxyRepository.class)) {
      ProxyRepository proxy = repository.adaptToFacet(ProxyRepository.class);

      proxy.getItemContentValidators().put("checksum", checksumValidator);
      proxy.getItemContentValidators().put("filetypevalidator", fileTypeItemContentValidator);
    }
  }
View Full Code Here

Examples of org.sonatype.nexus.proxy.repository.ProxyRepository

    RemoteStorageContext remoteStorageContext = applicationConfiguration.getGlobalRemoteStorageContext();
    String actualProtocolHint = protocolHint;
    String actualHost = host;
    String actualPort = port;
    if (repositoryId != null) {
      final ProxyRepository repository = repositoryRegistry.getRepositoryWithFacet(
          repositoryId, ProxyRepository.class
      );
      final URL url = new URL(repository.getRemoteUrl());
      actualHost = url.getHost();
      actualPort = String.valueOf(url.getPort() == -1 ? url.getDefaultPort() : url.getPort());
      remoteStorageContext = repository.getRemoteStorageContext();
      if (actualProtocolHint == null) {
        actualProtocolHint = "https";
      }
    }
    if (actualHost != null) {
View Full Code Here

Examples of org.sonatype.nexus.proxy.repository.ProxyRepository

            repository.setSearchable(model.isIndexable());

            repository.setNotFoundCacheTimeToLive(model.getNotFoundCacheTTL());

            if (repository.getRepositoryKind().isFacetAvailable(ProxyRepository.class)) {
              ProxyRepository proxyRepo = repository.adaptToFacet(ProxyRepository.class);

              try {
                proxyRepo.setRemoteUrl(model.getRemoteStorage().getRemoteStorageUrl());
              }
              catch (RemoteStorageException e) {
                ValidationResponse vr = new ApplicationValidationResponse();
                ValidationMessage error = new ValidationMessage("remoteStorageUrl", e.getMessage(), e.getMessage());
                vr.addValidationError(error);
                throw new InvalidConfigurationException(vr);
              }
              String oldPasswordForRemoteStorage = null;
              if (proxyRepo.getRemoteAuthenticationSettings() != null
                  && UsernamePasswordRemoteAuthenticationSettings.class.isInstance(proxyRepo
                  .getRemoteAuthenticationSettings())) {
                oldPasswordForRemoteStorage =
                    ((UsernamePasswordRemoteAuthenticationSettings) proxyRepo
                        .getRemoteAuthenticationSettings()).getPassword();
              }

              RemoteAuthenticationSettings remoteAuth =
                  getAuthenticationInfoConverter().convertAndValidateFromModel(
                      this.convertAuthentication(model.getRemoteStorage().getAuthentication(),
                          oldPasswordForRemoteStorage));
              RemoteConnectionSettings remoteConnSettings =
                  getGlobalRemoteConnectionSettings().convertAndValidateFromModel(
                      this.convertRemoteConnectionSettings(model.getRemoteStorage()
                          .getConnectionSettings()));

              if (remoteAuth != null) {
                proxyRepo.setRemoteAuthenticationSettings(remoteAuth);
              }
              else {
                proxyRepo.getRemoteStorageContext().removeRemoteAuthenticationSettings();
              }

              if (remoteConnSettings != null) {
                proxyRepo.setRemoteConnectionSettings(remoteConnSettings);
              }
              else {
                proxyRepo.getRemoteStorageContext().removeRemoteConnectionSettings();
              }

              // set auto block
              proxyRepo.setAutoBlockActive(((RepositoryProxyResource) model).isAutoBlockActive());

              // set type validation
              proxyRepo.setFileTypeValidation(((RepositoryProxyResource) model).isFileTypeValidation());

            }

            if (repository.getRepositoryKind().isFacetAvailable(MavenRepository.class)) {
              RepositoryPolicy repoPolicy =
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.