Coverage Report - org.kuali.student.core.atp.service.impl.AtpServiceImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
AtpServiceImpl
55%
81/146
42%
6/14
1.4
 
 1  
 /**
 2  
  * Copyright 2010 The Kuali Foundation Licensed under the
 3  
  * Educational Community License, Version 2.0 (the "License"); you may
 4  
  * not use this file except in compliance with the License. You may
 5  
  * obtain a copy of the License at
 6  
  *
 7  
  * http://www.osedu.org/licenses/ECL-2.0
 8  
  *
 9  
  * Unless required by applicable law or agreed to in writing,
 10  
  * software distributed under the License is distributed on an "AS IS"
 11  
  * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 12  
  * or implied. See the License for the specific language governing
 13  
  * permissions and limitations under the License.
 14  
  */
 15  
 
 16  
 package org.kuali.student.core.atp.service.impl;
 17  
 
 18  
 import java.util.Date;
 19  
 import java.util.List;
 20  
 
 21  
 import javax.jws.WebService;
 22  
 
 23  
 import org.kuali.student.core.atp.dao.AtpDao;
 24  
 import org.kuali.student.core.atp.dto.AtpDurationTypeInfo;
 25  
 import org.kuali.student.core.atp.dto.AtpInfo;
 26  
 import org.kuali.student.core.atp.dto.AtpSeasonalTypeInfo;
 27  
 import org.kuali.student.core.atp.dto.AtpTypeInfo;
 28  
 import org.kuali.student.core.atp.dto.DateRangeInfo;
 29  
 import org.kuali.student.core.atp.dto.DateRangeTypeInfo;
 30  
 import org.kuali.student.core.atp.dto.MilestoneInfo;
 31  
 import org.kuali.student.core.atp.dto.MilestoneTypeInfo;
 32  
 import org.kuali.student.core.atp.entity.Atp;
 33  
 import org.kuali.student.core.atp.entity.AtpDurationType;
 34  
 import org.kuali.student.core.atp.entity.AtpSeasonalType;
 35  
 import org.kuali.student.core.atp.entity.AtpType;
 36  
 import org.kuali.student.core.atp.entity.DateRange;
 37  
 import org.kuali.student.core.atp.entity.DateRangeType;
 38  
 import org.kuali.student.core.atp.entity.Milestone;
 39  
 import org.kuali.student.core.atp.entity.MilestoneType;
 40  
 import org.kuali.student.core.atp.service.AtpService;
 41  
 import org.kuali.student.core.dto.StatusInfo;
 42  
 import org.kuali.student.core.exceptions.AlreadyExistsException;
 43  
 import org.kuali.student.core.exceptions.DataValidationErrorException;
 44  
 import org.kuali.student.core.exceptions.DoesNotExistException;
 45  
 import org.kuali.student.core.exceptions.InvalidParameterException;
 46  
 import org.kuali.student.core.exceptions.MissingParameterException;
 47  
 import org.kuali.student.core.exceptions.OperationFailedException;
 48  
 import org.kuali.student.core.exceptions.PermissionDeniedException;
 49  
 import org.kuali.student.core.exceptions.VersionMismatchException;
 50  
 import org.kuali.student.core.search.dto.SearchCriteriaTypeInfo;
 51  
 import org.kuali.student.core.search.dto.SearchRequest;
 52  
 import org.kuali.student.core.search.dto.SearchResult;
 53  
 import org.kuali.student.core.search.dto.SearchResultTypeInfo;
 54  
 import org.kuali.student.core.search.dto.SearchTypeInfo;
 55  
 import org.kuali.student.core.search.service.SearchManager;
 56  
 import org.kuali.student.core.validation.dto.ValidationResultInfo;
 57  
 import org.springframework.transaction.annotation.Transactional;
 58  
 
 59  
 @WebService(endpointInterface = "org.kuali.student.core.atp.service.AtpService", serviceName = "AtpService", portName = "AtpService", targetNamespace = "http://student.kuali.org/wsdl/atp")
 60  
 @Transactional(readOnly=true,noRollbackFor={DoesNotExistException.class},rollbackFor={Throwable.class})
 61  2
 public class AtpServiceImpl implements AtpService {
 62  
 
 63  
         private AtpDao atpDao;
 64  
     private SearchManager searchManager;
 65  
 
 66  
         @Override
 67  
         @Transactional(readOnly=false)
 68  
         public DateRangeInfo addDateRange(String atpKey, String dateRangeKey,
 69  
                         DateRangeInfo dateRangeInfo) throws AlreadyExistsException,
 70  
                         DataValidationErrorException, InvalidParameterException,
 71  
                         MissingParameterException, OperationFailedException,
 72  
                         PermissionDeniedException {
 73  
 
 74  1
                 CheckMissingParameters(new String[]{"atpKey","dateRangeKey","dateRangeInfo"},
 75  
                                                new Object[]{ atpKey,  dateRangeKey,  dateRangeInfo});
 76  
                 
 77  
 
 78  1
                 dateRangeInfo.setAtpId(atpKey);
 79  1
                 dateRangeInfo.setId(dateRangeKey);
 80  1
                 DateRange dateRange = null;
 81  
                 
 82  
                 try {
 83  1
                         dateRange = AtpAssembler.toDateRange(false, dateRangeInfo,atpDao);
 84  0
                 } catch (DoesNotExistException e) {
 85  0
                 } catch (VersionMismatchException e) {
 86  1
                 }
 87  
                 
 88  1
                 atpDao.create(dateRange);
 89  
                 
 90  1
                 return AtpAssembler.toDateRangeInfo(dateRange);
 91  
         }
 92  
 
 93  
         private void CheckMissingParameters(String[] paramNames, Object[] params) throws MissingParameterException {
 94  9
                 String errors = null;
 95  9
                 int i = 0;
 96  30
                 for(Object param:params){
 97  21
                         if(param==null){
 98  0
                                 errors = errors==null?paramNames[i]:errors+", " + paramNames[i];
 99  
                         }
 100  21
                         i++;
 101  
                 }
 102  9
                 if(errors!=null){
 103  0
                         throw new MissingParameterException("Missing Parameters: " + errors);
 104  
                 }
 105  9
         }
 106  
 
 107  
         @Override
 108  
         @Transactional(readOnly=false)
 109  
         public MilestoneInfo addMilestone(String atpKey, String milestoneKey,
 110  
                         MilestoneInfo milestoneInfo) throws AlreadyExistsException,
 111  
                         DataValidationErrorException, InvalidParameterException,
 112  
                         MissingParameterException, OperationFailedException,
 113  
                         PermissionDeniedException {
 114  
                 
 115  1
                 CheckMissingParameters(new String[]{"atpKey","milestoneKey","milestoneInfo"},
 116  
                                                   new Object[]{ atpKey,  milestoneKey,  milestoneInfo});
 117  
 
 118  
 
 119  1
                 milestoneInfo.setAtpId(atpKey);
 120  1
                 milestoneInfo.setId(milestoneKey);
 121  1
                 Milestone milestone = null;
 122  
                 try {
 123  1
                         milestone = AtpAssembler.toMilestone(false, milestoneInfo,atpDao);
 124  0
                 } catch (DoesNotExistException e) {
 125  0
                 } catch (VersionMismatchException e) {
 126  1
                 }
 127  
                 
 128  1
                 atpDao.create(milestone);
 129  
                 
 130  1
                 return AtpAssembler.toMilestoneInfo(milestone);
 131  
         }
 132  
 
 133  
         @Override
 134  
         @Transactional(readOnly=false)
 135  
         public AtpInfo createAtp(String atpTypeKey, String atpKey, AtpInfo atpInfo)
 136  
                         throws AlreadyExistsException, DataValidationErrorException,
 137  
                         InvalidParameterException, MissingParameterException,
 138  
                         OperationFailedException, PermissionDeniedException {
 139  
 
 140  1
                 CheckMissingParameters(new String[]{"atpTypeKey","atpKey","atpInfo"},
 141  
                                    new Object[]{ atpTypeKey,  atpKey,  atpInfo});
 142  
 
 143  1
                 atpInfo.setType(atpTypeKey);
 144  1
                 atpInfo.setId(atpKey);
 145  
                 
 146  1
                 Atp atp = null;
 147  
                 try {
 148  1
                         atp = AtpAssembler.toAtp(false, atpInfo, atpDao);
 149  0
                 } catch (DoesNotExistException e) {
 150  0
                 } catch (VersionMismatchException e) {
 151  1
                 }
 152  
                 
 153  1
                 atpDao.create(atp);
 154  
                 
 155  1
                 AtpInfo result = AtpAssembler.toAtpInfo(atp);
 156  1
                 return result;
 157  
         }
 158  
 
 159  
         @Override
 160  
         @Transactional(readOnly=false)
 161  
         public StatusInfo deleteAtp(String atpKey) throws DoesNotExistException,
 162  
                         InvalidParameterException, MissingParameterException,
 163  
                         OperationFailedException, PermissionDeniedException {
 164  
                 
 165  1
                 atpDao.delete(Atp.class,atpKey);
 166  
                 
 167  1
                 StatusInfo statusInfo = new StatusInfo();
 168  1
                 statusInfo.setSuccess(true);
 169  
                 
 170  1
                 return statusInfo;
 171  
         }
 172  
 
 173  
         @Override
 174  
         public AtpInfo getAtp(String atpKey) throws DoesNotExistException,
 175  
                         InvalidParameterException, MissingParameterException,
 176  
                         OperationFailedException {
 177  
                 
 178  0
                 Atp atp = atpDao.fetch(Atp.class, atpKey);
 179  
                 
 180  0
                 return AtpAssembler.toAtpInfo(atp);
 181  
         }
 182  
 
 183  
         @Override
 184  
         public AtpDurationTypeInfo getAtpDurationType(String atpDurationTypeKey)
 185  
                         throws DoesNotExistException, InvalidParameterException,
 186  
                         MissingParameterException, OperationFailedException {
 187  
                 
 188  0
                 AtpDurationType atpDurationType = atpDao.fetch(AtpDurationType.class, atpDurationTypeKey);
 189  
                 
 190  0
                 return AtpAssembler.toGenericTypeInfo(AtpDurationTypeInfo.class, atpDurationType);
 191  
         }
 192  
 
 193  
         @Override
 194  
         public AtpSeasonalTypeInfo getAtpSeasonalType(String atpSeasonalTypeKey)
 195  
                         throws DoesNotExistException, InvalidParameterException,
 196  
                         MissingParameterException, OperationFailedException {
 197  
                 
 198  0
                 AtpSeasonalType atpSeasonalType = atpDao.fetch(AtpSeasonalType.class, atpSeasonalTypeKey);
 199  
                 
 200  0
                 return AtpAssembler.toGenericTypeInfo(AtpSeasonalTypeInfo.class, atpSeasonalType);
 201  
         }
 202  
 
 203  
         @Override
 204  
         public AtpTypeInfo getAtpType(String atpTypeKey)
 205  
                         throws DoesNotExistException, InvalidParameterException,
 206  
                         MissingParameterException, OperationFailedException {
 207  
                 
 208  0
                 AtpType atpType = atpDao.fetch(AtpType.class, atpTypeKey);
 209  
                 
 210  0
                 return AtpAssembler.toAtpTypeInfo(atpType);
 211  
         }
 212  
 
 213  
         @Override
 214  
         public DateRangeInfo getDateRange(String dateRangeKey)
 215  
                         throws DoesNotExistException, InvalidParameterException,
 216  
                         MissingParameterException, OperationFailedException {
 217  
                 
 218  0
                 DateRange dateRange = atpDao.fetch(DateRange.class, dateRangeKey);
 219  
                 
 220  0
                 return AtpAssembler.toDateRangeInfo(dateRange);
 221  
 
 222  
         }
 223  
 
 224  
         @Override
 225  
         public DateRangeTypeInfo getDateRangeType(String dateRangeTypeKey)
 226  
                         throws DoesNotExistException, InvalidParameterException,
 227  
                         MissingParameterException, OperationFailedException {
 228  
                 
 229  0
                 DateRangeType dateRangeType = atpDao.fetch(DateRangeType.class, dateRangeTypeKey);
 230  
                 
 231  0
                 return AtpAssembler.toGenericTypeInfo(DateRangeTypeInfo.class, dateRangeType);
 232  
         }
 233  
 
 234  
         @Override
 235  
         public MilestoneInfo getMilestone(String milestoneKey)
 236  
                         throws DoesNotExistException, InvalidParameterException,
 237  
                         MissingParameterException, OperationFailedException {
 238  
                 
 239  0
                 Milestone milestone = atpDao.fetch(Milestone.class, milestoneKey);
 240  
                 
 241  0
                 return AtpAssembler.toMilestoneInfo(milestone);
 242  
 
 243  
         }
 244  
 
 245  
         @Override
 246  
         public MilestoneTypeInfo getMilestoneType(String milestoneTypeKey)
 247  
                         throws DoesNotExistException, InvalidParameterException,
 248  
                         MissingParameterException, OperationFailedException {
 249  
                 
 250  0
                 MilestoneType milestoneType = atpDao.fetch(MilestoneType.class, milestoneTypeKey);
 251  
                 
 252  0
                 return AtpAssembler.toGenericTypeInfo(MilestoneTypeInfo.class, milestoneType);
 253  
         }
 254  
 
 255  
         @Override
 256  
         public List<AtpDurationTypeInfo> getAtpDurationTypes()
 257  
                         throws OperationFailedException {
 258  
                 
 259  0
                 List<AtpDurationType> atpDurationTypes = atpDao.find(AtpDurationType.class);
 260  
                 
 261  0
                 return AtpAssembler.toGenericTypeInfoList(AtpDurationTypeInfo.class, atpDurationTypes);
 262  
         }
 263  
 
 264  
         @Override
 265  
         public List<AtpSeasonalTypeInfo> getAtpSeasonalTypes()
 266  
                         throws OperationFailedException {
 267  
                 
 268  0
                 List<AtpSeasonalType> atpSeasonalTypes = atpDao.find(AtpSeasonalType.class);
 269  
                 
 270  0
                 return AtpAssembler.toGenericTypeInfoList(AtpSeasonalTypeInfo.class, atpSeasonalTypes);
 271  
         }
 272  
 
 273  
         @Override
 274  
         public List<AtpTypeInfo> getAtpTypes() throws OperationFailedException {
 275  
                 
 276  1
                 List<AtpType> atpTypes = atpDao.find(AtpType.class);
 277  
                 
 278  1
                 return AtpAssembler.toAtpTypeInfoList(atpTypes);
 279  
         }
 280  
 
 281  
         @Override
 282  
         public List<AtpInfo> getAtpsByAtpType(String atpTypeKey)
 283  
                         throws InvalidParameterException, MissingParameterException,
 284  
                         OperationFailedException {
 285  
                 
 286  1
                 List<Atp> atps = atpDao.findAtpsByAtpType(atpTypeKey);
 287  
                 
 288  1
                 return AtpAssembler.toAtpInfoList(atps);
 289  
         }
 290  
 
 291  
         @Override
 292  
         public List<AtpInfo> getAtpsByDate(Date searchDate)
 293  
                         throws InvalidParameterException, MissingParameterException,
 294  
                         OperationFailedException {
 295  
 
 296  1
                 List<Atp> atps = atpDao.findAtpsByDate(searchDate);
 297  
                 
 298  1
                 return AtpAssembler.toAtpInfoList(atps);
 299  
         }
 300  
 
 301  
         @Override
 302  
         public List<AtpInfo> getAtpsByDates(Date startDate, Date endDate)
 303  
                         throws InvalidParameterException, MissingParameterException,
 304  
                         OperationFailedException {
 305  
 
 306  1
                 List<Atp> atps = atpDao.findAtpsByDates(startDate, endDate);
 307  
                 
 308  1
                 return AtpAssembler.toAtpInfoList(atps);
 309  
         }
 310  
 
 311  
         @Override
 312  
         public List<DateRangeTypeInfo> getDateRangeTypes()
 313  
                         throws OperationFailedException {
 314  
                 
 315  0
                 List<DateRangeType> dateRangeTypes = atpDao.find(DateRangeType.class);
 316  
                 
 317  0
                 return AtpAssembler.toGenericTypeInfoList(DateRangeTypeInfo.class, dateRangeTypes);
 318  
         }
 319  
 
 320  
         @Override
 321  
         public List<DateRangeTypeInfo> getDateRangeTypesForAtpType(
 322  
                         String atpTypeKey) throws DoesNotExistException,
 323  
                         InvalidParameterException, MissingParameterException,
 324  
                         OperationFailedException {
 325  
                 
 326  1
                 List<DateRangeType> dateRangeTypes = atpDao.findDateRangeTypesForAtpType(atpTypeKey);
 327  
                 
 328  1
                 return AtpAssembler.toGenericTypeInfoList(DateRangeTypeInfo.class, dateRangeTypes);
 329  
         }
 330  
 
 331  
         @Override
 332  
         public List<DateRangeInfo> getDateRangesByAtp(String atpKey)
 333  
                         throws InvalidParameterException, MissingParameterException,
 334  
                         OperationFailedException {
 335  
                 
 336  1
                 List<DateRange> dateRanges = atpDao.findDateRangesByAtp(atpKey);
 337  
                 
 338  1
                 return AtpAssembler.toDateRangeInfoList(dateRanges);
 339  
         }
 340  
 
 341  
         @Override
 342  
         public List<DateRangeInfo> getDateRangesByDate(Date searchDate)
 343  
                         throws InvalidParameterException, MissingParameterException,
 344  
                         OperationFailedException {
 345  
                 
 346  1
                 List<DateRange> dateRanges = atpDao.findDateRangesByDate(searchDate);
 347  
                 
 348  1
                 return AtpAssembler.toDateRangeInfoList(dateRanges);
 349  
         }
 350  
 
 351  
         @Override
 352  
         public List<MilestoneTypeInfo> getMilestoneTypes()
 353  
                         throws OperationFailedException {
 354  
                 
 355  0
                 List<MilestoneType> milestoneTypes = atpDao.find(MilestoneType.class);
 356  
                 
 357  0
                 return AtpAssembler.toGenericTypeInfoList(MilestoneTypeInfo.class, milestoneTypes);
 358  
         }
 359  
 
 360  
         @Override
 361  
         public List<MilestoneTypeInfo> getMilestoneTypesForAtpType(
 362  
                         String atpTypeKey) throws DoesNotExistException,
 363  
                         InvalidParameterException, MissingParameterException,
 364  
                         OperationFailedException {
 365  
                 
 366  1
                 List<MilestoneType> milestoneTypes = atpDao.findMilestoneTypesForAtpType(atpTypeKey);
 367  
                 
 368  1
                 return AtpAssembler.toGenericTypeInfoList(MilestoneTypeInfo.class, milestoneTypes);
 369  
         }
 370  
 
 371  
         @Override
 372  
         public List<MilestoneInfo> getMilestonesByAtp(String atpKey)
 373  
                         throws InvalidParameterException, MissingParameterException,
 374  
                         OperationFailedException {
 375  
                 
 376  1
                 List<Milestone> milestones = atpDao.findMilestonesByAtp(atpKey);
 377  
                 
 378  1
                 return AtpAssembler.toMilestoneInfoList(milestones);
 379  
         }
 380  
 
 381  
         @Override
 382  
         public List<MilestoneInfo> getMilestonesByDates(Date startDate,
 383  
                         Date endDate) throws InvalidParameterException,
 384  
                         MissingParameterException, OperationFailedException {
 385  
                 
 386  1
                 List<Milestone> milestones = atpDao.findMilestonesByDates(startDate, endDate);
 387  
                 
 388  1
                 return AtpAssembler.toMilestoneInfoList(milestones);
 389  
         }
 390  
 
 391  
         @Override
 392  
         public List<MilestoneInfo> getMilestonesByDatesAndType(
 393  
                         String milestoneTypeKey, Date startDate, Date endDate)
 394  
                         throws InvalidParameterException, MissingParameterException,
 395  
                         OperationFailedException {
 396  
                 
 397  1
                 List<Milestone> milestones = atpDao.findMilestonesByDatesAndType(milestoneTypeKey, startDate, endDate);
 398  
                 
 399  1
                 return AtpAssembler.toMilestoneInfoList(milestones);
 400  
         }
 401  
 
 402  
         @Override
 403  
         @Transactional(readOnly=false)
 404  
         public StatusInfo removeDateRange(String dateRangeKey)
 405  
                         throws DoesNotExistException, InvalidParameterException,
 406  
                         MissingParameterException, OperationFailedException,
 407  
                         PermissionDeniedException {
 408  
                 
 409  0
                 atpDao.delete(DateRange.class, dateRangeKey);
 410  
                 
 411  0
                 StatusInfo statusInfo = new StatusInfo();
 412  0
                 statusInfo.setSuccess(true);
 413  
                 
 414  0
                 return statusInfo;
 415  
         }
 416  
 
 417  
         @Override
 418  
         @Transactional(readOnly=false)
 419  
         public StatusInfo removeMilestone(String milestoneKey)
 420  
                         throws DoesNotExistException, InvalidParameterException,
 421  
                         MissingParameterException, OperationFailedException,
 422  
                         PermissionDeniedException {
 423  
 
 424  0
                 atpDao.delete(Milestone.class, milestoneKey);
 425  
                 
 426  0
                 StatusInfo statusInfo = new StatusInfo();
 427  0
                 statusInfo.setSuccess(true);
 428  
                 
 429  0
                 return statusInfo;
 430  
         }
 431  
 
 432  
         @Override
 433  
         @Transactional(readOnly=false)
 434  
         public AtpInfo updateAtp(String atpKey, AtpInfo atpInfo)
 435  
                         throws DataValidationErrorException, DoesNotExistException,
 436  
                         InvalidParameterException, MissingParameterException,
 437  
                         OperationFailedException, PermissionDeniedException,
 438  
                         VersionMismatchException {
 439  
                 
 440  2
                 CheckMissingParameters(new String[]{"atpKey","atpInfo"},
 441  
                                new Object[]{ atpKey,  atpInfo});
 442  
 
 443  2
                 atpInfo.setId(atpKey);
 444  
                 
 445  2
                 Atp atp = AtpAssembler.toAtp(true, atpInfo, atpDao);
 446  1
                 if(atp==null){
 447  0
                         throw new DoesNotExistException("Atp does not exist for key: " + atpKey);
 448  
                 }
 449  
                 
 450  1
                 Atp updatedAtp = atpDao.update(atp);
 451  
                 
 452  1
                 AtpInfo result = AtpAssembler.toAtpInfo(updatedAtp);
 453  1
                 return result;
 454  
         }
 455  
 
 456  
         @Override
 457  
         @Transactional(readOnly=false)
 458  
         public DateRangeInfo updateDateRange(String dateRangeKey,
 459  
                         DateRangeInfo dateRangeInfo) throws DataValidationErrorException,
 460  
                         DoesNotExistException, InvalidParameterException,
 461  
                         MissingParameterException, OperationFailedException,
 462  
                         PermissionDeniedException, VersionMismatchException {
 463  
                 
 464  2
                 CheckMissingParameters(new String[]{"dateRangeKey","dateRangeInfo"},
 465  
                                new Object[]{ dateRangeKey,  dateRangeInfo});
 466  
                 
 467  2
                 dateRangeInfo.setId(dateRangeKey);
 468  
                 
 469  2
                 DateRange dateRange = AtpAssembler.toDateRange(true, dateRangeInfo, atpDao);
 470  
                 
 471  1
                 DateRange updatedDateRange = atpDao.update(dateRange);
 472  
                 
 473  1
                 DateRangeInfo result = AtpAssembler.toDateRangeInfo(updatedDateRange);
 474  1
                 return result;
 475  
         }
 476  
 
 477  
         @Override
 478  
         @Transactional(readOnly=false)
 479  
         public MilestoneInfo updateMilestone(String milestoneKey,
 480  
                         MilestoneInfo milestoneInfo) throws DataValidationErrorException,
 481  
                         DoesNotExistException, InvalidParameterException,
 482  
                         MissingParameterException, OperationFailedException,
 483  
                         PermissionDeniedException, VersionMismatchException {
 484  
                 
 485  2
                 CheckMissingParameters(new String[]{"milestoneKey","milestoneInfo"},
 486  
                                new Object[]{ milestoneKey,  milestoneInfo});
 487  
                 
 488  
 
 489  
                 
 490  2
                 milestoneInfo.setId(milestoneKey);
 491  
                 
 492  2
                 Milestone milestone = AtpAssembler.toMilestone(true, milestoneInfo, atpDao);
 493  1
                 if(milestone==null){
 494  0
                         throw new DoesNotExistException("Milestone does not exist for key: " + milestoneKey);
 495  
                 }
 496  
                 
 497  1
                 Milestone updatedMilestone = atpDao.update(milestone);
 498  
                 
 499  1
                 MilestoneInfo result = AtpAssembler.toMilestoneInfo(updatedMilestone);
 500  1
                 return result;
 501  
         }
 502  
 
 503  
         @Override
 504  
         public List<ValidationResultInfo> validateAtp(String validationType,
 505  
                         AtpInfo atpInfo) throws DoesNotExistException,
 506  
                         InvalidParameterException, MissingParameterException,
 507  
                         OperationFailedException {
 508  0
                 throw new UnsupportedOperationException("validateAtp");
 509  
         }
 510  
 
 511  
         @Override
 512  
         public List<ValidationResultInfo> validateDateRange(String validationType,
 513  
                         DateRangeInfo dateRangeInfo) throws DoesNotExistException,
 514  
                         InvalidParameterException, MissingParameterException,
 515  
                         OperationFailedException {
 516  0
                 throw new UnsupportedOperationException("validateDateRange");
 517  
         }
 518  
 
 519  
         @Override
 520  
         public List<ValidationResultInfo> validateMilestone(String validationType,
 521  
                         MilestoneInfo milestoneInfo) throws DoesNotExistException,
 522  
                         InvalidParameterException, MissingParameterException,
 523  
                         OperationFailedException {
 524  0
                 throw new UnsupportedOperationException("validateMilestone");
 525  
         }
 526  
 
 527  
         /**
 528  
          * Check for missing parameter and thow localized exception if missing
 529  
          *
 530  
          * @param param
 531  
          * @param parameter name
 532  
          * @throws MissingParameterException
 533  
          */
 534  
         private void checkForMissingParameter(Object param, String paramName)
 535  
                         throws MissingParameterException {
 536  0
                 if (param == null) {
 537  0
                         throw new MissingParameterException(paramName + " can not be null");
 538  
                 }
 539  0
         }
 540  
 
 541  
         public AtpDao getAtpDao() {
 542  0
                 return atpDao;
 543  
         }
 544  
 
 545  
         public void setAtpDao(AtpDao atpDao) {
 546  1
                 this.atpDao = atpDao;
 547  1
         }
 548  
 
 549  
         public SearchManager getSearchManager() {
 550  0
                 return searchManager;
 551  
         }
 552  
 
 553  
         public void setSearchManager(SearchManager searchManager) {
 554  0
                 this.searchManager = searchManager;
 555  0
         }
 556  
 
 557  
         @Override
 558  
         public SearchCriteriaTypeInfo getSearchCriteriaType(
 559  
                         String searchCriteriaTypeKey) throws DoesNotExistException,
 560  
                         InvalidParameterException, MissingParameterException,
 561  
                         OperationFailedException {
 562  
 
 563  0
                 return searchManager.getSearchCriteriaType(searchCriteriaTypeKey);
 564  
         }
 565  
 
 566  
         @Override
 567  
         public List<SearchCriteriaTypeInfo> getSearchCriteriaTypes()
 568  
                         throws OperationFailedException {
 569  0
                 return searchManager.getSearchCriteriaTypes();
 570  
         }
 571  
 
 572  
         @Override
 573  
         public SearchResultTypeInfo getSearchResultType(String searchResultTypeKey)
 574  
                         throws DoesNotExistException, InvalidParameterException,
 575  
                         MissingParameterException, OperationFailedException {
 576  0
                 checkForMissingParameter(searchResultTypeKey, "searchResultTypeKey");
 577  0
                 return searchManager.getSearchResultType(searchResultTypeKey);
 578  
         }
 579  
 
 580  
         @Override
 581  
         public List<SearchResultTypeInfo> getSearchResultTypes()
 582  
                         throws OperationFailedException {
 583  0
                 return searchManager.getSearchResultTypes();
 584  
         }
 585  
 
 586  
         @Override
 587  
         public SearchTypeInfo getSearchType(String searchTypeKey)
 588  
                         throws DoesNotExistException, InvalidParameterException,
 589  
                         MissingParameterException, OperationFailedException {
 590  0
                 checkForMissingParameter(searchTypeKey, "searchTypeKey");
 591  0
                 return searchManager.getSearchType(searchTypeKey);
 592  
         }
 593  
 
 594  
         @Override
 595  
         public List<SearchTypeInfo> getSearchTypes()
 596  
                         throws OperationFailedException {
 597  0
                 return searchManager.getSearchTypes();
 598  
         }
 599  
 
 600  
         @Override
 601  
         public List<SearchTypeInfo> getSearchTypesByCriteria(
 602  
                         String searchCriteriaTypeKey) throws DoesNotExistException,
 603  
                         InvalidParameterException, MissingParameterException,
 604  
                         OperationFailedException {
 605  0
                 checkForMissingParameter(searchCriteriaTypeKey, "searchCriteriaTypeKey");
 606  0
                 return searchManager.getSearchTypesByCriteria(searchCriteriaTypeKey);
 607  
         }
 608  
 
 609  
         @Override
 610  
         public List<SearchTypeInfo> getSearchTypesByResult(
 611  
                         String searchResultTypeKey) throws DoesNotExistException,
 612  
                         InvalidParameterException, MissingParameterException,
 613  
                         OperationFailedException {
 614  0
                 checkForMissingParameter(searchResultTypeKey, "searchResultTypeKey");
 615  0
                 return searchManager.getSearchTypesByResult(searchResultTypeKey);
 616  
         }
 617  
 
 618  
         @Override
 619  
         public SearchResult search(SearchRequest searchRequest) throws MissingParameterException  {
 620  0
             return searchManager.search(searchRequest, atpDao);
 621  
         }
 622  
 
 623  
 }