Coverage Report - org.kuali.student.enrollment.lpr.service.adapter.cleanup.LuiPersonRelationRuntimeExceptionCatcherAdapter
 
Classes in this File Line Coverage Branch Coverage Complexity
LuiPersonRelationRuntimeExceptionCatcherAdapter
0%
0/13
N/A
4
 
 1  
 /*
 2  
  * Copyright 2009 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 1.0 (the
 5  
  * "License"); you may not use this file except in compliance with the
 6  
  * License.  You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl1.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 13  
  * implied.  See the License for the specific language governing
 14  
  * permissions and limitations under the License.
 15  
  */
 16  
 package org.kuali.student.enrollment.lpr.service.adapter.cleanup;
 17  
 
 18  
 import org.kuali.student.common.exceptions.InvalidParameterException;
 19  
 import org.kuali.student.common.exceptions.VersionMismatchException;
 20  
 import org.kuali.student.common.exceptions.MissingParameterException;
 21  
 import org.kuali.student.common.exceptions.OperationFailedException;
 22  
 import org.kuali.student.common.exceptions.DataValidationErrorException;
 23  
 import org.kuali.student.common.exceptions.PermissionDeniedException;
 24  
 import org.kuali.student.common.exceptions.DisabledIdentifierException;
 25  
 import org.kuali.student.common.exceptions.AlreadyExistsException;
 26  
 import org.kuali.student.common.exceptions.DoesNotExistException;
 27  
 import org.kuali.student.common.exceptions.ReadOnlyException;
 28  
 import org.kuali.student.common.exceptions.*;
 29  
 
 30  
 import java.util.List;
 31  
 import org.kuali.student.common.dto.ContextInfo;
 32  
 import org.kuali.student.common.dto.StatusInfo;
 33  
 import org.kuali.student.enrollment.lpr.dto.LuiPersonRelationInfo;
 34  
 import org.kuali.student.enrollment.lpr.mock.LuiPersonRelationServiceAdapter;
 35  
 
 36  
 /**
 37  
  * A example of an adapter that might sit at the top of the stack and converts any
 38  
  * runtime exceptions into the formal OperationFailedException
 39  
  * <p/>
 40  
  * This could be genrated automatically from the contract definitions too.
 41  
  *
 42  
  * @Author Norm
 43  
  */
 44  0
 public class LuiPersonRelationRuntimeExceptionCatcherAdapter
 45  
         extends LuiPersonRelationServiceAdapter {
 46  
 
 47  
     @Override
 48  
     public String createLuiPersonRelation(String personId, String luiId,
 49  
                                           String luiPersonRelationType,
 50  
                                           LuiPersonRelationInfo luiPersonRelationInfo,
 51  
                                           ContextInfo context)
 52  
             throws DataValidationErrorException, 
 53  
                         AlreadyExistsException,
 54  
                         DoesNotExistException,
 55  
             DisabledIdentifierException, 
 56  
                         ReadOnlyException,
 57  
                         InvalidParameterException,
 58  
             MissingParameterException,
 59  
                         OperationFailedException,
 60  
             PermissionDeniedException {
 61  
         try {
 62  0
             return (getLprService().createLuiPersonRelation(personId, luiId,
 63  
                     luiPersonRelationType,
 64  
                     luiPersonRelationInfo,
 65  
                     context));
 66  0
         } catch (RuntimeException ex) {
 67  0
             throw new OperationFailedException("Got RuntimeException", ex);
 68  
         }
 69  
     }
 70  
 
 71  
     @Override
 72  
     public List<String> createBulkRelationshipsForPerson(String personId,
 73  
                                                          List<String> luiIdList,
 74  
                                                          String relationState,
 75  
                                                          String luiPersonRelationType,
 76  
                                                          LuiPersonRelationInfo luiPersonRelationInfo,
 77  
                                                          ContextInfo context)
 78  
             throws DataValidationErrorException, 
 79  
                         AlreadyExistsException,
 80  
                         DoesNotExistException,
 81  
             DisabledIdentifierException, 
 82  
                         ReadOnlyException,
 83  
                         InvalidParameterException,
 84  
             MissingParameterException,
 85  
                         OperationFailedException,
 86  
             PermissionDeniedException {
 87  
 
 88  
         try {
 89  0
             return (getLprService().createBulkRelationshipsForPerson(personId, luiIdList,
 90  
                     relationState,
 91  
                     luiPersonRelationType,
 92  
                     luiPersonRelationInfo,
 93  
                     context));
 94  0
         } catch (RuntimeException ex) {
 95  0
             throw new OperationFailedException("Got RuntimeException", ex);
 96  
         }
 97  
     }
 98  
 
 99  
     @Override
 100  
     public LuiPersonRelationInfo updateLuiPersonRelation(
 101  
             String luiPersonRelationId, LuiPersonRelationInfo luiPersonRelationInfo,
 102  
             ContextInfo context)
 103  
             throws DataValidationErrorException, 
 104  
                         DoesNotExistException,
 105  
                         InvalidParameterException,
 106  
             MissingParameterException, 
 107  
                         ReadOnlyException,
 108  
                         OperationFailedException,
 109  
             PermissionDeniedException,
 110  
                         VersionMismatchException {
 111  
         try {
 112  0
             return (getLprService().updateLuiPersonRelation(luiPersonRelationId,
 113  
                     luiPersonRelationInfo,
 114  
                     context));
 115  0
         } catch (RuntimeException ex) {
 116  0
             throw new OperationFailedException("Got RuntimeException", ex);
 117  
         }
 118  
     }
 119  
 
 120  
     @Override
 121  
     public StatusInfo deleteLuiPersonRelation(String luiPersonRelationId,
 122  
                                               ContextInfo context) throws
 123  
             DoesNotExistException, InvalidParameterException, MissingParameterException,
 124  
             OperationFailedException,
 125  
             PermissionDeniedException {
 126  
         try {
 127  0
             return (getLprService().deleteLuiPersonRelation(luiPersonRelationId, context));
 128  0
         } catch (RuntimeException ex) {
 129  0
             throw new OperationFailedException("Got RuntimeException", ex);
 130  
         }
 131  
     }
 132  
 }