/** * Removes the uid from not found cache. */ public void removeFromNotFoundCache( ResourceStoreRequest request ) { if ( isNotFoundCacheActive() ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Removing path " + request.getRequestPath() + " from NFC." ); } getNotFoundCache().removeWithParents( request.getRequestPath() ); } }
/** * Adds the uid to not found cache. */ @Override public void addToNotFoundCache( ResourceStoreRequest request ) { if ( isNotFoundCacheActive() ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Adding path " + request.getRequestPath() + " to NFC." ); } getNotFoundCache().put( request.getRequestPath(), Boolean.TRUE, getNotFoundCacheTimeToLive() * 60 ); } }
public void moveItem( boolean fromTask, ResourceStoreRequest from, ResourceStoreRequest to ) throws UnsupportedStorageOperationException, IllegalOperationException, ItemNotFoundException, StorageException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( getId() + ".moveItem() :: " + from.toString() + " --> " + to.toString() ); } if ( !getLocalStatus().shouldServiceRequest() ) { throw new RepositoryNotAvailableException( this ); } copyItem( fromTask, from, to ); deleteItem( fromTask, from ); }
public Collection<StorageItem> list( boolean fromTask, ResourceStoreRequest request ) throws IllegalOperationException, ItemNotFoundException, StorageException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( getId() + ".list() :: " + request.toString() ); } if ( !getLocalStatus().shouldServiceRequest() ) { throw new RepositoryNotAvailableException( this ); } request.addProcessedRepository( this ); StorageItem item = retrieveItem( fromTask, request ); if ( item instanceof StorageCollectionItem ) { return list( fromTask, (StorageCollectionItem) item ); } else { throw new ItemNotFoundException( request, this ); } }
public Collection<StorageItem> list( boolean fromTask, StorageCollectionItem coll ) throws IllegalOperationException, ItemNotFoundException, StorageException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( getId() + ".list() :: " + coll.getRepositoryItemUid().toString() ); } if ( !getLocalStatus().shouldServiceRequest() ) { throw new RepositoryNotAvailableException( this ); } maintainNotFoundCache( coll.getResourceStoreRequest() ); Collection<StorageItem> items = doListItems( new ResourceStoreRequest( coll ) ); for ( StorageItem item : items ) { item.getItemContext().putAll( coll.getItemContext() ); } return items; }
public StorageItem retrieveItem( ResourceStoreRequest request ) throws IllegalOperationException, ItemNotFoundException, StorageException, AccessDeniedException { if ( !checkConditions( request, Action.read ) ) { throw new ItemNotFoundException( request, this ); } StorageItem item = retrieveItem( false, request ); if ( StorageCollectionItem.class.isAssignableFrom( item.getClass() ) && !isBrowseable() ) { getLogger().debug( getId() + " retrieveItem() :: FOUND a collection on " + request.toString() + " but repository is not Browseable." ); throw new ItemNotFoundException( request, this ); } if ( !checkPostConditions( request, item ) ) { throw new ItemNotFoundException( request, this ); } return item; }
public StorageItem retrieveItem( boolean fromTask, ResourceStoreRequest request ) throws IllegalOperationException, ItemNotFoundException, StorageException if ( getLogger().isDebugEnabled() ) getLogger().debug( getId() + ".retrieveItem() :: " + request.toString() ); getLogger().info( String.format( "The file in repository %s on path=\"%s\" should be generated by ContentGeneratorId=%s, but component does not exists!", if ( getLogger().isDebugEnabled() ) getLogger().debug( getId() + " retrieveItem() :: FOUND " + uid.toString() ); if ( getLogger().isDebugEnabled() ) getLogger().debug( getId() + " retrieveItem() :: NOT FOUND " + uid.toString() );
public void deleteItem( boolean fromTask, ResourceStoreRequest request ) throws UnsupportedStorageOperationException, IllegalOperationException, ItemNotFoundException, StorageException if ( getLogger().isDebugEnabled() ) getLogger().debug( getId() + ".deleteItem() :: " + request.toString() ); if ( getLogger().isDebugEnabled() ) getLogger().debug( "We are deleting a collection, starting a walker to send delete notifications per-file." );
getLogger().info( String.format( "Rebuilding item attributes in repository %s from path=\"%s\"", RepositoryStringUtils.getHumanizedNameString( this ), request.getRequestPath() ) );
getLogger().debug( String.format( "Clearing NFC cache in repository %s from path=\"%s\"", RepositoryStringUtils.getHumanizedNameString( this ), request.getRequestPath() ) ); if ( getLogger().isDebugEnabled() ) getLogger().info( String.format( "NFC for repository %s from path=\"%s\" was cleared.", RepositoryStringUtils.getHumanizedNameString( this ), request.getRequestPath() ) ); getLogger().debug( String.format( "Clear NFC for repository %s from path=\"%s\" did not alter cache.", RepositoryStringUtils.getHumanizedNameString( this ), request.getRequestPath() ) );
public void copyItem( boolean fromTask, ResourceStoreRequest from, ResourceStoreRequest to ) throws UnsupportedStorageOperationException, IllegalOperationException, ItemNotFoundException, StorageException if ( getLogger().isDebugEnabled() ) getLogger().debug( getId() + ".copyItem() :: " + from.toString() + " --> " + to.toString() );