/** * Returns the type hold the kind of communication it will allow or block. * It MUST be filled with one of these values: jid, group or subscription. * * @return the type of communication it represent. */ public Type getType() { if (this.getRule() == null) { return null; } else { return this.getRule().getType(); } }
/** * Returns whether the receiver allows or denies every kind of communication. * * When filterIQ, filterMessage, filterPresence_in and filterPresence_out are not set * the receiver will block all communications. * * @return the all communications status. */ public boolean isFilterEverything() { return !(this.isFilterIQ() || this.isFilterMessage() || this.isFilterPresence_in() || this.isFilterPresence_out()); }
StringBuilder buf = new StringBuilder(); buf.append("<item"); if (this.isAllow()) { buf.append(" action=\"allow\""); } else { buf.append(" action=\"deny\""); buf.append(" order=\"").append(getOrder()).append("\""); if (getType() != null) { buf.append(" type=\"").append(getType()).append("\""); if (getValue() != null) { buf.append(" value=\"").append(getValue()).append("\""); if (isFilterEverything()) { buf.append("/>"); } else { buf.append(">"); if (this.isFilterIQ()) { buf.append("<iq/>"); if (this.isFilterMessage()) { buf.append("<message/>"); if (this.isFilterPresence_in()) { buf.append("<presence-in/>"); if (this.isFilterPresence_out()) { buf.append("<presence-out/>");
PrivacyItem item = new PrivacyItem(type, allow, order); item.setValue(parser.getAttributeValue("", "value")); if (eventType == XmlPullParser.START_TAG) { if (parser.getName().equals("iq")) { item.setFilterIQ(true); item.setFilterMessage(true); item.setFilterPresence_in(true); item.setFilterPresence_out(true);
/** * Returns the privacy item in the specified order. * * @param listName the name of the privacy list. * @param order the order of the element. * @return a List with {@link PrivacyItem} */ public PrivacyItem getItem(String listName, int order) { Iterator<PrivacyItem> values = getPrivacyList(listName).iterator(); PrivacyItem itemFound = null; while (itemFound == null && values.hasNext()) { PrivacyItem element = values.next(); if (element.getOrder() == order) { itemFound = element; } } return itemFound; }
StringBuilder buf = new StringBuilder(); buf.append("<item"); if (this.isAllow()) { buf.append(" action=\"allow\""); } else { buf.append(" action=\"deny\""); buf.append(" order=\"").append(getOrder()).append("\""); if (getType() != null) { buf.append(" type=\"").append(getType()).append("\""); if (getValue() != null) { buf.append(" value=\"").append(getValue()).append("\""); if (isFilterEverything()) { buf.append("/>"); } else { buf.append(">"); if (this.isFilterIQ()) { buf.append("<iq/>"); if (this.isFilterMessage()) { buf.append("<message/>"); if (this.isFilterPresence_in()) { buf.append("<presence-in/>"); if (this.isFilterPresence_out()) { buf.append("<presence-out/>");
PrivacyItem item = new PrivacyItem(type, allow, order); item.setValue(parser.getAttributeValue("", "value")); if (eventType == XmlPullParser.START_TAG) { if (parser.getName().equals("iq")) { item.setFilterIQ(true); item.setFilterMessage(true); item.setFilterPresence_in(true); item.setFilterPresence_out(true);
/** * Returns the privacy item in the specified order. * * @param listName the name of the privacy list. * @param order the order of the element. * @return a List with {@link PrivacyItem} */ public PrivacyItem getItem(String listName, int order) { Iterator<PrivacyItem> values = getPrivacyList(listName).iterator(); PrivacyItem itemFound = null; while (itemFound == null && values.hasNext()) { PrivacyItem element = values.next(); if (element.getOrder() == order) { itemFound = element; } } return itemFound; }
StringBuilder buf = new StringBuilder(); buf.append("<item"); if (this.isAllow()) { buf.append(" action=\"allow\""); } else { buf.append(" action=\"deny\""); buf.append(" order=\"").append(getOrder()).append("\""); if (getType() != null) { buf.append(" type=\"").append(getType()).append("\""); if (getValue() != null) { buf.append(" value=\"").append(getValue()).append("\""); if (isFilterEverything()) { buf.append("/>"); } else { buf.append(">"); if (this.isFilterIQ()) { buf.append("<iq/>"); if (this.isFilterMessage()) { buf.append("<message/>"); if (this.isFilterPresence_in()) { buf.append("<presence-in/>"); if (this.isFilterPresence_out()) { buf.append("<presence-out/>");
PrivacyItem item = new PrivacyItem(type, allow, order); item.setValue(parser.getAttributeValue("", "value")); if (eventType == XmlPullParser.START_TAG) { if (parser.getName().equals("iq")) { item.setFilterIQ(true); item.setFilterMessage(true); item.setFilterPresence_in(true); item.setFilterPresence_out(true);
/** * Returns whether the receiver allows or denies every kind of communication. * * When filterIQ, filterMessage, filterPresence_in and filterPresence_out are not set * the receiver will block all communications. * * @return the all communications status. */ public boolean isFilterEverything() { return !(this.isFilterIQ() || this.isFilterMessage() || this.isFilterPresence_in() || this.isFilterPresence_out()); }
/** * Returns the type hold the kind of communication it will allow or block. * It MUST be filled with one of these values: jid, group or subscription. * * @return the type of communication it represent. */ public Type getType() { if (this.getRule() == null) { return null; } else { return this.getRule().getType(); } }
/** * Returns the privacy item in the specified order. * * @param listName the name of the privacy list. * @param order the order of the element. * @return a List with {@link PrivacyItem} */ public PrivacyItem getItem(String listName, int order) { Iterator<PrivacyItem> values = getPrivacyList(listName).iterator(); PrivacyItem itemFound = null; while (itemFound == null && values.hasNext()) { PrivacyItem element = values.next(); if (element.getOrder() == order) { itemFound = element; } } return itemFound; }
/** * Returns whether the receiver allows or denies every kind of communication. * * When filterIQ, filterMessage, filterPresence_in and filterPresence_out are not set * the receiver will block all communications. * * @return the all communications status. */ public boolean isFilterEverything() { return !(this.isFilterIQ() || this.isFilterMessage() || this.isFilterPresence_in() || this.isFilterPresence_out()); }
/** * Returns the type hold the kind of communication it will allow or block. * It MUST be filled with one of these values: jid, group or subscription. * * @return the type of communication it represent. */ public Type getType() { if (this.getRule() == null) { return null; } else { return this.getRule().getType(); } }
/** * Sets the element identifier to apply the action. * * If the type is "jid", then the 'value' attribute MUST contain a valid Jabber ID. * If the type is "group", then the 'value' attribute SHOULD contain the name of a group * in the user's roster. * If the type is "subscription", then the 'value' attribute MUST be one of "both", "to", * "from", or "none". * * @param value is the identifier to apply the action. */ public void setValue(String value) { if (!(this.getRule() == null && value == null)) { this.getRule().setValue(value); } }
/** * Sets the element identifier to apply the action. * * If the type is "jid", then the 'value' attribute MUST contain a valid Jabber ID. * If the type is "group", then the 'value' attribute SHOULD contain the name of a group * in the user's roster. * If the type is "subscription", then the 'value' attribute MUST be one of "both", "to", * "from", or "none". * * @param value is the identifier to apply the action. */ public void setValue(String value) { if (!(this.getRule() == null && value == null)) { this.getRule().setValue(value); } }
/** * Sets the element identifier to apply the action. * * If the type is "jid", then the 'value' attribute MUST contain a valid Jabber ID. * If the type is "group", then the 'value' attribute SHOULD contain the name of a group * in the user's roster. * If the type is "subscription", then the 'value' attribute MUST be one of "both", "to", * "from", or "none". * * @param value is the identifier to apply the action. */ public void setValue(String value) { if (!(this.getRule() == null && value == null)) { this.getRule().setValue(value); } }
/** * Returns the element identifier to apply the action. * * If the type is "jid", then the 'value' attribute MUST contain a valid Jabber ID. * If the type is "group", then the 'value' attribute SHOULD contain the name of a group * in the user's roster. * If the type is "subscription", then the 'value' attribute MUST be one of "both", "to", * "from", or "none". * * @return the identifier to apply the action. */ public String getValue() { if (this.getRule() == null) { return null; } else { return this.getRule().getValue(); } }
/** * Returns the element identifier to apply the action. * * If the type is "jid", then the 'value' attribute MUST contain a valid Jabber ID. * If the type is "group", then the 'value' attribute SHOULD contain the name of a group * in the user's roster. * If the type is "subscription", then the 'value' attribute MUST be one of "both", "to", * "from", or "none". * * @return the identifier to apply the action. */ public String getValue() { if (this.getRule() == null) { return null; } else { return this.getRule().getValue(); } }