org.sonatype.nexus.proxy.repository.Repository.expireCaches()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中org.sonatype.nexus.proxy.repository.Repository.expireCaches方法的一些代码示例,展示了Repository.expireCaches的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Repository.expireCaches方法的具体详情如下:
包路径:org.sonatype.nexus.proxy.repository.Repository
类名称:Repository
方法名:expireCaches

Repository.expireCaches介绍

[英]Expires all the caches used by this repository implementation from path and below. This methods delegates to #expireCaches(ResourceStoreRequest,WalkerFilter) method using null for filter.
[中]从path及以下路径终止此存储库实现使用的所有缓存。此方法将null用作筛选器,委托给#expireCaches(ResourceStoreRequest,WalkerFilter)方法。

代码示例

代码示例来源:origin: org.sonatype.nexus/nexus-proxy

@Override
public boolean expireMetadataCaches( final ResourceStoreRequest request )
{
  return getRepository().expireCaches( request, getMetadataWalkerFilter() );
}

代码示例来源:origin: org.sonatype.nexus/nexus-proxy

@Override
public void expireCaches( ResourceStoreRequest request )
{
  final List<Repository> members = getMemberRepositories();
  for ( Repository member : members )
  {
    member.expireCaches( request );
  }
  super.expireCaches( request );
}

代码示例来源:origin: org.sonatype.nexus/nexus-app

@Deprecated
public void expireAllCaches( ResourceStoreRequest request )
{
  for ( Repository repository : repositoryRegistry.getRepositories() )
  {
    if ( repository.getLocalStatus().shouldServiceRequest() )
    {
      repository.expireCaches( request );
    }
  }
}

代码示例来源:origin: org.sonatype.nexus/nexus-proxy

@Override
public boolean expireMetadataCaches( final ResourceStoreRequest request )
{
  boolean cacheChanged = false;
  for ( String metadataPath : getMetadataFilePaths() )
  {
    final ResourceStoreRequest expireRequest = new ResourceStoreRequest( request );
    expireRequest.setRequestPath( metadataPath );
    boolean expired = getRepository().expireCaches( expireRequest, null );
    cacheChanged = cacheChanged || expired;
  }
  return cacheChanged;
}

代码示例来源:origin: org.sonatype.nexus/nexus-app

@Override
public Object doRun()
  throws Exception
{
  ResourceStoreRequest req = new ResourceStoreRequest( getResourceStorePath() );
  if ( getRepositoryId() != null )
  {
    getRepositoryRegistry().getRepository( getRepositoryId() ).expireCaches( req );
  }
  else
  {
    for ( Repository repository : getRepositoryRegistry().getRepositories() )
    {
      if ( repository.getLocalStatus().shouldServiceRequest() )
      {
        repository.expireCaches( req );
      }
    }
  }
  return null;
}

相关文章