Sonic Management API

com.sonicsw.ma.mgmtapi.config.impl
Class AbstractMgmtBeanFactory

java.lang.Object
  extended by com.sonicsw.ma.mgmtapi.config.impl.AbstractMgmtBeanFactory
Direct Known Subclasses:
MgmtBeanFactory

public abstract class AbstractMgmtBeanFactory
extends java.lang.Object


Constructor Summary
AbstractMgmtBeanFactory()
           
 
Method Summary
 void commit()
          Commit all changes that have been made to the beans and saved.
 void connect(IDirectoryFileSystemService dsProxy)
          Connect to the domain using the specified directory service interface
 void connect(java.lang.String domain, java.lang.String url, java.lang.String user, java.lang.String password)
          Connect to the domain using the specfied connection parameters.
 void connect(com.sonicsw.mx.config.TxnConfigServerUtility csu)
           
 IMgmtBeanBase createBeanObject(com.sonicsw.mx.config.IConfigBean bean)
           
 void createFolder(java.lang.String path)
          Create a folder at the specified path.
 void createFolder(java.lang.String path, java.util.Map attributes)
          Create a folder at the specified path and assocatiate the attributes with the folder.
 java.lang.String createUniqueName()
          Return a name that is unique across all beans.
 void deleteBean(IMgmtBeanBase bean)
          Delete the specified bean from the DS.
 void deleteBeans(IMgmtBeanBase[] beans)
          Delete the specified beans from the DS.
 void deleteFolder(java.lang.String path)
          Delete the specified folder.
 void deleteFolderPath(java.lang.String path)
          Recursively delete all folders and configurations under the specified path, including the path folder itself.
 void disconnect()
          Disconnect from the domain
 boolean doesConfigurationNameExist(java.lang.String name, java.lang.String folder)
          Check if a configuration with the specified name already exists in the specified folder
 java.lang.String exportContainerBootConfiguration(IMgmtBeanBase bean, java.lang.String domainName)
          Generate the container boot configuration for the specified container bean.
 java.lang.String exportDSBootConfiguration(IMgmtBeanBase bean)
          Generate the ds boot configuration for the specified bean.
 void flush()
          Flush the config server of all modified and unmodified beans.
 IMgmtBeanBase getBean(java.lang.String viewPath)
          Get the specified bean from the DS.
 com.sonicsw.mx.config.IConfigServer getConfigServer()
          This method fetches the Config Server reference from the wrapped Config Server utility.
 com.sonicsw.mx.config.ConfigServerUtility getConfigServerUtility()
          Get the ConfigServerUtility which is a wrapper around the Config Server to provide additional functionality such as import / export.
 java.util.List getConfigurationNames(java.lang.String parentFolder)
          Get a list of all the configurations elements under the specified parent folder.
 java.lang.String[] getConfigurations(java.lang.String parentFolder)
          Generates a java.lang.String array of all the configurations under the specified parent folder.
 java.lang.String getDomain()
          Get the domain name for the underlying connection
 java.util.List getFolderNames(java.lang.String parent)
          Get a list of all the folders under the specified parent folder.
 java.lang.String[] getFolders(java.lang.String parentFolder)
          Generates a java.lang.String array of all the folders under the specified parent folder.
 java.util.List list(java.lang.String path)
          Lists all the folders and elements names under the specified path.
 java.util.List listConfigElements(java.lang.String type)
          List all configurations of a specified type e.g.
 java.util.List listFolderElements(java.lang.String type)
           
 java.util.List listFolders(java.lang.String parentFolder)
          Return list of folders names under specified path
 java.util.List loadBeansInDirectory(java.lang.String dsPath)
          Loads the beans found under a DS path.
 java.lang.Class lookupReference(java.lang.String type, java.lang.String version)
           
 java.lang.Object lookupValue(com.sonicsw.mx.config.IConfigBean bean, java.lang.Object key)
           
 java.lang.Object lookupValue(java.lang.String type, java.lang.String version, java.lang.Object key)
           
 boolean pathExists(java.lang.String path)
          Check if a specified path exists.
 void rollback()
          Rollback changes made to the underlying config beans.
 void saveBean(IMgmtBeanBase bean)
          Save the specified bean to the DS.
 void saveBeans(IMgmtBeanBase[] beans)
          Save the specified beans to the DS.
 void setFolderMetaAttributes(java.lang.String path, java.util.Map attributes)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMgmtBeanFactory

