congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
CRepository
Code IndexAdd Tabnine to your IDE (free)

How to use
CRepository
in
org.sonatype.nexus.configuration.model

Best Java code snippets using org.sonatype.nexus.configuration.model.CRepository (Showing top 20 results out of 315)

origin: org.sonatype.nexus.plugins/nexus-restlet1x-testsupport-plugin

 @Override
 public AbstractProxyRepositoryConfiguration createExternalConfigurationHolder(final CRepository config) {
  return new AbstractProxyRepositoryConfiguration((Xpp3Dom) config.getExternalConfiguration())
  {
  };
 }
};
origin: org.sonatype.nexus/nexus-configuration

@Override
protected void copyTransients( Object source, Object destination )
{
  ( (CRepository) destination ).setExternalConfiguration( ( (CRepository) source ).getExternalConfiguration() );
  ( (CRepository) destination ).externalConfigurationImple = ( (CRepository) source ).externalConfigurationImple;
  ( (CRepository) destination ).defaultLocalStorageUrl = ( (CRepository) source ).defaultLocalStorageUrl;
  // trick with RemoteStorage, which is an object, and XStream will not "overlap" it properly (ie. destionation !=
  // null but source == null)
  if ( ( (CRepository) source ).getRemoteStorage() == null )
  {
    ( (CRepository) destination ).setRemoteStorage( null );
  }
}
origin: org.sonatype.nexus.plugins/nexus-site-repository-plugin

@Override
protected CRepositoryCoreConfiguration initCoreConfiguration() {
 CRepository repo = new DefaultCRepository();
 repo.setId("");
 repo.setProviderRole(WebSiteRepository.class.getName());
 repo.setProviderHint(SiteRepository.ID);
 Xpp3Dom ex = new Xpp3Dom(DefaultCRepository.EXTERNAL_CONFIGURATION_NODE_NAME);
 repo.setExternalConfiguration(ex);
 repo.setIndexable(false);
 repo.setWritePolicy(RepositoryWritePolicy.ALLOW_WRITE.name());
 repo.setNotFoundCacheTTL(1440);
 CRepositoryCoreConfiguration result = new CRepositoryCoreConfiguration(
   getTemplateProvider().getApplicationConfiguration(),
   repo,
   new CRepositoryExternalConfigurationHolderFactory<DefaultSiteRepositoryConfiguration>()
   {
    public DefaultSiteRepositoryConfiguration createExternalConfigurationHolder(CRepository config) {
     return new DefaultSiteRepositoryConfiguration((Xpp3Dom) config.getExternalConfiguration());
    }
   });
 return result;
}
origin: org.sonatype.nexus/nexus-app

protected void doForceNfcSetting( final Configuration configuration )
{
  getLogger().info(
    "Enforcing proper NFC use: every non-proxy repository present in system will have NFC deactivated (system property override present)." );
  // conservatively shut down NFC on any non-proxy repository
  for ( CRepository repository : configuration.getRepositories() )
  {
    final boolean isProxyRepository =
      repository.getRemoteStorage() != null && repository.getRemoteStorage().getUrl() != null;
    repository.setNotFoundCacheActive( isProxyRepository );
  }
}
origin: org.sonatype.nexus.plugins/nexus-ruby-plugin

CRepository repo = new DefaultCRepository();
repo.setId("");
repo.setName("");
repo.setProviderRole(Repository.class.getName());
repo.setProviderHint(DefaultProxyRubyRepository.ID);
repo.setRemoteStorage(new CRemoteStorage());
repo.getRemoteStorage().setProvider(
  getTemplateProvider().getRemoteProviderHintFactory().getDefaultHttpRoleHint());
repo.getRemoteStorage().setUrl("http://some-remote-repository/repo-root");
repo.setExternalConfiguration(ex);
repo.externalConfigurationImple = exConf;
repo.setWritePolicy(RepositoryWritePolicy.READ_ONLY.name());
repo.setNotFoundCacheActive(true);
repo.setNotFoundCacheTTL(1440);
repo.setIndexable(true);
repo.setSearchable(true);
origin: org.sonatype.nexus/nexus-rest-api

