input
stringlengths
10
828
output
stringlengths
5
107
public void set id object id id this id id
sets the identifier of the changed object
public object id get object id object obj return object id registry get id obj
returns the object id for the given shared object or null if the
public void check get principal p throws security exception if read mode all if read mode delegated super check get p else string id p get name if user equals id check id can read return throw new security exception id cannot retrieve this object
throws an exception if the given principal is not allowed to
public void add object obj object id id from id put id obj we can t just use to id put obj id here since e g if we ve cloned an object we ll clobber the first copy synchronized to id vector v vector to id get obj if v null v new vector to id put obj v v add element new object idrecord obj id
add a shared object to registry
public void set server permissions checker server permissions checker po if po null po new standard server permissions checker permissions handler po
sets an optional server permissions checker object used to handle
public void add permissions permissions perms object id id permissions put id perms
add a permissions object to the registry
public void check delete principal p throws security exception if write mode all if write mode delegated super check delete p else string id p get name if user equals id check id can write return throw new security exception id cannot delete this object
throws an exception if the given principal is not allowed to
public permissions get permissions object id id return permissions permissions get id
return the permissions object for the obj with the given id
public object id get delegate return delegate
returns the object id of the object that we delegate to
public void check change principal p change ch throws security exception if write mode all if write mode delegated super check change p ch else string id p get name if user equals id check id can write return throw new security exception id cannot change this object
throws an exception if the given principal is not allowed to
public void apply meta data replacement object meta data object id id replace our local cached copy if we have one cache object record cor cache object record objects get id if cor null cor meta data meta data this ordering is less fair than that used by server impl hash map h hash map clients clone for iterator i h values iterator i has next client queue cq client queue i next try cq enqueue meta data replacement meta data id catch throwable t t print stack trace
propagates a permissions change to downstream clients
public void add meta data object meta data object id id if meta data null meta put id meta data else meta remove id
adds a meta data object to the registry
public void set delegate object id delegate this delegate delegate
sets the delegate object id
public object get meta data object id id return meta get id
returns the meta data object for the given id
public void delete object object id id throws ioexception security exception server delete object id principal registry remove by id id
removes and deletes the object with the given id
public void remove by id object id id object obj from id get id remove obj from id remove id redundant
remove a shared obj from the registry
public basic principal add multiplexed client client cl string user multiplexed cl hash code should just put a counter here right long unique id system current time millis user hash code basic principal bp new basic principal user unique id null client queue cq new client queue this cl unique id bp cq set multiplexed true clients put new long unique id cq client vector add element cq return bp
adds a multiplexed client connection
public object get object object id id return from id get id
returns a reference to a obj for the given id
public object id get id object obj object id id null synchronized to id vector v vector to id get obj if v null for int i 0 i v size id null i object idrecord rec object idrecord v element at i if rec obj obj id rec id will terminate loop return id
returns the id for the given obj
public void clear to id clear from id clear permissions clear meta clear
clears all data in the registry
public void replace permissions permissions perms object id id try if the caller has simply changed the existing perms and then called replace permissions then we have a problem since serialization won t always force the changed object to be sent we check for that explicitly here and make a deep copy of the object if necessary permissions current get permissions id if current perms perms permissions deep copy utility copy perms server replace permissions perms id principal unique id catch exception ex ex print stack trace
replaces the permissions object for the shared object with the
public notebook entry get notebook entry return entry
returns the entry that this event refers to
public int get old position return old position
for entry moved events returns the old position of the moved entry
public void entry added notebook model event evt if evt is remote client broadcast change new add notebook entry change evt obj id
called when a new notebook entry is added
public void entry removed notebook model event evt if evt is remote client broadcast change new remove notebook entry change evt obj id
called when a notebook entry is removed
public void entry moved notebook model event evt if evt is remote client broadcast change new move notebook entry change evt obj id
called when a notebook entry is moved
public void set help item help item item int idx help items set element at item idx help listeners fire element replaced item idx
since we dont want to have to listen to each individual help item
public void update publishing config publishing config config config set public is public is selected config set name name get text config set generate headers generate headers is selected config set generate footers generate footers is selected
updates the config object based on the values in the panel
public void flush inactive objects throws exception system out println in flush inactive objects cache size is edu vt cs collab cork util size utility get size obj registry obj registry flush inactive objects
flushes all inactive objects currently in memory
public void entry added notebook model event evt
called when a new notebook entry is added
public void entry removed notebook model event evt
called when a new notebook entry is removed
public void entry moved notebook model event evt
called when a new notebook entry is moved
public void write throws exception obj registry write
writes all modified objects in the cache
public void add entry notebook entry entry add entry entry false
called by client ui object to add an entry to the session
public void remove entry notebook entry entry remove entry entry false
called by client ui object to remove an entry from the session
public void move entry notebook entry entry int new index move entry entry new index false
called by client ui object to move an entry to a new location
public int get active object count return obj registry get active object count
returns the number of active unflushed objects in the cache
public int get modified object count return obj registry get modified object count
returns the number of modified but unwritten objects in the cache
public void stop sharing object shared object replicated object client client tell the server we re not listening anymore if is participating vector me new vector 1 me add element new long client get client id manage participants change mpc new manage participants change 1 me broadcaster broadcast immediately client mpc id true then detach ourselves shared document data data shared document data shared object shared document doc data get shared document doc remove shared document listener this this client null
detach any listeners attached in code start sharing code
public void edit occurred shared document doc edit command com if is participating become participant com if client null if com get type edit command no op no op edit command change ncc new no op edit command change com broadcaster broadcast immediately client ncc id true else edit command change ecc new edit command change com broadcaster broadcast eventually client ecc id true
called when a local edit happens in the document
public int check pending change change pending change new change int result throttled change broadcaster send pending change edit command change ecc edit command change new change edit command change last null if pending instanceof composite change last edit command change composite change pending get last change else last edit command change pending if last get type ecc get type result throttled change broadcaster merge pending change return result
returns one of discard pending change send pending change or
public void activate if pane null pane set editable is writable
enable or disable the text pane on activation based on writability
public change merge changes change pending change new change composite change cc null if pending instanceof composite change cc composite change pending else cc new composite change cc add change pending cc add change new change return cc
called after check pending change
public object get network status object status null if server instanceof generic client stub status new integer generic client stub server get queue size return status
experimental method for returning indication of network status
public object id get object id return id
returns the current object id
public void set object id object id id object old this id this id id reset fire property change object id old id
sets the current object id
public object session data get object session data return osd
returns the object session data object for the label
public void reset if id null set text else vector v osd get items for object id id if v null v size 0 set text else if v size 1 set text 1 user set tool tip text you are the only one using this object else set text v size users set tool tip text format users object in use by v dump osd
resets the label to reflect the current objects users
public void element added list event evt if client is dispatch thread string list item item string list item evt get object runner run new updater item
invoked when an element is added to the end of the list
public void detach osd remove list listener listener
should be called to detach the label from the object data source
public object read object input stream in throws ioexception user list model list new user list model data input stream dis new data input stream in storage handler utility string item item util read string item dis while item null if item name equals ignore case timer interval list set timer interval integer parse int item value else try user data ud user data class for name item name new instance ud from external form item value list add user ud catch exception e e print stack trace item util read string item dis return list
reads the object from the given stream
public session data get session data replicated object client client return get session data client get user client
utility method for extracting the session data object for the user
public void set iconified boolean iconified if iconified this iconified boolean old this iconified this iconified iconified fire property change iconified new boolean old new boolean iconified
sets whether the object is minimized iconified or not
public object session data get object session data return object session data
returns the object session data were listening to
public hashtable get actions return null
disable clipboard ops
public boolean get iconified return iconified
retrieves whether the object is minimized or not
public void set activated boolean activated if activated this activated boolean old this activated this activated activated fire property change activated new boolean old new boolean activated
sets whether the object is activated or not
public long get client identifier return client identifier
returns the id of the client that the user is logged in from
public void set cursor id object id cursor id if cursor id equals cursor id object old this cursor id this cursor id cursor id fire property change cursor id old cursor id
sets the object id of the cursor data
public object id get cursor id return cursor id
returns the object id of the cursor data
public date get login time return login time
returns the time that the client logged in
public void fire property change string name object old object new value if listeners null listeners fire property change name old new value
notifies the server of a change
public string to string return get class get name iconified get iconified activated get activated cursor id get cursor id
returns a string representation of this component and its values
public void detach osd remove list listener this
tells the list model to detach itself from the object session data object
public date get idle time return idle time
returns the time that the user went idle
public void update user user data user int idx users index of user if idx 0 users set element at user idx user list model event evt new user list model event this user for enumeration e listeners elements e has more elements user list model listener e next element user changed evt fire contents changed this idx idx
causes an event to be fired indicating that the given user data object
public void set idle time date idle time date old this idle time if old idle time old null idle time null old equals idle time check for bad dates e g bad client side clock setting if idle time null long nt system current time millis long it idle time get time if it nt nt it 30000 idle time new date this idle time idle time fire property change idle time old idle time
sets the number of seconds that the user has been idle
public void set status string status object old this status this status status fire property change status old status
sets the status string e
public void client login server event evt replicated object user user evt get user system err println login user get name list add item create shared list item user
called when a client logs in
public void client logout server event evt replicated object user user evt get user system err println logout user get name shared list item item get shared list item user if item null list remove item item clean up session data item
called when a client logs out
public session data get session data replicated object user user session data data null shared list item item get shared list item user if item null try object id id object id from string item to string data session data client get object id catch exception e return data
utility method for returning the session data object for the
public window state parse window state string list item item replicated object client client window state window state null try string tuple parse item object id window state id object id from string tuple 4 system out println osd parse window state window state id window state id window state window state client get object window state id catch exception e system out println error retrieving window state object return window state
returns the window state object for the given item
protected boolean get replicate item property changes return false
may be overridden by subclasses to return true if
public void element added list event evt shared list list shared list evt get source shared list item item shared list item evt get object if listen for item props property support add property change listener this item long item id shared list event evt get item id if item id 1 if evt get index 1 item id list get item idat evt get index else item id list get item id item cl broadcast change new add item change item item id id false
invoked when an element is added to the end of the list
public string to external form return value
returns a string that can be parsed by code from external form code
protected void write items storage handler utility util print stream ps object obj throws ioexception
subclasses should override this to write any additional properties
public void from external form string external form this value external form
parses the string to initialize the item
public void element removed list event evt shared list item item shared list item evt get object if listen for item props property support remove property change listener this item we can t use the item id here because it has already been removed so we don t know what it is was cl broadcast change new remove item change item evt get index shared list event evt get item id id false
invoked when an element is removed from the list
public boolean equals object obj return obj instanceof string list item string list item obj value equals value
checks for equality of two string list items
protected void read item storage handler utility string item item object obj
subclasses should override this to initialize from values written
public string to external form string buffer buf new string buffer buf append id buf append delimiter buf append parent id buf append delimiter buf append get user object get class get name buf append delimiter buf append shared list item get user object to external form return buf to string
returns a string that can be parsed by code from external form code
public void element inserted list event evt shared list list shared list evt get source shared list item item shared list item evt get object if listen for item props property support add property change listener this item cl broadcast change new insert item change item evt get index shared list event evt get item id id false
invoked when an element is inserted into the list
protected shared list get new shared list return new shared list
subclasses should override this to return an empty instance of
public void element replaced list event evt shared list list shared list evt get source shared list item item shared list item evt get object if listen for item props property support add property change listener this item cl broadcast change new update item change item evt get index shared list event evt get item id id false
invoked when an element in the list is replaced
public void list cleared list event evt shared list list shared list evt get source if listen for item props for int i 0 i list get size i shared list item item shared list item list get item at i property support remove property change listener this item cl broadcast change new clear list change id false
called when the list is cleared
protected void fire property change string name object old object new value if pc listeners null pc listeners fire property change name old new value
this is here in case subclasses add additional properties
public string to external form byte array output stream os new byte array output stream print stream ps new print stream os for enumeration keys keys keys has more elements string key keys next element to string try util write string item ps key get property key catch ioexception e e print stack trace ps flush return os to string this would have been easier string writer sw new string writer list new print writer sw return sw to string
returns a string that can be parsed by code from external form code
public int get size return list get size
return the size of the shared list
public object get element at int idx try return list get item at idx catch array index out of bounds exception e return null catch throwable t t print stack trace return null
return the element at the specified index
public void set selected item object sel selected item sel
sets the selected item if used as a combo box model
public shared list item get item at int idx return item record items element at idx obj
returns the value at the specified index
private void add to list mutable tree node node maybe we should always remove the node and re add it just to be safe if list contains shared list item node list add item shared list item node for enumeration e node children e has more elements add to list mutable tree node e next element
recursively adds a node and its descendants to the shared list
public int get index shared list item item synchronized items int size items size for int i 0 i size i if item record items element at i obj equals item return i return 1
returns the index of the item
protected shared list item get item with id long id for enumeration e items elements e has more elements item record rec item record e next element if rec id id return rec obj return null
returns the item with the given id
public void set owner name string owner name object old this owner name this owner name owner name fire property change owner name old owner name
sets the name of the current owner of this object
public object read object input stream in throws ioexception shared map map new shared file return read object in map
reads the object from the given stream
public void add item shared list item item item record rec new item record item items add element rec if listeners null shared list event evt new shared list event this rec obj items index of rec rec id listeners fire element added evt
adds an item to the end
public string get description return uploaded files may not exceed max bytes
returns a string describing the constraints imposed by this quota
public void file deleted object id shared file id replicated object client client long size
called to notify the quota object that the content for the given
protected void add item shared list item item long id if get item with id id null item record rec new item record id item items add element rec if listeners null shared list event evt new shared list event this rec obj items index of rec rec id listeners fire element added evt
adds an item to the end