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


Java Node.getNodeID方法代码示例

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


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

示例1: listTopicsForAppId

import org.jivesoftware.openfire.pubsub.Node; //导入方法依赖的package包/类
/**
 * Get a list of Leaf Topic nodes for the passed in appId
 * (collection nodes aren't returned)
 * @param appId
 * @return
 */
public List<TopicNode> listTopicsForAppId(String appId) {
  ArrayList<TopicNode> result = new ArrayList<TopicNode>();
  CollectionNode rootNode = getRootAppTopic(appId);
  if (rootNode != null) {
    Collection<Node> nodes = rootNode.getNodes();
    for (Node node : nodes) {
      //For fixing: https://magneteng.atlassian.net/browse/MOB-833
      if (node.isCollectionNode()) {
        continue;
      }
      String identifier = node.getNodeID();
      boolean isAppTopic = TopicHelper.isAppTopic(identifier, appId);
      if (isAppTopic) {
        TopicNode tn = TopicNode.build(appId, node);
        result.add(tn);
      }
    }
  }
  return result;
}
 
开发者ID:magnetsystems,项目名称:message-server,代码行数:27,代码来源:MMXTopicManager.java

示例2: getTopicInfo

import org.jivesoftware.openfire.pubsub.Node; //导入方法依赖的package包/类
/**
 * Get a list of Leaf Topic nodes for the passed in appId
 * (collection nodes aren't returned)
 * @param appId
 * @return
 */
public List<com.magnet.mmx.server.api.v1.protocol.TopicInfo> getTopicInfo(String appId) {
  ArrayList<com.magnet.mmx.server.api.v1.protocol.TopicInfo> result =
      new ArrayList<com.magnet.mmx.server.api.v1.protocol.TopicInfo>();
  CollectionNode rootNode = getRootAppTopic(appId);
  if (rootNode != null) {
    Collection<Node> nodes = rootNode.getNodes();
    for (Node node : nodes) {
      //For fixing: https://magneteng.atlassian.net/browse/MOB-833
      if (node.isCollectionNode()) {
        continue;
      }
      String identifier = node.getNodeID();
      boolean isAppTopic = TopicHelper.isAppTopic(identifier, appId);
      if (isAppTopic) {
        com.magnet.mmx.server.api.v1.protocol.TopicInfo info =
            getTopicInfoFromNode(appId, node);
        result.add(info);
      }
    }
  }
  return result;
}
 
开发者ID:magnetsystems,项目名称:message-server,代码行数:29,代码来源:MMXTopicManager.java

示例3: removeTags

import org.jivesoftware.openfire.pubsub.Node; //导入方法依赖的package包/类
public MMXStatus removeTags(JID from, String appId, TopicAction.TopicTags rqt)
                    throws MMXException {
  String topic = TopicHelper.normalizePath(rqt.getTopicName());
  String realTopic = TopicHelper.makeTopic(appId, rqt.getUserId(), topic);
  Node node = mPubSubModule.getNode(realTopic);
  // No need to check for permission; just check for existing.
  if (node == null) {
    throw new MMXException(StatusCode.TOPIC_NOT_FOUND.getMessage(topic),
        StatusCode.TOPIC_NOT_FOUND.getCode());
  }
  List<String> tags = rqt.getTags();
  String serviceId = node.getService().getServiceID();
  String nodeId = node.getNodeID();

  if(!Utils.isNullOrEmpty(tags)) {
    TagDAO tagDao = DBUtil.getTagDAO();
    tagDao.deleteTagsForTopic(tags, appId, serviceId, nodeId);
  }

  MMXStatus status = (new MMXStatus())
          .setCode(StatusCode.SUCCESS.getCode())
          .setMessage(StatusCode.SUCCESS.getMessage());
  return status;
}
 
开发者ID:magnetsystems,项目名称:message-server,代码行数:25,代码来源:MMXTopicManager.java

示例4: getTags

import org.jivesoftware.openfire.pubsub.Node; //导入方法依赖的package包/类
public TopicAction.TopicTags getTags(JID from, String appId,
                    MMXTopicId rqt) throws MMXException {
  String topic = TopicHelper.normalizePath(rqt.getName());
  String realTopic = TopicHelper.makeTopic(appId, rqt.getEscUserId(), topic);
  Node node = mPubSubModule.getNode(realTopic);
  // No need to check for permission; just check for existing.
  if (node == null) {
    throw new MMXException(StatusCode.TOPIC_NOT_FOUND.getMessage(topic),
        StatusCode.TOPIC_NOT_FOUND.getCode());
  }

  TagDAO tagDao = DBUtil.getTagDAO();
  String serviceId = node.getService().getServiceID();
  String nodeId = node.getNodeID();
  List<String> tags = new ArrayList<String>();
  try {
    tags = tagDao.getTagsForTopic(appId, serviceId, nodeId);
  } catch (Exception e) {
    LOGGER.error("getTags : caught exception for getting tags appId={}, serviceId={}, nodeId={}",
            new Object[]{appId, serviceId, nodeId, e});

  }

  TopicAction.TopicTags topicTags = new TopicAction.TopicTags(rqt.getUserId(),
      rqt.getName(), tags, new Date());
  return topicTags;
}
 
