Platform SDK Java 8.5 API Reference

com.genesyslab.platform.applicationblocks.com
Class CfgBase

java.lang.Object
  extended by com.genesyslab.platform.applicationblocks.com.CfgBase
All Implemented Interfaces:
ICfgBase
Direct Known Subclasses:
CfgObject, CfgStructure

public abstract class CfgBase
extends java.lang.Object
implements ICfgBase

The parent class for all configuration objects categories including configuration objects child structures and classes.

Author:
Petr Makagon, Vladislav Baranovsky, Alexander Filatov, Anton Brazhnyk, Sergii Volokh

Constructor Summary
protected CfgBase(IConfService confService, ConfObjectBase confObjectData, boolean isSaved, ICfgObject parent)
          This constructor is used from particular wrapping objects and structures for data initialization from external DOM structure.
 
Method Summary
 CfgBase clone()
           
protected  void ensureDataBackup()
          This internal method is designed for "lazy initialization" of DOM data backup.
 boolean equals(java.lang.Object obj)
           
protected  void flushChildrenContent()
           
 IConfService getConfigurationService()
          Used to access the configuration cfgService that this object was created with.
 org.w3c.dom.Node getData()
          Deprecated.  
 Endpoint getEndpoint()
          Provides the location of the server to which this object belongs.
 java.util.Collection<java.lang.Integer> getLinkListCollection(java.lang.String propertyName)
           
protected  java.lang.Integer getLinkValue(java.lang.String propertyName)
           
protected  ILogger getLogger()
           
 CfgDescriptionClass getMetaData()
          Internal method to provide XML data manipulation functions with information about objects' properties.
protected  ICfgObject getParent()
          Used to retrieve reference to the parent of the current configuration object structure.
protected  java.lang.Object getProperty(java.lang.Class<?> retClass, java.lang.String propertyName)
          This method is used to get any configuration object's property using its string name.
protected  java.lang.Object getProperty(java.lang.Class<?> retClass, java.lang.String propertyName, boolean resolveLinks)
          This method is used to get any configuration object's property using its string name.
 java.lang.Object getProperty(java.lang.String propertyName)
          This method is used to get any configuration object's property using its string name.
 ConfObjectBase getRawObjectData()
          Returns reference to the underlying configuration protocol object structure.
 int hashCode()
           
protected  void initStruct(ConfObjectBase confObjectData, ICfgObject parent)
           
 boolean isSaved()
          Positive object saved state means that the object is read from the server or it is locally created and then successfully saved.
protected  java.util.concurrent.locks.ReadWriteLock lockObject()
           
protected  void reloadObjectWithNewData(ConfObject newObject)
           
protected  ICfgObject resolveLink(CfgObjectType objectType, int dbid)
           
 void setProperty(java.lang.String propertyName, java.lang.Object value)
          This method is used to set any configuration object's property using its string name.
 java.lang.String toString()
          Returns a string representation of the configuration information.
protected  java.lang.StringBuilder toStringProperties()
           
 org.w3c.dom.Node toXml()
          Used to represent configuration object or structure to XML.
protected  void updateChildrenSavedState()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CfgBase

protected CfgBase(IConfService confService,
                  ConfObjectBase confObjectData,
                  boolean isSaved,
                  ICfgObject parent)
This constructor is used from particular wrapping objects and structures for data initialization from external DOM structure. Usually it is data from the Configuration Protocol.

Parameters:
confService - a reference to Configuration Service
confObjectData - tree with configuration object data
isSaved - saved object state flag
parent - for a structure, a reference to its parent
Method Detail

initStruct

protected void initStruct(ConfObjectBase confObjectData,
                          ICfgObject parent)

getLogger

protected final ILogger getLogger()

lockObject

protected final java.util.concurrent.locks.ReadWriteLock lockObject()

getConfigurationService

public final IConfService getConfigurationService()
Used to access the configuration cfgService that this object was created with.

Returns:
reference to the configuration service.

getEndpoint

public final Endpoint getEndpoint()
Provides the location of the server to which this object belongs.

Specified by:
getEndpoint in interface ICfgBase
Returns:
the configuration server active endpoint.

toXml

