I've recently implemented it and like to share my experience with it.
One of the requirements of the spec was to have both the old and new specification in place for a certain transition period.
It was pretty clear, that we need some kind of abstraction for both specs, which led to the following interface:
public interface EntityCapabilities { Set<Hashed> getCapabilityHashSet(); byte[] createVerificationString(InfoNode infoNode); String createCapabilityHashNode(Hashed hashed); }
Both have a set of hashes (the old one only has one, which is itself), both can create a verification string from a set of features and identities and both can create a "capability hash node", each using their own algorithm.
The interface Hashed
is implemented by the old Entity Caps and also by the XEP-0300 hash element. InfoNode
is a disco#info
query response (features, identities, extensions).
The class structure looks like this:
Processing Entity Capabilities
When processing a presence stanza or stream features with either or both old and new Entity Capabilities, the flow has become quite complex as you can see in the following flow chart. However, the good news is that it works with only the above interface. Take a look at how it's implemented right now:
Generating Entity Capabilities
The generating entity side is a bit easier:
I hope you liked this little presentation about how both XEP-0115 and XEP-0390 can be implemented behind the same interface.
Entity Capabilties 2.0 will of course be available in the next release.
Please check this link
ReplyDeleteMynews8
Best Baby hooded Bath towels
Best organic Baby Bath towels
Best infant Baby Bath towels
top Best Baby Bath towels
Best and less Baby Bath towels
Well written article. Please check these articles also.
ReplyDeletewww.ABestPro.com
Best Huawei mate 20 pro screen protector
Best Huawei mate 20 pro glass protector
Best Huawei mate 20 pro screen protector
Best Huawei p20 pro screen protector
Best Huawei mate 10 screen protector
Best p20 pro screen protector
Well written article. Please check these articles also.
www.ABestPro.com
Best Huawei mate 20 pro wireless charging
Best Huawei mate se wireless charging
Best Huawei mate 10 pro wireless charging case
Best Huawei mate 10 pro wireless charging
Best Huawei wireless charging
Best Huawei mate 10 pro wireless charging case
Best Huawei mate 10 lite wireless charging
This is really great work. Thank you for sharing such a good and useful information here in the blog for everywhere. Are you ready for the new game sims 4 cheats update! new cas items, configurable stairs and more.
ReplyDelete