Search in sources :

Example 1 with ProtocolBuffersBimServerClientFactory

use of org.bimserver.client.protocolbuffers.ProtocolBuffersBimServerClientFactory in project BIMserver by opensourceBIM.

the class LocalDevSetup method setupProtocolBuffers.

public static final BimServerClientInterface setupProtocolBuffers(String address) {
    Path home = Paths.get("home");
    Path tmp = home.resolve("tmp");
    MetaDataManager metaDataManager = new MetaDataManager(tmp);
    try (BimServerClientFactory factory = new ProtocolBuffersBimServerClientFactory(address, 8000, 8000, null, metaDataManager, new SServicesMap())) {
        PluginManager pluginManager = LocalDevPluginLoader.createPluginManager(home);
        pluginManager.setMetaDataManager(metaDataManager);
        return factory.create(new UsernamePasswordAuthenticationInfo("admin@bimserver.org", "admin"));
    } catch (PluginException e) {
        LOGGER.error("", e);
    } catch (ServiceException e) {
        LOGGER.error("", e);
    } catch (ChannelConnectionException e) {
        LOGGER.error("", e);
    } catch (BimServerClientException e) {
        LOGGER.error("", e);
    } catch (Exception e) {
        LOGGER.error("", e);
    }
    return null;
}
Also used : Path(java.nio.file.Path) PluginManager(org.bimserver.plugins.PluginManager) SServicesMap(org.bimserver.shared.meta.SServicesMap) ServiceException(org.bimserver.shared.exceptions.ServiceException) ChannelConnectionException(org.bimserver.shared.ChannelConnectionException) UsernamePasswordAuthenticationInfo(org.bimserver.shared.UsernamePasswordAuthenticationInfo) PluginException(org.bimserver.shared.exceptions.PluginException) MetaDataManager(org.bimserver.emf.MetaDataManager) ProtocolBuffersBimServerClientFactory(org.bimserver.client.protocolbuffers.ProtocolBuffersBimServerClientFactory) BimServerClientException(org.bimserver.shared.exceptions.BimServerClientException) ProtocolBuffersBimServerClientFactory(org.bimserver.client.protocolbuffers.ProtocolBuffersBimServerClientFactory) JsonBimServerClientFactory(org.bimserver.client.json.JsonBimServerClientFactory) BimServerClientFactory(org.bimserver.shared.BimServerClientFactory) SoapBimServerClientFactory(org.bimserver.client.soap.SoapBimServerClientFactory) ChannelConnectionException(org.bimserver.shared.ChannelConnectionException) PluginException(org.bimserver.shared.exceptions.PluginException) BimServerClientException(org.bimserver.shared.exceptions.BimServerClientException) ServiceException(org.bimserver.shared.exceptions.ServiceException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 Path (java.nio.file.Path)1 JsonBimServerClientFactory (org.bimserver.client.json.JsonBimServerClientFactory)1 ProtocolBuffersBimServerClientFactory (org.bimserver.client.protocolbuffers.ProtocolBuffersBimServerClientFactory)1 SoapBimServerClientFactory (org.bimserver.client.soap.SoapBimServerClientFactory)1 MetaDataManager (org.bimserver.emf.MetaDataManager)1 PluginManager (org.bimserver.plugins.PluginManager)1 BimServerClientFactory (org.bimserver.shared.BimServerClientFactory)1 ChannelConnectionException (org.bimserver.shared.ChannelConnectionException)1 UsernamePasswordAuthenticationInfo (org.bimserver.shared.UsernamePasswordAuthenticationInfo)1 BimServerClientException (org.bimserver.shared.exceptions.BimServerClientException)1 PluginException (org.bimserver.shared.exceptions.PluginException)1 ServiceException (org.bimserver.shared.exceptions.ServiceException)1 SServicesMap (org.bimserver.shared.meta.SServicesMap)1