switch (xmlSecEvent.getEventType()) {
case XMLStreamConstants.START_ELEMENT:
XMLSecStartElement xmlSecStartElement = xmlSecEvent.asStartElement();
List<SecurityHeaderOrder> securityHeaderOrderList = outputProcessorChain.getSecurityContext().getAsList(SecurityHeaderOrder.class);
SecurityHeaderOrder securityHeaderOrder = securityHeaderOrderList.get(securityHeaderIndex);
if (!xmlSecStartElement.getName().equals(WSSConstants.TAG_xenc_EncryptedData) &&
!xmlSecStartElement.getName().equals(securityHeaderOrder.getSecurityHeaderElementName())) {
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE, "empty",
"Invalid security header order. Expected " +
securityHeaderOrder.getSecurityHeaderElementName() +
" but got " + xmlSecStartElement.getName());
}
Map<SecurityHeaderOrder, Deque<XMLSecEvent>> map = actionEventMap.get(securityHeaderOrder.getAction());
currentDeque = new ArrayDeque<XMLSecEvent>();
map.put(securityHeaderOrder, currentDeque);
securityHeaderIndex++;
break;