input
stringlengths
10
828
output
stringlengths
5
107
public void copy from configuration other copy from other null
copy contents of the argument into this config
public boolean includes year string a year return number util range includes get year a year return bibliographic util coverage includes get year a year
determine whether year s for this au include a given date
public void copy from configuration other param copy event pse merge other config tree into this one for iterator iter other key iterator iter has next string key string iter next string val other get key if pse null pse param copied key val put key val merge other config tdb into this one tdb other tdb other get tdb if other tdb null if tdb null tdb new tdb try tdb copy from other tdb catch tdb exception ex log error error copying into tdb ex
copy contents of the argument into this config
public void start service super start service log debug start service runner new task runner new task runner scheduler factory public scheduler create scheduler return new sort scheduler runner init service get daemon runner start service get app get status service register status accessor sched q runner get status accessor
start the compute service
public void stop service todo checkpoint here if runner null get app get status service unregister status accessor task runner get app get status service unregister status accessor sched q runner stop service runner null super stop service
stop the compute service
public string get year string au year get attr year if au year null au year get param year return au year
get year for this au
public boolean schedule task schedulable task task check runner return runner schedule task task
attempt to add a task to the schedule
public boolean is task schedulable schedulable task task check runner return runner is task schedulable task
return true iff the task could be scheduled but doesnt actually
public background task schedule hint background task task check runner return runner schedule hint task
find the earliest possible time a background task could be scheduled
public boolean is idle return runner is idle
return true if the sched service has nothing to do
public void copy from non destructively configuration other for iterator iter other key iterator iter has next string key string iter next if contains key key put key other get key
copy contents of the argument into this config
public string get start volume return bibliographic util get range set start get volume
get the start volume for this au
public string get end volume return bibliographic util get range set end get volume
get the end volume for this au
public config file get first error file list urls config cache config cache get config cache for iterator iter urls iterator iter has next string url string iter next if string util ends with ignore case url opt continue config file cf config cache get url if cf null cf is loaded return cf return null
return the first config file that got an error
public boolean wait config deadline timer while have config is full timer expired try have config wait full timer catch interrupted exception e no action check timer return have config is full
wait until the system is configured
public boolean is empty if key iterator has next return false tdb tdb get tdb if tdb null tdb is empty return false return true
return true iff config has no keys or title database
public boolean includes volume string a volume return number util range includes get volume a volume return bibliographic util coverage includes get volume a volume todo use a volume aware method instead that allows for example s2ii to not include s2iii s2v s2x to include s2ix but not s2w
determine whether the volume string for this au include a given volume
public string get string key string dfault string val get key if val null val dfault return val
return the config value associated with code key code
public string get volume string au volume get attr volume if au volume null au volume get param volume name if au volume null au volume get param volume str if au volume null au volume get param volume return au volume
return the volume from a tdb au
public boolean wait config return wait config deadline max
wait until the system is configured
public string get non empty string key string dfault string val get key if string util is null string val val dfault return val
return the config value associated with code key code
public string get edition string au edition get attr edition if au edition null au edition get param edition return au edition
return the edition from a tdb au
public boolean get boolean string key throws invalid param string val get key boolean bool string to bool val if bool null return bool boolean value throw new invalid not a boolean value key val
return the config value as a boolean
protected tdb au copy for tdb title tdb title title throws tdb exception tdb au au new tdb au name plugin id title add tdb au au immutable no need to copy au attrs attrs au props props au params params return au
create a copy of this tdb au for the specified title
public boolean get boolean string key boolean dfault string val get key if val null return dfault boolean bool string to bool val if bool null return bool boolean value log warning get boolean key val return dfault
return the config value as a boolean
public int get int string key throws invalid param string val get key try return integer parse int val catch number format exception e throw new invalid not an int value key val
return the config value as an int
public void pretty print print stream ps int indent ps println string util tab indent au name indent 2 ps println string util tab indent plugin plugin id pprint sorted map params params ps indent if attrs null attrs is empty pprint sorted map attrs attrs ps indent if props null props is empty pprint sorted map additional props props ps indent
print a full description of the au
public int get int string key int dfault string val get key if val null return dfault try return integer parse int val catch number format exception e log warning get int key val return dfault
return the config value as an int
public string to string return tdb au name
return a string representation of the title
public void set scheduler sort scheduler scheduler this scheduler scheduler
record the scheduler that created this schedule
public background task schedule hint background task task if scheduler null return scheduler schedule hint task return task
find the earliest possible time a background task could be
public list get events return events
return the list of
public collection get overrun tasks return overrun tasks
return the list of overrun tasks
public enum get enum class enum type string key throws invalid param string name get key try return enum value of enum type name catch illegal argument exception e throw new invalid not an enum of type enum type key name
return the config value as an enum
public enum get enum class enum type string key enum dfault string name get key if name null return dfault try return enum value of enum type name catch illegal argument exception e log warning get enum key illegal val name return dfault
return the config value as an enum
public long get long string key throws invalid param string val get key try return long parse long val catch number format exception e throw new invalid not a long value key val
return the config value as a long
public long get long string key long dfault string val get key if val null return dfault try return long parse long val catch number format exception e log warning get long key val return dfault
return the config value as a long
public long get time interval string key throws invalid param string val get key try return string util parse time interval val catch exception e throw new invalid not a time interval value key val
parse the config value as a time interval
public long get time interval string key long dfault string val get key if val null return dfault try return string util parse time interval val catch exception e log warning get time interval key val return dfault
parse the config value as a time interval
public long get size string key throws invalid param string val get key try return string util parse size val catch exception e throw new invalid not a valid size key val
parse the config value as a size in bytes specified
public void accept tasks for schedulable task task raw tasks task set accepted true
set all the tasks in this scheduler as having been accepted
public long get size string key long dfault string val get key if val null return dfault try return string util parse size val catch exception e log warning get size key val return dfault
parse the config value as a size in bytes specified
public float get percentage string key throws invalid param int val get int key if val 0 throw new invalid not an integer 0 key integer to string val return float val float 100 0
parse the config value which should be a non negative integer as a
public float get percentage string key double dfault int val if contains key key return float dfault try val get int key catch invalid param e log warning get percentage key get key return float dfault if val 0 log warning get percentage key val return float dfault return float val 100 0f
parse the config value which should be a non negative integer as a
public double get double string key throws invalid param string val get key try return platform util parse double val catch number format exception e throw new invalid not a double value key val
parse the config value as a floating point value
public double get double string key double dfault string val get key if val null return dfault try return platform util parse double val catch number format exception e log warning get double key val e to string return dfault
parse the config value as a floating point value
public void remove config tree string root key configuration subtree get config tree root key for iterator iter subtree key iterator iter has next string key string iter next remove root key key remove root key
remove the subtree below the specified key
public void copy config tree from configuration from config string root configuration subtree from config get config tree root if subtree is empty return for iterator iter subtree key iterator iter has next string relkey string iter next string key root relkey put key from config get key if from config contains key root put root from config get root
copy the contents of another configuration relative to the
public boolean is background task return false
return true iff this is a background task
public boolean is empty return tdb au count diff 0 diff keys is empty
determine whether this instance has no differences
public boolean contains string key return contains all keys true diff keys contains key
determine whether the value of a key has changed
public boolean contains tdb plugin id string plugin id return diff plugin ids contains plugin id
determines whether a plugin id is involved in differences between
public int get tdb au difference count return tdb au count diff
return the difference in the number of tdb aus between the old
public void set include url boolean val include url val
tell the hasher whether to include the url in the hash
public void set substance checker substance checker sub checker this sub checker sub checker
tell the block hasher to run all the hashed urls through a substance
public void start service super start service log debug start service the queue new hash queue the queue init get daemon get status service register status accessor hash q the queue get status accessor
start the hash service
public void stop service todo checkpoint here if the queue null get daemon get status service unregister status accessor hash q the queue stop the queue null super stop service
stop the hash service
public void cancel au hashes archival unit au if the queue null throw new illegal state exception hash service has not been initialized the queue cancel au hashes au
cancel all hashes on the specified au
public int get hash speed message digest digest if the queue null throw new illegal state exception hash service has not been initialized return the queue get hash speed digest
return the average hash speed or 1 if not known
public long pad hash estimate long estimate return estimate estimate est pad percent 100 est pad constant
add the configured padding percentage plus the constant
public boolean is idle return the queue is idle
return true if the hash service has nothing to do
protected boolean is included cached url set node node return true
subclass should override if it wants to exclude from the hash some
public void set filtered boolean val is filtered val
determines whether to hash filtered or raw content
public void set include url boolean val is include url val
determines whether to include the url of each file in its hash
public void set base64 result boolean val is base64 val
if true result is a base64 string if false the default result is
public int count unique versions comparator hash block version comparator hash block version versions sorted versions comparator int count 0 if versions length 0 count 1 for int idx 1 idx versions length idx if comparator compare versions idx 1 versions idx 0 count return count
count the partitions of the versions relative to the comparator
public void start service super start service log debug start service sched get daemon get sched service status service stat svc get daemon get status service stat svc register status accessor hash status table new status stat svc register overview accessor hash status table new hash overview
start the hash service
public void stop service status service stat svc get daemon get status service stat svc unregister status accessor hash status table stat svc unregister overview accessor hash status table super stop service
stop the hash service
public void cancel au hashes archival unit au synchronized queue lock for iterator iter queue list iterator iter has next hash task task hash task iter next if task urlset get archival unit au task cancel iter remove
cancel all hashes on the specified au
public int get hash speed message digest digest if sched null throw new illegal state exception hash service has not been initialized if total time 5 constants second return 1 int bpms total bytes hashed divide big integer value of total time int value return bpms
return the average hash speed or 1 if not known
public boolean can hash be scheduled before long duration deadline when return sched is task schedulable new dummy task when duration
test whether a hash request could be successfully sceduled before a
public boolean is idle return queue is empty
return true if the hash service has nothing to do
public static class timeout extends exception public timeout string msg super msg
exception thrown if a hash could not be completed by the deadline
public void add title db config from collection classloaders boolean need reload false for iterator it classloaders iterator it has next class loader cl class loader it next url title db url cl get resource config file bundled title db if title db url null if plugin titledb url list null plugin titledb url list new array list plugin titledb url list add title db url need reload true force a config reload this is required to make the bundled title configs immediately available otherwise they will not be available until the next config reload if need reload request reload
add a collection of bundled titledb config jar urls to
public void set name string name realm name name
set the realm name
public string get name return realm name
return the realm name
public file get platform dir string rel dir list dspace paths config manager get current config get list param platform disk space list if dspace paths size 0 throw new runtime exception no platform dir available file dir new file string dspace paths get 0 rel dir return dir
p return a directory under the platform disk space list
public void start service super start service resource mgr get app get resource manager one time jetty setup reset config
start the manager
public local file descr get local file descr string cache config file name return get local file descr map get cache config file name
return the local file descr the named cache config file or null if
public boolean check object credentials log debug3 check credentials try byte digest null if credentials instanceof password credentials instanceof string digest calculate digest credentials to string return equals digest else if credentials instanceof mdcredential return equals mdcredential credentials digest else log warning can t check credentials get class against mdcredential return false catch exception e log warning checking this e return false
check a credential
public output stream get output stream throws ioexception throw new ioexception output not supported
returns an output stream to the resource
public string encode string uri return uri
supress normal urlencoding
public file get cache config file string cache config file name return new file cache config dir cache config file name
return a file for the named cache config file
public file get cache config dir return cache config dir
return the cache config dir
public boolean has local cache config return has local cache config
return true if any daemon config has been done on this machine
protected void init account manager acct mgr configuration config common init acct mgr config init acct mgr
setup configuration before first use
protected void init account manager acct mgr if get history size 0 this password history new string get history size if get max failed attempts 0 this failed attempt history new long get max failed attempts hash alg get default hash algorithm last password change 1 last user password change 1 version 2
setup configuration before first use
protected void post load init account manager acct mgr configuration config common init acct mgr config if version 2 set r new hash set get role set if r add lockss servlet role content access log debug adding access content role to get name set roles r log debug updating get name to version 2 version 2 store user true
called after loading from file not called by factory
protected void common init account manager acct mgr configuration config this acct mgr acct mgr
setup configuration before first use
public user account create user string name return acct fact new user name this
create a new user account of the configured type
public void set email string val set changed string util equal strings email val email val
set the email address
public string get hash algorithm return hash alg
return the hash algorithm name
public long get last login return last login
get the time the user last logged in
public boolean delete user string name user account acct get user name if acct is static user throw new illegal argument exception can t delete static account acct if acct null return true return delete user acct
delete the user
public void store user user account acct throws not stored exception if acct is static user throw new illegal argument exception can t store static account acct if get user acct get name acct throw new illegal argument exception can t store uninstalled account acct store user internal acct
store the current state of the user account on disk
public configuration read au config file configuration au config try au config read cache config file config file au config catch ioexception e log warning couldn t read au config file e get message au config new configuration return au config
return the contents of the local au config file
public void set roles string val set roles val false
set the users roles
public void store user internal user account acct throws not stored exception string filename acct get filename if filename null filename generate filename acct file file new file get acct dir filename try store user internal acct file catch serialization exception e throw new not stored exception error storing user in database e catch ioexception e throw new not stored exception error storing user in database e acct set filename file get name
store the current state of the user account on disk
public void set roles string val boolean is interactive if log is debug2 log debug2 user name set roles val if string util equal strings roles val if is interactive auditable event changed roles from none roles to none val set changed true roles val role set null
set the users roles
public void load from props string props url throws ioexception if log is debug log debug load this from props url properties props new properties input stream ins get class get resource as stream props url props load ins load from props props
load realm users from properties file