appModel.setLocalStatus( LocalStatus.IN_SERVICE.name() );
if ( target != null )
  appModel.setLocalStatus( target.getLocalStatus() );
  ex = (Xpp3Dom) target.getExternalConfiguration();
appModel.setId( resource.getId() );
appModel.setName( resource.getName() );
appModel.setExposed( resource.isExposed() );
appModel.setProviderRole( resource.getProviderRole() );
  appModel.setExternalConfiguration( ex );
  appModel.setIndexable( false );
    appModel.setWritePolicy( repoResource.getWritePolicy() );
  appModel.setBrowseable( repoResource.isBrowseable() );
  appModel.setIndexable( repoResource.isIndexable() );
  appModel.setSearchable( repoResource.isIndexable() );
  appModel.setNotFoundCacheTTL( repoResource.getNotFoundCacheTTL() );
  appModel.setExternalConfiguration( ex );
origin: org.sonatype.nexus/nexus-configuration-model

value.setId( cRepository.getId() );
value.setName( cRepository.getName() );
value.setProviderRole( cRepository.getProviderRole() );
value.setProviderHint( cRepository.getProviderHint() );
value.setPathPrefix( cRepository.getPathPrefix() );
value.setLocalStatus( cRepository.getLocalStatus() );
value.setNotFoundCacheActive( cRepository.isNotFoundCacheActive() );
value.setNotFoundCacheTTL( cRepository.getNotFoundCacheTTL() );
value.setUserManaged( cRepository.isUserManaged() );
value.setExposed( cRepository.isExposed() );
value.setBrowseable( cRepository.isBrowseable() );
value.setWritePolicy( cRepository.getWritePolicy() );
value.setIndexable( cRepository.isIndexable() );
value.setSearchable( cRepository.isSearchable() );
value.setLocalStorage( upgradeCLocalStorage( cRepository.getLocalStorage() ) );
value.setRemoteStorage( upgradeCRemoteStorage( cRepository.getRemoteStorage() ) );
origin: org.sonatype.nexus.plugins/nexus-ruby-plugin

CRepository repo = new DefaultCRepository();
repo.setId("");
repo.setName("");
repo.setProviderRole(GroupRepository.class.getName());
repo.setProviderHint(DefaultRubyGroupRepository.ID);
repo.setSearchable(false);
repo.setExternalConfiguration(ex);
repo.setWritePolicy(RepositoryWritePolicy.READ_ONLY.name());
origin: org.sonatype.nexus.plugins/nexus-ruby-plugin

CRepository repo = new DefaultCRepository();
repo.setId("");
repo.setName("");
repo.setProviderRole(Repository.class.getName());
repo.setProviderHint(DefaultHostedRubyRepository.ID);
repo.setExternalConfiguration(ex);
repo.setWritePolicy(RepositoryWritePolicy.ALLOW_WRITE_ONCE.name());
repo.setNotFoundCacheTTL(1440);
repo.setIndexable(true);
repo.setSearchable(true);
origin: org.sonatype.nexus/nexus-configuration-model

if ( cRepository.getId() != null )
  serializer.startTag( NAMESPACE, "id" ).text( cRepository.getId() ).endTag( NAMESPACE, "id" );
if ( cRepository.getName() != null )
  serializer.startTag( NAMESPACE, "name" ).text( cRepository.getName() ).endTag( NAMESPACE, "name" );
if ( cRepository.getProviderRole() != null )
  serializer.startTag( NAMESPACE, "providerRole" ).text( cRepository.getProviderRole() ).endTag( NAMESPACE, "providerRole" );
if ( cRepository.getProviderHint() != null )
  serializer.startTag( NAMESPACE, "providerHint" ).text( cRepository.getProviderHint() ).endTag( NAMESPACE, "providerHint" );
if ( cRepository.getPathPrefix() != null )
  serializer.startTag( NAMESPACE, "pathPrefix" ).text( cRepository.getPathPrefix() ).endTag( NAMESPACE, "pathPrefix" );
