com.esf.net.netconf.service
Interface INetconfModule


public interface INetconfModule

This interface provides methods for managing a configuration datastore.


Method Summary
 void copyConfig(IConfigElement topElement)
          Replaces an entire configuration with the supplied configuration.
 void deleteConfig()
          Deletes an entire configuration datastore.
 NetconfError[] editConfig(IConfigElement topElement, boolean stopOnError)
          Supplies an IConfigElement representing the top element in the tree of elements that will be used to edit the configuration.
 java.lang.String getDataStoreName()
          Returns the name of this modules configuration datastore.
 IDataStoreElement getTopElement()
          Returns the top data element in this module's data structure.
 boolean holdsLock(int sessionId)
          Returns true if the resource is locked and the lock is held by the specified session.
 boolean isLocked()
          Returns true if the resource is locked, false otherwise
 void lock(int sessionId)
          Locks the resources represented by this module from modifications outside of the current NetConf session.
 void unlock(int sessionId)
          Unlocks the resources represented by this module.
 

Method Detail

getDataStoreName

java.lang.String getDataStoreName()
Returns the name of this modules configuration datastore.

Returns:
A String object representing the name of the configuration datastore.

getTopElement

IDataStoreElement getTopElement()
Returns the top data element in this module's data structure.

Returns:
The top IDataStoreElement object for this module.

lock

void lock(int sessionId)
          throws NetconfErrorException
Locks the resources represented by this module from modifications outside of the current NetConf session.

Parameters:
sessionId - The ID of the session requesting this operation.
Throws:
NetconfErrorException - If unable to lock the data store.

unlock

void unlock(int sessionId)
            throws NetconfErrorException
Unlocks the resources represented by this module.

Parameters:
sessionId - The ID of the session requesting this operation.
Throws:
NetconfErrorException - If data store was not locked or the specified session ID does not match the ID of the session that locked the module.

isLocked

boolean isLocked()
Returns true if the resource is locked, false otherwise

Returns:
A boolean indicating if the resource is locked.

holdsLock

boolean holdsLock(int sessionId)
Returns true if the resource is locked and the lock is held by the specified session.

Parameters:
sessionId - A session ID.
Returns:
A boolean indicating if the resource is locked by the specified session.

editConfig

NetconfError[] editConfig(IConfigElement topElement,
                          boolean stopOnError)
                          throws NetconfErrorException
Supplies an IConfigElement representing the top element in the tree of elements that will be used to edit the configuration.

Parameters:
topElement - The top IConfigElement object for this configuration.
stopOnError - a boolean indicating whether to stop when an error is encountered.
Returns:
An array of NetconfError objects indicating any errors encountered while processing the request, or null if no errors exist.
Throws:
NetconfErrorException - If there was a problem editing the configuration. The Exception will contain information the will be used to create the message to send to the requesting agent.

copyConfig

void copyConfig(IConfigElement topElement)
                throws NetconfErrorException
Replaces an entire configuration with the supplied configuration.

Parameters:
topElement - The top IConfigElement object for this configuration.
Throws:
NetconfErrorException - If there was a problem copying the configuration. The Exception will contain information the will be used to create the message to send to the requesting agent.

deleteConfig

void deleteConfig()
                  throws NetconfErrorException
Deletes an entire configuration datastore.

Throws:
NetconfErrorException - If there was a problem deleting the configuration datastore. The Exception will contain information the will be used to create the message to send to the requesting agent.