test_class.declarator: privacyFilter
test_class.modifier: private
test_class.original_string: private JabberIqPrivacy privacyFilter;
test_class.type: JabberIqPrivacy
test_class.var_name: privacyFilter
test_class.declarator: results
test_class.modifier: private
test_class.original_string: private ArrayDeque<Packet> results;
test_class.type: ArrayDeque<Packet>
test_class.var_name: results
test_class.file: tigase-server 7.1.0/src/test/java/tigase/xmpp/impl/JabberIqPrivacyTest.java
test_class.identifier: JabberIqPrivacyTest
test_class.superclass: extends ProcessorTestCase
test_case.body: @Test
          public void testValidateListBadSubscription() {
               List<Element> items = new ArrayList<Element>();
               
               Authorization result = null;
                            
               items.add(new Element("item", new String[] { "type", "value", "action", "order" },
                       new String[] { "subscription", "or", "allow", "10" }));
               items.add(new Element("item", new String[] { "action", "order" },
                       new String[] { "deny", "15" }));
               
               // session is allowed to be null here
               result = JabberIqPrivacy.validateList(null, items);
               assertEquals(Authorization.BAD_REQUEST, result);
          }
test_case.class_method_signature: JabberIqPrivacyTest.testValidateListBadSubscription()
test_case.full_signature: @Test public void testValidateListBadSubscription()
test_case.identifier: testValidateListBadSubscription
test_case.invocations: add add validateList assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testValidateListBadSubscription()
focal_class.declarator: ACTIVE_EL_NAME  = "active"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String     ACTIVE_EL_NAME  = "active";
focal_class.type: String
focal_class.var_name: ACTIVE_EL_NAME
focal_class.declarator: BLOCKED_ELEM = new Element("blocked", new String[] { "xmlns" }, new String[] { "urn:xmpp:blocking:errors" })
focal_class.modifier: protected static final
focal_class.original_string: protected static final Element     BLOCKED_ELEM = new Element("blocked", new String[] { "xmlns" }, new String[] { "urn:xmpp:blocking:errors" });
focal_class.type: Element
focal_class.var_name: BLOCKED_ELEM
focal_class.declarator: DEFAULT_EL_NAME = "default"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String     DEFAULT_EL_NAME = "default";
focal_class.type: String
focal_class.var_name: DEFAULT_EL_NAME
focal_class.declarator: ELEMENTS        = {
  		Iq.IQ_QUERY_PATH
  	}
focal_class.modifier: protected static final
focal_class.original_string: protected static final String[][] ELEMENTS        = {
  		Iq.IQ_QUERY_PATH
  	};
focal_class.type: String[][]
focal_class.var_name: ELEMENTS
focal_class.declarator: LIST_EL_NAME    = "list"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String     LIST_EL_NAME    = "list";
focal_class.type: String
focal_class.var_name: LIST_EL_NAME
focal_class.declarator: log = Logger.getLogger(JabberIqPrivacy.class.getName())
focal_class.modifier: protected static
focal_class.original_string: protected static Logger          log = Logger.getLogger(JabberIqPrivacy.class.getName());
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: ERROR_EL_NAME        = "error"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String    ERROR_EL_NAME        = "error";
focal_class.type: String
focal_class.var_name: ERROR_EL_NAME
focal_class.declarator: PRESENCE_EL_NAME     = "presence"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String    PRESENCE_EL_NAME     = "presence";
focal_class.type: String
focal_class.var_name: PRESENCE_EL_NAME
focal_class.declarator: PRESENCE_IN_EL_NAME  = "presence-in"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String    PRESENCE_IN_EL_NAME  = "presence-in";
focal_class.type: String
focal_class.var_name: PRESENCE_IN_EL_NAME
focal_class.declarator: PRESENCE_OUT_EL_NAME = "presence-out"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String    PRESENCE_OUT_EL_NAME = "presence-out";
focal_class.type: String
focal_class.var_name: PRESENCE_OUT_EL_NAME
focal_class.declarator: XMLNS                = "jabber:iq:privacy"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String    XMLNS                = "jabber:iq:privacy";
focal_class.type: String
focal_class.var_name: XMLNS
focal_class.declarator: ID                   = XMLNS
focal_class.modifier: protected static final
focal_class.original_string: protected static final String    ID                   = XMLNS;
focal_class.type: String
focal_class.var_name: ID
focal_class.declarator: XMLNSS               = { XMLNS }
focal_class.modifier: protected static final
focal_class.original_string: protected static final String[]  XMLNSS               = { XMLNS };
focal_class.type: String[]
focal_class.var_name: XMLNSS
focal_class.declarator: roster_util = RosterFactory.getRosterImplementation(
  			true)
