@Test @Rollback(false) public void testRegisterService() { try { serReg.registerServiceList(servicesList); } catch (ServiceRegistrationException e) { e.printStackTrace(); } }
@Override public void registerServiceList(List<Service> servicesList) throws ServiceRegistrationException { Session session = null; RegistryEntry tmpRegistryEntry = null; Transaction t = null; try { session = sessionFactory.openSession(); t = session.beginTransaction(); for (Service service : servicesList) { tmpRegistryEntry = new RegistryEntry( service.getServiceIdentifier(), service.getServiceEndpoint(), service.getServiceName(), service.getServiceDescription(), service.getAuthorSignature(), service.getPrivacyPolicy(), service.getSecurityPolicy(), service.getServiceCategory(), service.getServiceType(), service.getServiceLocation(), service.getContextSource(), service.getServiceInstance(), service.getServiceStatus()); session.save(tmpRegistryEntry); } t.commit(); log.debug("Service list saved."); } catch (Exception e) { if(t != null) t.rollback(); e.printStackTrace(); throw new ServiceRegistrationException(e); } finally { if (session != null) { session.close(); } } }
ServiceRegistry implements IServiceRegistry { @Override public void registerServiceList(List<Service> servicesList) throws ServiceRegistrationException { Session session = null; RegistryEntry tmpRegistryEntry = null; Transaction t = null; try { session = sessionFactory.openSession(); t = session.beginTransaction(); for (Service service : servicesList) { tmpRegistryEntry = new RegistryEntry( service.getServiceIdentifier(), service.getServiceEndpoint(), service.getServiceName(), service.getServiceDescription(), service.getAuthorSignature(), service.getPrivacyPolicy(), service.getSecurityPolicy(), service.getServiceCategory(), service.getServiceType(), service.getServiceLocation(), service.getContextSource(), service.getServiceInstance(), service.getServiceStatus()); session.save(tmpRegistryEntry); } t.commit(); log.debug("Service list saved."); } catch (Exception e) { if(t != null) t.rollback(); e.printStackTrace(); throw new ServiceRegistrationException(e); } finally { if (session != null) { session.close(); } } } }
ServiceRegistry implements IServiceRegistry { @Override public void registerServiceList(List<Service> servicesList) throws ServiceRegistrationException { Session session = null; RegistryEntry tmpRegistryEntry = null; Transaction t = null; try { session = sessionFactory.openSession(); t = session.beginTransaction(); for (Service service : servicesList) { tmpRegistryEntry = new RegistryEntry( service.getServiceIdentifier(), service.getServiceEndpoint(), service.getServiceName(), service.getServiceDescription(), service.getAuthorSignature(), service.getPrivacyPolicy(), service.getSecurityPolicy(), service.getServiceCategory(), service.getServiceType(), service.getServiceLocation(), service.getContextSource(), service.getServiceInstance(), service.getServiceStatus()); session.save(tmpRegistryEntry); } t.commit(); log.debug("Service list saved."); } catch (Exception e) { if(t != null) t.rollback(); e.printStackTrace(); throw new ServiceRegistrationException(e); } finally { if (session != null) { session.close(); } } } ServiceRegistry(); }
ServiceRegistry implements IServiceRegistry { @Override public void registerServiceList(List<Service> servicesList) throws ServiceRegistrationException { Session session = null; RegistryEntry tmpRegistryEntry = null; Transaction t = null; try { session = sessionFactory.openSession(); t = session.beginTransaction(); for (Service service : servicesList) { tmpRegistryEntry = new RegistryEntry( service.getServiceIdentifier(), service.getServiceEndpoint(), service.getServiceName(), service.getServiceDescription(), service.getAuthorSignature(), service.getPrivacyPolicy(), service.getSecurityPolicy(), service.getServiceCategory(), service.getServiceType(), service.getServiceLocation(), service.getContextSource(), service.getServiceInstance(), service.getServiceStatus()); session.save(tmpRegistryEntry); } t.commit(); log.debug("Service list saved."); } catch (Exception e) { if(t != null) t.rollback(); e.printStackTrace(); throw new ServiceRegistrationException(e); } finally { if (session != null) { session.close(); } } } ServiceRegistry(); @Override void registerServiceList(List<Service> servicesList); @Override void unregisterServiceList(List<Service> servicesList); @Override List<Service> retrieveServicesInCSSNode(String CSSID); @Override List<Service> retrieveServicesInCSS(String CSSID); @Override List<Service> retrieveServicesSharedByCIS(String CISID); @Override List<Service> findServices(Service filter); @Override List<Service> findServices(Service filter, String cisId); @Override void notifyServiceIsSharedInCIS(
			ServiceResourceIdentifier serviceIdentifier, String CISID); @Override void removeServiceSharingInCIS(
			ServiceResourceIdentifier serviceIdentifier, String CISID); @Override Service retrieveService(ServiceResourceIdentifier serviceIdentifier); @Override boolean changeStatusOfService(
			ServiceResourceIdentifier serviceIdentifier,
			ServiceStatus serviceStatus); SessionFactory getSessionFactory(); void setSessionFactory(SessionFactory sessionFactory); @Override boolean deleteServiceCSS(String CSSId); @Override boolean clearServiceSharedCIS(String CISId); @Override boolean updateRegisteredService(Service service); @Override List<String> retrieveCISSharedService(ServiceResourceIdentifier serviceIdentifier); }
ServiceRegistry implements IServiceRegistry { @Override public void registerServiceList(List<Service> servicesList) throws ServiceRegistrationException { Session session = null; RegistryEntry tmpRegistryEntry = null; Transaction t = null; try { session = sessionFactory.openSession(); t = session.beginTransaction(); for (Service service : servicesList) { tmpRegistryEntry = new RegistryEntry( service.getServiceIdentifier(), service.getServiceEndpoint(), service.getServiceName(), service.getServiceDescription(), service.getAuthorSignature(), service.getPrivacyPolicy(), service.getSecurityPolicy(), service.getServiceCategory(), service.getServiceType(), service.getServiceLocation(), service.getContextSource(), service.getServiceInstance(), service.getServiceStatus()); session.save(tmpRegistryEntry); } t.commit(); log.debug("Service list saved."); } catch (Exception e) { if(t != null) t.rollback(); e.printStackTrace(); throw new ServiceRegistrationException(e); } finally { if (session != null) { session.close(); } } } ServiceRegistry(); @Override void registerServiceList(List<Service> servicesList); @Override void unregisterServiceList(List<Service> servicesList); @Override List<Service> retrieveServicesInCSSNode(String CSSID); @Override List<Service> retrieveServicesInCSS(String CSSID); @Override List<Service> retrieveServicesSharedByCIS(String CISID); @Override List<Service> findServices(Service filter); @Override List<Service> findServices(Service filter, String cisId); @Override void notifyServiceIsSharedInCIS(
			ServiceResourceIdentifier serviceIdentifier, String CISID); @Override void removeServiceSharingInCIS(
			ServiceResourceIdentifier serviceIdentifier, String CISID); @Override Service retrieveService(ServiceResourceIdentifier serviceIdentifier); @Override boolean changeStatusOfService(
			ServiceResourceIdentifier serviceIdentifier,
			ServiceStatus serviceStatus); SessionFactory getSessionFactory(); void setSessionFactory(SessionFactory sessionFactory); @Override boolean deleteServiceCSS(String CSSId); @Override boolean clearServiceSharedCIS(String CISId); @Override boolean updateRegisteredService(Service service); @Override List<String> retrieveCISSharedService(ServiceResourceIdentifier serviceIdentifier);  }