IceStrom Interface

TopicManager
The TopicManager is a singleton object that acts as a factory and repository of
Topic objects. Its interface and related types are shown below:
module IceStorm {
dictionary<string, Topic*> TopicDict;
exception TopicExists {
string name;
};
exception NoSuchTopic {
string name;
};
interface TopicManager {
// create a new topic, which must have a unique name.
Topic* create(string name) throws TopicExists;
// allows a client to obtain a proxy for an existing topic
idempotent Topic* retrieve(string name) throws NoSuchTopic;
// supplies a dictionary of all existing topics.
idempotent TopicDict retrieveAll();
// returns Slice checksums for the IceStorm definitions
idempotent Ice::SliceChecksumDict getSliceChecksums();
};
};
Topic
The Topic interface represents a topic and provides several administrative operations
for configuring links and managing subscribers.
module IceStorm {
struct LinkInfo {
Topic* theTopic;
string name;
int cost;
};
sequence<LinkInfo> LinkInfoSeq;
dictionary<string, string> QoS;
exception LinkExists {
string name;
};
exception NoSuchLink {
string name;
};
exception AlreadySubscribed {};
exception BadQoS {
string reason;
};
interface Topic {
// returns the name assigned to the topic,
idempotent string getName();
// return proxies for the topic’s publisher object
idempotent Object* getPublisher();
idempotent Object* getNonReplicatedPublisher();
// adds a subscriber’s proxy to the topic;
// if another subscriber proxy already exists with the same object identity, the
// operation throws AlreadySubscribed.
// The operation returns the publisher for the topic
Object* subscribeAndGetPublisher(QoS theQoS, Object* subscriber) throws AlreadySubscribed, BadQoS;
// removes the subscriber from the topic.
idempotent void unsubscribe(Object* subscriber);
// A link to another topic is created using the link operation;
// if a link already exists to the given topic, the LinkExists exception is raised.
idempotent void link(Topic* linkTo, int cost) throws LinkExists;
// Links are destroyed using the unlink operation.
idempotent void unlink(Topic* linkTo) throws NoSuchLink;
idempotent LinkInfoSeq getLinkInfoSeq();
// destroy operation permanently destroys the topic.
void destroy();
};
};

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值