/** * Store a token element for later retrieval. Before storing the token, we check for a * previously processed token with the same (wsu/SAML) Id. * @param element is the token element to store * @param checkMultipleElements check for a previously stored element with the same Id. */ public void addTokenElement(Element element, boolean checkMultipleElements) throws WSSecurityException { if (tokenList == null) { tokenList = new ArrayList<Element>(); } if (checkMultipleElements) { for (Element elem : tokenList) { if (compareElementsById(element, elem)) { throw new WSSecurityException( WSSecurityException.INVALID_SECURITY_TOKEN, "duplicateError" ); } } } tokenList.add(element); }
/** * Store a token element for later retrieval. Before storing the token, we check for a * previously processed token with the same (wsu/SAML) Id. * @param element is the token element to store * @param checkMultipleElements check for a previously stored element with the same Id. */ public void addTokenElement(Element element, boolean checkMultipleElements) throws WSSecurityException { if (tokenList == null) { tokenList = new ArrayList<Element>(); } if (checkMultipleElements) { for (Element elem : tokenList) { if (compareElementsById(element, elem)) { throw new WSSecurityException( WSSecurityException.INVALID_SECURITY_TOKEN, "duplicateError" ); } } } tokenList.add(element); }