focal_class.modifier: protected static
focal_class.original_string: protected static RosterAbstract  roster_util = RosterFactory.getRosterImplementation(
  			true);
focal_class.type: RosterAbstract
focal_class.var_name: roster_util
focal_class.declarator: DISCO_FEATURES = { new Element("feature", new String[] {
  			"var" }, new String[] { XMLNS }) }
focal_class.modifier: protected static final
focal_class.original_string: protected static final Element[] DISCO_FEATURES = { new Element("feature", new String[] {
  			"var" }, new String[] { XMLNS }) };
focal_class.type: Element[]
focal_class.var_name: DISCO_FEATURES
focal_class.declarator: compar = new Comparator<Element>() {
  		@Override
  		public int compare(Element el1, Element el2) {
  			String or1 = el1.getAttributeStaticStr(ORDER);
  			String or2 = el2.getAttributeStaticStr(ORDER);
  			if (or1.length() != or2.length())
  				return Integer.compare(or1.length(), or2.length());
  
  			return or1.compareTo(or2);
  		}
  	}
focal_class.modifier: protected static final
focal_class.original_string: protected static final Comparator<Element> compar = new Comparator<Element>() {
  		@Override
  		public int compare(Element el1, Element el2) {
  			String or1 = el1.getAttributeStaticStr(ORDER);
  			String or2 = el2.getAttributeStaticStr(ORDER);
  			if (or1.length() != or2.length())
  				return Integer.compare(or1.length(), or2.length());
  
  			return or1.compareTo(or2);
  		}
  	};
focal_class.type: Comparator<Element>
focal_class.var_name: compar
focal_class.file: tigase-server 7.1.0/src/main/java/tigase/xmpp/impl/JabberIqPrivacy.java
focal_class.identifier: JabberIqPrivacy
focal_class.interfaces: implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc
focal_class.class_method_signature: JabberIqPrivacy.filter(Packet packet, XMPPResourceConnection session,
  			NonAuthUserRepository repo, Queue<Packet> results)
focal_class.full_signature: @Override public void filter(Packet packet, XMPPResourceConnection session,
  			NonAuthUserRepository repo, Queue<Packet> results)
focal_class.identifier: filter
focal_class.modifiers: @Override public
focal_class.parameters: (Packet packet, XMPPResourceConnection session,
  			NonAuthUserRepository repo, Queue<Packet> results)
focal_class.return: void
focal_class.signature: void filter(Packet packet, XMPPResourceConnection session,
  			NonAuthUserRepository repo, Queue<Packet> results)
focal_class.class_method_signature: JabberIqPrivacy.id()
focal_class.full_signature: @Override public String id()
focal_class.identifier: id
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String id()
focal_class.class_method_signature: JabberIqPrivacy.preProcess(Packet packet, XMPPResourceConnection session,
  			NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings)
focal_class.full_signature: @Override public boolean preProcess(Packet packet, XMPPResourceConnection session,
  			NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings)
focal_class.identifier: preProcess
focal_class.modifiers: @Override public
focal_class.parameters: (Packet packet, XMPPResourceConnection session,
  			NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings)
focal_class.return: boolean
focal_class.signature: boolean preProcess(Packet packet, XMPPResourceConnection session,
  			NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings)
focal_class.class_method_signature: JabberIqPrivacy.process(final Packet packet, final XMPPResourceConnection session,
  			final NonAuthUserRepository repo, final Queue<Packet> results, final Map<String,
  			Object> settings)
focal_class.full_signature: @Override public void process(final Packet packet, final XMPPResourceConnection session,
  			final NonAuthUserRepository repo, final Queue<Packet> results, final Map<String,
  			Object> settings)
