Skip to content

Commit

Permalink
Using overriden methods of Abstract Component to provide identity
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermesgb committed Mar 4, 2015
1 parent a0e3dfe commit c0b9c4e
Showing 1 changed file with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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.");
Expand Down

0 comments on commit c0b9c4e

Please sign in to comment.