use of i5.las2peer.api.p2p.ServiceNameVersion in project Distributed-Noracle-Backend by Distributed-Noracle.
the class QuestionVotesResource method getQuestionText.
private String getQuestionText(String questionId) throws ServiceInvocationException {
String qText = "";
Serializable rmiResult = Context.get().invoke(new ServiceNameVersion(NoracleQuestionService.class.getCanonicalName(), NoracleService.API_VERSION), "getQuestion", questionId);
if (rmiResult instanceof Question)
qText = ((Question) rmiResult).getText();
return qText;
}
use of i5.las2peer.api.p2p.ServiceNameVersion in project Distributed-Noracle-Backend by Distributed-Noracle.
the class QuestionVotesResource method getAllVotes.
@Override
public VoteList getAllVotes(String objectId) throws ServiceInvocationException {
Serializable rmiResult = Context.get().invoke(new ServiceNameVersion(NoracleVoteService.class.getCanonicalName(), NoracleService.API_VERSION), "getAllVotes", objectId);
VoteList vote;
if (rmiResult instanceof VoteList) {
vote = (VoteList) rmiResult;
} else {
throw new InternalServiceException("Unexpected result (" + rmiResult.getClass().getCanonicalName() + ") of RMI call");
}
return vote;
}
use of i5.las2peer.api.p2p.ServiceNameVersion in project Distributed-Noracle-Backend by Distributed-Noracle.
the class QuestionVotesResource method getAgentVote.
@Override
public Vote getAgentVote(String objectId, String agentId) throws ServiceInvocationException {
Serializable rmiResult = Context.get().invoke(new ServiceNameVersion(NoracleVoteService.class.getCanonicalName(), NoracleService.API_VERSION), "getAgentVote", objectId, agentId);
Vote vote;
if (rmiResult instanceof Vote) {
vote = (Vote) rmiResult;
} else {
throw new InternalServiceException("Unexpected result (" + rmiResult.getClass().getCanonicalName() + ") of RMI call");
}
return vote;
}
use of i5.las2peer.api.p2p.ServiceNameVersion in project Distributed-Noracle-Backend by Distributed-Noracle.
the class RelationVotesResource method getAgentVote.
@Override
public Vote getAgentVote(String objectId, String agentId) throws ServiceInvocationException {
Serializable rmiResult = Context.get().invoke(new ServiceNameVersion(NoracleVoteService.class.getCanonicalName(), NoracleService.API_VERSION), "getAgentVote", objectId, agentId);
Vote vote;
if (rmiResult instanceof Vote) {
vote = (Vote) rmiResult;
} else {
throw new InternalServiceException("Unexpected result (" + rmiResult.getClass().getCanonicalName() + ") of RMI call");
}
return vote;
}
use of i5.las2peer.api.p2p.ServiceNameVersion in project Distributed-Noracle-Backend by Distributed-Noracle.
the class NoracleServiceTest method startService.
private void startService(Node node, String clsName, String version) throws Exception {
ServiceAgentImpl serviceAgent = ServiceAgentImpl.createServiceAgent(new ServiceNameVersion(clsName, version), "testtest");
serviceAgent.unlock("testtest");
node.storeAgent(serviceAgent);
node.registerReceiver(serviceAgent);
}
Aggregations