Repository.adaptToFacet
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using org.sonatype.nexus.proxy.repository.Repository.adaptToFacet (Showing top 20 results out of 315)

  • Common ways to obtain Repository
private void myMethod () {
Repository r =
  • RepositoryRegistry repositoryRegistry;String repoId;repositoryRegistry.getRepository(repoId)
  • RepositoryItemUid repositoryItemUid;repositoryItemUid.getRepository()
  • RequestRoute requestRoute;requestRoute.getTargetedRepository()
  • Smart code suggestions by Codota
}
origin: org.sonatype.nexus/nexus-proxy

@Override
public MavenRepository getMasterRepository()
{
  return super.getMasterRepository().adaptToFacet( MavenRepository.class );
}
origin: org.sonatype.nexus/nexus-proxy

public void dispose()
{
  // kill the checker daemon threads
  for ( Repository repository : getRepositoriesMap().values() )
  {
    killMonitorThread( repository.adaptToFacet( ProxyRepository.class ) );
  }
}
origin: org.sonatype.nexus/nexus-proxy

public <T> List<T> getRepositoriesWithFacet( final Class<T> f )
{
  final List<Repository> repositories = getRepositories();
  final ArrayList<T> result = new ArrayList<T>();
  for ( Repository repository : repositories )
  {
    if ( repository.getRepositoryKind().isFacetAvailable( f ) )
    {
      result.add( repository.adaptToFacet( f ) );
    }
  }
  return Collections.unmodifiableList( result );
}
origin: org.sonatype.nexus.plugins/nexus-indexer-lucene-plugin

/**
 * The repository is capable of remote access for indexing purposes.
 *
 * @since 2.7.0
 */
private boolean REMOTEACCESSALLOWED(Repository repository) {
 final ProxyRepository proxyRepository = repository.adaptToFacet(ProxyRepository.class);
 if (proxyRepository != null) {
  return proxyRepository.getProxyMode().shouldProxy();
 }
 else {
  return false;
 }
}
origin: org.sonatype.nexus.plugins/nexus-p2-repository-plugin

private List<UpdateSiteProxyRepository> updateSites(GroupRepository group) {
 List<UpdateSiteProxyRepository> us = Lists.newArrayList();
 for (Repository repo : group.getMemberRepositories()) {
  if (repo.getRepositoryKind().isFacetAvailable(UpdateSiteProxyRepository.class)) {
   us.add(repo.adaptToFacet(UpdateSiteProxyRepository.class));
  }
 }
 if (us.isEmpty()) {
  getLogger().warn(
    "Group '" + group.getId() + "' has no UpdateSite repositories members. " + ROLE_HINT
      + " will be silent skipped!");
 }
 return us;
}
origin: org.sonatype.nexus.plugins/nexus-yum-repository-plugin

@Override
public void onActivate(final C config) {
 try {
  final Repository repository = repositoryRegistry.getRepository(config.repository());
  configureYum(yumRegistry.register(repository.adaptToFacet(MavenRepository.class)), config);
 }
 catch (NoSuchRepositoryException e) {
  // TODO
  throw Throwables.propagate(e);
 }
}
origin: org.sonatype.nexus.plugins/nexus-p2-repository-plugin

 @Override
 public void doApplyConfiguration(final Repository repository, final ApplicationConfiguration configuration,
                  final CRepositoryCoreConfiguration coreConfiguration)
   throws ConfigurationException
 {
  super.doApplyConfiguration(repository, configuration, coreConfiguration);

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

   proxy.getItemContentValidators().put("checksum", checksumValidator);
   proxy.getItemContentValidators().put("filetypevalidator", fileTypeItemContentValidator);
  }
 }
}
origin: org.sonatype.nexus.plugins/nexus-p2-repository-plugin

 protected void inspect(final Event<?> evt) {
  final UpdateSiteProxyRepository updateSite =
    ((RepositoryEvent) evt).getRepository().adaptToFacet(UpdateSiteProxyRepository.class);

  if (updateSite != null
    && (evt instanceof RepositoryEventExpireNotFoundCaches ||
    ((RepositoryConfigurationUpdatedEvent) evt).isRemoteUrlChanged())) {
   final ScheduledTask<?> mirrorTask = UpdateSiteMirrorTask.submit(scheduler, updateSite, false);
   log.debug("Submitted " + mirrorTask.getName());
  }
 }
}
origin: org.sonatype.nexus/nexus-rest-api

  public static String getRepositoryPolicy( Repository repository )
  {
    if ( repository.getRepositoryKind().isFacetAvailable( MavenRepository.class ) )
    {
      return repository.adaptToFacet( MavenRepository.class ).getRepositoryPolicy().toString();
    }
    else
    {
      return null;
    }
  }
}
origin: org.sonatype.nexus.plugins/nexus-restlet1x-plugin

 public static String getRepositoryPolicy(Repository repository) {
  if (repository.getRepositoryKind().isFacetAvailable(MavenRepository.class)) {
   return repository.adaptToFacet(MavenRepository.class).getRepositoryPolicy().toString();
  }
  else {
   return null;
  }
 }
}
origin: org.sonatype.nexus.plugins/nexus-timeline-plugin

 protected Set<String> getRepoIdsFromParams(Map<String, String> params) {
  Set<String> result = new HashSet<String>();

  Collection<Repository> repos = getRepositoryRegistry().getRepositories();

  for (Repository repo : repos) {
   // huh? release as policy exists for MavenRepository only?
   if (repo.getRepositoryKind().isFacetAvailable(MavenRepository.class)) {
    if (RepositoryPolicy.RELEASE.equals(repo.adaptToFacet(MavenRepository.class).getRepositoryPolicy())) {
     result.add(repo.getId());
    }
   }
  }

  return result;
 }
}
origin: org.sonatype.nexus/nexus-proxy

