@Test @Rollback(false) public void retrieveService() { Service retrievedService = null; try { retrievedService = serReg .retrieveService(servicesList.get(0).getServiceIdentifier()); } catch (ServiceRetrieveException e) { e.printStackTrace(); } assertTrue(retrievedService.getServiceName().equals( servicesList.get(0).getServiceName())); }
@Override public Service retrieveService(ServiceResourceIdentifier serviceIdentifier) throws ServiceRetrieveException { Session session = null; Service tmpService = null; RegistryEntry tmpRegistryEntry = null; try { session = sessionFactory.openSession(); tmpRegistryEntry = (RegistryEntry) session.get( RegistryEntry.class, new ServiceResourceIdentifierDAO(serviceIdentifier .getIdentifier().toString(), serviceIdentifier .getServiceInstanceIdentifier())); if (tmpRegistryEntry != null) { tmpService = tmpRegistryEntry.createServiceFromRegistryEntry(); } } catch (Exception e) { e.printStackTrace(); throw new ServiceRetrieveException(e); } finally { if (session != null) { session.close(); } } return tmpService; }
ServiceRegistry implements IServiceRegistry { @Override public Service retrieveService(ServiceResourceIdentifier serviceIdentifier) throws ServiceRetrieveException { Session session = null; Service tmpService = null; RegistryEntry tmpRegistryEntry = null; try { session = sessionFactory.openSession(); tmpRegistryEntry = (RegistryEntry) session.get( RegistryEntry.class, new ServiceResourceIdentifierDAO(serviceIdentifier .getIdentifier().toString(), serviceIdentifier .getServiceInstanceIdentifier())); if (tmpRegistryEntry != null) { tmpService = tmpRegistryEntry.createServiceFromRegistryEntry(); } } catch (Exception e) { e.printStackTrace(); throw new ServiceRetrieveException(e); } finally { if (session != null) { session.close(); } } return tmpService; } }
ServiceRegistry implements IServiceRegistry { @Override public Service retrieveService(ServiceResourceIdentifier serviceIdentifier) throws ServiceRetrieveException { Session session = null; Service tmpService = null; RegistryEntry tmpRegistryEntry = null; try { session = sessionFactory.openSession(); tmpRegistryEntry = (RegistryEntry) session.get( RegistryEntry.class, new ServiceResourceIdentifierDAO(serviceIdentifier .getIdentifier().toString(), serviceIdentifier .getServiceInstanceIdentifier())); if (tmpRegistryEntry != null) { tmpService = tmpRegistryEntry.createServiceFromRegistryEntry(); } } catch (Exception e) { e.printStackTrace(); throw new ServiceRetrieveException(e); } finally { if (session != null) { session.close(); } } return tmpService; } ServiceRegistry(); }
ServiceRegistry implements IServiceRegistry { @Override public Service retrieveService(ServiceResourceIdentifier serviceIdentifier) throws ServiceRetrieveException { Session session = null; Service tmpService = null; RegistryEntry tmpRegistryEntry = null; try { session = sessionFactory.openSession(); tmpRegistryEntry = (RegistryEntry) session.get( RegistryEntry.class, new ServiceResourceIdentifierDAO(serviceIdentifier .getIdentifier().toString(), serviceIdentifier .getServiceInstanceIdentifier())); if (tmpRegistryEntry != null) { tmpService = tmpRegistryEntry.createServiceFromRegistryEntry(); } } catch (Exception e) { e.printStackTrace(); throw new ServiceRetrieveException(e); } finally { if (session != null) { session.close(); } } return tmpService; } 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 Service retrieveService(ServiceResourceIdentifier serviceIdentifier) throws ServiceRetrieveException { Session session = null; Service tmpService = null; RegistryEntry tmpRegistryEntry = null; try { session = sessionFactory.openSession(); tmpRegistryEntry = (RegistryEntry) session.get( RegistryEntry.class, new ServiceResourceIdentifierDAO(serviceIdentifier .getIdentifier().toString(), serviceIdentifier .getServiceInstanceIdentifier())); if (tmpRegistryEntry != null) { tmpService = tmpRegistryEntry.createServiceFromRegistryEntry(); } } catch (Exception e) { e.printStackTrace(); throw new ServiceRetrieveException(e); } finally { if (session != null) { session.close(); } } return tmpService; } 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);  }