public void triggerNewRevision(DatabaseSession session, NotificationsManager notificationsManager, final BimServer bimServer, String siteAddress, Project project, final long roid, Trigger trigger, final NewService service) throws UserException, ServerException { ServiceMap serviceMap = bimServer.getServiceFactory().get(authorization, AccessMethod.INTERNAL); Thread thread = new Thread(){ @Override public void run() { try { serviceMap.get(ServiceInterface.class).triggerRevisionService(roid, service.getOid()); } catch (Exception e) { LOGGER.error("", e); } } }; thread.start(); }
private <T extends PublicInterface> T getServiceInterface(HttpServletRequest httpRequest, BimServer bimServer, Class<T> interfaceClass, String methodName, String token, String oAuthCode) throws UserException, ServerException { if (methodName.equals("login") || methodName.equals("autologin")) { return bimServer.getServiceFactory().get(AccessMethod.JSON).get(interfaceClass); return bimServer.getServiceFactory().get(AccessMethod.JSON).get(interfaceClass); T service = bimServer.getServiceFactory().get(token, AccessMethod.JSON).get(interfaceClass); if (service == null) { service = bimServer.getServiceFactory().get(AccessMethod.JSON).get(interfaceClass); if (httpRequest != null) { httpRequest.getSession().setAttribute("token", token);
try { if (token == null) { serviceMap = getBimServer().getServiceFactory().get(AccessMethod.SYNDICATION); } else { serviceMap = getBimServer().getServiceFactory().get(token, AccessMethod.SYNDICATION);
token = request.get("token").asText(); try { ServiceMap serviceMap = bimServer.getServiceFactory().get(token, AccessMethod.JSON); uoid = serviceMap.getBimServerAuthInterface().getLoggedInUser().getOid();
ServiceInterface service = getBimServer().getServiceFactory().get(token, AccessMethod.INTERNAL).get(ServiceInterface.class);
public <T extends PublicInterface> T getService(Class<T> clazz) { return getServiceFactory().get(new SystemAuthorization(getServerSettingsCache().getServerSettings().getSessionTimeOutSeconds(), TimeUnit.SECONDS), AccessMethod.INTERNAL).get(clazz); }
topicId = Long.parseLong(request.getParameter("topicId")); ServiceMap serviceMap = getBimServer().getServiceFactory().get(token, AccessMethod.INTERNAL);
bimServer.start(); if (bimServer.getServerInfo().getServerState() == ServerState.NOT_SETUP) { AdminInterface adminInterface = bimServer.getServiceFactory().get(new SystemAuthorization(1, TimeUnit.HOURS), AccessMethod.INTERNAL).get(AdminInterface.class); adminInterface.setup("http://localhost:" + port, "Administrator", "admin@bimserver.org", "admin", null, null, null); SettingsInterface settingsInterface = bimServer.getServiceFactory().get(new SystemAuthorization(1, TimeUnit.HOURS), AccessMethod.INTERNAL).get(SettingsInterface.class); settingsInterface.setCacheOutputFiles(false);
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; } }
ServiceInterface serviceInterface = getBimServer().getServiceFactory().get(token, AccessMethod.INTERNAL).get(ServiceInterface.class); SFile file = new SFile(); byte[] data = IOUtils.toByteArray(in); ServiceInterface service = getBimServer().getServiceFactory().get(token, AccessMethod.INTERNAL).get(ServiceInterface.class);
if (autoSetup) { try { AdminInterface adminInterface = bimServer.getServiceFactory().get(new SystemAuthorization(1, TimeUnit.HOURS), AccessMethod.INTERNAL).get(AdminInterface.class); adminInterface.setup("http://localhost:" + port, name, "My Description", "http://localhost:" + port + "/img/bimserver.png", "Administrator", "admin@bimserver.org", "admin"); SettingsInterface settingsInterface = bimServer.getServiceFactory().get(new SystemAuthorization(1, TimeUnit.HOURS), AccessMethod.INTERNAL).get(SettingsInterface.class); settingsInterface.setCacheOutputFiles(false); settingsInterface.setPluginStrictVersionChecking(false);
serviceMapInterface.add(RemoteServiceInterface.class, internalRemoteServiceInterfaces.get(serviceIdentifier)); P p = new P(); final InternalChannel internalChannel = new InternalChannel(bimServer.getServiceFactory(), bimServer.getServicesMap()); try { internalChannel.connect(new SimpleTokenHolder());
serverFactoryBean.setServiceClass(clazz); serverFactoryBean.getOutFaultInterceptors().add(new StatusCodeModifyingFaultInterceptor()); serverFactoryBean.setInvoker(new CustomInvoker(getBimServer().getServiceFactory(), clazz)); if (getBimServer().getConfig().getEnvironment() != Environment.WAR) { serverFactoryBean.setAddress((bindingId == WSDLConstants.NS_SOAP11 ? "/soap11/" : "/soap12/") + clazz.getSimpleName()); // equals check allowed, just keep using the constant
ServiceMap serviceMap = bimServer.getServiceFactory().get(authorization, AccessMethod.INTERNAL); ServiceInterface serviceInterface = serviceMap.get(ServiceInterface.class); if (bimServer.getServerSettingsCache().getServerSettings().isStoreServiceRuns()) {
ServiceInterface newService = bimServer.getServiceFactory().get(authorization, AccessMethod.INTERNAL).get(ServiceInterface.class);
long readExtendedDataRoid = service.getReadExtendedData() != null ? roid : -1; final ExplicitRightsAuthorization authorization = new ExplicitRightsAuthorization(bimServer, service.getUser().getOid(), service.getOid(), new long[]{readRevisionRoid}, writeProjectPoid, readExtendedDataRoid, writeExtendedDataRoid); ServiceInterface newService = bimServer.getServiceFactory().get(authorization, AccessMethod.INTERNAL).get(ServiceInterface.class);