use of org.bimserver.client.json.JsonChannel in project BIMserver by opensourceBIM.
the class NotificationsManager method getChannel.
public Channel getChannel(Service service) throws ChannelConnectionException {
switch(service.getNotificationProtocol()) {
case JSON:
JsonChannel jsonChannel = new JsonChannel(null, bimServer.getReflectorFactory(), jsonSocketReflectorFactory, service.getUrl() + "/json", bimServer.getServicesMap());
jsonChannel.connect(new SimpleTokenHolder());
return jsonChannel;
case INTERNAL:
DirectChannel directChannel = new DirectChannel(null, bimServer.getServiceFactory(), bimServer.getServicesMap());
try {
directChannel.connect();
} catch (UserException e) {
LOGGER.error("", e);
}
return directChannel;
default:
LOGGER.error("Unimplemented AccessMethod: " + service.getNotificationProtocol());
return null;
}
}
Aggregations