Set attributes on a MBean
@param name The name of the bean
@param attributes The attributes
@return The updated attributes list
@exception PrivilegedExceptionAction Thrown if the operation cannot be performed
353236
@SuppressWarnings({ "unchecked" })
   private AttributeList setAttributes(final String name, final HashMap attributes) throws PrivilegedActionException
   {
      return AccessController.doPrivileged(new PrivilegedExceptionAction<AttributeList>()
      {
         public AttributeList run() throws Exception
         {
            return Server.setAttributes(name, attributes);
         }
      });
   }
602947
public String removeAttribute(final String name) throws IllegalArgumentException {
        // Precondition check
        if (name == null || name.length() == 0) {
            throw new IllegalArgumentException("name must be specified");
        }

        final String remove = this.attributes.remove(name);
        return remove;
    }
1085844
public void setAttribute(String name, Object o) {
		if(logger.isDebugEnabled()) {
        	logger.debug("setAttribute - name=" + name + ", object=" + o);
        }
		if (name == null)
			throw new NullPointerException("Attribute name can not be null.");
		this.getAttributeMap().put(name, o);
	}
306464
@Override
    public void setAttributes(Map<String, List<String>> attributes) {
        // Tries to modify as many of the existing attributes in place to reduce DB churn in
        // hibernate

        // Make a local copy so we don't edit the original reference
        attributes = new LinkedHashMap<String, List<String>>(attributes);

        for (final Iterator<LocalAccountPersonAttributeImpl> attributesItr =
                        this.attributes.iterator();
                attributesItr.hasNext(); ) {
            final LocalAccountPersonAttributeImpl attribute = attributesItr.next();

            // Remove the new values for the attribute from the input map
            final String name = attribute.getName();
            final List<String> newValues = attributes.remove(name);

            // If no new values remove the attribute
            if (newValues == null) {
                attributesItr.remove();
            }
            // Otherwise update the existing values
            else {
                attribute.setValues(new ArrayList<String>(newValues));
            }
        }

        // Add any remaining new attributes to the list
        for (final Map.Entry<String, List<String>> attribute : attributes.entrySet()) {
            final String name = attribute.getKey();
            final List<String> values = attribute.getValue();
            this.attributes.add(new LocalAccountPersonAttributeImpl(name, values));
        }
    }
775326
public void setAttributes(java.util.Collection<LoadBalancerAttribute> attributes) {
        if (attributes == null) {
            this.attributes = null;
            return;
        }

        this.attributes = new java.util.ArrayList<LoadBalancerAttribute>(attributes);
    }
271470
private void setRestrictedAttributes(Map<String, String> attributes) {

        // Translate disabled attribute
        getModel().setDisabled("true".equals(attributes.get(DISABLED_ATTRIBUTE_NAME)));

        // Translate password expired attribute
        getModel().setExpired("true".equals(attributes.get(EXPIRED_ATTRIBUTE_NAME)));

        // Translate access window start time
        try { getModel().setAccessWindowStart(parseTime(attributes.get(ACCESS_WINDOW_START_ATTRIBUTE_NAME))); }
        catch (ParseException e) {
            logger.warn("Not setting start time of user access window: {}", e.getMessage());
            logger.debug("Unable to parse time attribute.", e);
        }

        // Translate access window end time
        try { getModel().setAccessWindowEnd(parseTime(attributes.get(ACCESS_WINDOW_END_ATTRIBUTE_NAME))); }
        catch (ParseException e) {
            logger.warn("Not setting end time of user access window: {}", e.getMessage());
            logger.debug("Unable to parse time attribute.", e);
        }

        // Translate account validity start date
        try { getModel().setValidFrom(parseDate(attributes.get(VALID_FROM_ATTRIBUTE_NAME))); }
        catch (ParseException e) {
            logger.warn("Not setting user validity start date: {}", e.getMessage());
            logger.debug("Unable to parse date attribute.", e);
        }

        // Translate account validity end date
        try { getModel().setValidUntil(parseDate(attributes.get(VALID_UNTIL_ATTRIBUTE_NAME))); }
        catch (ParseException e) {
            logger.warn("Not setting user validity end date: {}", e.getMessage());
            logger.debug("Unable to parse date attribute.", e);
        }

        // Translate timezone attribute
        getModel().setTimeZone(TimeZoneField.parse(attributes.get(TIMEZONE_ATTRIBUTE_NAME)));

    }
1221224
public static synchronized List<Object> getAttributes(final String name) {
		final List<Object> data = new ArrayList<>();

		for (final String id : SESSIONS.keySet()) {
			final HttpSession session = SESSIONS.get(id);
			try {
				final Object o = session.getAttribute(name);
				data.add(o);
				//CHECKSTYLE:OFF
			} catch (final Exception e) {
				// no data for this object.
			}
			//CHECKSTYLE:ON
		}

		return data;
	}
661442
public void setAttributes(String domainName, String beanName, List<Attribute> attributes) throws Exception {
		setAttributes(ObjectNameUtil.makeObjectName(domainName, beanName), attributes);
	}
237860
public MBeanAttributeInfo[] getAttributesInfo(ObjectName name) throws JMException {
		checkClientConnected();
		try {
			return mbeanConn.getMBeanInfo(name).getAttributes();
		} catch (Exception e) {
			throw createJmException("Problems getting bean information from " + name, e);
		}
	}
696076
public void setAttributeFieldNames(String fieldNames) {
		String[] names = fieldNames.split(",");
		if (this.attributeFieldInfos == null) {
			this.attributeFieldInfos = new ArrayList<JmxAttributeFieldInfo>();
		}
		for (int i = 0; i < names.length; i++) {
			this.attributeFieldInfos.add(new JmxAttributeFieldInfo(names[i]));
		}
	}
59538
@Override
    public void setAttribute(final String name, final String value) {
        hash.put(name, value);
    }
1121943
@Override
    public void setAttributes(final Map<String, List<Object>> attributes) {
        for (final IAdditionalDescriptors additionalDescriptors : delegateDescriptors) {
            additionalDescriptors.setAttributes(attributes);
        }
    }
844743
public void setName(String name) throws ApplicationException {
	if (name == null) return;
	this.name = name.trim();
	if (name.length() == 0) throw new ApplicationException("invalid attribute definition", "attribute [name] can't be a empty string");
    }
760340
public void setAttribute(ObjectName name, String attrName, Object value) throws Exception {
		checkClientConnected();
		Attribute attribute = new Attribute(attrName, value);
		mbeanConn.setAttribute(name, attribute);
	}
163844
public void setAttribute(String domainName, String beanName, String attrName, Object value) throws Exception {
		setAttribute(ObjectNameUtil.makeObjectName(domainName, beanName), attrName, value);
	}
511328
public final void setAttributes(final Map<String, Attribute> attributes) {
        for (Map.Entry<String, Attribute> entry: attributes.entrySet()) {
            Object attribute = entry.getValue();
            if (!(attribute instanceof Attribute)) {
                final String msg =
                        "Attribute: '" + entry.getKey() + "' is not an attribute. It is a: " + attribute;
                LOGGER.error("Error setting the Attributes: {}", msg);
                throw new IllegalArgumentException(msg);
            } else {
                ((Attribute) attribute).setConfigName(entry.getKey());
            }
        }
        this.attributes = attributes;
    }
706542
public Object getAttribute(String name) {
		if(logger.isDebugEnabled()) {
			logger.debug("getAttribute - name=" + sessionKey);
		}
		if (name == null)
			throw new NullPointerException("Attribute name can not be null.");
		return this.getAttributeMap().get(name);
	}