@Test @Rollback(false) public void clearServiceCIS() throws CISNotFoundException{ serReg.clearServiceSharedCIS(_cisTestId); }
@Override public boolean clearServiceSharedCIS(String CISId) throws CISNotFoundException { Session session = null; Transaction t = null; try { session = sessionFactory.openSession(); List<ServiceSharedInCISDAO> tmpServiceSharedCIS = session .createCriteria(ServiceSharedInCISDAO.class) .add(Restrictions.eq("CISId", CISId)).list(); if (tmpServiceSharedCIS.size() == 0) { throw new CISNotFoundException("The CIS with id: " + CISId + " is not in the Registry."); } t = session.beginTransaction(); for (ServiceSharedInCISDAO serviceSharedInCISDAO : tmpServiceSharedCIS) { session.delete(serviceSharedInCISDAO); } t.commit(); } catch (CISNotFoundException ex) { log.error(ex.getMessage()); throw ex; } catch (Exception e) { if (t != null) { t.rollback(); } log.error(e.getMessage()); } finally { if (session != null ) { session.close(); } } return false; }
ServiceRegistry implements IServiceRegistry { @Override public boolean clearServiceSharedCIS(String CISId) throws CISNotFoundException { Session session = null; Transaction t = null; try { session = sessionFactory.openSession(); List<ServiceSharedInCISDAO> tmpServiceSharedCIS = session .createCriteria(ServiceSharedInCISDAO.class) .add(Restrictions.eq("CISId", CISId)).list(); if (tmpServiceSharedCIS.size() == 0) { throw new CISNotFoundException("The CIS with id: " + CISId + " is not in the Registry."); } t = session.beginTransaction(); for (ServiceSharedInCISDAO serviceSharedInCISDAO : tmpServiceSharedCIS) { session.delete(serviceSharedInCISDAO); } t.commit(); } catch (CISNotFoundException ex) { log.error(ex.getMessage()); throw ex; } catch (Exception e) { if (t != null) { t.rollback(); } log.error(e.getMessage()); } finally { if (session != null ) { session.close(); } } return false; } }
ServiceRegistry implements IServiceRegistry { @Override public boolean clearServiceSharedCIS(String CISId) throws CISNotFoundException { Session session = null; Transaction t = null; try { session = sessionFactory.openSession(); List<ServiceSharedInCISDAO> tmpServiceSharedCIS = session .createCriteria(ServiceSharedInCISDAO.class) .add(Restrictions.eq("CISId", CISId)).list(); if (tmpServiceSharedCIS.size() == 0) { throw new CISNotFoundException("The CIS with id: " + CISId + " is not in the Registry."); } t = session.beginTransaction(); for (ServiceSharedInCISDAO serviceSharedInCISDAO : tmpServiceSharedCIS) { session.delete(serviceSharedInCISDAO); } t.commit(); } catch (CISNotFoundException ex) { log.error(ex.getMessage()); throw ex; } catch (Exception e) { if (t != null) { t.rollback(); } log.error(e.getMessage()); } finally { if (session != null ) { session.close(); } } return false; } ServiceRegistry(); }
ServiceRegistry implements IServiceRegistry { @Override public boolean clearServiceSharedCIS(String CISId) throws CISNotFoundException { Session session = null; Transaction t = null; try { session = sessionFactory.openSession(); List<ServiceSharedInCISDAO> tmpServiceSharedCIS = session .createCriteria(ServiceSharedInCISDAO.class) .add(Restrictions.eq("CISId", CISId)).list(); if (tmpServiceSharedCIS.size() == 0) { throw new CISNotFoundException("The CIS with id: " + CISId + " is not in the Registry."); } t = session.beginTransaction(); for (ServiceSharedInCISDAO serviceSharedInCISDAO : tmpServiceSharedCIS) { session.delete(serviceSharedInCISDAO); } t.commit(); } catch (CISNotFoundException ex) { log.error(ex.getMessage()); throw ex; } catch (Exception e) { if (t != null) { t.rollback(); } log.error(e.getMessage()); } finally { if (session != null ) { session.close(); } } return false; } 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 boolean clearServiceSharedCIS(String CISId) throws CISNotFoundException { Session session = null; Transaction t = null; try { session = sessionFactory.openSession(); List<ServiceSharedInCISDAO> tmpServiceSharedCIS = session .createCriteria(ServiceSharedInCISDAO.class) .add(Restrictions.eq("CISId", CISId)).list(); if (tmpServiceSharedCIS.size() == 0) { throw new CISNotFoundException("The CIS with id: " + CISId + " is not in the Registry."); } t = session.beginTransaction(); for (ServiceSharedInCISDAO serviceSharedInCISDAO : tmpServiceSharedCIS) { session.delete(serviceSharedInCISDAO); } t.commit(); } catch (CISNotFoundException ex) { log.error(ex.getMessage()); throw ex; } catch (Exception e) { if (t != null) { t.rollback(); } log.error(e.getMessage()); } finally { if (session != null ) { session.close(); } } return false; } 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);  }