public <T> T getRepositoryWithFacet( final String repoId, final Class<T> f )
  throws NoSuchRepositoryException
{
  final Repository r = getRepository( repoId );
  if ( r.getRepositoryKind().isFacetAvailable( f ) )
  {
    return r.adaptToFacet( f );
  }
  else
  {
    throw new NoSuchRepositoryException( repoId );
  }
}
origin: org.sonatype.nexus.plugins/nexus-p2-repository-plugin

 @Subscribe
 @AllowConcurrentEvents
 public void inspect(final RepositoryRegistryEventAdd evt) {
  if (!applicationStatusSource.getSystemStatus().isNexusStarted()) {
   return;
  }
  final UpdateSiteProxyRepository updateSite =
    ((RepositoryRegistryEventAdd) evt).getRepository().adaptToFacet(UpdateSiteProxyRepository.class);

  if (updateSite != null) {
   updateSite.setExposed(false);
   final ScheduledTask<?> mirrorTask = UpdateSiteMirrorTask.submit(scheduler, updateSite, true);
   log.debug("Submitted " + mirrorTask.getName());
  }
 }
}
origin: org.sonatype.nexus/nexus-rest-api

protected RepositoryGroupResource buildGroupResource( Request request, String groupId ) 
  throws NoSuchRepositoryException,
    ResourceException
{
  Repository repo = getRepositoryRegistry().getRepository( groupId );
  
  if ( repo.getRepositoryKind().isFacetAvailable( GroupRepository.class ) )
  {
    return buildGroupResource( request, repo.adaptToFacet( GroupRepository.class ) );
  }
  
  return null;
}

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

protected RepositoryGroupResource buildGroupResource(Request request, String groupId)
  throws NoSuchRepositoryException,
      ResourceException
{
 Repository repo = getRepositoryRegistry().getRepository(groupId);
 if (repo.getRepositoryKind().isFacetAvailable(GroupRepository.class)) {
  return buildGroupResource(request, repo.adaptToFacet(GroupRepository.class));
 }
 return null;
}
origin: org.sonatype.nexus/nexus-proxy

@Override
public Boolean getValueFor( RepositoryItemUid subject )
{
  return subject.getRepository().getRepositoryKind().isFacetAvailable( MavenRepository.class )
    && pathIsValidGav( subject.getRepository().adaptToFacet( MavenRepository.class ), subject.getPath() );
}
origin: org.sonatype.nexus/nexus-rest-api

protected List<Mirror> getMirrors( Repository repository )
{
  if ( repository.getRepositoryKind().isFacetAvailable( ProxyRepository.class ) )
  {
    return repository.adaptToFacet( ProxyRepository.class ).getDownloadMirrors().getMirrors();
  }
  else
  {
    return repository.getPublishedMirrors().getMirrors();
  }
}
origin: org.sonatype.nexus/nexus-proxy

@Override
public Boolean getValueFor( RepositoryItemUid subject )
{
  return subject.getRepository().getRepositoryKind().isFacetAvailable( MavenRepository.class )
    && pathIsValidGav( subject.getRepository().adaptToFacet( MavenRepository.class ), subject.getPath() );
}
origin: org.sonatype.nexus/nexus-proxy

@Override
public Boolean getValueFor( RepositoryItemUid subject )
{
  return subject.getRepository().getRepositoryKind().isFacetAvailable( MavenRepository.class )
    && pathIsValidSnapshotGav( subject.getRepository().adaptToFacet( MavenRepository.class ), subject.getPath() );
}
origin: org.sonatype.nexus.plugins/nexus-restlet1x-plugin

protected MavenRepository getMavenRepository(String id)
  throws ResourceException
{
 try {
  Repository repository = getUnprotectedRepositoryRegistry().getRepository(id);
  if (!repository.getRepositoryKind().isFacetAvailable(MavenRepository.class)) {
   throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST, "This is not a Maven repository!");
  }
  return repository.adaptToFacet(MavenRepository.class);
 }
 catch (NoSuchRepositoryException e) {
  throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND, e.getMessage(), e);
 }
}
org.sonatype.nexus.proxy.repositoryRepositoryadaptToFacet

Javadoc

Returns the facet of Repository, if available, otherwise it returns null.

Popular methods of Repository

  • getId
    Returns the ID of the resourceStore.
  • getRepositoryKind
    This is the "type"/kind of the repository. It tells some minimal info about the repo working (not co
  • getName
    Gets repository human name.
  • getRepositoryContentClass
    This is the "class" of the repository content. It is used in grouping, only same content reposes may
  • retrieveItem
  • storeItem
  • getLocalStatus
    Gets local status.
  • getLocalUrl
    Returns the local URL of this repository, if any.
  • createUid
    Creates an UID within this Repository.
  • deleteItem
  • getLocalStorage
    Returns the local storage of the repository. Per repository instance may exists.
  • isSearchable
    Is Repository searchable?.
  • getLocalStorage,
  • isSearchable,
  • isUserManaged,
  • getAttributesHandler,
  • getNotFoundCache,
  • getPathPrefix,
  • getProviderHint,
  • getProviderRole,
  • getPublishedMirrors

Popular in Java

  • Reading from database using SQL prepared statement
  • startActivity (Activity)
  • setRequestProperty (URLConnection)
  • putExtra (Intent)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)