public AbstractMgmtBeanFactory()
Method Detail

commit

public void commit()
            throws MgmtException
Commit all changes that have been made to the beans and saved. This takes these changes and sends them to the DS.

Throws:
MgmtException

connect

public void connect(IDirectoryFileSystemService dsProxy)
             throws MgmtException
Connect to the domain using the specified directory service interface

Parameters:
dsProxy -
Throws:
MgmtException

connect

public void connect(java.lang.String domain,
                    java.lang.String url,
                    java.lang.String user,
                    java.lang.String password)
             throws MgmtException
Connect to the domain using the specfied connection parameters.

Parameters:
domain -
url -
user -
password -
Throws:
MgmtException

connect

public void connect(com.sonicsw.mx.config.TxnConfigServerUtility csu)

createBeanObject

public IMgmtBeanBase createBeanObject(com.sonicsw.mx.config.IConfigBean bean)
                               throws MgmtException
Throws:
MgmtException

createFolder

public void createFolder(java.lang.String path)
                  throws MgmtException
Create a folder at the specified path. The parent folder must exist.

Parameters:
path -
Throws:
MgmtException

createFolder

public void createFolder(java.lang.String path,
                         java.util.Map attributes)
                  throws MgmtException
Create a folder at the specified path and assocatiate the attributes with the folder. The parent folder must exist for the specified path.

Parameters:
path - The path to the new folder.
attributes - Meta attributes to associate with this folder.
Throws:
MgmtException

createUniqueName

public java.lang.String createUniqueName()
Return a name that is unique across all beans.

Returns:

deleteBean

public void deleteBean(IMgmtBeanBase bean)
                throws MgmtException
Delete the specified bean from the DS.

Throws:
MgmtException

deleteBeans

public void deleteBeans(IMgmtBeanBase[] beans)
                 throws MgmtException
Delete the specified beans from the DS.

Parameters:
beans -
Throws:
MgmtException

deleteFolder

public void deleteFolder(java.lang.String path)
                  throws MgmtException
Delete the specified folder. Throws and Exception if the folder isn't empty.

Parameters:
path -
Throws:
MgmtException

deleteFolderPath

public void deleteFolderPath(java.lang.String path)
                      throws MgmtException
Recursively delete all folders and configurations under the specified path, including the path folder itself.

Parameters:
path -
Throws:
MgmtException

disconnect

public void disconnect()
                throws com.sonicsw.mx.config.ConfigServiceException
Disconnect from the domain

Throws:
com.sonicsw.mx.config.ConfigServiceException

doesConfigurationNameExist

public boolean doesConfigurationNameExist(java.lang.String name,
                                          java.lang.String folder)
Check if a configuration with the specified name already exists in the specified folder

Parameters:
name -
parentFolder -
Returns:

exportContainerBootConfiguration

public java.lang.String exportContainerBootConfiguration(IMgmtBeanBase bean,
                                                         java.lang.String domainName)
                                                  throws MgmtException
Generate the container boot configuration for the specified container bean.

Throws:
MgmtException

exportDSBootConfiguration

public java.lang.String exportDSBootConfiguration(IMgmtBeanBase bean)
                                           throws MgmtException
Generate the ds boot configuration for the specified bean.

Throws:
MgmtException

flush

public void flush()
           throws MgmtException
Flush the config server of all modified and unmodified beans. This empties the config server and frees up any memory used by loaded config beans. Any references to beans are invalid following a flush - you must re-get your beans from the DS.

Throws:
MgmtException

getBean

public IMgmtBeanBase getBean(java.lang.String viewPath)
                      throws MgmtException
Get the specified bean from the DS.

Throws:
MgmtException

getConfigServer

public com.sonicsw.mx.config.IConfigServer getConfigServer()
This method fetches the Config Server reference from the wrapped Config Server utility.

Returns:
the server reference.

getConfigServerUtility

public com.sonicsw.mx.config.ConfigServerUtility getConfigServerUtility()
Get the ConfigServerUtility which is a wrapper around the Config Server to provide additional functionality such as import / export.

