@Override public String getId () { return this.itemInformation.getName (); }
public FolderWatcher ( final String... path ) { this.location = new Location ( path ); }
/** * Merge the two result sets * * @param firstResult * first set * @param secondResult * second set * @return the merged result */ protected WriteAttributeResults mergeResults ( final WriteAttributeResults firstResult, final WriteAttributeResults secondResult ) { final WriteAttributeResults newResults = new WriteAttributeResults (); if ( firstResult != null ) { newResults.putAll ( firstResult ); } if ( secondResult != null ) { newResults.putAll ( secondResult ); } return newResults; }
@Override public WriteAttributeResults setAttributes ( final Map<String, Variant> attributes ) { final WriteAttributeResults writeAttributeResults = new WriteAttributeResults (); for ( final Map.Entry<String, Variant> entry : attributes.entrySet () ) { if ( this.reservedAttributes.contains ( entry.getKey () ) ) { writeAttributeResults.put ( entry.getKey (), new WriteAttributeResult ( new Exception ( "Attribute may not be set" ) ) ); } } return writeAttributeResults; }
@Override public WriteResult call () throws Exception { writeHandler.handleWrite ( value, operationParameters ); return new WriteResult (); } } );
public DataItemInformationBase ( final DataItemInformation information ) { super (); this.id = information.getName (); this.ioDirection = EnumSet.copyOf ( information.getIODirection () ); }
@Override public void complete ( final WriteResult result ) { setResult ( new WriteAttributeResults () ); }
public Entry[] call () throws Exception { if ( this.folder == null ) { throw new NoSuchFolderException ( this.location.asArray () ); } return this.folder.list ( this.location.getPathStack () ); }
private static WriteAttributeResult convertResult ( final ErrorInformation errorInformation ) { if ( errorInformation == null ) { return WriteAttributeResult.OK; } else { return new WriteAttributeResult ( new OperationException ( errorInformation.getMessage () ).fillInStackTrace () ); } }
public void addEntry ( final Location location, final String name, final String itemId, final String description ) { final Folder folder = this.rootFolder.findFolder ( location.getPathStack (), true ); folder.addItemEntry ( name, itemId, description ); }
@Override public Set<IODirection> getIODirections () { return Collections.unmodifiableSet ( this.itemInformation.getIODirection () ); }
public FolderWatcher ( final String... path ) { this.location = new Location ( path ); }
@Override public void complete ( final WriteAttributeResults results ) { setResult ( new WriteResult () ); }
@Override public void disposeItem ( final DataItem item ) { this.itemMap.remove ( item.getInformation ().getName () ); }
public void removeEntry ( final Location location, final String name ) { final Folder folder = this.rootFolder.findFolder ( location.getPathStack (), false ); if ( folder == null ) { return; } folder.removeItemEntry ( name ); }
public void addFolderListener ( final FolderListener listener, final Location location ) { synchronized ( this.folderListeners ) { if ( !this.folderListeners.containsKey ( location ) ) { this.folderListeners.put ( location, new FolderSyncController ( this.connection, new Location ( location ) ) ); } final FolderSyncController controller = this.folderListeners.get ( location ); controller.addListener ( listener ); } }
@Override public WriteResult call () throws Exception { writeHandler.handleWrite ( operationParameters.getUserInformation (), value ); return new WriteResult (); } } );
public String getName ( final ItemDescriptor descriptor ) { try { return descriptor.getItem ().getInformation ().getName (); } catch ( final Throwable e ) { return null; } }
public void addFolderListener ( final FolderListener listener, final Location location ) { synchronized ( this.folderListeners ) { if ( !this.folderListeners.containsKey ( location ) ) { this.folderListeners.put ( location, new FolderSyncController ( this.connection, new Location ( location ) ) ); } final FolderSyncController controller = this.folderListeners.get ( location ); controller.addListener ( listener ); } }
@Override public WriteResult call () throws Exception { writeHandler.handleWrite ( operationParameters.getUserInformation (), value ); return new WriteResult (); } } );