Platform SDK Java 8.5 API Reference

com.genesyslab.platform.applicationblocks.com
Class CfgObject

java.lang.Object
  extended by com.genesyslab.platform.applicationblocks.com.CfgBase
      extended by com.genesyslab.platform.applicationblocks.com.CfgObject
All Implemented Interfaces:
ICfgBase, ICfgObject, java.lang.Cloneable
Direct Known Subclasses:
CfgAccessGroup, CfgActionCode, CfgAgentGroup, CfgAgentLogin, CfgAlarmCondition, CfgApplication, CfgAppPrototype, CfgBriefInfo, CfgCallingList, CfgCampaign, CfgCampaignGroup, CfgDelta, CfgDN, CfgDNGroup, CfgEnumerator, CfgEnumeratorValue, CfgField, CfgFilter, CfgFolder, CfgFormat, CfgGVPCustomer, CfgGVPIVRProfile, CfgGVPReseller, CfgHost, CfgIVR, CfgIVRPort, CfgObjectiveTable, CfgPerson, CfgPersonLastLogin, CfgPhysicalSwitch, CfgPlace, CfgPlaceGroup, CfgRole, CfgScheduledTask, CfgScript, CfgService, CfgSkill, CfgStatDay, CfgStatTable, CfgSwitch, CfgTableAccess, CfgTenant, CfgTimeZone, CfgTransaction, CfgTreatment, CfgVoicePrompt

public abstract class CfgObject
extends CfgBase
implements ICfgObject

This is a base class for all standalone Configuration Server objects.

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

Constructor Summary
protected CfgObject(IConfService confService, ConfObjectBase objectData, boolean isSaved, java.lang.Object[] additionalParameters)
           
protected CfgObject(IConfService confService, org.w3c.dom.Node xmlData, java.lang.Object[] additionalParameters)
          Main constructor designed for usage from generated classes in deserializing constructors.
 
Method Summary
 CfgObject clone()
          Creates and returns a copy of this object.
 void delete()
          Deletes the configuration object from the Configuration Server.
protected  void doSetFolderId(java.lang.Integer dbid)
           
protected  void ensureDataBackup()
          This internal method is designed for "lazy initialization" of DOM data backup.
 java.lang.Integer getFolderId()
          This property specifies DBID of the folder, in which the object resides in the Configuration Server.
 int getObjectDbid()
          Returns the dbid of the current object, or 0 if object has not been saved.
 java.lang.String getObjectPath()
          Returns path of the object in the Configuration Server.
 CfgObjectType getObjectType()
          Returns the configuration object type.
 void refresh()
          Retrieves the latest data from the Configuration Server and updates the object's data.
protected  void reloadObjectWithNewData(ConfObject newObject)
           
protected  void reloadObjectWithNewData(ConfObject newObject, java.lang.String objectPath, java.lang.Integer folderDbid)
           
 void removeAccount(CfgObject accountObject, boolean recursive)
          Deprecated.  
protected  void resetDataBackup()
           
 int retrieveAccountPermissions(CfgObject accountObject)
          Retrieves a permission mask (see CfgPermissions enumeration) of accessing the object by a specified account (another configuration object).
 CfgACL retrieveACL()
          Retrieves a full list of permissions to access this object for all user accounts.
 java.util.List<PermissionDescriptor> retrievePermissions()
          Deprecated.  
 void save()
          Synchronizes changes in a class with Configuration Server.
 void setAccountPermissions(CfgObject accountObject, int newPermissionsMask)
          Deprecated.  
 void setAccountPermissions(CfgObject accountObject, int newPermissionsMask, boolean recursive)
          Deprecated.  
 void setFolderId(java.lang.Integer dbid)
          This property specifies DBID of the folder, in which the object will reside in the Configuration Server.
This method is to be used while the object is been created, but not modified.
 void update(ICfgDelta deltaObject)
          Updates the current object from the passed delta object.
 boolean updateACL(CfgObject accountObject, java.lang.Integer newPermissionsMask, boolean recursive)
          Changes the permissions on this object for the specified account.
 
Methods inherited from class com.genesyslab.platform.applicationblocks.com.CfgBase
equals, flushChildrenContent, getConfigurationService, getData, getEndpoint, getLinkListCollection, getLinkValue, getLogger, getMetaData, getParent, getProperty, getProperty, getProperty, getRawObjectData, hashCode, initStruct, isSaved, lockObject, resolveLink, setProperty, toString, toStringProperties, toXml, updateChildrenSavedState
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.genesyslab.platform.applicationblocks.com.ICfgBase
getEndpoint, getProperty, getRawObjectData, setProperty, toXml
 