Returns:
The ConfiguServerUtility

getConfigurationNames

public java.util.List getConfigurationNames(java.lang.String parentFolder)
                                     throws MgmtException
Get a list of all the configurations elements under the specified parent folder.

Parameters:
parent - The parent folder under which to find all available child configurations.
Returns:
A list of folders (java.lang.String)
Throws:
MgmtException - When an error occurs building the list of configurations.

getConfigurations

public java.lang.String[] getConfigurations(java.lang.String parentFolder)
                                     throws MgmtException
Generates a java.lang.String array of all the configurations under the specified parent folder.

Parameters:
parent - The parent folder under all available child configurations will be found.
Returns:
A list of configurations (java.lang.String). This method will never return 'null' - instead a zero-length array is used to simplify calling code.
Throws:
MgmtException - If a failure occurs

getDomain

public java.lang.String getDomain()
Get the domain name for the underlying connection

Returns:
The domain name

getFolderNames

public java.util.List getFolderNames(java.lang.String parent)
                              throws MgmtException
Get a list of all the folders under the specified parent folder.

Parameters:
parent - The parent folder under all available child folders will be returned.
Returns:
A list of folders (java.lang.String)
Throws:
MgmtException - If a failure occurs

getFolders

public java.lang.String[] getFolders(java.lang.String parentFolder)
                              throws MgmtException
Generates a java.lang.String array of all the folders under the specified parent folder.

Parameters:
parent - The parent folder under all available child folders will be found.
Returns:
A list of folders (java.lang.String). This method will never return 'null' - instead a zero-length array is used to simplify calling code.
Throws:
MgmtException - If a failure occurs

list

public java.util.List list(java.lang.String path)
                    throws MgmtException
Lists all the folders and elements names under the specified path.

Throws:
MgmtException

listConfigElements

public java.util.List listConfigElements(java.lang.String type)
                                  throws MgmtException
List all configurations of a specified type e.g. MQ_BROKER.

Parameters:
type - The type e.g. MQ_BROKER
Returns:
A list of names of configations
Throws:
MgmtException

listFolderElements

public java.util.List listFolderElements(java.lang.String type)
                                  throws MgmtException
Throws:
MgmtException

listFolders

public java.util.List listFolders(java.lang.String parentFolder)
                           throws MgmtException
Return list of folders names under specified path

Throws:
MgmtException

loadBeansInDirectory

public java.util.List loadBeansInDirectory(java.lang.String dsPath)
                                    throws MgmtException
Loads the beans found under a DS path.

Parameters:
dsPath - The DS path to where in the DS the config elements are kept
Returns:
A list of IMgmtBeanBase-derived beans
Throws:
MgmtException - If an error/load failure occurs

lookupReference

public java.lang.Class lookupReference(java.lang.String type,
                                       java.lang.String version)

lookupValue

public java.lang.Object lookupValue(com.sonicsw.mx.config.IConfigBean bean,
                                    java.lang.Object key)

lookupValue

public java.lang.Object lookupValue(java.lang.String type,
                                    java.lang.String version,
                                    java.lang.Object key)

pathExists

public boolean pathExists(java.lang.String path)
Check if a specified path exists.

Parameters:
path -
Returns:

rollback

public void rollback()
              throws MgmtException
Rollback changes made to the underlying config beans. All modified beans are reverted to their unmodified state.

Throws:
MgmtException

saveBean

public void saveBean(IMgmtBeanBase bean)
              throws MgmtException
Save the specified bean to the DS.

Parameters:
bean - The bean to be stored in the DS
Throws:
MgmtException - If an error/save failure occurs

saveBeans

public void saveBeans(IMgmtBeanBase[] beans)
               throws MgmtException
Save the specified beans to the DS.

Parameters:
bean - The bean(s) to be stored in the DS
Throws:
MgmtException - If an error/save failure occurs

setFolderMetaAttributes

public void setFolderMetaAttributes(java.lang.String path,
                                    java.util.Map attributes)
                             throws MgmtException
Throws:
MgmtException

Sonic Management API

Copyright © 2001-2011 Progress Software Corporation. All Rights Reserved.
HTML formatted on 12-Aug-2011.