My main trouble was updating the user properties in the annex tab, but here's how I got it to work ...
I have a wrapper around the protocol and connection, where I defined this method:
@Override
public void updateConfigObject(ConfObjectDelta configObj) {
if(!canWrite())
throw new IllegalStateException("Unable to update configuation object because connection is not ready!");
Guard.argumentNotNull(configObj, "configObj");
int id = configObj.getObjectDbid();
RequestUpdateObject req = RequestUpdateObject.create();
req.setObjectDelta(configObj);
Message resp = connection.request(req);
if(resp instanceof EventObjectUpdated) {
logger.info("ConfigWriter.createConfigObject: Object [{}] updated successfully!", id);
return;
}
String errMsg = "Failed to update object [" + id + "]! ";
if(resp instanceof EventError)
errMsg += ((EventError)resp).getDescription();
else
errMsg += "Unexpected response [" + (resp == null ? "null" : resp.messageName()) + "]";
logger.error("ConfigWriter.updateConfigObject: {}", errMsg);
throw new MessagingException(errMsg);
}Then from the client code (in this case a simple JUnit test):
ConfObjectDelta deltaObj = new ConfObjectDelta(connection.getConfigServerContextMetadata(), CfgObjectType.CFGApplication);
KeyValueCollection s2 = new KeyValueCollection();
s2.addString("o1", "FOO!");
KeyValueCollection changedProps = new KeyValueCollection();
deltaObj.setPropertyValue("changedUserProperties", changedProps);
changedProps = (KeyValueCollection)deltaObj.getOrCreatePropertyValue("changedUserProperties");
changedProps.addList("s2", s2);
ConfObject obj = (ConfObject)deltaObj.getOrCreatePropertyValue("deltaApplication");
obj.setPropertyValue(DBID, id);
obj.setPropertyValue(STATE, CfgObjectState.CFGDisabled.asInteger());
writer.updateConfigObject(deltaObj);Note that the getOrCreatePropertyValue method does not seem to work for KVList collections like "changedUserProperties", or "deletedUserProperties", it just returns null. So I had to create a new KeyValueCollection myself, set it as a property on the delta object with the expected attribute name - see
https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgDeltaApplicationCheers!