ArrayList<EncodingOperation> operations = new ArrayList<EncodingOperation>();
Timestamp timestamp = config.getTimestamp();
if (timestamp != null)
{
operations.add(new TimestampOperation(timestamp.getTtl()));
}
Username username = config.getUsername();
if (username != null && user != null && password != null)
{
NonceFactory factory = Util.loadFactory(NonceFactory.class, configuration.getNonceFactory(), DefaultNonceFactory.class);
operations.add(new SendUsernameOperation(user, password, username.isDigestPassword(), username.isUseNonce(), username.isUseCreated(), factory.getGenerator()));
}
Sign sign = config.getSign();
if (sign != null && (!fault || sign.isIncludeFaults()))
{
List<Target> targets = convertTargets(sign.getTargets());
if (sign.isIncludeTimestamp())
{
if (timestamp == null)
operations.add(new TimestampOperation(null));
if (targets != null && targets.size() > 0)
targets.add(new WsuIdTarget("timestamp"));
}