if ( cRepository.getLocalStatus() != null )
  serializer.startTag( NAMESPACE, "localStatus" ).text( cRepository.getLocalStatus() ).endTag( NAMESPACE, "localStatus" );
if ( cRepository.isNotFoundCacheActive() != false )
  serializer.startTag( NAMESPACE, "notFoundCacheActive" ).text( String.valueOf( cRepository.isNotFoundCacheActive() ) ).endTag( NAMESPACE, "notFoundCacheActive" );
if ( cRepository.getNotFoundCacheTTL() != 0 )
origin: org.sonatype.nexus/nexus-configuration

if ( StringUtils.isBlank( cfg.getId() ) )
else if ( !cfg.getId().matches( REPOSITORY_ID_PATTERN ) )
if ( "all".equals( cfg.getId() ) )
if ( StringUtils.isBlank( cfg.getName() ) )
  response.addValidationWarning( new ValidationMessage( "id", "Repository with ID='" + cfg.getId()
    + "' has no name, defaulted it's name to it's ID." ) );
  cfg.setName( cfg.getId() );
  LocalStatus.valueOf( cfg.getLocalStatus() );
    + cfg.getId() + "\" has unacceptable value \"" + cfg.getLocalStatus() + "\"! (Allowed values are: \""
    + LocalStatus.IN_SERVICE + "\" and \"" + LocalStatus.OUT_OF_SERVICE + "\")", e ) );
if ( cfg.isIndexable() && ( !"maven2".equals( cfg.getProviderHint() ) ) )
    + cfg.getProviderHint() + "\" repositories, only Maven2 repositories are indexable!" ) );
  cfg.setIndexable( false );
if ( "maven2".equals( cfg.getProviderHint() ) || "maven1".equals( cfg.getProviderHint() ) )
  if ( cfg.getRemoteStorage() != null && cfg.getRemoteStorage().getUrl() != null
    && !cfg.getRemoteStorage().getUrl().endsWith( RepositoryItemUid.PATH_SEPARATOR ) )
origin: org.sonatype.nexus/nexus-rest-api

throws PlexusResourceException
M2RepositoryConfiguration exConf = new M2RepositoryConfiguration( (Xpp3Dom) target.getExternalConfiguration() );
  if ( target.getRemoteStorage() == null )
    target.setRemoteStorage( new CRemoteStorage() );
  target.getRemoteStorage().setUrl( model.getRemoteStorage().getRemoteStorageUrl() );
  target.getRemoteStorage().setAuthentication(
    this.convertAuthentication( model.getRemoteStorage().getAuthentication(), null ) );
  target.getRemoteStorage().setConnectionSettings(
    this.convertRemoteConnectionSettings( model.getRemoteStorage().getConnectionSettings() ) );
  target.getRemoteStorage().setHttpProxySettings(
    this.convertHttpProxySettings( model.getRemoteStorage().getHttpProxySettings(), null ) );
origin: org.sonatype.nexus/nexus-test-harness-base

CRepository cRepo = NexusConfigUtil.getRepo( repo.getId() );
Assert.assertEquals( expected.getId(), cRepo.getId() );
Assert.assertEquals( expected.getChecksumPolicy(), cRepo.getChecksumPolicy() );
Assert.assertEquals( expected.getName(), cRepo.getName() );
  cRepo.getType() );
Assert.assertNotNull( "Unknown repo type='" + cRepo.getType() + "'!", expectedCc );
Assert.assertEquals( expected.getFormat(), expectedCc.getId() );
Assert.assertEquals( expected.getNotFoundCacheTTL(), cRepo.getNotFoundCacheTTL() );
Assert.assertEquals( expected.getOverrideLocalStorageUrl(), cRepo.getLocalStorage() );
  Assert.assertNull( cRepo.getRemoteStorage() );
    .getRemoteStorage().getUrl() );
Assert.assertEquals( expected.getRepoPolicy(), cRepo.getRepositoryPolicy() );
origin: org.sonatype.nexus/nexus-test-harness-launcher

