public void setFolderListener ( final Location location, final FolderListener listener ) { logger.debug ( "Setting folder listener - location: {}, listener: {}", location, listener ); this.folderListeners.put ( location, listener ); final Folder folder = this.rootFolder.findFolder ( location.getPathStack (), false ); if ( folder != null ) { folder.setListener ( listener ); } }
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 ); }
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 Entry[] call () throws Exception { if ( this.folder == null ) { throw new NoSuchFolderException ( this.location.asArray () ); } return this.folder.list ( this.location.getPathStack () ); }
private void unsubscribePath ( final SessionCommon session, final Location location ) throws NoSuchFolderException { final Object tag = session.getData ().getTag ( new Location ( location ) ); if ( tag != null ) { session.getData ().removePath ( location ); synchronized ( this.subscriberMap ) { this.subscriberMap.remove ( tag ); } final Stack<String> pathStack = location.getPathStack (); getRootFolder ().unsubscribe ( pathStack, tag ); } }
final Stack<String> pathStack = location.getPathStack ();