本文整理汇总了Java中rice.p2p.scribe.ScribeMultiClient类的典型用法代码示例。如果您正苦于以下问题:Java ScribeMultiClient类的具体用法?Java ScribeMultiClient怎么用?Java ScribeMultiClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ScribeMultiClient类属于rice.p2p.scribe包,在下文中一共展示了ScribeMultiClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: before
import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
@Before
public void before() throws Exception {
scribeClient = mock(ScribeMultiClient.class);
topic = mock(Topic.class);
id = mock(Id.class);
topicId = mock(Id.class);
endpoint = mock(Endpoint.class);
scribeContent = mock(KoalaScribeContent.class);
applicationContext = mock(ApplicationContext.class);
wrappedScribeContentMessage = new WrappedScribeContentMessage(mock(NodeHandle.class), topic, WrappedScribeContentMessageType.ANYCAST, EntityMethod.UPDATE, "json", "transaction-id");
koalaIdFactory = mock(KoalaIdFactory.class);
when(koalaIdFactory.buildIdFromToString(TOPIC_ID)).thenReturn(topicId);
scribe = spy(new KoalaScribeImpl(setupPastryNode(), applicationContext));
scribe.setKoalaIdFactory(koalaIdFactory);
messageDeserializer = scribe.getEndpoint().getDeserializer();
}
示例2: testOnApplicationStarting
import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
@Test
public void testOnApplicationStarting() {
// setup
setupTopics();
Topic topic = mock(Topic.class);
when(aScribe.subscribeToTopic(isA(String.class), isA(ScribeMultiClient.class))).thenReturn(topic);
when(koalaIdUtils.isIdClosestToMe(eq(nodeIdFull), eq(leafNodeHandles), isA(Id.class), eq(NodeScope.AVAILABILITY_ZONE))).thenReturn(false).thenReturn(true);
// act
volumeManagerApplication.onApplicationStarting();
// assert
assertTrue(this.volumeManagerApplication.getSubscribedTopics().contains(createVolumeTopic));
assertTrue(this.volumeManagerApplication.getSubscribedTopics().contains(deleteVolumeTopic));
assertTrue(this.volumeManagerApplication.getSubscribedTopics().contains(detachVolumeTopic));
assertTrue(this.volumeManagerApplication.getSubscribedTopics().contains(attachVolumeTopic));
assertTrue(this.volumeManagerApplication.getSubscribedTopics().contains(createSnapshotTopic));
assertTrue(this.volumeManagerApplication.getSubscribedTopics().contains(deleteSnapshotTopic));
verify(volumeManagerQueueManager).createVolumeApplicationWatchers(nodeIdFull);
}
示例3: subscribeToTopic
import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
public Topic subscribeToTopic(String topicName, ScribeMultiClient scribeClient) {
LOG.debug(String.format("subscribeToTopic(%s, %s)", topicName, scribeClient));
Topic topic = createTopic(topicName);
subscribe(topic, scribeClient);
return topic;
}
示例4: setupTopics
import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
private void setupTopics() {
createVolumeTopic = new Topic(koalaIdFactory.buildId(koalaIdFactory.buildPId(PiTopics.CREATE_VOLUME.getPiLocation()).forLocalScope(PiTopics.CREATE_VOLUME.getNodeScope())));
deleteVolumeTopic = new Topic(koalaIdFactory.buildId(koalaIdFactory.buildPId(PiTopics.DELETE_VOLUME.getPiLocation()).forLocalScope(PiTopics.DELETE_VOLUME.getNodeScope())));
attachVolumeTopic = new Topic(koalaIdFactory.buildId(koalaIdFactory.buildPId(PiTopics.ATTACH_VOLUME.getPiLocation()).forLocalScope(PiTopics.ATTACH_VOLUME.getNodeScope())));
detachVolumeTopic = new Topic(koalaIdFactory.buildId(koalaIdFactory.buildPId(PiTopics.DETACH_VOLUME.getPiLocation()).forLocalScope(PiTopics.DETACH_VOLUME.getNodeScope())));
createSnapshotTopic = new Topic(koalaIdFactory.buildId(koalaIdFactory.buildPId(PiTopics.CREATE_SNAPSHOT.getPiLocation()).forLocalScope(PiTopics.CREATE_SNAPSHOT.getNodeScope())));
deleteSnapshotTopic = new Topic(koalaIdFactory.buildId(koalaIdFactory.buildPId(PiTopics.DELETE_SNAPSHOT.getPiLocation()).forLocalScope(PiTopics.CREATE_SNAPSHOT.getNodeScope())));
when(aScribe.subscribeToTopic(eq(PiTopics.CREATE_VOLUME.getUrl()), isA(ScribeMultiClient.class))).thenReturn(createVolumeTopic);
when(aScribe.subscribeToTopic(eq(PiTopics.DELETE_VOLUME.getUrl()), isA(ScribeMultiClient.class))).thenReturn(deleteVolumeTopic);
when(aScribe.subscribeToTopic(eq(PiTopics.ATTACH_VOLUME.getUrl()), isA(ScribeMultiClient.class))).thenReturn(attachVolumeTopic);
when(aScribe.subscribeToTopic(eq(PiTopics.DETACH_VOLUME.getUrl()), isA(ScribeMultiClient.class))).thenReturn(detachVolumeTopic);
when(aScribe.subscribeToTopic(eq(PiTopics.CREATE_SNAPSHOT.getUrl()), isA(ScribeMultiClient.class))).thenReturn(createSnapshotTopic);
when(aScribe.subscribeToTopic(eq(PiTopics.DELETE_SNAPSHOT.getUrl()), isA(ScribeMultiClient.class))).thenReturn(deleteSnapshotTopic);
}
示例5: before
import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
@Before
public void before() {
KoalaIdFactory koalaIdFactory = new KoalaIdFactory(99, 99);
koalaIdFactory.setKoalaPiEntityFactory(new KoalaPiEntityFactory());
imageManager.setKoalaIdFactory(koalaIdFactory);
imageManager.setScribe(koalaScribeImpl);
when(koalaScribeImpl.subscribeToTopic(anyString(), any(ScribeMultiClient.class))).thenReturn(topic);
imageManager.setActivationCheckPeriodSecs(123);
imageManager.setStartTimeout(456);
when(koalaIdUtils.isIdClosestToMe(eq(nodeIdFull), eq(leafNodeHandles), isA(Id.class), eq(NodeScope.AVAILABILITY_ZONE))).thenReturn(false).thenReturn(true);
}
示例6: subscribe
import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
@Override
public void subscribe(PId topicId, ScribeMultiClient listener) {
subscribeInvoked = true;
}
示例7: unsubscribe
import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
@Override
public void unsubscribe(PId topicId, ScribeMultiClient listener) {
unsubscribeInvoked = true;
}
示例8: subscribe
import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
/**
* To subscribe to a topic use instead {@link KoalaPastryScribeApplicationBase#subscribe(PId)}
*/
@Deprecated
public void subscribe(PiLocation atopic, ScribeMultiClient listener) {
PId topicPId = getKoalaIdFactory().buildPId(atopic.getUrl()).forLocalScope(atopic.getNodeScope());
this.subscribe(topicPId, listener);
}
示例9: unsubscribe
import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
/**
* To unsubscribe to a topic use instead {@link KoalaPastryScribeApplicationBase#unsubscribe(PId)}
*/
@Deprecated
public void unsubscribe(PiLocation atopic, ScribeMultiClient listener) {
PId topicPId = getKoalaIdFactory().buildPId(atopic.getUrl()).forLocalScope(atopic.getNodeScope());
this.unsubscribe(topicPId, listener);
}
示例10: subscribe
import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
@Deprecated
void subscribe(PiLocation atopic, ScribeMultiClient listener);
示例11: unsubscribe
import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
@Deprecated
void unsubscribe(PiLocation atopic, ScribeMultiClient listener);
示例12: shouldHandlSuccess
import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
@Test
public void shouldHandlSuccess() {
superNodeApplication.subscribe(mock(PId.class), mock(ScribeMultiClient.class));
}
示例13: subscribe
import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
public void subscribe(Topic topic, ScribeMultiClient client, RawScribeContent content, NodeHandle hint);
示例14: subscribe
import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
public void subscribe(Topic topic, ScribeMultiClient client, ScribeContent content, NodeHandle hint);
示例15: subscribe
import rice.p2p.scribe.ScribeMultiClient; //导入依赖的package包/类
public void subscribe(Collection<Topic> nodeWasParent, ScribeMultiClient client, RawScribeContent content, NodeHandle hint);