Changeset 536 for geisa/service
- Timestamp:
- 07/25/12 18:37:30 (12 years ago)
- Location:
- geisa/service
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
geisa/service/implementation/com/ether/GeisaServiceImpl.java
r533 r536 2 2 3 3 import com.ether.dao.IsotopeG03DAO; 4 import com.ether.dao.IsotopeG09DAO; 5 import com.ether.dao.IsotopeIasiG03DAO; 6 import com.ether.dao.IsotopeIasiG09DAO; 4 7 import org.apache.commons.logging.Log; 5 8 import org.apache.commons.logging.LogFactory; … … 9 12 10 13 import java.util.List; 14 import java.util.Set; 11 15 12 16 /** … … 34 38 @NotNull 35 39 @Transactional(readOnly = true) 36 public List<IsotopeG03> getTransitionsByIsotopeG03Name( final String isotopeName)40 public List<IsotopeG03> getTransitionsByIsotopeG03Name( final List<String> isotopeNameArray, final Float spectralRangeLower, final Float spectralRangeUpper) 37 41 throws ServiceException 38 42 { 39 43 try 40 44 { 41 return _isotopeG03DAO.getTransitionsByIsotopeG03Name(isotopeName); 45 return _isotopeG03DAO.getTransitionsByIsotopeG03Name( isotopeNameArray, spectralRangeLower, spectralRangeUpper ); 46 } 47 catch( PersistenceException e ) 48 { 49 throw new ServiceException( ServiceException.ServiceCode.ISOTOPE_NOT_FOUND, e ); 50 } 51 } 52 53 @NotNull 54 @Transactional(readOnly = true) 55 public List<Pair> getTransitionsLU( final List<String> isotopeNameArray, final Float spectralRangeLower, final Float spectralRangeUpper ) 56 throws ServiceException 57 { 58 try 59 { 60 return _isotopeG03DAO.getTransitionsLU( isotopeNameArray, spectralRangeLower, spectralRangeUpper ); 61 } 62 catch( PersistenceException e ) 63 { 64 throw new ServiceException( ServiceException.ServiceCode.ISOTOPE_NOT_FOUND, e ); 65 } 66 } 67 68 @NotNull 69 @Transactional(readOnly = true) 70 public List<IsotopeG03> getTransitionsByIsotopeG03NameByTransitionLower( final String isotopeName, final Float spectralRangeLower, final Float spectralRangeUpper, final String transitionLower) 71 throws ServiceException 72 { 73 try 74 { 75 return _isotopeG03DAO.getTransitionsByIsotopeG03NameByTransitionLower( isotopeName, spectralRangeLower, spectralRangeUpper, transitionLower ); 76 } 77 catch( PersistenceException e ) 78 { 79 throw new ServiceException( ServiceException.ServiceCode.ISOTOPE_NOT_FOUND, e ); 80 } 81 } 82 83 @NotNull 84 @Transactional(readOnly = true) 85 public Set<String> getTransitionsLower( final Object geisaSelectedDatabase, final List<String> isotopesSelectedNameList, final Float spectralRangeLower, final Float spectralRangeUpper ) 86 throws ServiceException 87 { 88 try 89 { 90 if(geisaSelectedDatabase.equals( IsotopeG03.class.toString() )) 91 return _isotopeG03DAO.getTransitionsLower( isotopesSelectedNameList, spectralRangeLower, spectralRangeUpper ); 92 else if(geisaSelectedDatabase.equals( IsotopeG09.class.toString() )) 93 return _isotopeG09DAO.getTransitionsLower( isotopesSelectedNameList, spectralRangeLower, spectralRangeUpper ); 94 else if(geisaSelectedDatabase.equals( IsotopeIasiG03.class.toString() )) 95 return _isotopeIasiG03DAO.getTransitionsLower( isotopesSelectedNameList, spectralRangeLower, spectralRangeUpper ); 96 else 97 return _isotopeIasiG09DAO.getTransitionsLower( isotopesSelectedNameList, spectralRangeLower, spectralRangeUpper ); 98 99 100 101 } 102 catch( PersistenceException e ) 103 { 104 throw new ServiceException( ServiceException.ServiceCode.ISOTOPE_NOT_FOUND, e ); 105 } 106 } 107 108 @NotNull 109 @Transactional(readOnly = true) 110 public Set<String> getTransitionsUpper( final Object geisaSelectedDatabase, final List<String> isotopesSelectedNameList, final Float spectralRangeLower, final Float spectralRangeUpper ) 111 throws ServiceException 112 { 113 try 114 { 115 if(geisaSelectedDatabase.equals( IsotopeG03.class.toString() )) 116 return _isotopeG03DAO.getTransitionsUpper( isotopesSelectedNameList, spectralRangeLower, spectralRangeUpper ); 117 else if(geisaSelectedDatabase.equals( IsotopeG09.class.toString() )) 118 return _isotopeG09DAO.getTransitionsUpper( isotopesSelectedNameList, spectralRangeLower, spectralRangeUpper ); 119 else if(geisaSelectedDatabase.equals( IsotopeIasiG03.class.toString() )) 120 return _isotopeIasiG03DAO.getTransitionsUpper( isotopesSelectedNameList, spectralRangeLower, spectralRangeUpper ); 121 else 122 return _isotopeIasiG09DAO.getTransitionsUpper( isotopesSelectedNameList, spectralRangeLower, spectralRangeUpper ); 42 123 } 43 124 catch( PersistenceException e ) … … 53 134 } 54 135 136 @Required 137 public void setIsotopeG09DAO( final IsotopeG09DAO isotopeG09DAO ) 138 { 139 _isotopeG09DAO = isotopeG09DAO; 140 } 141 142 @Required 143 public void setIsotopeIasiG03DAO( final IsotopeIasiG03DAO isotopeIasiG03DAO ) 144 { 145 _isotopeIasiG03DAO = isotopeIasiG03DAO; 146 } 147 148 @Required 149 public void setIsotopeIasiG09DAO( final IsotopeIasiG09DAO isotopeIasiG09DAO ) 150 { 151 _isotopeIasiG09DAO = isotopeIasiG09DAO; 152 } 153 55 154 private static final Log LOGGER = LogFactory.getLog( GeisaServiceImpl.class ); 56 155 57 156 private IsotopeG03DAO _isotopeG03DAO; 58 157 private IsotopeG09DAO _isotopeG09DAO; 158 private IsotopeIasiG03DAO _isotopeIasiG03DAO; 159 private IsotopeIasiG09DAO _isotopeIasiG09DAO; 59 160 } -
geisa/service/interface/com/ether/GeisaService.java
r533 r536 6 6 7 7 import java.util.List; 8 import java.util.Set; 8 9 9 10 /** … … 14 15 extends Service 15 16 { 16 17 @NotNull 17 18 List<IsotopeG03> getAllIsotopeG03() throws ServiceException; 18 19 19 20 @NotNull 20 List<IsotopeG03> getTransitionsByIsotopeG03Name( final String isotopeName) throws ServiceException;21 List<IsotopeG03> getTransitionsByIsotopeG03Name( final List<String> isotopeNameArray, final Float spectralRangeLower, final Float spectralRangeUpper ) throws ServiceException; 21 22 23 @NotNull 24 List<Pair> getTransitionsLU( final List<String> isotopeNameArray, final Float spectralRangeLower, final Float spectralRangeUpper ) throws ServiceException; 25 26 @NotNull 27 List<IsotopeG03> getTransitionsByIsotopeG03NameByTransitionLower( final String isotopeName, final Float spectralRangeLower, final Float spectralRangeUpper, final String transitionLower ) throws ServiceException; 28 29 @NotNull 30 Set<String> getTransitionsLower( final Object geisaSelectedDatabase, final List<String> isotopesSelectedNameList, final Float spectralRangeLower, final Float spectralRangeUpper ) 31 throws ServiceException; 32 33 @NotNull 34 Set<String> getTransitionsUpper( final Object geisaSelectedDatabase, final List<String> isotopesSelectedNameList,final Float spectralRangeLower,final Float spectralRangeUpper ) 35 throws ServiceException; 22 36 }
Note: See TracChangeset
for help on using the changeset viewer.