/*
 * Copyright 2005-2013 The Kuali Foundation
 * 
 * Licensed under the Educational Community License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.opensource.org/licenses/ecl1.php
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.kuali.kra.service.impl;

import gov.grants.apply.forms.phs398CareerDevelopmentAwardSup11V11.CitizenshipDataType;
import gov.grants.apply.forms.phs398CareerDevelopmentAwardSup11V11.CitizenshipDataType.Enum;
import org.kuali.kra.bo.CitizenshipType;
import org.kuali.kra.infrastructure.CitizenshipTypes;
import org.kuali.kra.service.CitizenshipTypeService;

/**
 * 
 * This class...
 */
public class CitizenshipTypeServiceImpl implements CitizenshipTypeService {
    
    /**
     * 
     * @see org.kuali.kra.service.CitizenshipTypeService#getEnumValueOfCitizenshipType(org.kuali.kra.bo.CitizenshipType)
     */
    public Enum getEnumValueOfCitizenshipType(CitizenshipType citizenshipType) throws IllegalArgumentException {
        Enum retVal = null;
        switch(citizenshipType.getCitizenshipTypeCode()){
            case CitizenshipDataType.INT_NON_U_S_CITIZEN_WITH_TEMPORARY_VISA : {
                retVal = CitizenshipDataType.NON_U_S_CITIZEN_WITH_TEMPORARY_VISA;
                break;
            }
            case CitizenshipDataType.INT_PERMANENT_RESIDENT_OF_U_S : {
                retVal = CitizenshipDataType.PERMANENT_RESIDENT_OF_U_S;
                break;
            }
            case CitizenshipDataType.INT_U_S_CITIZEN_OR_NONCITIZEN_NATIONAL : {
                retVal = CitizenshipDataType.U_S_CITIZEN_OR_NONCITIZEN_NATIONAL;
                break;
            }
            default: {
                throw new IllegalArgumentException("Invalid citizenship type provided");
            }
        }
        return retVal;
    }

	public CitizenshipTypes getCitizenshipDataFromExternalSource() {
		// TODO  generate data for citizenship
		throw new RuntimeException("Method not implemented");
		
	}
   

}

@@ -1029,15 +1029,643 @@
 his 
-class..
+service has been made available for implementers who will be using an external source%0D%0A * for citizenship data. It hooks into S2SUtilService via the system parameter%0D%0A * PI_CITIZENSHIP_FROM_CUSTOM_DATA. Setting this to %220%22 will see that S2SUtilServiceImpl::getCitizenship receive a%0D%0A * CitizenshipTypes from this service, as opposed to KcPerson's extended attributes%0D%0A * %0D%0A * Schools who need external citizenship data are expected to override this service with their own%0D%0A * implementation of %22getCitizenshipDataFromExternalSource().%0D%0A * %0D%0A * getEnumValueOfCitizenshipType has been included as a convenience method should it be needed
 .%0D%0A 
@@ -2938,116 +2938,158 @@
 %0D%0A%09%09
-// TODO  generate data for citizenship%0D%0A%09%09throw new RuntimeException(%22Method not imple
+throw new UnsupportedOperationException(%22External Source Must be configured when system para
 me
-n
 te
-d%22);%0D%0A%09%09%0D%0A%09%7D%0D%0A   
+r PI_CITIZENSHIP_FROM_CUSTOM_DATA is set to '0'%22);%0D%0A%09%7D
 %0D%0A%0D%0A

Add class documentation, remove todo, throw unsupported exception.