Constructor Detail

CfgObject

protected CfgObject(IConfService confService,
                    ConfObjectBase objectData,
                    boolean isSaved,
                    java.lang.Object[] additionalParameters)

CfgObject

protected CfgObject(IConfService confService,
                    org.w3c.dom.Node xmlData,
                    java.lang.Object[] additionalParameters)
Main constructor designed for usage from generated classes in deserializing constructors.

Parameters:
confService - configuration service instance
xmlData - bound data from Configuration SDK message
additionalParameters - additional parameters from Configuration SDK message
Method Detail

getObjectType

public CfgObjectType getObjectType()
Returns the configuration object type.

Specified by:
getObjectType in interface ICfgObject
Returns:
object type

getObjectDbid

public int getObjectDbid()
Returns the dbid of the current object, or 0 if object has not been saved.

Specified by:
getObjectDbid in interface ICfgObject
Returns:
Configuration object dbid or 0

getObjectPath

public final java.lang.String getObjectPath()
Returns path of the object in the Configuration Server.

Empty or null value means that object read request was done without ICfgFilterBasedQuery.getDoRequestObjectPath() option enabled, configuration server did not return this value for some reason, or this multiple objects read response does not contain paths for all the objects read.

Note: Be aware that to track moving of the object to different folder ("to different path") in the configuration server, it is required to subscribe for CfgFolder's changes and look which CfgFolder got updated to contain this particular object.

Returns:
object path or null
See Also:
ICfgFilterBasedQuery.getDoRequestObjectPath()

getFolderId

public final java.lang.Integer getFolderId()
This property specifies DBID of the folder, in which the object resides in the Configuration Server.

Zero or null value means that object read request was done without ICfgFilterBasedQuery.getDoRequestFolderId() option enabled, configuration server did not return this value for some reason, or this multiple objects read response does not contain folders DBIDs for all the objects read.

Note: Be aware that to track moving of the object to different folder in the configuration server, it is required to subscribe for CfgFolder's changes and look which CfgFolder got updated to contain this particular member.

Returns:
folder DBID, 0 or null
See Also:
ICfgFilterBasedQuery.getDoRequestFolderId()

setFolderId

public final void setFolderId(java.lang.Integer dbid)
This property specifies DBID of the folder, in which the object will reside in the Configuration Server.
This method is to be used while the object is been created, but not modified. It can't be changed after object is created and saved in the configuration server.
To change the object's folder dbid ("move object to other folder"), there is following way: read "target" CfgFolder, add the new member and save it.

Parameters:
dbid - folder DBID.
Throws:
ConfigRuntimeException - is object is saved.

doSetFolderId

protected final void doSetFolderId(java.lang.Integer dbid)

reloadObjectWithNewData

protected void reloadObjectWithNewData(ConfObject newObject)
Overrides:
reloadObjectWithNewData in class CfgBase

reloadObjectWithNewData

protected void reloadObjectWithNewData(ConfObject newObject,
                                       java.lang.String objectPath,
                                       java.lang.Integer folderDbid)

save

public void save()
          throws ConfigException
Synchronizes changes in a class with Configuration Server. Internally generates the correct delta object and sends it to Configuration Server.

Specified by:
save in interface ICfgObject
Throws:
ConfigException - exception while requesting configuration information update

delete

public void delete()
            throws ConfigException
Deletes the configuration object from the Configuration Server.

Specified by:
delete in interface ICfgObject
Throws:
ConfigException - in case of exception on object remove request

refresh

public void refresh()
             throws ConfigException
Retrieves the latest data from the Configuration Server and updates the object's data.

Specified by:
refresh in interface ICfgObject
Throws:
ConfigException - exception while requesting configuration information

update

public void update(ICfgDelta deltaObject)
Updates the current object from the passed delta object.

Specified by:
update in interface ICfgObject
Parameters:
deltaObject - the delta object received from configuration server

retrieveAccountPermissions

public int retrieveAccountPermissions(CfgObject accountObject)
                               throws ConfigException
Retrieves a permission mask (see CfgPermissions enumeration) of accessing the object by a specified account (another configuration object). For example, called on CfgTenant with CfgAgent as a parameter, returns the set of permissions for this agent to access this tenant.

Parameters:
accountObject - account (can be any Configuration Server class).
Returns:
Permissions mask.
Throws:
ConfigException - exception while requesting configuration information
See Also:
CfgPermissions, retrieveACL(), updateACL(CfgObject, Integer, boolean)