public org.w3c.dom.Node toXml()
Used to represent configuration object or structure to XML. Method returns copy of actual object properties values, so it can be used directly.
   Node newNode = cfgObject.toXml();
   doc.adoptNode(newNode);
   doc.appendChild(newNode);
 

Specified by:
toXml in interface ICfgBase
Returns:
DOM node containing object/structure elements values.

getParent

protected ICfgObject getParent()
Used to retrieve reference to the parent of the current configuration object structure.

Returns:
reference to the parent object of this structure, this object by itself, or null.

isSaved

public final boolean isSaved()
Positive object saved state means that the object is read from the server or it is locally created and then successfully saved. Local modifications of the objects properties does not affect this state - object "is saved", but "is not updated on the server" in this case.

Returns:
true if object is saved in the configuration server.

getData

@Deprecated
public final org.w3c.dom.Node getData()
Deprecated. 

Internal method to get DOM representation of the object.
Note: Starting from Platform SDK 8.5.0 version it returns DOM copy of the actual data structures, but not original values content. So, changes in its content will not affect actual object properties values.

Returns:
DOM data object.
See Also:
toXml()

getRawObjectData

public ConfObjectBase getRawObjectData()
Returns reference to the underlying configuration protocol object structure.

Note: It is designed for internal usage.
Any modifications in the underlying structures may bring inconsistency with covering COM AB classes.

Specified by:
getRawObjectData in interface ICfgBase
Returns:
original configuration protocol object instance reference.

reloadObjectWithNewData

protected void reloadObjectWithNewData(ConfObject newObject)

flushChildrenContent

protected void flushChildrenContent()

getMetaData

public final CfgDescriptionClass getMetaData()
Internal method to provide XML data manipulation functions with information about objects' properties. This description is specific for each of configuration object class.

Returns:
internal structure with object type properties

getLinkValue

protected java.lang.Integer getLinkValue(java.lang.String propertyName)

getLinkListCollection

public java.util.Collection<java.lang.Integer> getLinkListCollection(java.lang.String propertyName)

getProperty

public java.lang.Object getProperty(java.lang.String propertyName)
This method is used to get any configuration object's property using its string name.

Specified by:
getProperty in interface ICfgBase
Parameters:
propertyName - The name of the property
Returns:
property value

getProperty

protected java.lang.Object getProperty(java.lang.Class<?> retClass,
                                       java.lang.String propertyName)
This method is used to get any configuration object's property using its string name.

Parameters:
retClass - class of return object - used to handle configuration protocol enumeration types Conf* (extending GEnum)
propertyName - The name of the property
Returns:
property value instantiated as typified object

getProperty

protected java.lang.Object getProperty(java.lang.Class<?> retClass,
                                       java.lang.String propertyName,
                                       boolean resolveLinks)
This method is used to get any configuration object's property using its string name.

Parameters:
retClass - class of return object - used to handle configuration protocol enumeration types Conf* (extending GEnum)
propertyName - The name of the property
Returns:
property value instantiated as typified object

setProperty

public void setProperty(java.lang.String propertyName,
                        java.lang.Object value)
This method is used to set any configuration object's property using its string name. Any changes will not be synchronized with Configuration Server until the save() method is called.

Specified by:
setProperty in interface ICfgBase
Parameters:
propertyName - The name of the property
value - New property value
Throws:
java.lang.NullPointerException - if property new value is null.
ConfigRuntimeException - if there is some problem with the attribute or value for it (see message or inner exception for details).

resolveLink

protected ICfgObject resolveLink(CfgObjectType objectType,
                                 int dbid)
                          throws ConfigException
Throws:
ConfigException

ensureDataBackup

protected void ensureDataBackup()
This internal method is designed for "lazy initialization" of DOM data backup. It is automatically called before any object property change and it has to create backup copy of object DOM data if it has not been created before.


updateChildrenSavedState

protected void updateChildrenSavedState()

toString

public java.lang.String toString()
Returns a string representation of the configuration information.

Overrides:
toString in class java.lang.Object
Returns:
data string dump for debugging purposes

toStringProperties

protected java.lang.StringBuilder toStringProperties()

clone

public CfgBase clone()
              throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

Platform SDK Java 8.5 API Reference

Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.