开发者ID:magnetsystems,项目名称:message-server,代码行数:28,代码来源:MMXTopicManager.java

示例5: setTags

import org.jivesoftware.openfire.pubsub.Node; //导入方法依赖的package包/类
public MMXStatus setTags(JID from, String appId, TopicAction.TopicTags rqt)
                    throws MMXException {
  String topic = TopicHelper.normalizePath(rqt.getTopicName());
  String realTopic = TopicHelper.makeTopic(appId, rqt.getUserId(), topic);
  Node node = mPubSubModule.getNode(realTopic);
  // No need to check for permission; just check for existing.
  if (node == null) {
    LOGGER.trace("setTags : node not found appId={},  topic={}", appId, realTopic);
    throw new MMXException(StatusCode.TOPIC_NOT_FOUND.getMessage(topic),
        StatusCode.TOPIC_NOT_FOUND.getCode());
  }
  List<String> tags = rqt.getTags();
  String serviceId = node.getService().getServiceID();
  String nodeId = node.getNodeID();

  TagDAO tagDao = DBUtil.getTagDAO();
  tagDao.deleteAllTagsForTopic(appId, serviceId, nodeId);

  if(!Utils.isNullOrEmpty(tags)) {
    for(String tag : tags) {
      try {
        tagDao.createTopicTag(tag, appId, serviceId, nodeId);
      } catch (DbInteractionException e) {
        return (new MMXStatus())
                .setCode(StatusCode.SERVER_ERROR.getCode())
                .setMessage(e.getMessage());
      }
    }
  }

  MMXStatus status = (new MMXStatus())
      .setCode(StatusCode.SUCCESS.getCode())
      .setMessage(StatusCode.SUCCESS.getMessage());
  return status;
}
 
开发者ID:magnetsystems,项目名称:message-server,代码行数:36,代码来源:MMXTopicManager.java

示例6: addTags

import org.jivesoftware.openfire.pubsub.Node; //导入方法依赖的package包/类
public MMXStatus addTags(JID from, String appId, TopicAction.TopicTags rqt)
                    throws MMXException {
  String topic = TopicHelper.normalizePath(rqt.getTopicName());
  String realTopic = TopicHelper.makeTopic(appId, rqt.getUserId(), topic);
  Node node = mPubSubModule.getNode(realTopic);
  // No need to check for permission; just check for existing.
  if (node == null) {
    throw new MMXException(StatusCode.TOPIC_NOT_FOUND.getMessage(topic),
        StatusCode.TOPIC_NOT_FOUND.getCode());
  }
  List<String> tags = rqt.getTags();

  String serviceId = node.getService().getServiceID();
  String nodeId = node.getNodeID();

  if(!Utils.isNullOrEmpty(tags)) {
    TagDAO tagDao = DBUtil.getTagDAO();
    for(String tag : tags) {
      try {
        LOGGER.trace("addTags : creating topic setting tag={}, appId={}, serviceId={}, nodeId={}",
                new Object[]{tag, appId, serviceId, nodeId});

        tagDao.createTopicTag(tag, appId, serviceId, nodeId);
      } catch (DbInteractionException e) {
        LOGGER.error("addTags : caught exception setting tag={}, appId={}, serviceId={}, nodeId={}"
                , new Object[]{tag, appId, serviceId, nodeId, e});
        return (new MMXStatus())
            .setCode(StatusCode.SERVER_ERROR.getCode())
            .setMessage(e.getMessage());
      }
    }
  } else {
    LOGGER.trace("addTags : received an empty tag list appId={}, serviceId={}, nodeId={}", new Object[]{appId, serviceId, nodeId});
  }

  MMXStatus status = (new MMXStatus())
      .setCode(StatusCode.SUCCESS.getCode())
      .setMessage(StatusCode.SUCCESS.getMessage());
  return status;
}
 
开发者ID:magnetsystems,项目名称:message-server,代码行数:41,代码来源:MMXTopicManager.java

示例7: NodeTask

import org.jivesoftware.openfire.pubsub.Node; //导入方法依赖的package包/类
protected NodeTask(Node node)
{
    nodeId = node.getNodeID();
    serviceId = node.getService().getServiceID();
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:6,代码来源:NodeTask.java

示例8: NodeChangeTask

import org.jivesoftware.openfire.pubsub.Node; //导入方法依赖的package包/类
public NodeChangeTask(Node node)
{
    this.node = node;
    nodeId = node.getNodeID();
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:6,代码来源:NodeChangeTask.java

示例9: NodeTask

import org.jivesoftware.openfire.pubsub.Node; //导入方法依赖的package包/类
protected NodeTask(Node node)
{
	nodeId = node.getNodeID();
	serviceId = node.getService().getServiceID();
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:6,代码来源:NodeTask.java

示例10: NodeChangeTask

import org.jivesoftware.openfire.pubsub.Node; //导入方法依赖的package包/类
public NodeChangeTask(Node node)
{
	this.node = node;
	nodeId = node.getNodeID();
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:6,代码来源:NodeChangeTask.java


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