Parses attributes as a Map, used in both parseWebIdentitySessionContext and parseSessionContext

@return attributes for either session context or web identity session context
@throws IOException
489629
private Map<String, String> parseAttributes() throws IOException {
        if (jsonParser.nextToken() != JsonToken.START_OBJECT) {
            throw new JsonParseException("Not a Attributes object", jsonParser.getCurrentLocation());
        }

        Map<String, String> attributes = new HashMap<>();

        while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
            String key = jsonParser.getCurrentName();
            String value = jsonParser.nextTextValue();
            attributes.put(key, value);
        }

        return attributes;
    }
923062
protected Map<String, String> getElementAttributes() {
        // Preserve order of attributes
        Map<String, String> attrs = new HashMap<>();

        if (this.getVoice() != null) {
            attrs.put("voice", this.getVoice().toString());
        }
        if (this.getLoop() != null) {
            attrs.put("loop", this.getLoop().toString());
        }
        if (this.getLanguage() != null) {
            attrs.put("language", this.getLanguage().toString());
        }

        return attrs;
    }
136386
protected Map<String, String> getElementAttributes() {
        // Preserve order of attributes
        Map<String, String> attrs = new HashMap<>();

        if (this.getTo() != null) {
            attrs.put("to", this.getTo());
        }
        if (this.getFrom() != null) {
            attrs.put("from", this.getFrom());
        }
        if (this.getAction() != null) {
            attrs.put("action", this.getAction().toString());
        }
        if (this.getMethod() != null) {
            attrs.put("method", this.getMethod().toString());
        }
        if (this.getStatusCallback() != null) {
            attrs.put("statusCallback", this.getStatusCallback().toString());
        }

        return attrs;
    }
1141527
@Override
    public Map<String, List<Object>> getAttributeMap() {
        final Map<String, List<Object>> attrMap = userAttributes;
        return attrMap;
    }
843348
static JSONObject processAttributesForCovering(Map<String, Object> attributes) {
    HashMap<String, Object> attributeMap = new HashMap<String, Object>();
    if (attributes.containsKey(Conversation.NAME)) {
      attributeMap.put(Conversation.NAME,
              attributes.get(Conversation.NAME));
    }
    Map<String, Object> innerAttribute = new HashMap<String, Object>();
    for (Map.Entry<String, Object> entry : attributes.entrySet()) {
      String k = entry.getKey();
      if (!Arrays.asList(Conversation.CONVERSATION_COLUMNS).contains(k)) {
        innerAttribute.put(k, entry.getValue());
      }
    }
    if (!innerAttribute.isEmpty()) {
      attributeMap.put(Conversation.ATTRIBUTE, innerAttribute);
    }
    if (attributeMap.isEmpty()) {
      return null;
    }
    return new JSONObject(attributeMap);
  }
246361
protected Map<String, Object> getAttributeMap() {
		if(this.sipSessionAttributeMap == null) {
			this.sipSessionAttributeMap = new ConcurrentHashMap<String, Object>();
		}
		return this.sipSessionAttributeMap;
	}
42219
public PKCS9Attribute[] getAttributes() {
        PKCS9Attribute[] attribs = new PKCS9Attribute[attributes.size()];
        ObjectIdentifier oid;

        int j = 0;
        for (int i=1; i < PKCS9Attribute.PKCS9_OIDS.length &&
                      j < attribs.length; i++) {
            attribs[j] = getAttribute(PKCS9Attribute.PKCS9_OIDS[i]);

            if (attribs[j] != null)
                j++;
        }
        return attribs;
    }
298633
@Override
    public Map<String, List<Object>> getAttributes() {
        for (final IAdditionalDescriptors additionalDescriptors : delegateDescriptors) {
            final Map<String, List<Object>> attributes = additionalDescriptors.getAttributes();
            if (attributes != null && !attributes.isEmpty()) {
                return attributes;
            }
        }

        return Collections.emptyMap();
    }
