input
stringlengths
10
828
output
stringlengths
5
107
public hash code builder append final byte value i total i total i constant value return this
append a code hash code code for a code byte code
public void parse final string authorization header matcher matcher header pattern matcher authorization header if matcher matches throw new illegal state exception authorization header authorization header doesn t match with oauth pattern header pattern pattern this start parse matcher key value matcher key value pattern matcher authorization header while key value matcher find string name key value matcher group 1 string value key value matcher group 2 this do param name value
parses the code authorization code http header
public string get consumer key return consumer key
returns the consumer key reference
public hash code builder append final byte array if array null i total i total i constant else for int i 0 i array length i append array i return this
append a code hash code code for a code byte code array
public equals builder append final int lhs final int rhs if is equals return this is equals lhs rhs return this
p test if two code int code s are equal
protected consumer storage get consumer storage return this consumer storage
returns the used consumer storage reference
public hash code builder append final char value i total i total i constant value return this
append a code hash code code for a code char code
public boolean add nonce final string nonce return this nonces add nonce
add a nonce to an access
public boolean contains nonce final string nonce return this nonces contains nonce
checks if the access already contains a nonce
public equals builder append final short lhs final short rhs if is equals return this is equals lhs rhs return this
p test if two code short code s are equal
public hash code builder append final char array if array null i total i total i constant else for int i 0 i array length i append array i return this
append a code hash code code for a code char code array
protected token storage get token storage return this token storage
returns the used token storage reference
public void serialize final abstract token token throws ioexception this write param oauth token token get token this write param oauth token secret token get token secret map string string sp data token get sp data if sp data is empty for entry string string entry sp data entry set this write param entry get key entry get value
serializes the token
public hash code builder append final double value return append double double to long bits value
append a code hash code code for a code double code
private void write param final string name final string value throws ioexception if value null return if this counter 0 this writer write delim this writer write utf8 utils url encode name this writer write equals this writer write utf8 utils url encode value this counter
serializes a field
public equals builder append final char lhs final char rhs if is equals return this is equals lhs rhs return this
p test if two code char code s are equal
public void close if this writer null try this writer close catch ioexception e close gracefully
simply closes the serializer gracefully
protected token generator get token generator return this token generator
returns the used token generator reference
public hash code builder append final double array if array null i total i total i constant else for int i 0 i array length i append array i return this
append a code hash code code for a code double code array
public equals builder append final byte lhs final byte rhs if is equals return this is equals lhs rhs return this
p test if two code byte code s are equal
public hash code builder append final float value i total i total i constant float float to int bits value return this
append a code hash code code for a code float code
protected token secret generator get token secret generator return this token secret generator
returns the used token secret generator reference
public hash code builder append final float array if array null i total i total i constant else for int i 0 i array length i append array i return this
append a code hash code code for a code float code array
public hash code builder append final int value i total i total i constant value return this
append a code hash code code for a code int code
public hash code builder append final int array if array null i total i total i constant else for int i 0 i array length i append array i return this
append a code hash code code for a code int code array
public hash code builder append final long value i total i total i constant int value value 32 return this
append a code hash code code for a code long code
public equals builder append final boolean lhs final boolean rhs if is equals return this is equals lhs rhs return this
p test if two code booleans code s are equal
public hash code builder append final long array if array null i total i total i constant else for int i 0 i array length i append array i return this
append a code hash code code for a code long code array
public equals builder append final object lhs final object rhs if is equals return this if lhs rhs return this if lhs null rhs null this set equals false return this if lhs length rhs length this set equals false return this for int i 0 i lhs length is equals i append lhs i rhs i return this
p performs a deep comparison of two code object code arrays
public equals builder append final long lhs final long rhs if is equals return this if lhs rhs return this if lhs null rhs null this set equals false return this if lhs length rhs length this set equals false return this for int i 0 i lhs length is equals i append lhs i rhs i return this
p deep comparison of array of code long code
public hash code builder append final object array if array null i total i total i constant else for int i 0 i array length i append array i return this
append a code hash code code for an code object code array
public hash code builder append final short value i total i total i constant value return this
append a code hash code code for a code short code
public equals builder append final int lhs final int rhs if is equals return this if lhs rhs return this if lhs null rhs null this set equals false return this if lhs length rhs length this set equals false return this for int i 0 i lhs length is equals i append lhs i rhs i return this
p deep comparison of array of code int code
public hash code builder append final short array if array null i total i total i constant else for int i 0 i array length i append array i return this
append a code hash code code for a code short code array
public hash code builder append super final int super hash code i total i total i constant super hash code return this
adds the result of super
public equals builder append final short lhs final short rhs if is equals return this if lhs rhs return this if lhs null rhs null this set equals false return this if lhs length rhs length this set equals false return this for int i 0 i lhs length is equals i append lhs i rhs i return this
p deep comparison of array of code short code
public equals builder append final char lhs final char rhs if is equals return this if lhs rhs return this if lhs null rhs null this set equals false return this if lhs length rhs length this set equals false return this for int i 0 i lhs length is equals i append lhs i rhs i return this
p deep comparison of array of code char code
public equals builder append final byte lhs final byte rhs if is equals return this if lhs rhs return this if lhs null rhs null this set equals false return this if lhs length rhs length this set equals false return this for int i 0 i lhs length is equals i append lhs i rhs i return this
p deep comparison of array of code byte code
public void flush base64 throws ioexception if position 0 if encode out write encode3to4 b4 buffer position options position 0 end if encoding else throw new ioexception base64 input not properly padded end else decoding end if buffer partially full end flush
method added by phil
public equals builder append final double lhs final double rhs if is equals return this if lhs rhs return this if lhs null rhs null this set equals false return this if lhs length rhs length this set equals false return this for int i 0 i lhs length is equals i append lhs i rhs i return this
p deep comparison of array of code double code
public equals builder append final float lhs final float rhs if is equals return this if lhs rhs return this if lhs null rhs null this set equals false return this if lhs length rhs length this set equals false return this for int i 0 i lhs length is equals i append lhs i rhs i return this
p deep comparison of array of code float code
public equals builder append final boolean lhs final boolean rhs if is equals return this if lhs rhs return this if lhs null rhs null this set equals false return this if lhs length rhs length this set equals false return this for int i 0 i lhs length is equals i append lhs i rhs i return this
p deep comparison of array of code boolean code
private void set equals final boolean is equals this is equals is equals
sets the code is equals code value
public void suspend encoding throws ioexception flush base64 this suspend encoding true end suspend encoding
suspends encoding of the stream
public response get resp from ws reference ws resource location return get resp from ws ws resource location defaul mediatype
makes a request to the ws with media type
public string get string string message string temp str system out print message buffered reader br new buffered reader new input stream reader system in boolean done false while done try temp str br read line done true catch exception e system out print that is not the correct input please try again continue return temp str
get string from user input
public int get int string message string temp str int value 1 boolean done false system out print message buffered reader br new buffered reader new input stream reader system in while done try temp str br read line value integer parse int temp str done true catch exception e system out print that is not the correct input please try again continue return value
get int function returns what int the user entered
public void write tofile string temp string dest boolean append try buffered writer out new buffered writer new file writer dest append out write temp out close catch ioexception e
write to file provides a function to write to files easly
public array list read from file string dest array list string file contents new array list string string temp try buffered reader in new buffered reader new file reader dest while temp in read line null file contents add temp in close catch ioexception e system out print where reading in from file return file contents
reads from a file
public string get mimetype return mimetype
get the mime type
public void command sent string conn id string cmd log info command sent cmd
log an ftp command being sent to the server
public void reply received string conn id string reply log info reply received reply
log an ftp reply being sent back to the client
public void download started string conn id string remote filename log info started download remote filename
notifies that a download has started
public void download completed string conn id string remote filename log info completed download remote filename
notifies that a download has completed
public void upload started string conn id string remote filename log info started upload remote filename
notifies that an upload has started
public void upload completed string conn id string remote filename log info completed upload remote filename
notifies that an upload has completed
public void command action command c displayable d if c back command d list destroy parent show return switch list get selected index case 0 break case 1 break case 2 break case 3 new app files bluetooth guimusic client parent break default system err println unexpected choice break
process the command event
public void destroy finalize the server work bt server destroy
destroys this component
public void start app if is init show
creates the demo view and action buttons
private void process connection stream connection conn read the name first string name read name conn check this item is published and get the file name name app files files access control get file name name load data into buffer to be sent byte data get data name send data now send data data conn close connection and good bye try conn close catch ioexception e ignore
reads the name from the specified connection
protected void destroy app boolean unconditional if configure server null configure server destroy if music null music destroy
destroys the application
public void command action command c displayable d if c exit cmd destroy app true notify destroyed return switch menu get selected index case 0 configure server new configure server this break case 1 image client new guiimage client this break case 0 music new app files music menu selection method this break case 1 video new app files videos menu selection method this break case 2 image new app files images menu selection method this break case 3 configure server new configure server this break default system err println unexpected choice break is init true
responds to commands issued on client or server form
public void destroy finalize the image client work bt client destroy
destroys this component
public void command action command c displayable d if c back command d list destroy parent show return switch list get selected index case 0 new app files bluetooth guiimage client parent break default system err println unexpected choice break
process the command event
public void command action command c displayable d if c back command d list destroy parent show return switch list get selected index case 0 new app files bluetooth guivideo client parent break default system err println unexpected choice break
process the command event
public void set resources collection resources iterator it resources iterator while it has next resource res resource it next add res
set the resource collection and create references
public void add object res if res instanceof resource add resource res
add a resource
public job manager get instance boolean initialized if jmf null synchronized job manager factory class if jmf null initialize return jmf get instance
get an instance of the associated job manager
protected void get job manager home throws naming exception ctx new initial context props object obj ctx lookup deisa ejb job manager job home job manager remote home javax rmi portable remote object narrow obj job manager remote home class
initializes the job home object
public void set timer interval long timer interval this timer interval timer interval timer new timer timer add notification listener this null null timer add notification type resource service mbean interval null new date timer interval timer start logger info job management started with timer interval this timer interval msec
set the timer intervall to the given value
protected void remove job manager job manager remote jmi throws job manager exception try jmi remove catch remote exception e throw new job manager exception could not access job manager e get message catch remove exception e throw new job manager exception could not remove job manager e get message finally jmi null
remove the job manager instance
public void clear resource cache resource map clear
clear the resource map
public void create
nothing to be done here at creation time
public object name pre register mbean server server object name name throws exception logger info preregistering job manager mbean if name null this name name else this name new object name de mpg rzg grid unicore service job manager logger debug registering as this name return this name
pre registering the mbean
public void pre deregister throws exception timer remove notification listener this
we only need to remove the notification listener
public boolean is initialized if initialized synchronized job manager class return initialized return true
returns the initialization status of this class
public void run logger debug thread started this reply reply null try reply retrieve outcome job id vsite connection catch exception ex logger warn thread unsuccessful ex get message if reply null if reply instanceof retrieve outcome reply add reply reply it only makes sense to look for streamed std out err if the reply was of the correct type try zip input stream is connection get streamed input stream logger debug got is is available add reply is catch ioexception e logger warn no files attached connection done logger debug thread done this
run method of this thread class
public void post register boolean registration done logger info post registering job manager mbean
in the post registering phase the timer mbean is created which
protected void add reply reply reply if results null results new array list results add reply
synchronized add of replies for the threads
public void set timer interval long timer interval this timer interval timer interval timer new timer timer add notification listener this null null timer add notification type job manager mbean interval null new date timer interval timer start logger info job management started with timer interval this timer interval msec
set the attribute timer interval
public void start logger info name get canonical name started try context ctx new initial context queue fac queue connection factory ctx lookup connection factory queue queue ctx lookup queue job manager mdbean catch naming exception e logger warn could not find queue creating it
start the mbean operation
public void ejb create throws ejbexception
create method of this message bean
public void set gateway uri string gateway throws job manager exception try reference new reference ssl gateway identity catch exception e throw new job manager exception e this gateway gateway
set the unicore gateway url
public void ejb activate throws ejbexception remote exception activate logger log factory get log this get class
reactivate the session
public void session created http session event arg0 logger info sesson created arg0 get source try initialize enumeration en arg0 get session get attribute names logger info session attr while en has more elements logger info en next element catch naming exception e well what can we do about that logger warn initializing failed due to naming exception e get message
if a session is created the method is invoked by the container
public void session destroyed http session event arg0 logger info session destroyed save session
clean up and save the users session parameters which should be
public void attribute added http session binding event arg0 http session session arg0 get session if arg0 get name equals vsite try vsite changed session string arg0 get value catch job manager exception e ok that s unfavorable but well what can we do todo distinguish the causes logger warn could not get vsite information on change for session attribute vsite else test if the new attribute is the authenticated user if arg0 get name equals remote user initialize user session string arg0 get value
this listener is interested in events concerning
public void attribute removed http session binding event arg0 todo auto generated method stub
currently we are not interested in this method
public void ejb passivate throws ejbexception remote exception release the job manager job manager null logger null if hsession null hsession is open hsession close
go to passivation
public string get gateway uri return gateway
get the unicore gateway uri in the unicore form
public collection get virtual sites throws job manager exception principal principal this ctx get caller principal logger info ejb created from principal get name return job manager get virtual sites
get the virtual sites known to a gateway
public void set gateway uri string gateway throws job manager exception job manager set gateway uri gateway
set the new gateway uri
public job status get job status object job id object vsite x509 certificate cert signature signature throws job manager exception get session find the job in the database job status hbm job status null try job status job status hbm hsession get job status hbm class new integer ajoidentifier job id get value catch exception e logger error error while trying to access a job status e get class get name logger error e get message return the job status return job status
get the status of the specified job
public void cancel job object job id object vsite x509 certificate cert signature signature throws job manager exception try unregister ajoidentifier job id get value catch exception e logger error could not unregister job throw new job manager exception e job manager cancel job job id vsite cert signature update status ajoidentifier job id vsite vsite cert signature
cancels a job and discards its output in the njs uspace
public void halt job object job id object vsite x509 certificate cert signature signature throws job manager exception todo auto generated method stub throw new job manager exception not implemented yet
not implemented yet
public void kill job object job id object vsite x509 certificate cert signature signature throws job manager exception job manager kill job job id vsite cert signature get session job status hbm status job status hbm hsession get job status hbm class new integer ajoidentifier job id get value if status null status set reason being killed hsession update status hsession flush
kill abort a job running on an njs
public void resume job object job id object vsite x509 certificate cert signature signature throws job manager exception todo auto generated method stub throw new job manager exception not implemented yet
not implemented yet
public collection get virtual sites throws job manager exception vsite vsites get virtual sites native collection a l arrays as list vsites return a l
get the virtual sites in a standardized form
protected session get session hsession factory get current session if hsession null hsession factory open session else if hsession is open hsession factory open session return hsession
handle hibernate session management
protected connection get connection throws com fujitsu arcon servlet connection exception if connection null synchronized job manager class if connection null connection get socket is closed connection set keep open true connection connection get connection reference return connection
get a new connection