input
stringlengths
10
828
output
stringlengths
5
107
public boolean is shutdown return get state server configuration server state shutdown
returns whether the server is in the shutdown state
public string get get bean code string instr string buffer sb new string buffer sb append rn int nameidx instr index of name nameidx 6 int endnameidx instr index of nameidx int propidx instr index of property propidx 10 int endpropidx instr index of propidx string name instr substring nameidx endnameidx string prop instr substring propidx endpropidx get the get xxx method name for the bean string getmethod string tool get get method name from var prop sb append out print string value of name getmethod return sb to string
get the java code for the usebean section
public string get set all bean code string instr string buffer sb new string buffer int nameidx instr index of name nameidx 6 int endnameidx instr index of nameidx string name instr substring nameidx endnameidx sb append bean handler set object parameters request name return sb to string
set all values on the bean
public string get use bean code string instr string buffer sb new string buffer jspbean handler bean handler new jspbean handler sb append rn int ididx instr index of id ididx 4 int endididx instr index of ididx int classidx instr index of class classidx 7 int endclassidx instr index of classidx string id instr substring ididx endididx string classname instr substring classidx endclassidx class id new class must have bean constructor sb append classname id new classname return sb to string
get the java code for the usebean section
public string get init parameter string name object ret this get val name trim if ret null serve logger log warn exten config get init parameter failed to get value for name return null return ret to string
returns a code string code containing the value of the
public boolean save file serve serve file file string path try com extentech toolkit jfile writer copy file file path file delete catch ioexception ex logger log err file upload widget save file couldn t move file file get path to path return false return true
moves the given file to its canonical location
public void init global vals int numitems globals get num rows string parmname parmval for int i 0 i numitems i parmname globals get string val i parameter name parmval globals get string val i parameter value globalvals put parmname parmval
set values on the global config object so that they can
public boolean delete file string fn if check access return false string drx this get directory if drx null if fn index of drx 0 return false not in the upload dir file fnx new file fn if fnx exists return false try fnx delete return true catch exception e return false
delete the file associated with this record
public boolean delete file serve serve string fname if check access return false string base dir serve get real path file file new file base dir fname if file exists return false try file delete return true catch exception e return false
deletes a file from the upload directory
public object get global val string name return globalvals get name
get the current value of a global
public void init config vals int numitems this get num rows string parmname parmval for int i 0 i numitems i parmname this get string val i description parmval this get string val i data configvals put parmname parmval
set values on the config object so that they can
public void init hashtable args for int i 0 i 4 i string val string args get string value of i switch i case 0 url val break case 1 driver val break case 2 user val break case 3 password val break
sets the database connection parameters
public enumeration get headers string s enumeration e this req header names elements return e
return the headers for this request
public string get address try return inet address get by name ip to string string value of port catch java net unknown host exception e this log e error getting host name for ip string value of ip return null
returns the web url for this server root
public enumeration get headers enumeration e req header names elements enumeration a req header values elements vector headers new vector while e has more elements headers add string e next element string a next element return headers elements
return an enumeration of header strings
public void set link add event url string s this link add event url s
add the set method for the url string
public void set link add event text string s this link add event text s
add the set method for the url text
public string get field string name if fields null throw new illegal state exception upload process has not been run return fields get name
returns the value of the specified form field
public void init cron cron new luminet cron this if this debug cron set debug this debug cronthread new thread cron serve srvnum cron cronthread start
initializes the new v2
public void populate date list result set rs string datefield print stream out super datelist clear try while rs next object dv null dv rs get object datefield if dv instanceof timestamp super cal set time new java sql date timestamp dv get time else super cal set time java sql date dv int dom super cal get super cal day of month super datelist add new integer dom catch exception e out print warning result set calendar widget populate date list failed e to string
populate the list of valid dates with a resultset
public void set page link string p this page link p
set the page for the generated url to use
public long get pulse time object val global settings get pulsechecker interval if val null pulsetime long parse long string val return pulsetime
returns the interval at which the pulse checker is to ping the
public boolean get pulse enabled object val global settings get pulsechecker enabled return val null true string val equals true
returns whether the pulse checker is enabled
public void run this serve inuse push this try get the streams in new serve input stream socket get input stream out new serve output stream socket get output stream this catch out of memory error oome system gc system err println serve connection run oome catch exception e problem getting streams e get message sc bad request e try parse request the money socket close this finalize catch throwable e serve log serve connection run failed e to string ignore this serve inuse remove this
start the connection
public hashtable get global settings hashtable global hash new hashtable try statement statement connection create statement get the list of server instances java sql result set rs statement execute query select from luminet globals while rs next global hash put rs get string parameter name rs get string parameter value if this debug enumeration e global hash elements while e has more elements string s string e next element logger log info global s rs close catch exception e logger log err error fatal exception starting luminet in get global settings e return global hash
return the global settings for this luminet server
public int get content length return get int header content length 1
returns the size of the request entity data or 1 if not known
public string get rfcdate simple date format fmt new simple date format eee d mmm yyyy hh mm ss z java sql date t new java sql date system current time millis return fmt format t
we need to format the date like so
return attributes get name
returns the value of the named attribute of the network service or
public string get protocol return req protocol
returns the protocol and version of the request as a string of
public string get scheme if this is secure return https return http
returns the scheme of the url used in this request for example
public long get uptime millis try long st long counters get server start time long stl st long value long nw system current time millis return nw stl catch exception e return 0l
returns the lifespan of this serve instance
public int get server port return socket get local port
returns the port number on which this request was received as used in
public void set relay auth user string r relay auth user r
set the user name to authenticate to the mail relay host
public void set relay auth password string r relay auth password r
set the password to authenticate to the mail relay host
public string get remote addr use the apache mod proxy forwarded ip 1 15 04 jm if this get header x forwarded for null return this get header x forwarded for return socket get inet address to string
returns the ip address of the agent that sent the request
public void reload server log shutting down server string value of srvnum this get server name try sessions set cache file session cache file sessions write to disk this destroy all servlets this server socket null system exit 0 catch exception e this log error serve reload server failed e
kills and reloads this server instance
public string get remote host return socket get inet address get host name
returns the fully qualified host name of the agent that sent the
public string get real path string path return serve get real path path
applies alias rules to the specified virtual path and returns the
public servlet input stream get input stream throws ioexception return in
returns an input stream for reading request data
public buffered reader get reader buffered reader r new buffered reader new input stream reader in return r
returns a buffered reader for reading request data
public void reload servlet string servletname string alias servlet srv servlet this servlets get servletname servlets remove srv srv destroy servlet srv new this get servlet instance servletname this add servlet alias srv new
reload a servlet by name
public int get parameter count return query names size
get the number of params
public string get parameter string name try enumeration en get parameter names int i query names index of name if i 1 return null else return string query values element at i catch exception e return null
returns the value of the specified query string parameter or null
public void set parameter string name string value if query names null query names new vector query values new vector req header names add element name to lower case req header values add element value query names add name query values add value
luminet specific helper method to allow putting new
public void finalize this reload server
shut down serve instances
public void log string message logger log info message
write information to the servlet log
public void log exception exception string message logger log err message exception
write a stack trace to the servlet log
public void log string message java lang throwable t logger log err message t
write a stack trace to the servlet log
public string get request uri return get request uri false
returns the full request uri
public void add to log file string line logger log info line
write a line to the server log file
public string get servlet path return req uri path
returns the part of the request uri that referred to the servlet being
public string get path info string path get request uri string servlet get servlet path int queryidx path index of if queryidx 1 path path substring path index of servlet servlet length queryidx else path path substring path last index of 1 return path
returns optional extra path information following the servlet path but
public string get file part string path vdirectory list vd cfg get vdirectory list string filename path string real path path string pth while path length 0 pth length 0 path last index of path index of path path substring 1 path length pth get path part path real path filename substring pth length return real path
returns alias for the specified virtual path
public string get path translated return this get real path this get path info
returns extra path information translated to a real path
public string get query string if this get method equals ignore case get return req query else if it s a post there should be no variables on the query string return null
get query string
public string get auth type this server does not support authentication return null
returns the authentication scheme of the request or null if none
public string get header string name int i req header names index of name to lower case if i 1 return null return string req header values element at i
returns the value of a header field or null if not known
public int get int header string name int def string val get header name if val null return def try return integer parse int val catch exception e return def
returns the value of an integer header field
public object get attribute string name return object attributes get name
returns the value of the named attribute of the network service or
public long get long header string name long def string val get header name if val null return def try return long parse long val catch exception e return def
returns the value of a long header field
public long get date header string name long def string val get header name if val null return def try return date format get date instance parse val get time catch exception e return def
returns the value of a date header field
public enumeration get header names return req header names elements
returns an enumeration of the header names
public vector get cookie vector vector cookie vect new vector java util arrays as list this get cookies return cookie vect
some more useful cookie methods
public boolean client supports cookies tricky boolean f true if this getco return f
luminet specific method which returns whether
public string get requested session id string idstr if get session get id equals ignore case idstr get session get id return idstr
gets the session id specified with this request
public boolean is requested session id valid luminet session session luminet session this get session if session is valid return true return false
checks whether this request is associated with a session that is
public void set content length int length set int header content length length
sets the content length for this response
public servlet output stream get output stream return servlet output stream out
returns an output stream for writing response data
public print writer get writer throws ioexception writer pout null try pout new print writer new output stream writer this out char encoding catch unsupported encoding exception e pout new print writer this out try without conversion return print writer pout
returns a print writer for writing response data
return char encoding
returns the character set encoding used for this mime body
public void add cookie cookie cookie outcookies add cookie
adds the specified cookie to the response
public boolean contains header string name return res header names contains name
checks whether the response message header has a field with the
public void set status int r string n this res code r this res message n
sets the status code and message for this response
set header name to1123 string new date value
sets the value of a date header field
public string encode url string url if this client supports cookies we ve got cookies no need to rewrite urls return url else http session sesh this get session already a parameter string if url index of 1 url sessionid else url sessionid url this get session get id return url
encodes the specified url by including the session id in it
public void add extension extension extension string name extension get extension name list extension list extensions get name if list null list collections synchronized list new array list extension list add extension extensions put name list fire extension added extension
adds a new extension to the list of registered extension points
protected void fire extension added extension extension for extension change listener ecl extension change listeners ecl extension added extension
informs all registered listeners that a new extension was added
protected void fire extension removed extension extension for extension change listener ecl extension change listeners ecl extension removed extension
informs all registered listeners that an extension was removed
public void add extension change listener extension change listener ecl extension change listeners add ecl
adds the given class as listener for change events
public void remove extension change listener extension change listener ecl extension change listeners remove ecl
removes the given listener
public void download for connection conn get connection list get connections if conn instanceof connection url try new urldownload new url get source connection url conn get url this null start download break catch malformed urlexception e e print stack trace
downloads the referenced service to determine the geometry object
public void add part byte partdata parts add partdata
adds the given part to the end of the list
public void write to file filename throws ioexception filename get parent file mkdirs file output stream fos new file output stream filename write number of blocks fos write parts size n get bytes write blocks for byte data parts fos write data length n get bytes fos write data
writes this parts object into the given file
public service add geometry string filename geometry geo service service new service service set geometry geo service get connection list add connection new connection url filename get services add service return service
adds a new service entry for the given geometry
public void write xml string filename throws ioexception string buffer xml new string buffer xml append xml version 1 0 response for service service get services xml append service get xml xml append response parts object po new parts object po add part xml to string get bytes po write to new file filename
writes this service list into the given service file
public string get xml string buffer result new string buffer result append connections for connection conn get connections result append conn get xml result append connections return result to string
returns all connections in a connections tag
public server list load server list string url throws malformed urlexception final server list sl new server list sl add listener new download finished listener public void download finished download finished data dfd list url addresses sl get addresses for url addr addresses system out println found addr synchronized sl sl notify all public void download failed download finished data dfd exception e info window show error e synchronized service list service list notify all sl download new url url synchronized sl try sl wait catch interrupted exception e e print stack trace return sl
loads a server list from the given address
public service load service final service service now choose the first service for download service add listener new download finished listener public void download finished download finished data dfd synchronized service service notify all public void download failed download finished data dfd exception e info window show error e synchronized service service notify all service download synchronized service try service wait 10000 catch interrupted exception e e print stack trace return service
downloads the given service it is an empty service object retrieved
public geometry load geometry final geometry geometry then download the first geometry e g the sphere geometry add listener new download finished listener public void download finished download finished data dfd synchronized geometry geometry notify all public void download failed download finished data dfd exception e info window show error e synchronized geometry geometry notify all geometry download synchronized geometry try geometry wait catch interrupted exception e e print stack trace set current geometry geometry return geometry
downloads the given geometry it is an empty geometry object retrieved
public geometry get current geometry return current geometry
returns the geometry that currently belongs to this model
protected void fire model changed event model change type mct for model changed listener mcl model changed listeners mcl model changed this mct
inform all listeners that this model has changed
protected void start throws malformed urlexception interrupted exception unavailable service exception create extension manager extension manager em new extension manager load configuration configuration conf new configuration load internal plugins gdm new geo data model load internal plugins em gdm conf load plugins load plugins em conf
loads a geometry and displays it in a window using jogl
protected void load plugins extension manager em configuration conf string plugins conf get property plugins if plugins null plugins system get property user home file separator earth3d java file separator plugins try conf set propery plugins plugins catch ioexception e e print stack trace file plugins dir new file plugins plugins dir mkdirs plugin manager load plugins plugins dir conf em
loads plugins using the
protected void create main window geo data model gdm extension manager em configuration conf main window mw new main window gdm conf mw set extension manager em mw set size 800 600 center window on screen mw set location relative to null mw set visible true mw get split pane set divider location 0 25
creates a jframe window containing the opengl widget
protected properties get jar properties jar file jar file throws ioexception jar entry jentry jar file get jar entry plugin properties properties jprop new properties jprop load jar file get input stream jentry return jprop
loads the properties of the plugin from the jar files plugin
protected void register extensions jar file jar file plugin class loader pcl todo add extension manager
loads the file extensions
protected jtool bar create tool bar jtool bar result new jtool bar return result
creates the toolbar for this application
public void set extension manager extension manager extension manager extension manager add extension this
registers itself as extension with the name main window
public glmain3 d get main3 dwidget return main3 dwidget
returns the glmain3 d widget that displays the earth planet
public geo data model get geo data model return geo data model
returns the geo data model currently displayed by the glmain3 d widget