use of com.axway.ats.action.objects.model.ObjectCannotBeTaggedException in project ats-framework by Axway.
the class MimePackage method tag.
/**
* Tagging the message by adding "Automation-Message-Tag" header with the current time value(in milliseconds).
* This is useful if want to recognize this message between others in the same IMAP folder.
* *
* @throws ActionException
*/
@PublicAtsApi
public void tag() throws ActionException {
// we use the message's sent time as a unique tag
String tagValue = Long.toString(Calendar.getInstance().getTimeInMillis());
try {
setHeader("Automation-Message-Tag", tagValue);
// if everything is OK, then this is our tag
tag = tagValue;
log.info(getDescription() + " tagged with tag '" + tag + "'");
} catch (PackageException e) {
throw new ObjectCannotBeTaggedException(getDescription(), null, e);
}
}
Aggregations