1310972
protected Map<String, List<Object>> collectAttributesForLdapEntry(final LdapEntry ldapEntry, final String username) {
        val attributeMap = Maps.<String, List<Object>>newHashMapWithExpectedSize(this.principalAttributeMap.size());
        LOGGER.debug("The following attributes are requested to be retrieved and mapped: [{}]", attributeMap.keySet());
        this.principalAttributeMap.forEach((key, attributeNames) -> {
            val attr = ldapEntry.getAttribute(key);
            if (attr != null) {
                LOGGER.debug("Found principal attribute: [{}]", attr);
                val names = (Collection<String>) attributeNames;
                if (names.isEmpty()) {
                    LOGGER.debug("Principal attribute [{}] is collected as [{}]", attr, key);
                    attributeMap.put(key, CollectionUtils.wrap(attr.getStringValues()));
                } else {
                    names.forEach(s -> {
                        LOGGER.debug("Principal attribute [{}] is virtually remapped/renamed to [{}]", attr, s);
                        attributeMap.put(s, CollectionUtils.wrap(attr.getStringValues()));
                    });
                }
            } else {
                LOGGER.warn("Requested LDAP attribute [{}] could not be found on the resolved LDAP entry for [{}]", key, ldapEntry.getDn());
            }
        });
        if (this.collectDnAttribute) {
            LOGGER.debug("Recording principal DN attribute as [{}]", this.principalDnAttributeName);
            attributeMap.put(this.principalDnAttributeName, CollectionUtils.wrapList(ldapEntry.getDn()));
        }
        return attributeMap;
    }
948880
@Override
	public Map<String, Object> getAttributesMap() {
		@SuppressWarnings("unchecked")
		Map<String, Object> threadAttributesMap = (Map<String, Object>)getAttribute(FLASH_ATTRIBUTES_MAP);
		if(threadAttributesMap == null) {
			threadAttributesMap = new FlashAttributesMap();
			putAttribute(FLASH_ATTRIBUTES_MAP, threadAttributesMap);
		}
		return threadAttributesMap;
	}
1047498
protected Map<String,Object> getAttributeMap() {
		if(sipApplicationSessionAttributeMap == null) {
			sipApplicationSessionAttributeMap = new ConcurrentHashMap<String,Object>() ;
		}
		return sipApplicationSessionAttributeMap;
	}
1002530
public static AttributeList setAttributes(String name, HashMap attributes) throws JMException
   {
      MBeanServer server = getMBeanServer();
      ObjectName objName = new ObjectName(name);
      MBeanInfo info = server.getMBeanInfo(objName);
      MBeanAttributeInfo[] attributesInfo = info.getAttributes();
      AttributeList newAttributes = new AttributeList();

      for (int a = 0; a < attributesInfo.length; a++)
      {
         MBeanAttributeInfo attrInfo = attributesInfo[a];
         String attrName = attrInfo.getName();

         if (!attributes.containsKey(attrName))
            continue;

         String value = (String) attributes.get(attrName);
         if (value.equals("null") && server.getAttribute(objName, attrName) == null)
         {
            if (trace)
               log.trace("ignoring 'null' for " + attrName);
            continue;
         }

         String attrType = attrInfo.getType();
         Attribute attr = null;
         try
         {
            Object realValue = PropertyEditors.convertValue(value, attrType);
            attr = new Attribute(attrName, realValue);
         }
         catch (ClassNotFoundException e)
         {
            if (trace)
               log.trace("Failed to load class for attribute: " + attrType, e);
            throw new ReflectionException(e, "Failed to load class for attribute: " + attrType);
         }
         catch (IntrospectionException e)
         {
            if (trace)
               log.trace("Skipped setting attribute: " + attrName + 
                         ", cannot find PropertyEditor for type: " + attrType);
            continue;
         }

         server.setAttribute(objName, attr);
         newAttributes.add(attr);
      }

      return newAttributes;
   }
1002999
protected Map<String, List<Object>> retrievePersonAttributesFromAttributeRepository(final String id) {
        synchronized (lock) {
            val repository = getAttributeRepository();
            if (repository == null) {
                LOGGER.warn("No attribute repositories could be fetched from application context");
                return new HashMap<>(0);
            }
            return CoreAuthenticationUtils.retrieveAttributesFromAttributeRepository(repository, id, this.attributeRepositoryIds);
        }
    }
