public class AttributeSubscriptionList
extends java.lang.Object
AttributeSubscriptionList
is used for defining pairs messageId::attributeId
for subscription to row data in incoming protocol "event" messages.
Subscribed attributes can be defined or undefined in protocol. In any case subscribed attribute will not
be parsed by Platform SDK. They can be accessed on the message level by indexers
with their id (in the string form, e.g. "14"
) as a key.
Attribute subscription feature is useful in case when user needs to:
ConfServerProtocol protocol = new ConfServerProtocol(
new Endpoint("conf-srv", HOST, PORT));
protocol.setUserName(USERNAME);
protocol.set...
AttributeSubscriptionList subscriptionList = new AttributeSubscriptionList();
subscriptionList.addAttribute(EventObjectsRead.ID, "9"); // 9 - "ConfObject"
subscriptionList.applyToContext(protocol.connectionContext());
protocol.open();
After such configuration of the connection, incoming EventObjectsRead
will not contain Documents at eventObjectsRead.getConfObject()
,
but it will be possible to get raw string as it is packed for transportation with:
String confData = (String) ((DataSupport) eventObjectsRead).attributes().get("9");
For Platform SDK version earlier than 8.5, "raw attribute value" means minimal values "wrapping"
with classes like Integer, Long, String or byte[].
subscriptionList.addAttribute(EventObjectsRead.ID, "9", AttributeSubscriptionType.Raw);
And then the data may be accessed by the way like:
AttributeRawValue confData = (AttributeRawValue) ((DataSupport) eventObjectsRead).attributes().get("9");
AttributeRawValue
Modifier and Type | Class | Description |
---|---|---|
static class |
AttributeSubscriptionList.AttributeSubscriptionType |
Enumeration defining possible types of attribute subscription.
|
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
SUBSCRIPTION_LIST_KEY |
The key this list is expected in context under.
|
Constructor | Description |
---|---|
AttributeSubscriptionList() |
Modifier and Type | Method | Description |
---|---|---|
void |
addAttribute(int messageId,
java.lang.String attributeId) |
Adds given pair
messageId::attributeId to list. |
void |
addAttribute(int messageId,
java.lang.String attributeId,
AttributeSubscriptionList.AttributeSubscriptionType type) |
Adds given pair
messageId::attributeId to list. |
void |
applyToContext(ConnectionContext ctx) |
Apply this subscription list to given
ConnectionContext . |
static boolean |
attributeSubscribed(ConnectionContext context,
int msgId,
java.lang.String attrId) |
Deprecated.
|
boolean |
contains(int messageId,
java.lang.String attrId) |
Deprecated.
|
java.util.Map<java.lang.String,AttributeSubscriptionList.AttributeSubscriptionType> |
getMessageSubscriptions(int messageId) |
Returns attributes mappings for particular message.
|
boolean |
removeAttribute(int messageId,
java.lang.String attrId) |
Removes subscription for given messageId::attrId pair.
|
boolean |
removeWholeMessage(int messageId) |
Removes subscription to all attributes for given message.
|
public static final java.lang.String SUBSCRIPTION_LIST_KEY
public void applyToContext(ConnectionContext ctx)
ConnectionContext
. This method replaces
subscription in the context (if exists) with the current one.ctx
- ConnectionContext to apply subscription to@Deprecated public boolean contains(int messageId, java.lang.String attrId)
messageId
- message IDattrId
- attribute IDgetMessageSubscriptions(int)
public java.util.Map<java.lang.String,AttributeSubscriptionList.AttributeSubscriptionType> getMessageSubscriptions(int messageId)
messageId
- protocol message id.public void addAttribute(int messageId, java.lang.String attributeId)
messageId::attributeId
to list.messageId
- message ID.attributeId
- attribute ID.public void addAttribute(int messageId, java.lang.String attributeId, AttributeSubscriptionList.AttributeSubscriptionType type)
messageId::attributeId
to list.messageId
- message ID.attributeId
- attribute ID.type
- subscription type or null.public boolean removeAttribute(int messageId, java.lang.String attrId)
messageId
- message IDattrId
- attribute IDpublic boolean removeWholeMessage(int messageId)
messageId
- message ID.@Deprecated public static boolean attributeSubscribed(ConnectionContext context, int msgId, java.lang.String attrId)
context
- connection context to look in.msgId
- message ID.attrId
- attribute ID.getMessageSubscriptions(int)
Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.