retrievePermissions

@Deprecated
public java.util.List<PermissionDescriptor> retrievePermissions()
                                                         throws ConfigException
Deprecated. 

Retrieves a full list of permissions to access this object for all user accounts.

Returns:
A list of PermissionDescriptor objects
Throws:
ConfigException - exception while requesting configuration information
See Also:
retrieveACL(), retrieveAccountPermissions(CfgObject)

retrieveACL

public CfgACL retrieveACL()
                   throws ConfigException
Retrieves a full list of permissions to access this object for all user accounts.

Returns:
Structure with a list of permissions descriptions.
Throws:
ConfigException - exception while requesting configuration information.
See Also:
retrieveAccountPermissions(CfgObject), updateACL(CfgObject, Integer, boolean)

updateACL

public boolean updateACL(CfgObject accountObject,
                         java.lang.Integer newPermissionsMask,
                         boolean recursive)
                  throws ConfigException
Changes the permissions on this object for the specified account.

Parameters:
accountObject - Account (can be any Configuration Server class)
newPermissionsMask - New permissions mask or null. See CfgPermissions enumeration. Null means that the account record should be removed from the ACL.
recursive - This flag, if set to true, directs Configuration Server to remove permissions at the objects subordinate to the one specified in the accountObject parameter. This way all the subordinate objects will receive permissions identical to their parent object. However, this is not the way to set up an individual permission recursively. For this purpose the NoPropagate flag in the permission record should be used. The flag is only relevant to the following object types: CfgFolder, CfgTenant, CfgSwitch, CfgIVR, CfgEnumerator.
Returns:
true if ACL was updated, or false if no change was made.
Throws:
ConfigException - exception while requesting configuration information update
See Also:
CfgPermissions, retrieveACL(), retrieveAccountPermissions(CfgObject)

removeAccount

@Deprecated
public void removeAccount(CfgObject accountObject,
                                     boolean recursive)
                   throws ConfigException
Deprecated. 

Removes the specified account from the current object's access list.
This method is deprecated - use updateACL(accountObject, null, recursive) instead of it.

Parameters:
accountObject - the account object to remove from the access list
recursive - specifies whether to remove the account recursively from child objects
Throws:
ConfigException - exception while updating configuration information
See Also:
updateACL(CfgObject, Integer, boolean)

setAccountPermissions

@Deprecated
public void setAccountPermissions(CfgObject accountObject,
                                             int newPermissionsMask)
                           throws ConfigException
Deprecated. 

Changes the permissions on this object from the specified account. This method sets the permissions recursively on all child objects by default.

Parameters:
accountObject - Account (can be any Configuration Server class)
newPermissionsMask - New permissions mask. See CfgPermissions enumeration.
Throws:
ConfigException - exception while requesting configuration information update
See Also:
CfgPermissions, updateACL(CfgObject, Integer, boolean)

setAccountPermissions

@Deprecated
public void setAccountPermissions(CfgObject accountObject,
                                             int newPermissionsMask,
                                             boolean recursive)
                           throws ConfigException
Deprecated. 

Changes the permissions on this object from the specified account.

Parameters:
accountObject - Account (can be any Configuration Server class)
newPermissionsMask - New permissions mask. See CfgPermissions enumeration.
recursive - This flag, if set to TRUE, directs Configuration Server to remove permissions at the objects subordinate to the one specified in the accountObject parameter. This way all the subordinate objects will receive permissions identical to their parent object. However, this is not the way to set up an individual permission recursively. For this purpose the NoPropagate flag in the permission record should be used. The flag is only relevant to the following object types: CfgFolder, CfgTenant, CfgSwitch, CfgIVR, CfgEnumerator
Throws:
ConfigException - exception while requesting configuration information update
See Also:
CfgPermissions, updateACL(CfgObject, Integer, boolean)

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.

Overrides:
ensureDataBackup in class CfgBase

resetDataBackup

protected void resetDataBackup()

clone

public CfgObject clone()
                throws java.lang.CloneNotSupportedException
Description copied from interface: ICfgObject
Creates and returns a copy of this object.

Specified by:
clone in interface ICfgObject
Overrides:
clone in class CfgBase
Returns:
a clone of this instance.
Throws:
java.lang.CloneNotSupportedException - subclasses that override the clone method can throw this exception to indicate that an instance cannot be cloned.
See Also:
Cloneable

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.