Overview | Package | Class | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hyperic.hq.agent.server
Interface AgentStorageProvider

All Superinterfaces:
  GenericValueMap

All Known Implementing Classes:
  AgentDListProvider

    public interface AgentStorageProvider

extends GenericValueMap

Provides a very simple/generic storage interface. Subsystems within the Agent may require local storage for configurations or for a temporary datastore. This interface should be used by things such as a property file writer, or a JDBC backend. It is based on the Properties object.

Method Summary
`void` | `addOverloadedInfo(java.lang.String listName, java.lang.String info)`
`void` | `addToList(java.lang.String listName, java.lang.String value)` Add a value to a storage column.
`void` | `createList(java.lang.String listName, int recSize)` Create a list in storage.
`void` | `deleteList(java.lang.String listName)` Delete an entire list from storage.
`void` | `dispose()` Perform any cleanup that the storage provider requires.
`void` | `flush()` Flush values to permanent storage.
`java.lang.String` | `getDescription()` Get information about the storage provider.
`java.util.Set` | `getKeys()`
`java.util.Iterator` | `getListIterator(java.lang.String listName)` Get an iterator for a named list.
`java.lang.String` | `getValue(java.lang.String key)` Gets a value from the storage object.
`void` | `init(java.lang.String info)` Initialize the storage provider with simple bootstrap information.
`void` | `setValue(java.lang.String key, java.lang.String value)` Sets a value within the storage object.

Method Detail

### getDescription

    java.lang.String getDescription()

  Get information about the storage provider.

  Returns:
    A short description about the provider.

### setValue

    void setValue(java.lang.String key,
                  java.lang.String value)

  Sets a value within the storage object. The key may be any String, but should probably be in a Java Properties stylee. If 'value' is null, the key will be deleted from storage.

  Specified by:
    `setValue` in interface `GenericValueMap`
  Parameters:
    `key` - Key for the attribute
    `value` - Value of the key

### getValue

    java.lang.String getValue(java.lang.String key)

  Gets a value from the storage object.

  Specified by:
    `getValue` in interface `GenericValueMap`
  Parameters:
    `key` - Key for which to retrieve the value
  Returns:
    The value previously specified via setValue, or null if the key does not exist.

### getKeys

    java.util.Set getKeys()

  Specified by:
    `getKeys` in interface `GenericValueMap`
  Returns:
    A set of all keys in the storage provider.

### flush

    void flush()
               throws AgentStorageException

  Flush values to permanent storage. Implementers of this interface may cache properties internally -- this method gives them a chance to store it to permanent storage before it gets lost.

  Throws:
    `AgentStorageException`

### init

    void init(java.lang.String info)
              throws AgentStorageException

  Initialize the storage provider with simple bootstrap information. This string is unique to the storage provider and may contain a filename for further configuration, database DSN, etc.

  Parameters:
    `info` - parameters for the StorageProvider to store data and index files
  Throws:
    `AgentStorageException`

### dispose

    void dispose()

  Perform any cleanup that the storage provider requires.

### addToList

    void addToList(java.lang.String listName,
                   java.lang.String value)
                   throws AgentStorageException

  Add a value to a storage column. If the column does not yet exist, it will be created.

  Parameters:
    `listName` - Name of the column to add to
    `value` - Value to add to the column
  Throws:
    `AgentStorageException`

### getListIterator

    java.util.Iterator getListIterator(java.lang.String listName)

  Get an iterator for a named list. If there is no list currently in storage, or the list contains 0 elements, null will be returned.

  Parameters:
    `listName` - name of the list to get an iterator for.

### deleteList

    void deleteList(java.lang.String listName)

  Delete an entire list from storage. This is basically a shortcut for deleting all elements as returned by getListIterator()

### createList

    void createList(java.lang.String listName,
                    int recSize)
                    throws AgentStorageException

  Create a list in storage. This method is intended creating non standard lists. Currently only used in the DList provider.

  Throws:
    `AgentStorageException`

### addOverloadedInfo

    void addOverloadedInfo(java.lang.String listName,
                           java.lang.String info)

Overview | Package | Class | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.