public void run(){ try { callback.success(syncService.getPrivateProfiles(serviceIdentifier, token)); } catch (Throwable e) { callback.error(e); } } });
public void run(){ try { callback.success(syncService.getPublicProfiles(serviceIdentifier)); } catch (Throwable e) { callback.error(e); } } });
public void run(){ try { callback.success(syncService.getService(serviceIdentifier)); } catch (Throwable e) { callback.error(e); } } });
@Override public void newExtendedDataOnRevision(Long poid, Long roid, Long edid, Long soid, String serviceIdentifier, String profileIdentifier, String userToken, String token, String apiUrl) throws UserException, ServerException { bimServer.getInternalServicesManager().getLocalRemoteServiceInterface(serviceIdentifier).newExtendedDataOnRevision(poid, roid, edid, soid, serviceIdentifier, profileIdentifier, userToken, token, apiUrl); } }
public void run(){ try { syncService.newExtendedDataOnProject(poid, edid, soid, serviceIdentifier, profileIdentifier, userToken, token, apiUrl); callback.success(); } catch (Throwable e) { callback.error(e); } } });
public void run(){ try { syncService.newRevision(poid, roid, soid, serviceIdentifier, profileIdentifier, userToken, token, apiUrl); callback.success(); } catch (Throwable e) { callback.error(e); } } });
public void run(){ try { syncService.newExtendedDataOnRevision(poid, roid, edid, soid, serviceIdentifier, profileIdentifier, userToken, token, apiUrl); callback.success(); } catch (Throwable e) { callback.error(e); } } });
@Override public void newExtendedDataOnProject(Long poid, Long edid, Long soid, String serviceIdentifier, String profileIdentifier, String userToken, String token, String apiUrl) throws UserException, ServerException { bimServer.getInternalServicesManager().getLocalRemoteServiceInterface(serviceIdentifier).newExtendedDataOnProject(poid, edid, soid, serviceIdentifier, profileIdentifier, userToken, token, apiUrl); }
@Override public void newRevision(Long poid, Long roid, Long soid, String serviceIdentifier, String profileIdentifier, String userToken, String token, String apiUrl) throws UserException, ServerException { RemoteServiceInterface localRemoteServiceInterface = bimServer.getInternalServicesManager().getLocalRemoteServiceInterface(serviceIdentifier); if (localRemoteServiceInterface == null) { throw new UserException("No local remote service found " + serviceIdentifier); } localRemoteServiceInterface.newRevision(poid, roid, soid, serviceIdentifier, profileIdentifier, userToken, token, apiUrl); }
@Override public List<SProfileDescriptor> getAllPublicProfiles(String notificationsUrl, String serviceIdentifier) throws ServerException, UserException { requireRealUserAuthentication(); try (BimServerClientFactory factory = new JsonBimServerClientFactory(notificationsUrl, getBimServer().getServicesMap(), getBimServer().getJsonSocketReflectorFactory(), getBimServer().getReflectorFactory(), getBimServer().getMetaDataManager())){ try (BimServerClientInterface client = factory.create()) { return client.getRemoteServiceInterface().getPublicProfiles(serviceIdentifier); } } catch (Exception e) { return handleException(e); } }
@Override public List<SProfileDescriptor> getAllPrivateProfiles(String notificationsUrl, String serviceIdentifier) throws ServerException, UserException { if (notificationsUrl == null) { throw new UserException("Missing notificationsUrl"); } requireRealUserAuthentication(); try (DatabaseSession session = getBimServer().getDatabase().createSession()) { try (BimServerClientFactory factory = new JsonBimServerClientFactory(notificationsUrl, getBimServer().getServicesMap(), getBimServer().getJsonSocketReflectorFactory(), getBimServer().getReflectorFactory(), getBimServer().getMetaDataManager())) { BimServerClientInterface client = factory.create(); OAuthServer oAuthServer = session.querySingle(StorePackage.eINSTANCE.getOAuthServer_ApiUrl(), notificationsUrl); User user = session.get(StorePackage.eINSTANCE.getUser(), getAuthorization().getUoid(), OldQuery.getDefault()); for (OAuthAuthorizationCode oAuthAuthorizationCode : user.getOAuthAuthorizationCodes()) { if (oAuthAuthorizationCode.getOauthServer() == oAuthServer) { return client.getRemoteServiceInterface().getPrivateProfiles(serviceIdentifier, oAuthAuthorizationCode.getCode()); } } return null; } } catch (Exception e) { return handleException(e); } }
@Override public SServiceDescriptor getServiceDescriptor(String baseUrl, String serviceIdentifier) throws ServerException, UserException { requireRealUserAuthentication(); try { try (BimServerClientFactory factory = new JsonBimServerClientFactory(baseUrl, getBimServer().getServicesMap(), getBimServer().getJsonSocketReflectorFactory(), getBimServer().getReflectorFactory(), getBimServer().getMetaDataManager())) { BimServerClientInterface client = factory.create(); SServiceDescriptor service = client.getRemoteServiceInterface().getService(serviceIdentifier); if (service == null) { throw new UserException("No service found with identifier " + serviceIdentifier); } service.setUrl(baseUrl); return service; } } catch (Exception e) { return handleException(e); } }