}
@SuppressWarnings("unchecked")
private Collection getUsernamePolicies(MessagePolicy mPolicy, CallbackHandler handler, boolean senderConfiguration)
throws PolicyGenerationException {
Collection requiredElements = new ArrayList();
WSSPolicy encryptUsernamePolicy = null;
Iterator it = mPolicy.iterator();
while (it.hasNext()) {
WSSPolicy policy = (WSSPolicy)it.next();
if (PolicyTypeUtil.authenticationTokenPolicy(policy)) {
if ((policy.getFeatureBinding() != null) &&
(PolicyTypeUtil.usernameTokenPolicy(policy.getFeatureBinding()))) {
if (senderConfiguration && !runtimeUsernamePassword) {
setUsernamePassword((AuthenticationTokenPolicy)policy, handler);
}
requiredElements.add(policy);
}