org.astrogrid.acr.system
Interface Configuration


public interface Configuration

AR System Service: Inspect and alter the configuration of the AstroRuntime. Allows the setting of key-value pairs, which are automatically persisted between executions. As well as altering configuration settings, this is also useful for storing bits of state that should persist between script invocations (e.g. preferences, window positions and sizes), plus configuration information (e.g. username, service endpoints)

Service Name
system.configuration

Method Summary
 String getKey(String key)
          get the value of a key.
 Map list()
          list the contents of the store.
 String[] listKeys()
          list the keys present in the store.
 void removeKey(String string)
          remove a previously defined key.
 void reset()
          Reset the configuration back to factory settings.
 boolean setKey(String key, String value)
          Set the value of a new or existing key.
 

Method Detail

setKey

boolean setKey(String key,
               String value)
Set the value of a new or existing key.

Parameters:
key - name of key
value - new value of key
Returns:
ignore

getKey

String getKey(String key)
get the value of a key.

Parameters:
key - the name of the key
Returns:
the associated value, or null

listKeys

String[] listKeys()
                  throws ACRException
list the keys present in the store.

Returns:
an array of key names
Throws:
ACRException - in unlikely case of the backing store being unreadable.

list

Map list()
         throws ACRException
list the contents of the store.

List all configuration keys (python) # connect to the AR from xmlrpc import Server from os.path import expanduser ar = Server(file(expanduser('~/.astrogrid-desktop')).next().strip() +'xmlrpc') for (i, j) in ar.system.configuration.list().iteritems(): print i,

:", j     
And this script returns
performance.showProgressDialogueAfter : 5
org.astrogrid.registry.query.endpoint : http://registry.astrogrid.org/astrogrid-registry/services/RegistryQueryv1_0
votech.jackdaw.endpoint : http://thor.roe.ac.uk/jackdaw/like
cds.vizier.endpoint : http://cdsws.u-strasbg.fr/axis/services/VizieR
votech.vomon.endpoint : http://vomon.roe.ac.uk/status.xml
system.rmi.endScanPort : 2099
system.webserver.endScanPort : 8800
last.upgraded.to : unreleased
network.proxyPort : 80
...
 

Returns:
a map of key-value pairs.
Throws:
ACRException - in unlikely case of the backing store being unreadable

removeKey

void removeKey(String string)
remove a previously defined key.

Parameters:
string -

reset

void reset()
           throws ServiceException
Reset the configuration back to factory settings. All user configuration will be lost

Throws:
ServiceException


Copyright © 2002-2010 AstroGrid. All Rights Reserved.