@Test @Rollback(false) public void testForBug1004() throws ServiceRetrieveException{ Service tmpServiceFilter=new Service(); ServiceResourceIdentifier sid = new ServiceResourceIdentifier(); int i = 0; try { while (i < _numberOfServiceCreated) { sid.setIdentifier(new URI("societies", "the/path/of/the/service/v" + i, null)); sid.setServiceInstanceIdentifier("instance_" + i); tmpServiceFilter.setServiceIdentifier(sid); List<Service> returnedList = serReg.findServices(tmpServiceFilter); assertTrue(returnedList.size() == 1); i++; } } catch (URISyntaxException e) { throw new ServiceRetrieveException(e); } }
@Override public List<Service> findServices(Service filter) throws ServiceRetrieveException { Session session = null; List<RegistryEntry> tmpRegistryEntryList = new ArrayList<RegistryEntry>(); try{ session = sessionFactory.openSession(); Criteria c = this.createCriteriaFromService(filter, session); tmpRegistryEntryList = c.list(); } catch(Exception ex){ log.error("Exception in findServices: " + ex.getMessage()); throw new ServiceRetrieveException(ex); } finally{ if(session!= null) session.close(); } return createListService(tmpRegistryEntryList); }
ServiceRegistry implements IServiceRegistry { @Override public List<Service> findServices(Service filter) throws ServiceRetrieveException { Session session = null; List<RegistryEntry> tmpRegistryEntryList = new ArrayList<RegistryEntry>(); try{ session = sessionFactory.openSession(); Criteria c = this.createCriteriaFromService(filter, session); tmpRegistryEntryList = c.list(); } catch(Exception ex){ log.error("Exception in findServices: " + ex.getMessage()); throw new ServiceRetrieveException(ex); } finally{ if(session!= null) session.close(); } return createListService(tmpRegistryEntryList); } }
ServiceRegistry implements IServiceRegistry { @Override public List<Service> findServices(Service filter) throws ServiceRetrieveException { Session session = null; List<RegistryEntry> tmpRegistryEntryList = new ArrayList<RegistryEntry>(); try{ session = sessionFactory.openSession(); Criteria c = this.createCriteriaFromService(filter, session); tmpRegistryEntryList = c.list(); } catch(Exception ex){ log.error("Exception in findServices: " + ex.getMessage()); throw new ServiceRetrieveException(ex); } finally{ if(session!= null) session.close(); } return createListService(tmpRegistryEntryList); } ServiceRegistry(); }
ServiceRegistry implements IServiceRegistry { @Override public List<Service> findServices(Service filter) throws ServiceRetrieveException { Session session = null; List<RegistryEntry> tmpRegistryEntryList = new ArrayList<RegistryEntry>(); try{ session = sessionFactory.openSession(); Criteria c = this.createCriteriaFromService(filter, session); tmpRegistryEntryList = c.list(); } catch(Exception ex){ log.error("Exception in findServices: " + ex.getMessage()); throw new ServiceRetrieveException(ex); } finally{ if(session!= null) session.close(); } return createListService(tmpRegistryEntryList); } 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 List<Service> findServices(Service filter) throws ServiceRetrieveException { Session session = null; List<RegistryEntry> tmpRegistryEntryList = new ArrayList<RegistryEntry>(); try{ session = sessionFactory.openSession(); Criteria c = this.createCriteriaFromService(filter, session); tmpRegistryEntryList = c.list(); } catch(Exception ex){ log.error("Exception in findServices: " + ex.getMessage()); throw new ServiceRetrieveException(ex); } finally{ if(session!= null) session.close(); } return createListService(tmpRegistryEntryList); } 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);  }