input
stringlengths
10
828
output
stringlengths
5
107
protected void set bread crumb detail string path string text crumb path path crumb text text
set bread crumb detail
public string get banner return status title
return the page banner text
public void do page activity try lockss title iterator get lockss title iterator catch sqlexception exception string error text failed to lookup lockss title definitions log error error text exception add status text error text exception to string
set up the lockss title iterator
public void get bread crumb detail string parent get parameter ap e parameter set admin crumb detail do we have a parent page if string util is null string parent if set cluster member page page banner equals parent append bread crumb detail ccp command setmember parent
return bread crumb information describe the path to this page
protected void append bread crumb detail string path string text crumb path append text crumb path path crumb text append text crumb text text
append additional bread crumb detail
public boolean do command throws exception string cluster parse for cluster if cluster null set the active cluster cluster utils set active cluster servlet interface cluster return false verify parameters enough information to do a search if verify parameters return false return do search
search title metadata at present only institutional not cache metadata
private search do query db db string field name text string original search text throws sqlexception string search text convert wildcards original search text search search search based on a predefined query field if search get static query field name text null search result db query search query new string search text return search search dynamic institution specfic metadata search get metadata query field name text search result db query search query new string field name text search text return search
perform a single search operation
private search get static query string field name text search search null string column null set up for a known field null if we can t handle this query if search home page lockss title equals ignore case field name text column db title else if search home page institution id equals ignore case field name text column db localid else return null return search details display label database column name sql query search new search search label field name text search column column search query select from db title table where column like return search
set up an sql query for a predefined search field
protected string append text string current text string additional text string buffer target if current text null throw new render base render exception null bread crumb detail provided target new string buffer current text if target length 0 if target char at target length 1 target append return target append additional text to string
append additional slash separated text to a breadcrumb variable
private search get metadata query string field name text search search new search search label field name text search column db value search query select from db definedfields table where db name and db value like return search
set up an sql query for an institutionally defined metadata field
private string get lockss title db db int journal id throws sqlexception db result result null result set result set null try result db query select from db title table where db journalid journal id result set result get set if result set next throw new response exception failed to lookup title no matching id journal id return result set get string db title finally db utils close result
lookup a journal title by id
private void render row table table string label int integer value render row table label string value of integer value
render a row
public void set admin crumb detail set bread crumb detail ccp command admin home admin title
top level bread crumb information administrative command
private void render row table table string label string value text table new row table new cell align right valign top nowrap table add label table new cell table new cell valign top nowrap table add value text
render a statistic row
private string format string label string text return label text
format match text in a consistent manner
private int get int object integer try return integer parse int string integer catch number format exception exception throw new response exception invalid integer integer
return an integer value parsed from supplied string
private void render header table table string header table new row table new cell colspan 2 table new cell align left valign top nowrap table add new bold header add rows table 1 3 3
render a row header
public void set status crumb detail set bread crumb detail ccp command status home status title
top level bread crumb information status commands
private void render one title string title string result1 string result2 element result root element element result root get xml utils create element get response root ap e result element get xml utils create element result root ap e title get xml utils add text element title element get xml utils create element result root ap e value get xml utils add text element result1 element get xml utils create element result root ap e value if string util is null string result2 get xml utils add text element result2
create an xml response sequence for one matching title
private void render aus table table display complete title au ombinations render complete titles table sorted titles handle any aus that have titles which conflict with the local ui database request conflicting titles table sorted conflicting titles finally request titles for any aus not found in the title db request missing titles table sorted aus
render archival units
private void render map db db map map throws sqlexception iterator iterator map entry set iterator while iterator has next map entry entry map entry iterator next string title get lockss title db get int entry get key match match match entry get value render one title title match value1 match value2
generate response xml for an entire matching results map
private hash map populate map search search throws sqlexception result set result set search result get set hash map hash map new hash map while result set next hash map put string value of result set get int db journalid format search label result set get string search column return hash map
populate map with search results response data to be rendered using xml
public void set empty crumb detail set bread crumb detail
empty bread crumb information for home pages and other
private map not map map1 map map2 hash map result map new hash map iterator iterator map1 entry set iterator while iterator has next map entry entry map entry iterator next if map2 contains key entry get key match match new match entry get value result map put entry get key match return result map
not of two result maps return all map1 journal ids not in map2
protected string crumb path string p1 string p2 string buffer path new string buffer if string util is null string p1 path append p1 path append path append p2 return path to string
form breadcrumb path parameter text
public int do local setup and verification string name parse utils get text get xml utils get request root ap e name return name null local success local fail
verify user input fields
public command targets get command targets return select all targets
select target systems for command execution
protected command targets select all targets string cluster get active cluster return new command targets cluster cache member list cluster false
select every cluster member for command no setup
public command targets get command targets array list target list select only the requested target system target list parse utils get element text list get xml utils get request document ap e target return select targets and setup in any cluster target list
select target systems for command execution
public int do local setup and verification if string util is null string get parameter ap e target throw new response exception a target system is required return local success
verify user input fields none required
protected command targets select all targets and setup string cluster get active cluster return new command targets cluster cache member list cluster true
send command to all cluster systems select one target for setup
protected command targets select one target and get setup from cluster command targets command targets string cluster cluster get active cluster command targets new command targets cluster cache member list cluster true command targets set pick one true return command targets
select a cluster member as command target and a cluster member for setup
public void do page activity
per page activities
protected command targets select targets list target systems return select targets target systems false
select targets by name no setup
protected command targets select targets in any cluster list target systems return select targets target systems false null true
select targets by name no setup
protected command targets select targets and setup list target systems return select targets target systems true
select targets by name do setup from within the designated target pool
public boolean do command throws exception db db db get instance boolean status try remove one or more existing fields if is remove request if status remove db set response detail message delete successful return status add a new cluster if status add db set response detail message get parameter ap e newmember added return status finally always release database resources db close
add and remove metadata field names
private command targets select targets list target systems boolean setup required return select targets target systems setup required null
select targets by name optionally do setup from within the target pool
private boolean is remove request string action get parameter ap e action return delete equals ignore case action
is this a remove request
public int do local setup and verification string comment parse utils get text get xml utils get request root ap e comment return comment null local success local fail
verify required input fields
public boolean do command throws exception use the cluster member cache cluster cache cluster cache new cluster cache try remove one or more existing clusters if is delete request boolean status remove clusters cluster cache if status set response detail message delete successful return status try to add new cluster go populate the new cluster on success if add cluster cluster cache return false redirect to populate new cluster throw new cluster control transaction complete exception set cluster finally always release cache resources cluster cache close
add and remove clusters
private boolean add cluster cluster cache cluster cache throws exception string name cluster name specified if not no further action is possible name parse utils get text get xml utils get request root ap e newmember if string util is null string name return false create the cluster if cluster cache cluster create name set response status message cluster name to upper case already exists return false return true
add a new cluster
private void redirect to populate new cluster throws ioexception string cluster get parameter ap e newmember string detail cluster cluster created string buffer command new string buffer ccp command setmember command append command append ap e detail command append command append urlencoder encode detail cluster utils set active cluster get servlet interface cluster servlet interface redirect page render base new href command to string
set active cluster and redirect to the add machines page
private boolean is delete request string action parse utils get text get xml utils get request root ap e action return delete equals ignore case action
is this a delete request
public boolean has next command target return command target iterator has next
is another cluster member available for command execution
public boolean do command throws exception cluster cache cluster cache nothing required for the initial add machine activity if is setup request return true partial form exit with false preserves partially completed fields if partial form return false we have a complete definition update cluster cache new cluster cache try if update member cluster cache return false set response detail message update successful return true finally cluster cache close
add and remove cluster members
private boolean partial form string port host name if string util is null string get parameter ap e name return true ensure the password and confirmation match if matching password get parameter ap e pw1 get parameter ap e pw2 return true verify port number port get parameter ap e newport if port null if ap servlet port equals port return true return false
note partially completed form fields premature submission
private boolean matching password string pw1 string pw2 if string util is null string pw1 string util is null string pw2 return true if string util is null string pw1 string util is null string pw2 set response status message provide or omit both the password and confirmation return false if pw1 equals pw2 set response status message password and confirmation do not match return false return true
do pasword and confirmation macth
private int get port string port text try return integer parse int port text catch number format exception exception if string util is null string port text set response status message a port number must be supplied else set response status message invalid port number port text return 1
is this a valid port number
public cluster member next command target object member command target iterator next verify cluster member member return cluster member member
fetch next cluster member for command execution
private boolean is update request return update equals ignore case get parameter ap e action
is this an update request
public void do page status line if status line null table table font status text status text status text new font status text color standard error color status text add status line table new table 0 standard table align center add to page table add rows table 1 3 3 table new row table new cell align center table add status text add rows table 1 3
command status error text
public boolean has next setup target return setup target iterator has next
is another cluster member available for setup execution
private void redirect to edit page throws ioexception string action null string name null if is update request name get parameter ap e existingmember action update else name get parameter ap e newmember action add if string util is null string name throw new response exception invalid argument no machine name servlet interface redirect page render base new href ccp command editmember ap e name urlencoder encode name ap e action urlencoder encode action ap e setup initial
redirect to edit an ip access group
public cluster member next setup target object member setup target iterator next verify cluster member member return cluster member member
fetch next cluster member for setup execution
private string get title parameter string au id string value get parameter encode name ap e title au id if value null value get parameter encode name ap e publication au id if page render base standard reserved value equals value value null return value
get encoded title or detail parameter value
private int get port string port text try return integer parse int port text catch number format exception exception return 1
get port number
private boolean is remove request string action action get parameter ap e action return remove equals ignore case action
is this a remove member request
public boolean remote setup required return remote setup required
should one cluster member be selected for setup work
private boolean is update request string action action get parameter ap e action return update equals ignore case action
is this an update member request
public void set remote setup required boolean setup required remote setup required setup required
set the remote command setup flag
public boolean do command throws exception return true
set the active cluster
protected string parse for cluster node list node list string cluster node list get xml utils get list get request root ap e existingmember for int i 0 i node list get length i cluster get xml utils get text element node list item i skip the option spacer if page render base standard reserved value equals cluster continue if string util is null string cluster cluster null return cluster no cluster specified return null
parse off the cluster name
protected string get cluster name return cluster utils get active cluster servlet interface
get the name of the active cluster
public boolean pick one return pick one
should one cluster member be selected to execute this command
private boolean add title to db db db string title throws sqlexception boolean title was added false is this title in the lockss title table if db utils exists db db title table db title title no add it with a unique title id value int title id db utils get id value db db title table db execute insert into db title table set db title db localid db journalid title id db subscription new string title journal definition active title was added true return title was added
add new journal titles to the database
public void set pick one boolean state pick one state
set the pick a target for command execution flag
public void do page detail line table table string text font font table new table 0 standard table align center add to page table detail text the bold space preserves vertical alignment text detail line null detail line b nbsp b font new font font color standard info color font add text table new row table new cell table add font
command details informational
public boolean do command throws exception verify parameters support some activity if parameters require action string detail get parameter ap e detail if string util is null string detail set response detail message detail return false to preserve any user input return false remove one or more addresses from this group if is remove request return remove address add an address if is add request have add address return add address return false
add and remove clusters
public int command target count return command target size
fetch the number of available command target systems
private void verify cluster member object cluster member if cluster member instanceof cluster member throw new response exception not a cluster member object cluster member to string
validate a cluster member object
private boolean is remove request return remove equals ignore case get parameter ap e action
is this a delete request
protected string get active cluster return cluster utils get active cluster servlet interface
get the name of the active cluster
private boolean is add request return add equals ignore case get parameter ap e action
is this an create request
public boolean do command throws exception verify parameters if verify parameters return false remove one or more groups if is delete request boolean status remove groups if status set response detail message delete successful return status create a new group if is create request create group return false for create and update redirect to the edit group page redirect to edit page throw new cluster control transaction complete exception ip access groups
add and remove clusters
public command targets get command targets return select one target and get setup from cluster
select a target system for command setup and execution
private boolean verify parameters if is delete request return string util is null string get parameter ap e existingmember if is update request return string util is null string get parameter ap e setmember return string util is null string get parameter ap e newmember
validate required parameters
private void redirect au configure throws ioexception cluster control command parameters cp string param string value param ap e publication value get parameter param if page render base is null select option value param ap e plugin value get parameter param if page render base is null select option value param ap e classname value get parameter param get servlet interface redirect page render base new href ap command addauconfigure param urlencoder encode value
redirect to the configure au page
private void redirect to edit page throws ioexception string detail null string name null string buffer command if is create request name get parameter ap e newmember detail access group name created if name null name get parameter ap e setmember command new string buffer ccp command ipaccessgroupupdate command append command append ap e name command append command append urlencoder encode name if detail null command append command append ap e detail command append command append urlencoder encode detail servlet interface redirect page render base new href command to string
redirect to edit an ip access group
private int increment if present string name int increment 0 if page render base is null select option get parameter name increment return increment
is a select string present
private int parameter count int count 0 if string util is null string get parameter ap e classname count count increment if present ap e plugin count increment if present ap e publication return count
return a count of supplied parameters
public set string key set iterator iterator super key set iterator hash map string keys new hash map while iterator has next string key case blind string iterator next to string string keys put key get key return string keys key set
get the set of keys contained in this map
public iterator string key iterator return string key set iterator
get an iterator to the string based key set
private boolean is create request return is delete request is update request
is this an create request
public boolean contains key string key return super contains key new case blind string key
does the map contain this key
public object get string key if key null throw new unsupported operation exception null key return super get new case blind string key
fetch a value by name null keys are not supported
public void put string key object value if key null value null throw new unsupported operation exception null key or value super put new case blind string key value
add the key value pair to the map null values are not supported
public void remove string key if key null throw new unsupported operation exception null key super remove new case blind string key
remove a key value pair from this map
public boolean equals object object return string equals ignore case case blind string object to string
case insensitive compare
protected void set connection connection connection connection connection
set the connection object
public int hash code return string to upper case hash code
get a hash code for this case insensitive string
public void set driver string driver this driver driver
specifiy a jdbc driver required
public string get cluster name return cluster name
fetch the cluster name
public void set parameter string name string value this parameters put name value
specifiy jdbc driver properties optional
private string get db title string au id db db db get instance try db begin transaction return get db title db au id catch sqlexception exception throw new render base render exception exception to string finally db rollback transaction db utils close db
get the journal title for this au from the ui database
public int compare to object object return host name compare to cluster member object get host name
compare this cluster member to another facilitates sorting the
public void stop ui stop app
stop the ui
protected void stop app running false super stop
stop the ui by stopping the managers in the reverse order of
public void set credentials string username string password this username username this password password
set the username and password required for database access
public void set log string filename this logfile filename
set the log file name for debugging only