899311
@Override
	public byte[] serializeAttributes(final MemcachedBackupSession sessions, final ConcurrentMap<String, Object> attributes) {
		if (attributes == null) {
        	throw new NullPointerException();
        }

        final ByteArrayOutputStream bos = new ByteArrayOutputStream();
        try {
        	// This performs a deep serialization of the target instance.
            // It's serialized to a string as flexjson doesn't like writing to
            // an OutputStreamWriter: it throws the exception "Stepping back two steps is not supported".
            // See https://github.com/moresandeep/memcached-session-manager/commit/db2faaa0a846e16d65ac0b14819689c67bf92c68#commitcomment-512505
        	final String serResult = serializer.deepSerialize(attributes);
        	if (LOG.isDebugEnabled()) {
        	    LOG.debug("JSON Serialised object: " + serResult);
        	}
        	return serResult.getBytes(); // converts to bytes
        } catch (final Exception e) {
        	LOG.warn("Caught Exception deserializing JSON " + e);
        	throw new IllegalArgumentException();
        } finally {
        	close(bos);
        }
	}
581605
private Map<String, String> parseAttributes(I_CmsXmlContentLocation formatterLoc) {

        Map<String, String> result = new LinkedHashMap<>();
        for (I_CmsXmlContentValueLocation mappingLoc : formatterLoc.getSubValues(N_ATTRIBUTE)) {
            String key = CmsConfigurationReader.getString(m_cms, mappingLoc.getSubValue(N_KEY));
            String value = CmsConfigurationReader.getString(m_cms, mappingLoc.getSubValue(N_VALUE));
            result.put(key, value);
        }
        return Collections.unmodifiableMap(result);
    }
395284
protected Map<String, String> getElementAttributes() {
        // Preserve order of attributes
        Map<String, String> attrs = new HashMap<>();

        if (this.isMuted() != null) {
            attrs.put("muted", this.isMuted().toString());
        }
        if (this.getBeep() != null) {
            attrs.put("beep", this.getBeep().toString());
        }
        if (this.isStartConferenceOnEnter() != null) {
            attrs.put("startConferenceOnEnter", this.isStartConferenceOnEnter().toString());
        }
        if (this.isEndConferenceOnExit() != null) {
            attrs.put("endConferenceOnExit", this.isEndConferenceOnExit().toString());
        }
        if (this.getWaitUrl() != null) {
            attrs.put("waitUrl", this.getWaitUrl().toString());
        }
        if (this.getWaitMethod() != null) {
            attrs.put("waitMethod", this.getWaitMethod().toString());
        }
        if (this.getMaxParticipants() != null) {
            attrs.put("maxParticipants", this.getMaxParticipants().toString());
        }
        if (this.getRecord() != null) {
            attrs.put("record", this.getRecord().toString());
        }
        if (this.getRegion() != null) {
            attrs.put("region", this.getRegion().toString());
        }
        if (this.getWhisper() != null) {
            attrs.put("whisper", this.getWhisper());
        }
        if (this.getTrim() != null) {
            attrs.put("trim", this.getTrim().toString());
        }
        if (this.getStatusCallbackEvents() != null) {
            attrs.put("statusCallbackEvent", this.getStatusCallbackEventsAsString());
        }
        if (this.getStatusCallback() != null) {
            attrs.put("statusCallback", this.getStatusCallback().toString());
        }
        if (this.getStatusCallbackMethod() != null) {
            attrs.put("statusCallbackMethod", this.getStatusCallbackMethod().toString());
        }
        if (this.getRecordingStatusCallback() != null) {
            attrs.put("recordingStatusCallback", this.getRecordingStatusCallback().toString());
        }
        if (this.getRecordingStatusCallbackMethod() != null) {
            attrs.put("recordingStatusCallbackMethod", this.getRecordingStatusCallbackMethod().toString());
        }
        if (this.getRecordingStatusCallbackEvents() != null) {
            attrs.put("recordingStatusCallbackEvent", this.getRecordingStatusCallbackEventsAsString());
        }
        if (this.getEventCallbackUrl() != null) {
            attrs.put("eventCallbackUrl", this.getEventCallbackUrl().toString());
        }

        return attrs;
    }
682506
public static Attribute[] getAttributes(InputStream stream) throws IOException, ParseException {
        Reader r = new BufferedReader(new InputStreamReader(stream));
        StreamTokenizer tokenizer = new StreamTokenizer(r);
        
        ArffParser parser = new ArffParser();
        parser.initTokenizer(tokenizer);

        List<Attribute> attributes = new ArrayList<>();
        parser.readHeader(tokenizer, attributes);

        return attributes.toArray(new Attribute[attributes.size()]);
    }