focal_class.identifier: process
focal_class.modifiers: @Override public
focal_class.parameters: (final Packet packet, final XMPPResourceConnection session,
  			final NonAuthUserRepository repo, final Queue<Packet> results, final Map<String,
  			Object> settings)
focal_class.return: void
focal_class.signature: void process(final Packet packet, final XMPPResourceConnection session,
  			final NonAuthUserRepository repo, final Queue<Packet> results, final Map<String,
  			Object> settings)
focal_class.class_method_signature: JabberIqPrivacy.supDiscoFeatures(final XMPPResourceConnection session)
focal_class.full_signature: @Override public Element[] supDiscoFeatures(final XMPPResourceConnection session)
focal_class.identifier: supDiscoFeatures
focal_class.modifiers: @Override public
focal_class.parameters: (final XMPPResourceConnection session)
focal_class.return: Element[]
focal_class.signature: Element[] supDiscoFeatures(final XMPPResourceConnection session)
focal_class.class_method_signature: JabberIqPrivacy.supElementNamePaths()
focal_class.full_signature: @Override public String[][] supElementNamePaths()
focal_class.identifier: supElementNamePaths
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String[][]
focal_class.signature: String[][] supElementNamePaths()
focal_class.class_method_signature: JabberIqPrivacy.supNamespaces()
focal_class.full_signature: @Override public String[] supNamespaces()
focal_class.identifier: supNamespaces
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String[]
focal_class.signature: String[] supNamespaces()
focal_class.class_method_signature: JabberIqPrivacy.allowed(Packet packet, XMPPResourceConnection session)
focal_class.full_signature: protected boolean allowed(Packet packet, XMPPResourceConnection session)
focal_class.identifier: allowed
focal_class.modifiers: protected
focal_class.parameters: (Packet packet, XMPPResourceConnection session)
focal_class.return: boolean
focal_class.signature: boolean allowed(Packet packet, XMPPResourceConnection session)
focal_class.class_method_signature: JabberIqPrivacy.allowedByDefault(Packet packet, XMPPResourceConnection session)
focal_class.full_signature: protected boolean allowedByDefault(Packet packet, XMPPResourceConnection session)
focal_class.identifier: allowedByDefault
focal_class.modifiers: protected
focal_class.parameters: (Packet packet, XMPPResourceConnection session)
focal_class.return: boolean
focal_class.signature: boolean allowedByDefault(Packet packet, XMPPResourceConnection session)
focal_class.class_method_signature: JabberIqPrivacy.matchToPrivacyListElement(boolean packetIn, Packet packet, Element elem, ITEM_ACTION action)
focal_class.full_signature: protected boolean matchToPrivacyListElement(boolean packetIn, Packet packet, Element elem, ITEM_ACTION action)
focal_class.identifier: matchToPrivacyListElement
focal_class.modifiers: protected
focal_class.parameters: (boolean packetIn, Packet packet, Element elem, ITEM_ACTION action)
focal_class.return: boolean
focal_class.signature: boolean matchToPrivacyListElement(boolean packetIn, Packet packet, Element elem, ITEM_ACTION action)
focal_class.class_method_signature: JabberIqPrivacy.prepareError(Packet packet, XMPPResourceConnection session)
focal_class.full_signature: protected Packet prepareError(Packet packet, XMPPResourceConnection session)
focal_class.identifier: prepareError
focal_class.modifiers: protected
focal_class.parameters: (Packet packet, XMPPResourceConnection session)
focal_class.return: Packet
focal_class.signature: Packet prepareError(Packet packet, XMPPResourceConnection session)
focal_class.class_method_signature: JabberIqPrivacy.processGetRequest(final Packet packet,
  			final XMPPResourceConnection session, final Queue<Packet> results)
focal_class.full_signature: protected void processGetRequest(final Packet packet,
  			final XMPPResourceConnection session, final Queue<Packet> results)
focal_class.identifier: processGetRequest
focal_class.modifiers: protected
focal_class.parameters: (final Packet packet,
  			final XMPPResourceConnection session, final Queue<Packet> results)
focal_class.return: void
focal_class.signature: void processGetRequest(final Packet packet,
  			final XMPPResourceConnection session, final Queue<Packet> results)
focal_class.class_method_signature: JabberIqPrivacy.processSetRequest(final Packet packet,
  			final XMPPResourceConnection session, final Queue<Packet> results)
