amip.api.highlevel
Class Config

java.lang.Object
  extended by amip.api.highlevel.Config

public class Config
extends java.lang.Object

Provides easy access to AMIP configuration.


Field Summary
static java.lang.String DISABLE_TRANSPORTS
           
static java.lang.String DUMP_END
           
static java.lang.String OUTPUT_COMMAND
           
 
Method Summary
 java.util.Map getDump()
          Uses cfgdump API command to dump all the config options and values.
 java.lang.String getOption(java.lang.String option)
          Gets AMIP config option value.
 void load()
          Loads config.
 void save()
          Saves config.
 void setOption(java.lang.String option, java.lang.String value)
          Sets AMIP config option.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DUMP_END

public static final java.lang.String DUMP_END
See Also:
Constant Field Values

OUTPUT_COMMAND

public static final java.lang.String OUTPUT_COMMAND
See Also:
Constant Field Values

DISABLE_TRANSPORTS

public static final java.lang.String DISABLE_TRANSPORTS
See Also:
Constant Field Values
Method Detail

setOption

public void setOption(java.lang.String option,
                      java.lang.String value)
               throws GeneralClientException
Sets AMIP config option.

Parameters:
option - option name.
value - option value.
Throws:
GeneralClientException

getOption

public java.lang.String getOption(java.lang.String option)
                           throws GeneralClientException
Gets AMIP config option value.

Parameters:
option - option to get.
Returns:
value of the option.
Throws:
GeneralClientException

save

public void save()
          throws GeneralClientException
Saves config. Note, that you can change many options without the need to call this. If you've changed somethig that requires config reloading, then call this method. Once config is saved, AMIP will automatically reload it and apply all the settings.

Throws:
GeneralClientException

load

public void load()
          throws GeneralClientException
Loads config. If you load it without saving, all changes will be lost. Don't load config explicitly after saving it with save() method, AMIP loads it automatically when timestamp changes.

Throws:
GeneralClientException

getDump

public java.util.Map getDump()
                      throws GeneralClientException,
                             java.lang.InterruptedException
Uses cfgdump API command to dump all the config options and values. May take some time to complete on slow connections, don't call often.

Warning: may hang if used with old AMIP 2.53 beta version that doesn't print =DUMP_END= when dump is finished.

Returns:
Map with sorted config keys and values.
Throws:
GeneralClientException
java.lang.InterruptedException