Assert.assertEquals(cRepo.getId(), expected.getId());
Assert.assertEquals(cRepo.getName(), expected.getName());
CRepository cRepo = getTest().getNexusConfigUtil().getRepo(repo.getId());
Assert.assertEquals(expected.getId(), cRepo.getId());
Assert.assertEquals(expected.getName(), cRepo.getName());
Assert.assertEquals(expected.getNotFoundCacheTTL(), cRepo.getNotFoundCacheTTL());
   cRepo.getLocalStorage().getUrl());
   cRepo.getLocalStorage().getUrl().endsWith("/") ? cRepo.getLocalStorage().getUrl()
     : cRepo.getLocalStorage().getUrl() + "/";
 String overridLocalStorage =
   expected.getOverrideLocalStorageUrl().endsWith("/") ? expected.getOverrideLocalStorageUrl()
 Assert.assertNull(cRepo.getRemoteStorage());
 Assert.assertEquals(cRepo.getRemoteStorage().getUrl(),
   expected.getRemoteStorage().getRemoteStorageUrl());
origin: org.sonatype.nexus/nexus-test-harness-launcher

public M2LayoutedM1ShadowRepositoryConfiguration getRepoShadow(String repoId)
  throws IOException
{
 List<CRepository> repos = getNexusConfig().getRepositories();
 for (Iterator<CRepository> iter = repos.iterator(); iter.hasNext(); ) {
  CRepository cRepo = iter.next();
  // check id
  if (cRepo.getId().equals(repoId)) {
   M2LayoutedM1ShadowRepositoryConfiguration exRepoConf =
     new M2LayoutedM1ShadowRepositoryConfiguration((Xpp3Dom) cRepo.getExternalConfiguration());
   return exRepoConf;
  }
 }
 return null;
}
origin: org.sonatype.nexus/nexus-proxy

public String getRemoteUrl()
{
  if ( getCurrentConfiguration( false ).getRemoteStorage() != null )
  {
    return getCurrentConfiguration( false ).getRemoteStorage().getUrl();
  }
  else
  {
    return null;
  }
}
origin: org.sonatype.nexus/nexus-configuration

if ( StringUtils.isEmpty( repo.getId() ) )
else if ( !repo.getId().matches( REPOSITORY_ID_PATTERN ) )
  if ( StringUtils.isEmpty( repo.getName() ) )
    repo.setName( repo.getId() );
    response.addValidationWarning( new ValidationMessage( "id", "Repository with ID='" + repo.getId()
                      + "' has no name, defaulted to it's ID." ) );
  if ( !validateLocalStatus( repo.getLocalStatus() ) )
      new ValidationMessage( "id", "LocalStatus of repository with ID='" + repo.getId() ) + "' is wrong "
        + repo.getLocalStatus() + "! (Allowed values are: '" + LocalStatus.IN_SERVICE + "' and '"
        + LocalStatus.OUT_OF_SERVICE + "')" );
    if ( context.getExistingRepositoryIds().contains( repo.getId() ) )
      response.addValidationError( new ValidationMessage( "id", "Repository with ID=" + repo.getId() + " already exists!" ) );
    context.getExistingRepositoryIds().add( repo.getId() );
    if ( context.getExistingRepositoryShadowIds().contains( repo.getId() ) )
      response.addValidationError( new ValidationMessage( "id", "Repository " + repo.getId()
        + " conflicts with existing Shadow with same ID='" + repo.getId() + "'!" ) );
    if ( context.getExistingRepositoryGroupIds().contains( repo.getId() ) )
origin: org.sonatype.nexus/nexus-configuration

