public boolean shouldServiceRequest() { return IN_SERVICE.equals( this ); } }
@Subscribe @AllowConcurrentEvents public void inspect(final RepositoryEventLocalStatusChanged revt) { StringBuilder sb = new StringBuilder("The repository '"); sb.append(revt.getRepository().getName()); sb.append("' (ID='").append(revt.getRepository().getId()).append("') was put "); LocalStatus newStatus = revt.getNewLocalStatus(); if (LocalStatus.IN_SERVICE.equals(newStatus)) { sb.append("IN SERVICE."); } else if (LocalStatus.OUT_OF_SERVICE.equals(newStatus)) { sb.append("OUT OF SERVICE."); } else { sb.append(revt.getRepository().getLocalStatus().toString()).append("."); } sb.append(" The previous state was "); if (LocalStatus.IN_SERVICE.equals(revt.getOldLocalStatus())) { sb.append("IN SERVICE."); } else if (LocalStatus.OUT_OF_SERVICE.equals(revt.getOldLocalStatus())) { sb.append("OUT OF SERVICE."); } else { sb.append(revt.getOldLocalStatus().toString()).append("."); } getFeedRecorder().addSystemEvent(FeedRecorder.SYSTEM_REPO_LSTATUS_CHANGES_ACTION, sb.toString()); }
/** * The shadow is delegating it's availability to it's master, but we can still shot down the shadow only. */ @Override public LocalStatus getLocalStatus() { return super.getLocalStatus().shouldServiceRequest() && getMasterRepository().getLocalStatus().shouldServiceRequest() ? LocalStatus.IN_SERVICE : LocalStatus.OUT_OF_SERVICE; }
public void setLocalStatus( LocalStatus localStatus ) { getCurrentConfiguration( true ).setLocalStatus( localStatus.toString() ); }
public LocalStatus getLocalStatus() { if( getCurrentConfiguration( false ).getLocalStatus() == null ) { return null; } return LocalStatus.valueOf( getCurrentConfiguration( false ).getLocalStatus() ); }
@Override public boolean expireCaches( final ResourceStoreRequest request, final WalkerFilter filter ) { if ( !getLocalStatus().shouldServiceRequest() ) { return false; } // at this level (we are not proxy) expireCaches() actually boils down to "expire NFC" only // we are NOT crawling local storage content to flip the isExpired flags to true on a hosted // repo, since those attributes in case of hosted (or any other non-proxy) repositories does not have any // meaning // 2nd, remove the items from NFC return expireNotFoundCaches( request, filter ); }
public DefaultCRepository() { // id // name // providerRole // providerHint setPathPrefix( null ); setLocalStatus( LocalStatus.IN_SERVICE.toString() ); setNotFoundCacheActive( false ); setNotFoundCacheTTL( 15 ); setUserManaged( true ); setExposed( true ); setBrowseable( true ); setWritePolicy( RepositoryWritePolicy.ALLOW_WRITE_ONCE.name() ); setIndexable( true ); setSearchable( true ); } }
LocalStatus.valueOf( cfg.getLocalStatus() );
public Response putOutOfService(String repoId, String repoType) throws IOException { RepositoryStatusResource status = new RepositoryStatusResource(); status.setId(repoId); status.setRepoType(repoType); status.setLocalStatus(LocalStatus.OUT_OF_SERVICE.name()); return changeStatus(status); }
@Deprecated public void expireAllCaches( ResourceStoreRequest request ) { for ( Repository repository : repositoryRegistry.getRepositories() ) { if ( repository.getLocalStatus().shouldServiceRequest() ) { repository.expireCaches( request ); } } }
/** * The repository is in service for indexing purposes */ private boolean INSERVICE(Repository repository) { return LocalStatus.IN_SERVICE.equals(repository.getLocalStatus()); }
resource.setLocalStatus(repo.getLocalStatus().toString());
public Response putInService(String repoId, String repoType) throws IOException { RepositoryStatusResource status = new RepositoryStatusResource(); status.setId(repoId); status.setRepoType(repoType); status.setLocalStatus(LocalStatus.IN_SERVICE.name()); return changeStatus(status); }
@Subscribe public void onEvent(final RepositoryEventLocalStatusChanged event) { if (this.equals(event.getRepository()) && event.getNewLocalStatus().shouldServiceRequest()) { createP2CompositeXmls(getMemberRepositoryIds(), true); } }
@Deprecated public Collection<String> evictAllUnusedProxiedItems( ResourceStoreRequest req, long timestamp ) throws IOException { ArrayList<String> result = new ArrayList<String>(); for ( Repository repository : repositoryRegistry.getRepositories() ) { if ( LocalStatus.IN_SERVICE.equals( repository.getLocalStatus() ) ) { result.addAll( repository.evictUnusedItems( req, timestamp ) ); } } return result; }
dependent.setLocalStatus(shadow.getLocalStatus().toString());
public static Response putOutOfService( String repoId, String repoType ) throws IOException { RepositoryStatusResource status = new RepositoryStatusResource(); status.setId( repoId ); status.setRepoType( repoType ); status.setLocalStatus( LocalStatus.OUT_OF_SERVICE.name() ); return changeStatus( status ); }
@Override public void expireCaches( final ResourceStoreRequest request ) { if ( !getLocalStatus().shouldServiceRequest() ) { return; } // expire proxy cache expireProxyCaches( request ); // do the stuff we inherited super.expireCaches( request ); }
public void reindexAllRepositories( String path, boolean fullReindex ) throws IOException { List<Repository> reposes = repositoryRegistry.getRepositories(); for ( Repository repository : reposes ) { if ( LocalStatus.IN_SERVICE.equals( repository.getLocalStatus() ) ) { reindexRepository( repository, fullReindex ); } } publishAllIndex(); }