input
stringlengths 10
828
| output
stringlengths 5
107
|
|---|---|
private composite normalize text string text string normalized text composite display new composite boolean truncated false if normalized length 60 normalized normalized substring 0 59 truncated true display add normalized if truncated display add new italic truncated return display
|
truncate matching search text in a consistent manner
|
private boolean is update request string action action parse utils get text get xml utils get request root action return update equals ignore case action
|
is this an update request
|
private boolean is setup request return initial equals ignore case get parameter ap e setup
|
is this the initial setup request
|
private void add normalized select select string text string default text if text equals ignore case default text select add text false text
|
normalize select value add new text if not already in the list
|
private boolean update successful return is setup request is update request get status get response document
|
did we successfully update machine info
|
private table new search text table table table new table 0 standard table align center width 80 table new row table new cell align center table add search is not case sensitive wildcards are supported table new row table new cell align center table add use table add new bold table add to match a sequence of characters table add new bold table add to match a single character add rows table 1 return table
|
add brief search help
|
public string get banner return standard not set
|
return the page banner text
|
public string get title return standard not set
|
return the page title
|
public void get bread crumb detail
|
return bread crumb information describe the path to this page
|
protected link new machine detail link string host string path string title string buffer url new string buffer ap command machinedetail add url parameter url ap e target host add url parameter url ap e title title add url parameter url ap e parameter path add request parameters to url url ap e target ap e restore return new link url to string host
|
create a new machine detail link
|
protected font abbreviate size with warning string size return abbreviate size size true
|
truncate size to one of gb mb kb warning if below 1 gb
|
protected font abbreviate size string size return abbreviate size size false
|
truncate size to one of gb mb kb
|
protected font abbreviate size long size return abbreviate size string value of size false
|
truncate size to one of gb mb kb
|
protected long parse long string value try return long parse long remove character value catch number format exception exception return 1
|
parse a diskspace value text version of a long integer
|
protected string remove character string original char character string buffer result new string buffer for int i 0 i original length i char c if c original char at i character result append c return result to string
|
remove a character from a string
|
public void get bread crumb detail set admin crumb detail append bread crumb detail ccp command ipaccessgroups ip access groups page page banner
|
return bread crumb information describe the path to this page
|
public void do page activity if group name get parameter ap e name null throw new render base render exception missing mandatory parameter ap e name set id and address iterator group name
|
fetch an iterator to the ip access control group names
|
public void get bread crumb detail set admin crumb detail
|
return bread crumb information describe the path to this page
|
private boolean is create action string action get parameter ap e action if create equals ignore case action return true if delete equals ignore case action string util is null string get parameter ap e newmember return true return false
|
add cluster command
|
private boolean create successful return is create action get status get response document
|
did we successfully add a cluster
|
private void display other cache locations table table if empty cache system list add rows table 1 3 display cache systems table also preserved on
|
display other caches that preserve this au
|
private boolean is restore command string command parse utils get client command get xml utils get request document return ap command restoreau equals command
|
is this a client restore command
|
private boolean is restore action return edit au configure restore au equals ignore case get text ap e action
|
is this an au restore
|
private boolean is update action return update equals ignore case get text ap e action
|
is this an au update
|
private document find response string server try return find response document for server server catch xml exception exception return null
|
locate the response document for a specified server
|
private boolean update successful return is update action get status get response document
|
did we successfully update the au
|
private boolean remove successful return is remove action get status get response document
|
did we successfully remove the au
|
private boolean deactivate successful return is deactivate action get status get response document
|
did we successfully deactivate the au
|
private string error string text log warning text add status text text return com value unknown
|
set error text return the standard unknown message
|
public void get bread crumb detail set admin crumb detail append bread crumb detail ccp command aclmenu acl menu page page banner
|
return bread crumb information describe the path to this page
|
public void do page activity try ip group name iterator get ip group name iterator journal acls if acl menu page acl journal equals ignore case get parameter ap e type string parameter get parameter ap e parameter string array null if parameter null array new string parameter lockss title iterator get lockss title iterator array note setup complete page setup complete true catch sqlexception exception string error text failed to obtain lockss title or ip access control group information log error error text exception add status text error text exception to string
|
initial setup get iterators to access group names journals etc
|
private select populate target form and select string type iterator iterator select select add target form type select new select ap e parameter false select attribute on change javascript targetform parameter value this value targetform submit populate and pad select select iterator 10 return select
|
create and populate the target select box and associated hidden form
|
private void add target form string type form form new form form attribute name targetform form add new input input hidden ap e action newtarget form add new input input hidden ap e type type form add new input input hidden ap e parameter add to page form
|
set up a hidden form to handle acl target selection
|
private void add target designation table table string type add target designation table type null
|
add the target selection header
|
protected void set au cache iterator iterator iterator au cache iterator iterator
|
set the au cache list iterator
|
private void add target designation table table string type select select table new row table new cell colspan 3 align center valign top table add new bold type add rows table 1 3 standard row spacing if select null table new row table new cell colspan 3 align center valign top table add select
|
add the target selection list
|
private void add text table table string text table inner table new row table new cell colspan 3 align center inner new table 0 standard table width 80 align center inner new row inner new cell align center valign top inner add text table add inner
|
add new text to the page
|
protected iterator get au cache iterator return au cache iterator
|
get the au cache list iterator
|
public void do page activity try ip delete group name iterator get ip group name iterator ip update group name iterator get ip group name iterator catch sqlexception exception string error text failed to obtain ip access control group information log error error text exception add status text error text exception to string
|
fetch an iterator to the ip access control group names
|
public string get banner return not implemented
|
return the page banner text
|
public string get title return status
|
return the page title
|
protected iterator au cache subset iterator original string remove text array list result list new array list while original has next result list add original next for int i 0 i remove text length i int index result list index of remove text i if index 1 result list remove index return result list iterator
|
edit an iterated list removing specified members
|
protected document get setup document if setup document null if setup document super get setup document null return null return setup document
|
establish command setup information
|
private string format platform document document string value value parse utils get text get xml utils document get document element ap e platformver return ap value unknown equals value null value
|
fetch platform identifier
|
protected string get plugin name string name get text ap e pluginname if string util is null string name org w3c dom element plugin element name if plugin element get plugin null name parse utils get text get xml utils plugin element ap e name return name
|
get plugin name
|
private string format api version document document return parse utils get xml version get xml utils document
|
fetch ithe api version
|
private string format build document document org w3c dom element build org w3c dom element element string buffer result string time host build get xml utils get element document get document element ap e build parse utils verify mandatory element build ap e build time parse utils get text get xml utils build ap e timestamp host parse utils get text get xml utils build ap e host return time on host
|
fetch formatted build information
|
protected string get plugin id org w3c dom element plugin element if plugin element get plugin null return parse utils get text get xml utils plugin element ap e id return
|
get plugin id the classname
|
private font format free space document document org w3c dom element diskspace string buffer result string byte text pick up the free space diskspace get xml utils get element document get document element ap e diskspace parse utils verify mandatory element diskspace ap e diskspace byte text parse utils get text get xml utils diskspace ap e free return abbreviate size with warning byte text
|
format server free space text
|
public string get banner return admin title
|
return the page banner text
|
protected string get plugin journal title org w3c dom element plugin element string title null if plugin element get plugin null title parse utils get text get xml utils plugin element ap e title if title null string name get plugin name handle null titles this really should not be necessary title com value unknown if string util is null string name title for plugin name log warning null title configuration provided by remote host return title
|
get the journal title for the au this plugin is caching
|
public void add banner detail table table add active cluster select table
|
override standard page header details
|
protected table render common string lockss title string plugin name return render common lockss title plugin name null
|
establish the main table and render common page
|
public string get title return set active cluster
|
return the page title
|
private void save target url string target look up and save the target url target get text ap e target if string util is null string target target null if target null servlet interface set ccp targeturl target
|
save the target url parameter as session context data
|
private tree map sort iterator name iterator iterator value iterator tree map sorted new tree map while name iterator has next verify iterator length if value iterator has next string error name and value iterators have differing lengths throw new illegal state exception error save sort by name the name value pair sorted put string name iterator next string value iterator next if value iterator has next string error value iterator has too many entries throw new illegal state exception error return sorted
|
sort the edit or restore lists for display purposes
|
private tag submit button string label string command string script javascript au menu dispatch visible hidden command return new on click button label script
|
set up a button with javascript onclick functionality
|
protected input submit button string label string name input input new input input submit ap e action label string buffer attribute new string buffer attribute append return au confirm this delete deactivate if name null attribute append attribute append name attribute append attribute append input attribute on click attribute to string return input
|
submit button with confirm on remove java script
|
protected void render submit table table string label render submit table label null null
|
render a single submit button
|
private iterator get titles from setup document document document iterator iterator array list result if document get setup document null return null result new array list iterator get element text iterator document ap e title first select entries get text ap e title ap e info while iterator has next string title string iterator next if lockss title list contains title result add title return result size 1 null result iterator
|
get an iterator to the list of available titles as noted in the
|
public string get banner return error status information
|
return the page banner text
|
public string get title return error
|
return the page title
|
public void do page body block bold new block block bold block center new block block center break paragraph new break break para add to page center add message and command name bold add message center add paragraph center add bold center add paragraph center add command center add command if exception null comment comment exception text center add paragraph center add exception center add exception to string add the stack trace as a comment comment new comment comment add exception formatter error exception add to page comment
|
page body p display command and exception detail p
|
private void display other cache locations table table if empty cache system list iterator iterator au cache subset get au cache iterator get successful response systems if iterator has next add rows table 1 3 display cache systems table iterator also preserved on
|
display other cache locations for this au
|
private document find first au id document document find response document containing element ap e auid if document null string message missing ap e auid element in successful au creation response log warning message error message return null return document
|
lookup the first response containing an auid
|
protected void render au menu link table table block center center new block block center table new table 0 standard table width 60 center add table add to page center table new row table new cell nowrap align center table add new link ccp command aumenu return to archival unit configuration
|
render a link to the au management page
|
private string get text document document string element name return parse utils get text get xml utils document get document element element name
|
lookup text in the provided xml document
|
protected boolean empty cache system list return au cache iterator has next
|
do we have an empty au cache list
|
private boolean is create command return create equals ignore case get text ap e action
|
is this an au create action
|
protected void display target systems from request table table string label iterator iterator parse utils get element text list get xml utils get request document ap e target iterator display cache systems table iterator label
|
display a simple list of the cache systems
|
private void render review file link table table string size string au info get content size if size null size equals 0 add a link to the first page of the file list display add rows table 1 3 table new row table new cell colspan 3 align center nowrap table add new file link 0 review files
|
render the review files anchor
|
private boolean complete create success return is create command get global status
|
did we successfully create an au on every cluster system
|
protected void display success systems table table string label iterator iterator get successful response systems iterator display cache systems table iterator label
|
display the list of cache systems that successfully responded to a command
|
protected void display cache systems table table display cache systems table cache location
|
display current au cache systems from database
|
public string get banner return empty cluster
|
return the page banner text
|
public void do page body table table new table 0 standard table width 80 align center add to page table add message and command name add rows table 1 table new row table new cell align center table add new bold unable to continue add rows table 1 1 3 table new row table new cell align center table add the page you requested requires interaction with table add one or more remote lockss machines the current table add cluster does not have any machines defined as members
|
page body p display command and exception detail p
|
protected void display cache systems table table string label display cache systems table au cache iterator label
|
display current au cache systems from database
|
private string get au value object key string empty value string new value string value string au info get key if string util is null string value value empty value if value equals empty value value new value return value to lower case
|
set display value with proper defaults
|
private boolean is set action string action get parameter ap e action if action null return false return string util starts with ignore case action set
|
set password command
|
private boolean password successful return is set action get status get response document
|
did we successfully set a password
|
private boolean password not set if password successful return false return setpassword equals ignore case get parameter ap e parameter
|
query state parameter are we setting the password
|
private object get au size object key string empty value string new value string value string au info get key font font long bytes if string util is null string value value empty value if value equals empty value return new value if bytes parse long value 1 return empty value if bytes kb font abbreviate size bytes font add bytes bytes return font return string value of bytes
|
set display value with proper defaults
|
public void do page activity try field name iterator get metadata fieldname iterator catch sqlexception exception string error text failed to lookup field names log error error text exception add status text error text exception to string
|
set up the field name iterator here
|
private string get au date object key string empty value string new value string date get au value key empty value new value return normalize au status date date
|
normalize a daemon supplied date string
|
public void get bread crumb detail set admin crumb detail append bread crumb detail ap command journaldefinition journal definition page page banner
|
return bread crumb information describe the path to this page
|
private int get start of range string value int start value index of int end value index of string range if start 1 end 1 throw new illegal state exception missing file range value range value substring start 1 end try return integer parse int range catch number format exception exception throw new illegal state exception invalid file range range
|
locate and return the file range from the archival unit status table
|
private string get range string value return string value of get start of range value 1
|
determine the file range from archival unit status table prompt text
|
public string get from title string column throws sqlexception db result result null result set result set null try look up the title result db query select from db title table where db title new string title text fetch the column requested result set result get set if result set next return result set get string column log warning unknown journal title requested title text throw new render base render exception unknown title title text finally if result null result close
|
fetch requested data from the titles table
|
private string get range text string value int range get start of range value return string value of range string value of range files for display 1
|
make file range text from archival unit status table prompt
|
public string get from defined fields string parameter throws sqlexception db result result null result set result set null try look up the title result db query select from db definedfields table where db journalid journal id and name new string parameter fetch the column requested result set result get set return result set next result set get string db value finally if result null result close
|
fetch requested data from the defined field name table
|
private int get journal id string title text throws sqlexception db result result result set result set int id result db query select from db title table where db title new string title text result set result get set if result set next throw new render base render exception title title text is not in the titles table id result set get int db journalid result close return id
|
get the journal id for a specified title
|
private object new file link string range string link text return new file link range link text
|
return a link to the next or previous file display page
|
private hash map get journal field values int journal id throws sqlexception db result result result set result set hash map defined fields result db query select from db definedfields table where db journalid journal id result set result get set defined fields new hash map while result set next defined fields put result set get string db name result set get string db value result close return defined fields
|
get all of the metadata fields defined for a particular title
|
private string encode parameters string buffer buffer new string buffer ap e title buffer append buffer append java net urlencoder encode get parameter ap e title return http utils encode buffer to string
|
build a link to the journal definition selection page preserve
|
private void format parameter string buffer url string name string value get parameter name value string util is null string value urlencoder encode value url append url append name url append url append value
|
build up an http parameter code name value code
|
protected int key count string key type org w3c dom document document org w3c dom element element org w3c dom element keys node list list if document get setup document null return 0 keys get xml utils get element document get document element key type if keys null return 0 return get xml utils get list keys ap e key get length
|
determine the number of au keys available either defining or editable
|
private boolean editable key string key type string edit if ap e auedit equals key type return true if ap e audefining equals key type return com true equals edit throw new illegal argument exception key type
|
is this key editable
|
private object format url hash map file info string url string file info get node name if string util is null string url return new error font if is directory file info font font new color font standard directory color font add url return font return url
|
format a url for presentation
|
private boolean is file list request string skip get parameter ap e skiprows return string util is null string skip
|
is this request for the au summary
|
private boolean is directory hash map file info return equals ignore case string file info get node child count
|
is this a directory
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.