/* (non-Javadoc)
@see org.apereo.portal.portlets.swapper.IAttributeSwapperHelper#resetAttributes(java.lang.String)
502269
@Override
    public void resetAttributes(ExternalContext externalContext) {
        final Principal currentUser = externalContext.getCurrentUser();
        final String uid = currentUser.getName();

        this.logger.warn("User '" + uid + "' reseting to default attributes");

        // Remove the person directory override
        this.portalRootPersonAttributeDao.removeUserAttributeOverride(uid);

        // Remove the IPerson attribute override, bit of a hack as we really just remove all
        // overrides
        // then re-add all attributes from person directory
        final PortletRequest portletRequest = (PortletRequest) externalContext.getNativeRequest();
        final HttpServletRequest portalRequest =
                this.portalRequestUtils.getPortletHttpRequest(portletRequest);

        final IPerson person = this.personManager.getPerson(portalRequest);

        final Set<String> overriddenAttributes =
                (Set<String>) person.getAttribute(OVERRIDDEN_ATTRIBUTES);
        if (overriddenAttributes != null) {
            person.setAttribute(OVERRIDDEN_ATTRIBUTES, null);

            for (final String attribute : overriddenAttributes) {
                person.setAttribute(attribute, null);
            }
        }

        final IPersonAttributes originalUserAttributes = this.getOriginalUserAttributes(uid);
        final Map<String, List<Object>> attributes = originalUserAttributes.getAttributes();
        person.setAttributes(attributes);
    }
1213395
public LDAPQuery setAttributes(String... attributes) {
		if(attributes != null && attributes.length > 0) {
			this.attributes = attributes;
		} else {
			this.attributes = ALL_ATTRIBUTES;
		}
		return this;
	}
764494
public void setReadAttributes(java.util.Collection<String> readAttributes) {
        if (readAttributes == null) {
            this.readAttributes = null;
            return;
        }

        this.readAttributes = new java.util.ArrayList<String>(readAttributes);
    }
1292210
public void setAttributes(Map<String, Object> attr) {
    pendingAttributes.clear();
    pendingAttributes.putAll(attr);
  }
156061
public void setAttributeUpdates(java.util.Collection<TypedLinkFacetAttributeUpdate> attributeUpdates) {
        if (attributeUpdates == null) {
            this.attributeUpdates = null;
            return;
        }

        this.attributeUpdates = new java.util.ArrayList<TypedLinkFacetAttributeUpdate>(attributeUpdates);
    }
44176
public void writeAttributes(Iterable<Attribute> attributes) throws IOException {
    List<String> attributeNames = Lists.newArrayList();
    List<String> attributeLabels = Lists.newArrayList();

    for (Attribute attr : attributes) {
      attributeNames.add(attr.getName());
      if (attr.getLabel() != null) {
        attributeLabels.add(attr.getLabel());
      } else {
        attributeLabels.add(attr.getName());
      }
    }

    writeAttributes(attributeNames, attributeLabels);
  }
1295273
public void setAttributeKeys(java.util.Collection<String> attributeKeys) {
        if (attributeKeys == null) {
            this.attributeKeys = null;
            return;
        }

        this.attributeKeys = new java.util.ArrayList<String>(attributeKeys);
    }
524385
@Override
    public void setAttributes(final Map<String, List<Object>> attrs) {
        for (final Entry<String, List<Object>> attrEntry : attrs.entrySet()) {
            final String key = attrEntry.getKey();
            final List<Object> value = attrEntry.getValue();
            setAttribute(key, value);
        }
        /*
         * This is the method used by Authentication.authenticate() -- and
         * elsewhere -- to initialize a valid IPerson in the portal.  We want
         * to *fail fast* if there's something wrong with that process.
         */
        validateUsername();
    }
1242648
public void setAttributeMethodNames(String methodNames) {
		String[] names = methodNames.split(",");
		if (this.attributeMethodInfos == null) {
			this.attributeMethodInfos = new ArrayList<JmxAttributeMethodInfo>();
		}
		for (int i = 0; i < names.length; i++) {
			this.attributeMethodInfos.add(new JmxAttributeMethodInfo(names[i]));
		}
	}
1154429
public void set(String[] attributeNames, Object[] values) {
        if (attributeNames == null || values == null || attributeNames.length != values.length) {
            throw new IllegalArgumentException("must pass non-null arrays of equal length");
        }

        for (int i = 0; i < attributeNames.length; i++) {
            set(attributeNames[i], values[i]);
        }
    }
1135500
public void setCustomAttributes(java.util.Collection<SchemaAttributeType> customAttributes) {
        if (customAttributes == null) {
            this.customAttributes = null;
            return;
        }

        this.customAttributes = new java.util.ArrayList<SchemaAttributeType>(customAttributes);
    }
771060
public void clearAttributes() throws DevFailed {
        for (final AttributeImpl attributeImpl : dynamicAttributes.values()) {
            deviceImpl.removeAttribute(attributeImpl);
        }
        forwardedAttributes.clear();
        dynamicAttributes.clear();
    }
781737
public void setSessionAttributes(Map<String, Object> attributes)
    {
        this.sessionAttributes.putAll(attributes);
        propertyChangeSupport.firePropertyChange(SESSION_ATTRIBUTES, null, sessionAttributes);
    }
795443
public void setAttributes( final Collection<String> attributes )
    {
        this.attributes = attributes == null ? null : Collections.unmodifiableSet( new HashSet<String>( attributes ) );
    }
618876
@Override
    public void setAttribute(String name, Object value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Setting attribute: " + name);
        }
        this.attributes.put(name, value);
    }
213819
public void deletePersistentAttributes() {
        if (persistenceAdapter == null) {
            throw new IllegalStateException("Attempting to delete persistence attributes without a configured persistence adapter");
        }
        if (persistenceAttributesSet) {
            persistenceAdapter.deleteAttributes(requestEnvelope);
            persistentAttributes = null;
            persistenceAttributesSet = false;
        }
    }
710094
protected void resetValue(Attribute attribute) {

        String initValue = "";
        if (m_initialImageAttributes.containsKey(attribute.name())) {
            initValue = m_initialImageAttributes.getString(attribute.name());
        }
        if (m_fields.containsKey(attribute)) {
            m_fields.get(attribute).setFormValueAsString(initValue);
        }
    }