public boolean hasAnyTargetsForRequest( ResourceStoreRequest request ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "hasAnyTargetsForRequest() :: " + this.getId() ); } return targetRegistry.hasAnyApplicableTarget( this ); }
/** * Gets the not found cache. * * @return the not found cache */ public PathCache getNotFoundCache() { if ( notFoundCache == null ) { // getting it lazily notFoundCache = getCacheManager().getPathCache( getId() ); } return notFoundCache; }
public TargetSet getTargetsForRequest( ResourceStoreRequest request ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "getTargetsForRequest() :: " + this.getId() + ":" + request.getRequestPath() ); } return targetRegistry.getTargetsForRepositoryPath( this, request.getRequestPath() ); }
protected void enforceWritePolicy( ResourceStoreRequest request, Action action ) throws IllegalRequestException { // check for write once (no redeploy) if ( Action.update.equals( action ) && !RepositoryWritePolicy.ALLOW_WRITE.equals( this.getWritePolicy() ) ) { throw new IllegalRequestException( request, "Repository with ID='" + getId() + "' does not allow updating artifacts." ); } }
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 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; }
getLogger().debug( getId() + ".deleteItem() :: " + request.toString() );
getLogger().debug( getId() + ".copyItem() :: " + from.toString() + " --> " + to.toString() );
throw new IllegalRequestException( request, "Repository with ID='" + getId() + "' is Read Only, but action was '" + action.toString() + "'!" );
getLogger().debug( getId() + ".storeItem() :: " + item.getRepositoryItemUid().toString() );