on 09-27-2010 9:38 AM
Hi,
I have two components, the Client and the Server.
The Client calls the Server via a method call, passing an IWDNode as a parameter.
This IWDNode must have a series of attributes, that represents the settings by which the Server operates.
Since on the Server I have a design-time built replica of the structure of the IWDNode that has to be passed, is there a way to do a quick check if the IWDNode is the type of the Server's local node and, in case, do a quick cast to the Server's local node's class?
There is no context mapping between the Client and the Server because they need to be decoupled enough in order to allow the Client to call the Server multiple times with possibly different IWDNodes.
Thank you,
Pietro
Hi,
If you already have the same replica of the node structure in server component then you don't have to compare the whole structure. If you compare the name only then you can continue with your logic.
Use the following code to get the name.
IWDNode node = // passed node.
String nodeName = node.getNodeInfo().getName();
Hope it helps.
Regards,
Manoj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In that case just loop through the node and check for each attributes like:
Iterator iter = wdContext.node<NODE NAME>().getNodeInfo().iterateAttributes();
IWDAttributeInfo attrInfo = null;
while(iter.hasNext()) {
attrInfo = (IWDAttributeInfo)iter.next();
attrInfo.getName(); // To check with attribute name
attrInfo.getDataType().getName(); // To check with attribute type
}
A bit tedious process to check the entire structure, but I don't find any better way.
Regards,
Manoj
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.