/** * Returns true if the specified feature is part of the discovered information. * * @param feature the feature to check * @return true if the requestes feature has been discovered */ public boolean containsFeature(String feature) { for (Iterator<Feature> it = getFeatures(); it.hasNext();) { if (feature.equals(it.next().getVar())) return true; } return false; }
public String getChildElementXML() { StringBuffer buf = new StringBuffer(); buf.append("<query xmlns=\"http://jabber.org/protocol/disco#info\""); if (getNode() != null) { buf.append(" node=\""); buf.append(getNode()); buf.append("\""); } buf.append(">"); synchronized (identities) { for (int i = 0; i < identities.size(); i++) { Identity identity = (Identity) identities.get(i); buf.append(identity.toXML()); } } synchronized (features) { for (int i = 0; i < features.size(); i++) { Feature feature = (Feature) features.get(i); buf.append(feature.toXML()); } } // Add packet extensions, if any are defined. buf.append(getExtensionsXML()); buf.append("</query>"); return buf.toString(); }
/** * Test if a DiscoverInfo response contains duplicate features. * * @return true if duplicate identities where found, otherwise false */ public boolean containsDuplicateFeatures() { List<Feature> checkedFeatures = new LinkedList<Feature>(); for (Feature f : features) { for (Feature f2 : checkedFeatures) { if (f.equals(f2)) return true; } checkedFeatures.add(f); } return false; }
features.add(it.next().getVar());
public String getChildElementXML() { StringBuilder buf = new StringBuilder(); buf.append("<query xmlns=\"http://jabber.org/protocol/disco#info\""); if (getNode() != null) { buf.append(" node=\""); buf.append(getNode()); buf.append("\""); } buf.append(">"); synchronized (identities) { for (Identity identity : identities) { buf.append(identity.toXML()); } } synchronized (features) { for (Feature feature : features) { buf.append(feature.toXML()); } } // Add packet extensions, if any are defined. buf.append(getExtensionsXML()); buf.append("</query>"); return buf.toString(); }
public String getChildElementXML() { StringBuilder buf = new StringBuilder(); buf.append("<query xmlns=\"http://jabber.org/protocol/disco#info\""); if (getNode() != null) { buf.append(" node=\""); buf.append(getNode()); buf.append("\""); } buf.append(">"); synchronized (identities) { for (Identity identity : identities) { buf.append(identity.toXML()); } } synchronized (features) { for (Feature feature : features) { buf.append(feature.toXML()); } } // Add packet extensions, if any are defined. buf.append(getExtensionsXML()); buf.append("</query>"); return buf.toString(); }
public String getChildElementXML() { StringBuilder buf = new StringBuilder(); buf.append("<query xmlns=\"" + NAMESPACE + "\""); if (getNode() != null) { buf.append(" node=\""); buf.append(StringUtils.escapeForXML(getNode())); buf.append("\""); } buf.append(">"); synchronized (identities) { for (Identity identity : identities) { buf.append(identity.toXML()); } } synchronized (features) { for (Feature feature : features) { buf.append(feature.toXML()); } } // Add packet extensions, if any are defined. buf.append(getExtensionsXML()); buf.append("</query>"); return buf.toString(); }
/** * Returns true if the specified feature is part of the discovered information. * * @param feature the feature to check * @return true if the requestes feature has been discovered */ public boolean containsFeature(String feature) { for (Iterator it = getFeatures(); it.hasNext();) { if (feature.equals(((DiscoverInfo.Feature) it.next()).getVar())) return true; } return false; }
/** * Returns true if the specified feature is part of the discovered information. * * @param feature the feature to check * @return true if the requestes feature has been discovered */ public boolean containsFeature(String feature) { for (Iterator<Feature> it = getFeatures(); it.hasNext();) { if (feature.equals(it.next().getVar())) return true; } return false; }
/** * Adds a new feature to the discovered information. * * @param feature the discovered feature */ public void addFeature(String feature) { addFeature(new Feature(feature)); }
/** * Adds a new feature to the discovered information. * * @param feature the discovered feature */ public void addFeature(String feature) { addFeature(new Feature(feature)); }
/** * Adds a new feature to the discovered information. * * @param feature the discovered feature */ public void addFeature(String feature) { addFeature(new DiscoverInfo.Feature(feature)); }
/** * Returns true if the specified feature is part of the discovered information. * * @param feature the feature to check * @return true if the requestes feature has been discovered */ public boolean containsFeature(String feature) { for (Iterator<Feature> it = getFeatures(); it.hasNext();) { if (feature.equals(it.next().getVar())) return true; } return false; }
/** * Adds a new feature to the discovered information. * * @param feature the discovered feature */ public void addFeature(String feature) { addFeature(new Feature(feature)); }