focal_class.full_signature: protected void processSetRequest(final Packet packet,
  			final XMPPResourceConnection session, final Queue<Packet> results)
focal_class.identifier: processSetRequest
focal_class.modifiers: protected
focal_class.parameters: (final Packet packet,
  			final XMPPResourceConnection session, final Queue<Packet> results)
focal_class.return: void
focal_class.signature: void processSetRequest(final Packet packet,
  			final XMPPResourceConnection session, final Queue<Packet> results)
focal_class.class_method_signature: JabberIqPrivacy.validateList(final XMPPResourceConnection session,
  			final List<Element> items)
focal_class.full_signature: public static Authorization validateList(final XMPPResourceConnection session,
  			final List<Element> items)
focal_class.identifier: validateList
focal_class.modifiers: public static
focal_class.parameters: (final XMPPResourceConnection session,
  			final List<Element> items)
focal_class.return: Authorization
focal_class.signature: Authorization validateList(final XMPPResourceConnection session,
  			final List<Element> items)
focal_class.superclass: extends XMPPProcessor
focal_method.body: public static Authorization validateList(final XMPPResourceConnection session,
  			final List<Element> items) {
  		Authorization result = null;
  
  		try {
  			HashSet<Integer> orderSet = new HashSet<Integer>();
  
  			// creating set of all known groups in roster
  			HashSet<String> groups = new HashSet<String>();
  
  			if (session != null) {
  				JID[] jids = roster_util.getBuddies(session);
  
  				if (jids != null) {
  					for (JID jid : jids) {
  						String[] buddyGroups = roster_util.getBuddyGroups(session, jid);
  
  						if (buddyGroups != null) {
  							for (String group : buddyGroups) {
  								groups.add(group);
  							}
  						}
  					}
  				}
  			}
  			for (Element item : items) {
  				ITEM_TYPE type = ITEM_TYPE.all;
  
  				if (item.getAttributeStaticStr(TYPE) != null) {
  					type = ITEM_TYPE.valueOf(item.getAttributeStaticStr(TYPE));
  				}    // end of if (item.getAttribute(TYPE) != null)
  
  				String value = item.getAttributeStaticStr(VALUE);
  
  				switch (type) {
  				case jid :
  
  					// if jid is not valid it will throw exception
  					JID.jidInstance(value);
  
  					break;
  
  				case group :
  					boolean matched = groups.contains(value);
  
  					if (!matched) {
  						result = Authorization.ITEM_NOT_FOUND;
  					}
  
  					break;
  
  				case subscription :
  
  					// if subscription is not valid it will throw exception
  					ITEM_SUBSCRIPTIONS.valueOf(value);
  
  					break;
  
  				case all :
  				default :
  					break;
  				}
  				if (result != null) {
  					break;
  				}
  
  				// if action is not valid it will throw exception
  				ITEM_ACTION.valueOf(item.getAttributeStaticStr(ACTION));
  
  				// checking unique order attribute value
  				Integer order = Integer.parseInt(item.getAttributeStaticStr(ORDER));
  
  				if ((order == null) || (order < 0) ||!orderSet.add(order)) {
  					result = Authorization.BAD_REQUEST;
  				}
  				if (result != null) {
  					break;
  				}
  			}
  		} catch (Exception ex) {
  
  			// if we get exception list is not valid
  			result = Authorization.BAD_REQUEST;
  		}
  
  		return result;
  	}
focal_method.class_method_signature: JabberIqPrivacy.validateList(final XMPPResourceConnection session,
  			final List<Element> items)
focal_method.full_signature: public static Authorization validateList(final XMPPResourceConnection session,
  			final List<Element> items)
focal_method.identifier: validateList
focal_method.invocations: getBuddies getBuddyGroups add getAttributeStaticStr valueOf getAttributeStaticStr getAttributeStaticStr jidInstance contains valueOf valueOf getAttributeStaticStr parseInt getAttributeStaticStr add
focal_method.modifiers: public static
focal_method.parameters: (final XMPPResourceConnection session,
  			final List<Element> items)
focal_method.return: Authorization
focal_method.signature: Authorization validateList(final XMPPResourceConnection session,
  			final List<Element> items)