Platform SDK Java 8.5 API Reference

com.genesyslab.platform.configuration.protocol.obj
Class ConfStructure

java.lang.Object
  extended by com.genesyslab.platform.configuration.protocol.obj.ConfObjectBase
      extended by com.genesyslab.platform.configuration.protocol.obj.ConfStructure
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
ConfSchema

public class ConfStructure
extends ConfObjectBase

Class represents a data (properties values) container for configuration protocol structure.

Note: Be aware that some objects attributes may have special structure type like ParentID or OwnerID in Folder object.
It is possible to create and fill ConfStructure instance separately, and set it as objects' property value like this (its not right, don't use it):

 ConfStructure ownerId = new ConfStructure(metadata, CfgStructureType.CFGID);
 ownerId.setPropertyValue("type", 7);
 ownerId.setPropertyValue("DBID", 1);
 folder.setPropertyValue("ownerID", ownerId);
It may work in some cases, but it can fail in scenarios like XML serialization.
Actual type of this particular property is CfgOwnerID. It may be created with:
 ConfStructure ownerId = new ConfStructure((CfgDescriptionStructure) metadata.getCfgClass("CfgOwnerID"));
 ...
Recommended way for child structure creation is to use special helper method getOrCreatePropertyValue(), which takes actual metadata description and creates proper structure if it has not been created already:
 ConfStructure ownerId = (ConfStructure) folder.getOrCreatePropertyValue("ownerID");
 ownerId.setPropertyValue("type", 7);
 ownerId.setPropertyValue("DBID", 1);
This method works for child structure or structure collection properties also. For example, adding of members to access group may look like:
 ConfStructureCollection members = (ConfStructureCollection) accGroup.getOrCreatePropertyValue("memberIDs");
 ConfStructure id = members.createStructure();
 id.setPropertyValue("type", CfgObjectType.CFGPerson.ordinal());
 id.setPropertyValue("DBID", person1.getObjectDbid());
 members.add(id);
 id = members.createStructure();
 id.setPropertyValue("type", CfgObjectType.CFGPerson.ordinal());
 id.setPropertyValue("DBID", person2.getObjectDbid());
 members.add(id);
Note*: Structure collections does not control uniqueness of child elements. So, in mentioned sample it is supposed that the persons are not present in the members list already.


Constructor Summary
ConfStructure(CfgDescriptionStructure metadata)
          Creates and initializes configuration structure data container by structure class description.
ConfStructure(CfgMetadata metadata, CfgStructureType structType)
          Creates and initializes configuration structure data container by structure structure type.
 
Method Summary
 CfgDescriptionStructure getClassInfo()
          Returns reference to the structure class MetaData description.
 
Methods inherited from class com.genesyslab.platform.configuration.protocol.obj.ConfObjectBase
checkTypeCompatibility, clone, createChildElement, equals, getAttributeInfo, getOrCreatePropertyValue, getPropertyInfo, getPropertyValue, getPropertyValue, hashCode, setPropertyValue, setPropertyValue, toString, toString, toStringContentHelper, toStringHelper
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConfStructure

public ConfStructure(CfgDescriptionStructure metadata)
Creates and initializes configuration structure data container by structure class description.

Parameters:
metadata - structure class MetaData description.
Throws:
ConfObjectAttributeException - if given MetaData is null or there is some problem with its usage here.

ConfStructure

public ConfStructure(CfgMetadata metadata,
                     CfgStructureType structType)
Creates and initializes configuration structure data container by structure structure type.

Parameters:
metadata - structure class MetaData description.
structType - type of configuration structure
Throws:
java.lang.NullPointerException - if given MetaData is null.
ConfObjectAttributeException - if given MetaData does not contain description for given structure type or there is some problem with its usage here.
Method Detail

getClassInfo

public CfgDescriptionStructure getClassInfo()
Returns reference to the structure class MetaData description.

Overrides:
getClassInfo in class ConfObjectBase
Returns:
structure class MetaData description.

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.