本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例7: NodeTask
import org.jivesoftware.openfire.pubsub.Node; //导入方法依赖的package包/类
protected NodeTask(Node node)
{
nodeId = node.getNodeID();
serviceId = node.getService().getServiceID();
}
示例8: NodeChangeTask
import org.jivesoftware.openfire.pubsub.Node; //导入方法依赖的package包/类
public NodeChangeTask(Node node)
{
this.node = node;
nodeId = node.getNodeID();
}
示例9: NodeTask
import org.jivesoftware.openfire.pubsub.Node; //导入方法依赖的package包/类
protected NodeTask(Node node)
{
nodeId = node.getNodeID();
serviceId = node.getService().getServiceID();
}
示例10: NodeChangeTask
import org.jivesoftware.openfire.pubsub.Node; //导入方法依赖的package包/类
public NodeChangeTask(Node node)
{
this.node = node;
nodeId = node.getNodeID();
}