input stringlengths 10 828 | output stringlengths 5 107 |
|---|---|
public long delete message by uid long message uid string session id throws delete message exception session id not valid exception try imap manager manager new imap manager return manager set deleted message uid session id catch manager exception ex throw new delete message exception ex get message | this method validates the session id and if it is successful a message |
public string subscribe folder string folder name string session id throws manager exception session id not valid exception if log is trace enabled log trace subscribe folder try int user id this dao validate session id session id if user id 1 throw new session id not valid exception session id session id is not valid return dao subscribe folder folder name user id catch data access exception ex throw new manager exception ex get message | this method validates the session id and if it is successful subscribes |
public string un subscribe folder string folder name string session id throws manager exception session id not valid exception if log is trace enabled log trace un subscribe folder try int user id this dao validate session id session id if user id 1 throw new session id not valid exception session id session id is not valid return dao un subscribe folder folder name user id catch data access exception ex throw new manager exception ex get message | this method validates the session id and if it is successful removes the |
private void lookup data source throws exception initial context ctx new initial context try try tomcat i e java comp env jdbc sync4j data source data source ctx lookup java comp env jndi data source name catch naming exception ne try try jboss i e java jdbc sync4j data source data source ctx lookup java jndi data source name catch exception ex try try othser j2ee server jdbc sync4j data source data source ctx lookup jndi data source name catch exception e throw new exception data source jndi data source name not found e to string | locates the correct datasource |
public void delete folder string folder name string session id throws delete folder exception session id not valid exception try imap manager manager new imap manager manager delete folder folder name session id catch manager exception ex throw new delete folder exception ex get message | this method validates the session id and if it is successful deletes the |
public void expunge string session id long folder id throws manager exception session id not valid exception if log is trace enabled log trace expunge try int user id this dao validate session id session id if user id 1 throw new session id not valid exception session id session id is not valid dao expunge folder id catch data access exception ex throw new manager exception ex get message | this method will remove all the messages containing the deleted flag |
public string update folder string old folder name string new folder name string session id throws update folder exception session id not valid exception try imap manager manager new imap manager return manager update folder old folder name new folder name session id catch manager exception ex throw new update folder exception ex get message | this method validates the session id and if it is successful updates the |
public string copy folder string session id string from string to throws manager exception session id not valid exception if log is trace enabled log trace copy folder try int user id this dao validate session id session id if user id 1 throw new session id not valid exception session id session id is not valid return null catch data access exception ex throw new manager exception ex get message | this method copy one folder to another location |
public string subscribe folder string folder name string session id throws subscribe folder exception session id not valid exception try imap manager manager new imap manager return manager subscribe folder folder name session id catch manager exception ex throw new subscribe folder exception ex get message | this method validates the session id and if it is successful subscribes |
public folder status get folder status string folder name string session id throws manager exception session id not valid exception if log is trace enabled log trace get folder status try int user id this dao validate session id session id if user id 1 throw new session id not valid exception session id session id is not valid return dao get folder status folder name user id catch data access exception ex throw new manager exception ex get message | this method will return the status of a current folder existing messages |
public string un subscribe folder string folder name string session id throws session id not valid exception un subscribe folder exception try imap manager manager new imap manager return manager un subscribe folder folder name session id catch manager exception ex throw new un subscribe folder exception ex get message | this method validates the session id and if it is successful removes the |
public void expunge folder string session id long folder id throws session id not valid exception folder not found exception try imap manager manager new imap manager manager expunge session id folder id catch manager exception ex throw new folder not found exception ex get message | this method will remove all the messages containing the deleted flag |
public long update flags string session id long message uid string flags throws manager exception session id not valid exception if log is trace enabled log trace update flags try int user id this dao validate session id session id if user id 1 throw new session id not valid exception session id session id is not valid return dao update flags message uid flags catch data access exception ex throw new manager exception ex get message | updates the flags on a specified message |
public string copy folder string session id string from string to throws folder not found exception session id not valid exception try imap manager manager new imap manager return manager copy folder session id from to catch manager exception ex throw new folder not found exception ex get message | this method copy one folder to another location |
public void set notifiable string session id boolean is notifiable throws manager exception session id not valid exception if log is trace enabled log trace update notifiable status try int user id this dao validate session id session id if user id 1 throw new session id not valid exception session id session id is not valid dao set notifiable user id is notifiable catch data access exception ex throw new manager exception ex get message | updates the notification status of the given user |
public folder status get folder status string folder name string session id throws session id not valid exception folder not found exception try imap manager manager new imap manager return manager get folder status folder name session id catch manager exception ex throw new folder not found exception ex get message | this method will return the status of a current folder existing messages |
public long update flags string session id long message uid string flags throws session id not valid exception update flags exception try imap manager manager new imap manager return manager update flags session id message uid flags catch manager exception ex throw new update flags exception ex get message | updates the flags on a specified message |
public void set nofifiable string session id boolean is notifiable throws session id not valid exception set notifiable status exception try imap manager manager new imap manager manager set notifiable session id is notifiable catch manager exception ex throw new set notifiable status exception ex get message | updates the notification status of the given user |
public void test authenticate throws exception system out println authenticate string username user string password password web service instance new web service string result instance authenticate username password assert not null result system out print result | test of authenticate method of class web service |
public void test folder add remove throws exception system out println add folder string add to folder null string folder name testfolder1 int folder type 0 string flgs null string username user string password password web service instance new web service string session id instance authenticate username password long result instance add folder add to folder folder name folder type flgs session id system out println folder created has id result assert not null result system out println going to remove folder id result instance delete folder folder name session id system out println folder removed | test of add folder method of class web service |
public void test update folder throws exception system out println update folder string add to folder null string folder name test update folder int folder type 0 string flgs null string username user string password password web service instance new web service string session id instance authenticate username password long folder id instance add folder add to folder folder name folder type flgs session id string new folder name folder name upatated string result instance update folder folder name new folder name session id assert equals new folder name result instance delete folder new folder name session id | test of update folder method of class web service |
public int delete message in folder string folder name int message id throws data access exception connection connection null prepared statement ps null try connection data source get connection ps connection prepare statement query delete message id in folder ps set string 1 folder name ps set int 2 message id ps execute ps null catch exception ex throw new data access exception ex get message finally try connection close catch sqlexception ex throw new data access exception ex get message return message id | deletes a message in a folder |
private int get user idby session id string session id throws data access exception connection connection null prepared statement ps null int user id 1 try connection data source get connection ps connection prepare statement query select username by session id ps set string 1 session id result set rs ps execute query if rs next user id rs get int 1 catch exception ex throw new data access exception ex get message finally try connection close catch sqlexception ex throw new data access exception ex get message return user id | returns the folder id given the foldername |
private int get number of users throws data access exception connection connection null prepared statement ps null int count 1 try connection data source get connection ps connection prepare statement query select number of users result set rs ps execute query if rs next count rs get int 1 catch exception ex throw new data access exception ex get message finally try connection close catch sqlexception ex throw new data access exception ex get message return count | returns the number of users in db |
private int get number of msgs throws data access exception connection connection null prepared statement ps null int count 1 try connection data source get connection ps connection prepare statement query select number of messages result set rs ps execute query if rs next count rs get int 1 catch exception ex throw new data access exception ex get message finally try connection close catch sqlexception ex throw new data access exception ex get message return count | returns the number of messages in db |
private int get max idin folder long folder id throws data access exception connection connection null prepared statement ps null int count 1 try connection data source get connection ps connection prepare statement query select max id in folder ps set long 1 folder id result set rs ps execute query if rs next count rs get int 1 catch exception ex throw new data access exception ex get message finally try connection close catch sqlexception ex throw new data access exception ex get message return count | returns the number of messages in folder |
public void total order broadcast message message throws ioexception for socket address sequencer sequencers message send sequencer | primary method for this class attempts to send a message to some group |
public void shutdown dest shutdown | shuts down any threads created by this server |
public void shutdown sequencer shutdown sender shutdown | shuts down any threads created by this sequencer |
public void start start listening for the token thread token listener new thread this token manager token listener start condition variable that the token manager will notify when it receives the token have token this token manager get condition | initializes the token sending receiving functionality |
public void set next sequencer socket address next sequencer this token manager set next address next sequencer | sets the next moving sequencer in the ring |
public void receive message message message type type message get type if type message type join receivers synchronized receivers receivers add message get source else if type message type leave receivers synchronized receivers receivers remove message get source | receives join leave messages and uses them to update the senders |
public void receive message message message type type message get type if type message type join receivers synchronized receivers receivers add message get sender id else if type message type leave receivers synchronized receivers receivers remove message get sender id else if type message type join senders synchronized senders senders add message get sender id else if type message type leave senders synchronized senders senders remove message get sender id else handler receive message | this method grabs join leave messages and uses them to update the |
public int hash code return super hash code object hash code | returns a hash code for this object message |
public string to string return super to string object object | returns a string representation of this object message |
public socket address get socket address return update get socket address | returns the update threads socket address |
public void set token token token this token manager set token token | sets the token for the token communications agent token manager |
public socket address get socket address return incoming get socket address | returns the multicast managers socket address |
public void send message message throws ioexception synchronized receivers for socket address receiver receivers message send receiver | send a multicast message to all members of the receiver group |
public boolean equals message m return hash code m hash code | compares the given message to this message |
public void shutdown try leave the multicast group message leave new message message type leave receivers get socket address leave set sender id node id leave send multicast manager catch ioexception e e print stack trace finally super shutdown | shuts down any threads created by this message receiver |
private void send ids socket address receiver throws ioexception synchronized receivers for entry long socket address entry receivers entry set message m new message message type join receivers entry get value m set sender id entry get key m send receiver synchronized senders for entry long socket address entry senders entry set message m new message message type join senders entry get value m set sender id entry get key m send receiver | sends the node ids of all group members to the given receiver |
public int hash code return super hash code method name hash code | returns a hash code for this rpcmessage |
public void shutdown try leave the multicast group message leave new message message type leave senders get socket address leave set sender id node id leave send multicast manager catch ioexception e e print stack trace finally update shutdown | shuts down any threads created by this message sender |
public long get sender id return sender id | returns this messages sender id |
public void run while running try socket socket listener accept object input stream ois new object input stream socket get input stream message message message ois read object socket close handler receive message catch ioexception e catch class not found exception e e print stack trace | the main loop of this thread |
public void receive message message system out println message | print the given message to system |
public string to string return super to string method name method name | returns a string representation of this rpcmessage |
public void shutdown this token manager shutdown this receiver shutdown this sender shutdown | explicit shutdown mechanism |
public void receive message message | receives a message and immediately returns |
public socket address get socket address return ut listener get local socket address | returns the socket address that this receiver is listening on |
public long get seq num return seq num | returns this messages sequence number |
public void shutdown incoming shutdown | shuts down any threads created by this multicast manager |
public void set message handler message handler handler ut handler handler | sets this message receivers handler to the given message handler |
public socket address get source return source | returns this messages source socket address |
public void set next address socket address next this next next | method to set the next token manager in the ring using addresses |
public void clear token this token lock lock this token null this token lock unlock | clears the token held by this object |
public int hash code return type hash code source hash code | returns a hash code for this message |
public void set next sender socket address next sender this token manager set next address next sender | sets the next privileged sender in the token ring |
public void send socket address dest throws ioexception socket socket new socket socket connect dest object output stream oos new object output stream socket get output stream oos write object this socket close | send this message to the given destination |
public void start thread token listener new thread this token manager token listener start | starts the token listening functionality inside of a new thread |
public void shutdown receiever shutdown sender shutdown | shuts down both the message sending and message receiving functionality |
public void set sender id long sender id this sender id sender id | sets this messages sender id to the given id |
public void shutdown this token manager shutdown sender shutdown | shuts down the token listening functionality of this sender |
public void set seq num long seq num this seq num seq num | sets this messages sequence number to the given sequence number |
public void total order broadcast message message throws ioexception get the most recent clock value for this process long timestamp this logical clocks get this receiever get node id timestamp message set timestamp timestamp send the message this sender send message update this process s logical clock this logical clocks put this receiever get node id timestamp | implemenation of the procedure to multicast m page 17 of the de fago |
public string to string return get class get simple name type type source source seq num seq num sender id sender id timestamp timestamp | returns a string representation of this message |
public void value changed tree selection event e default mutable tree node node default mutable tree node tree get last selected path component if node null return object node info node get user object if node is leaf produce prod produce node info if debug system out print prod to string else produce prod produce node info display produce prod to string if debug system out println node info to string | required by tree selection listener interface |
public date get remote date throws remote exception return new date | the remote method that does all the work |
private void add temperature logentry type measurements measurements string temperature id double temperature logentry type measurements temperature temperature type object factory create logentry type measurements temperature temperature type set location temperature id temperature type set value big decimal value of temperature list logentry type measurements temperature temperatures measurements get temperature temperatures add temperature type | adds a temperature element to the given measurements |
public void transform source xml source stream result output stream throws exception transformer factory trans fact transformer factory new instance transformer trans trans fact new transformer xslt source trans transform xml source output stream | performs an xslt transformation sending the results |
private void create default configuration throws storage exception object factory object factory new object factory furnace configuration object factory create furnaceconfiguration furnaceconfiguration temperature temp object factory create furnaceconfiguration temperature temp set mintemp new big decimal 25 temp set runningtemp new big decimal 80 temp set timebeforestop 60 furnace configuration set temperature temp furnaceconfiguration oxygen oxygen object factory create furnaceconfiguration oxygen oxygen set maxo2 percentage 85 oxygen set o2 percentage 20 oxygen set oxygencontrol onofftype on oxygen set timebeforestop 100 furnace configuration set oxygen oxygen persist | creates and persists a default configuration |
public void set furnace id java lang string param if param null update the setting tracker local furnace id tracker true else local furnace id tracker true this local furnace id param | auto generated setter method |
public void set log entry java lang string param if param null update the setting tracker local log entry tracker true else local log entry tracker true this local log entry param | auto generated setter method |
public void on scanned robot scanned robot event e fire 1 turn right e get bearing double distance e get distance int how close 1 if distance 250 how close 2 if distance 150 how close 3 if distance 50 how close 4 switch how close case 1 fire how close ahead 25 break case 2 fire how close ahead 20 break case 3 fire how close break case 4 fire how close back 50 break scan | on scanned robot what to do when you see another robot |
public void on hit by bullet hit by bullet event e turn right e get bearing scan | on hit by bullet what to do when youre hit by a bullet |
public double get n int p int q return double p q | method which gives n |
public double get phi n int p int q return double p 1 q 1 | method which gives pi n |
public double get e int p int q double phi n pgcd pgcd new pgcd double pgcd value double higer value p q p q for double e higer value e phi n e pgcd value pgcd get pgcd phi n e if pgcd value 1 return e the case where the pgcd of p and q is never found normally this will never happens return 0 | method which gives e |
public double get d double e double phi n long d 0 double result while true result e d phi n if result 1 d e return d system out println test d d | method which gives d |
public command ending this ending true return no state tracking | mark this command as ending the conversation |
public command translated this translated true return this | mark this command as needing translation by the tts server |
public string get string string id string val get string id null if val null throw new configuration exception missing id return val | get the value of a required parameter |
public command no state tracking this no state tracking true return this | mark this command as safely ignorable for client state tracking |
public int get int string id return as int id get string id | get the value of a required parameter as an integer |
public int get int string id int default val return as int id get string id integer to string default val | get the value of an optional parameter as an integer |
public resource get resource string id return find resource get string id | look up a resource whose location is specified in a parameter |
public void add mouse listener to table list mouse listener mouse listeners arrays as list get table get mouse listeners if mouse listeners contains j table mouse listener get table add mouse listener j table mouse listener | this method will add a |
private void set analysis list event list analysis analysis list this analysis list analysis list this analysis list glazed lists event list analysis list glazed lists sync event list to list analysis list this analysis list | this setter will make a copy of the given |
public void set video dir file dir get settings video dir dir get absolute path reset the cached value for this directory so it will be reinitialized during the next request video dir null | set a new directory for storing and reading compressed video files |
public string get capturer name return get settings capturer name | returns the first chosen capturer of the last program instance |
public void set uncompressed video dir file dir get settings uncompressed video dir dir get absolute path reset the cached value for this directory so it will be reinitialized during the next request uncompressed video dir null | set a new directory for storing and reading uncompressed video files |
public boolean add recording recording recording int old size get recording count boolean result get recordings add recording fire property change recording count old size get recording count return result | add a recording to the association |
public void set recording status recording status recording status boolean was recorded is recorded if recording status recording status non existant file this recording status null fire property change recording status this recording status this recording status recording status if recording status is erroneous don t change the statuscode if it is erroneous this status code recording status get code else this recording status recording status fire property change recorded was recorded is recorded | this method should set the right |
private void check recording duration recording recording file video file if recording get duration 0 long duration get duration video file recording set duration duration logger warn previously unsaved duration for recording get video file name now set to duration | check if the duration for the given recording and videofile is synchronized correctly |
public int refresh cache analysis analysis int files missing 0 for recording recording analysis get recordings file video file refresh cache recording files missing video file null files missing files missing return files missing | this method will iterate over the |
public boolean new blob detected event blob blob return true to keep blob false to discard if biggest blob null blob h biggest blob h biggest blob blob return true return false | callback method for the |
private void delete video file recording recording file video file get video file recording if video file null video file delete on exit logger debug video file get absolute path scheduled for deletion | delete the video file from the disk for the given |
private int delete empty directories int folders deleted file directory if directory exists file files directory list files for int i 0 i files length i don t delete invisible directories if files i is directory files i get name char at 0 folders deleted delete empty directories folders deleted files i we need a pre increment here so the variable will be incremented before it is returned return directory delete folders deleted folders deleted | recursively delete all empty directories found in a given directory |
public void set position int position if position get duration position 0 get video impl set position position fire property change position this position this position position | set the current playback position of the player |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.