@Override
protected ExternalConfiguration<?> prepareExternalConfiguration( Object configuration )
{
  if ( externalConfigurationFactory == null )
  {
    return null;
  }
  // prepare the Xpp3Dom root node
  if ( repositoryModel.getExternalConfiguration() == null )
  {
    // just put an elephant in South Africa to find it for sure ;)
    repositoryModel
      .setExternalConfiguration( new Xpp3Dom( DefaultCRepository.EXTERNAL_CONFIGURATION_NODE_NAME ) );
  }
  // set the holder
  if ( repositoryModel.externalConfigurationImple == null )
  {
    // in 1st round, i intentionally choosed to make our lives bitter, and handle config manually
    // later we will see about it
    repositoryModel.externalConfigurationImple =
      externalConfigurationFactory.createExternalConfigurationHolder( repositoryModel );
  }
  return new DefaultExternalConfiguration<AbstractXpp3DomExternalConfigurationHolder>(
                                             getApplicationConfiguration(),
                                             this,
                                             (AbstractXpp3DomExternalConfigurationHolder) repositoryModel.externalConfigurationImple );
}
origin: org.sonatype.nexus/nexus-proxy

public void setRemoteStorage( RemoteRepositoryStorage remoteStorage )
{
  this.remoteStorage = remoteStorage;
  if ( remoteStorage == null )
  {
    getCurrentConfiguration( true ).setRemoteStorage( null );
  }
  else
  {
    if ( getCurrentConfiguration( true ).getRemoteStorage() == null )
    {
      getCurrentConfiguration( true ).setRemoteStorage( new CRemoteStorage() );
    }
    getCurrentConfiguration( true ).getRemoteStorage().setProvider( remoteStorage.getProviderId() );
    setWritePolicy( RepositoryWritePolicy.READ_ONLY );
  }
}
origin: org.sonatype.nexus/nexus-proxy

if ( repo.getRemoteStorage() != null )
    if ( repo.getRemoteStorage() != null )
        getRemoteRepositoryStorage( repo.getId(), repo.getRemoteStorage().getUrl(),
          repo.getRemoteStorage().getProvider() );
        configRemoteStorage.validateStorageUrl( repo.getRemoteStorage().getUrl() );
        oldRemoteStorage.validateStorageUrl( repo.getRemoteStorage().getUrl() );
      if ( repo.getRemoteStorage().getAuthentication() != null )
        prepository.setRemoteAuthenticationSettings( authenticationInfoConverter.convertAndValidateFromModel( repo.getRemoteStorage().getAuthentication() ) );
      if ( repo.getRemoteStorage().getConnectionSettings() != null )
        prepository.setRemoteConnectionSettings( globalRemoteConnectionSettings.convertAndValidateFromModel( repo.getRemoteStorage().getConnectionSettings() ) );
      if ( repo.getRemoteStorage().getHttpProxySettings() != null )
        if ( repo.getRemoteStorage().getHttpProxySettings().isBlockInheritance() )
          prepository.setRemoteProxySettings( globalHttpProxySettings.convertAndValidateFromModel( repo.getRemoteStorage().getHttpProxySettings() ) );
org.sonatype.nexus.configuration.modelCRepository

Javadoc

The Nexus repository model.

Most used methods

  • getExternalConfiguration
    Get repository implementation's own configuration.
  • getRemoteStorage
    Get the remote storage definition of repository.
  • setExternalConfiguration
    Set repository implementation's own configuration.
  • setId
    Set repository ID. It should uniquely identify this repository across Nexus.
  • setIndexable
    Set if true, repository will get indexed. If false, the files and artifacts from repository will NOT
  • setName
    Set human readable Repository name.
  • setNotFoundCacheTTL
    Set notFoundCache, the neg-cache records time to live in minutes. How long will misses be cached.
  • setRemoteStorage
    Set the remote storage definition of repository.
  • setWritePolicy
    Set the policy of the repositories write capability, i.e. (ALLOW_WRITE, ALLOW_WRITE_ONCE, READ_ONLY)
  • setNotFoundCacheActive
    Set if true, NFC will be used. If false, no miss caching will happen.
  • setProviderHint
    Set the implementation of repository.
  • setProviderRole
    Set the type of repository.
  • setProviderHint,
  • setProviderRole,
  • getId,
  • getLocalStorage,
  • getName,
  • setSearchable,
  • getLocalStatus,
  • getProviderHint,
  • getNotFoundCacheTTL,
  • setBrowseable

Popular in Java

  • Making http post requests using okhttp
  • getApplicationContext (Context)
  • setRequestProperty (URLConnection)
  • setContentView (Activity)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JList (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now