本文整理汇总了Java中javax.mail.Flags.Flag.SEEN属性的典型用法代码示例。如果您正苦于以下问题:Java Flag.SEEN属性的具体用法?Java Flag.SEEN怎么用?Java Flag.SEEN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.mail.Flags.Flag
的用法示例。
在下文中一共展示了Flag.SEEN属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFlags
/**
* Updates in-memory flags from stored metadata and returns them.
*/
@Override
public Flags getFlags() throws MessagingException {
super.setFlag(Flag.RECENT, isRecent());
super.setFlag(Flag.SEEN, !isUnread());
super.setFlag(Flag.ANSWERED, isReplied());
super.setFlag(Flag.DELETED, isDeleted());
return super.getFlags();
}
示例2: getSearchTerm
/**
* Returns a <pre>{@link SearchTerm}</pre> to be used when retrieving messages.
* Default term is only for unseen emails, but when retrieveSeenEmails is
* set to true it returns a union of terms for both unseen and seen messages.
*
* @return a search term to be used for message retrieval.
*/
private SearchTerm getSearchTerm() {
Flags seenFlag = new Flags(Flag.SEEN);
FlagTerm unseenFlagTerm = new FlagTerm(seenFlag, false);
if (retrieveSeenEmails) {
FlagTerm seenFlagTerm = new FlagTerm(seenFlag, true);
return new OrTerm(unseenFlagTerm, seenFlagTerm);
}
return unseenFlagTerm;
}
示例3: setFlag
private void setFlag(NodeRef nodeRef, Flag flag, boolean value)
{
String permission = (flag == Flag.DELETED ? PermissionService.DELETE_NODE : PermissionService.WRITE_PROPERTIES);
AccessStatus status = permissionService.hasPermission(nodeRef, permission);
if (status == AccessStatus.DENIED)
{
if(flag == Flag.DELETED)
{
logger.debug("[setFlag] Access denied to set DELETED FLAG:" + nodeRef);
throw new AccessDeniedException("No permission to set DELETED flag");
}
if(flag == Flag.SEEN)
{
logger.debug("[setFlag] Access denied to set SEEN FLAG:" + nodeRef);
//TODO - should we throw an exception here?
//throw new AccessDeniedException("No permission to set DELETED flag");
}
else
{
logger.debug("[setFlag] Access denied to set flag:" + nodeRef);
throw new AccessDeniedException("No permission to set flag:" + flag.toString());
}
}
else
{
checkForFlaggableAspect(nodeRef);
policyBehaviourFilter.disableBehaviour(ContentModel.ASPECT_AUDITABLE);
policyBehaviourFilter.disableBehaviour(ContentModel.ASPECT_VERSIONABLE);
try
{
if(logger.isDebugEnabled())
{
logger.debug("set flag nodeRef:" + nodeRef + ",flag:" + flagToQname.get(flag) + ", value:" + value);
}
nodeService.setProperty(nodeRef, flagToQname.get(flag), value);
messageCache.remove(nodeRef);
}
finally
{
policyBehaviourFilter.enableBehaviour(ContentModel.ASPECT_AUDITABLE);
policyBehaviourFilter.enableBehaviour(ContentModel.ASPECT_VERSIONABLE);
}
}
}