org.rhq.augeas
Class AugeasProxy

java.lang.Object
  extended by org.rhq.augeas.AugeasProxy

public class AugeasProxy
extends Object

This is the main entry point for interfacing with Augeas. The proxy is supplied with AugeasConfiguration that configures what and how Augeas should load and optionally with an AugeasTreeBuilder which specifies how to build an in memory representation of the tree returned from Augeas itself (see AugeasTree).

Author:
Filip Drabek, Ian Springer

Constructor Summary
AugeasProxy(AugeasConfiguration config)
          Instantiates new proxy with supplied configuration and DefaultAugeasTreeBuilder as the tree builder.
AugeasProxy(AugeasConfiguration config, AugeasTreeBuilder builder)
           
 
Method Summary
 void close()
           
protected  void finalize()
           
 net.augeas.Augeas getAugeas()
           
 AugeasTree getAugeasTree(String moduleName, boolean lazy)
          Produces the Augeas tree by loading it from augeas (if load() wasn't called already) and calling out to the tree builder to construct the tree.
 AugeasConfiguration getConfiguration()
           
 AugeasTreeBuilder getTreeBuilder()
           
 void load()
          Initializes and loads the Augeas tree.
 String printTree(String path)
          A helper method to produce the string representation of the tree.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AugeasProxy

public AugeasProxy(AugeasConfiguration config)
Instantiates new proxy with supplied configuration and DefaultAugeasTreeBuilder as the tree builder.

Parameters:
config - the augeas configuration.

AugeasProxy

public AugeasProxy(AugeasConfiguration config,
                   AugeasTreeBuilder builder)
Method Detail

getConfiguration

public AugeasConfiguration getConfiguration()
Returns:
the Augeas configuration of the proxy

getTreeBuilder

public AugeasTreeBuilder getTreeBuilder()
Returns:
the tree builder used to build augeas trees

load

public void load()
          throws AugeasTreeException
Initializes and loads the Augeas tree.

Throws:
AugeasTreeException
net.augeas.AugeasException - if Augeas could not be initialized.

getAugeasTree

public AugeasTree getAugeasTree(String moduleName,
                                boolean lazy)
                         throws AugeasTreeException
Produces the Augeas tree by loading it from augeas (if load() wasn't called already) and calling out to the tree builder to construct the tree.

Parameters:
moduleName - the name of the Augeas module to use for loading
lazy - true if the tree is lazily initialized, false for eager initialization
Returns:
the tree
Throws:
AugeasTreeException - if the specified module wasn't configured or if there was some error loading the tree.

printTree

public String printTree(String path)
A helper method to produce the string representation of the tree.

Parameters:
path -
Returns:

getAugeas

public net.augeas.Augeas getAugeas()
Returns:
the underlying Augeas API instance.

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

close

public void close()


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.