From c0b9c4ef2f66a040845db6f9cde6345f2b749ef5 Mon Sep 17 00:00:00 2001 From: Guilherme Baptista Date: Wed, 4 Mar 2015 19:40:55 -0300 Subject: [PATCH] Using overriden methods of Abstract Component to provide identity --- .../xmpp/MediaServerComponent.java | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/buddycloud/mediaserver/xmpp/MediaServerComponent.java b/src/main/java/com/buddycloud/mediaserver/xmpp/MediaServerComponent.java index 9db0ede..54f2617 100644 --- a/src/main/java/com/buddycloud/mediaserver/xmpp/MediaServerComponent.java +++ b/src/main/java/com/buddycloud/mediaserver/xmpp/MediaServerComponent.java @@ -107,12 +107,12 @@ protected IQ handleDiscoInfo(IQ iq) { if (endPoint != null) { Element queryEl = disco.getElement().element("query"); - addIdentity(queryEl, "component", getName(), "generic"); - - addFeature(queryEl, NAMESPACE_DISCO_INFO); - addFeature(queryEl, NAMESPACE_XMPP_PING); - addFeature(queryEl, NAMESPACE_LAST_ACTIVITY); - addFeature(queryEl, NAMESPACE_ENTITY_TIME); +// addIdentity(queryEl, "component", getName(), "generic"); +// +// addFeature(queryEl, NAMESPACE_DISCO_INFO); +// addFeature(queryEl, NAMESPACE_XMPP_PING); +// addFeature(queryEl, NAMESPACE_LAST_ACTIVITY); +// addFeature(queryEl, NAMESPACE_ENTITY_TIME); Element xEl = queryEl.addElement("x", "jabber:x:data"); xEl.addAttribute("type", "result"); @@ -145,6 +145,21 @@ private void addField(Element xEl, String var, String type, fieldEl.addElement("value").setText(value); } + @Override + protected String[] discoInfoFeatureNamespaces() { + return new String[]{NAMESPACE_DISCO_INFO, NAMESPACE_XMPP_PING, NAMESPACE_LAST_ACTIVITY, NAMESPACE_ENTITY_TIME}; + } + + @Override + protected String discoInfoIdentityCategory() { + return "component"; + } + + @Override + protected String discoInfoIdentityCategoryType() { + return "generic"; + } + @Override public void postComponentShutdown() { LOGGER.debug("Buddycloud Media XMPP component was disconnected.");