当前位置: 首页>>代码示例>>Java>>正文


Java NodeAffiliate.getSubscriptions方法代码示例

本文整理汇总了Java中org.jivesoftware.openfire.pubsub.NodeAffiliate.getSubscriptions方法的典型用法代码示例。如果您正苦于以下问题:Java NodeAffiliate.getSubscriptions方法的具体用法?Java NodeAffiliate.getSubscriptions怎么用?Java NodeAffiliate.getSubscriptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jivesoftware.openfire.pubsub.NodeAffiliate的用法示例。


在下文中一共展示了NodeAffiliate.getSubscriptions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: canAccessItems

import org.jivesoftware.openfire.pubsub.NodeAffiliate; //导入方法依赖的package包/类
@Override
public boolean canAccessItems(Node node, JID owner, JID subscriber) {
    // Let node owners and sysadmins always get node items
    if (node.isAdmin(owner)) {
        return true;
    }
    NodeAffiliate nodeAffiliate = node.getAffiliate(owner);
    if  (nodeAffiliate == null) {
        // This is an unknown entity to the node so deny access
        return false;
    }
    // Any subscription of this entity that was approved will give him access
    // to retrieve the node items
    for (NodeSubscription subscription : nodeAffiliate.getSubscriptions()) {
        if (subscription.isActive()) {
            return true;
        }
    }
    // No approved subscription was found so deny access
    return false;
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:22,代码来源:AuthorizeAccess.java

示例2: canPublish

import org.jivesoftware.openfire.pubsub.NodeAffiliate; //导入方法依赖的package包/类
@Override
public boolean canPublish(Node node, JID entity) {
    NodeAffiliate nodeAffiliate = node.getAffiliate(entity);
    // Deny access if user does not have any relation with the node or is an outcast
    if (nodeAffiliate == null ||
            nodeAffiliate.getAffiliation() == NodeAffiliate.Affiliation.outcast) {
        return false;
    }
    // Grant access if user is an owner of publisher
    if (nodeAffiliate.getAffiliation() == NodeAffiliate.Affiliation.publisher ||
            nodeAffiliate.getAffiliation() == NodeAffiliate.Affiliation.owner) {
        return true;
    }
    // Grant access if at least one subscription of this user was approved
    for (NodeSubscription subscription : nodeAffiliate.getSubscriptions()) {
        if (subscription.isActive()) {
            return true;
        }
    }
    return false;
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:22,代码来源:OnlySubscribers.java

示例3: canAccessItems

import org.jivesoftware.openfire.pubsub.NodeAffiliate; //导入方法依赖的package包/类
@Override
public boolean canAccessItems(Node node, JID owner, JID subscriber) {
       // Let node owners and sysadmins always get node items
       if (node.isAdmin(owner)) {
           return true;
       }
       NodeAffiliate nodeAffiliate = node.getAffiliate(owner);
       if  (nodeAffiliate == null) {
           // This is an unknown entity to the node so deny access
           return false;
       }
       // Any subscription of this entity that was approved will give him access
       // to retrieve the node items
       for (NodeSubscription subscription : nodeAffiliate.getSubscriptions()) {
           if (subscription.isActive()) {
               return true;
           }
       }
       // No approved subscription was found so deny access
       return false;
   }
 
开发者ID:coodeer,项目名称:g3server,代码行数:22,代码来源:AuthorizeAccess.java

示例4: canPublish

import org.jivesoftware.openfire.pubsub.NodeAffiliate; //导入方法依赖的package包/类
@Override
public boolean canPublish(Node node, JID entity) {
       NodeAffiliate nodeAffiliate = node.getAffiliate(entity);
       // Deny access if user does not have any relation with the node or is an outcast
       if (nodeAffiliate == null ||
               nodeAffiliate.getAffiliation() == NodeAffiliate.Affiliation.outcast) {
           return false;
       }
       // Grant access if user is an owner of publisher
       if (nodeAffiliate.getAffiliation() == NodeAffiliate.Affiliation.publisher ||
               nodeAffiliate.getAffiliation() == NodeAffiliate.Affiliation.owner) {
           return true;
       }
       // Grant access if at least one subscription of this user was approved
       for (NodeSubscription subscription : nodeAffiliate.getSubscriptions()) {
           if (subscription.isActive()) {
               return true;
           }
       }
       return false;
   }
 
开发者ID:coodeer,项目名称:g3server,代码行数:22,代码来源:OnlySubscribers.java


注:本文中的org.jivesoftware.openfire.pubsub.NodeAffiliate.getSubscriptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。