/******************************************************************************* * Copyright 2014 Federal Chancellery Austria * MOA-ID has been developed in a cooperation between BRZ, the Federal * Chancellery Austria - ICT staff unit, and Graz University of Technology. * * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by * the European Commission - subsequent versions of the EUPL (the "Licence"); * You may not use this work except in compliance with the Licence. * You may obtain a copy of the Licence at: * http://www.osor.eu/eupl/ * * Unless required by applicable law or agreed to in writing, software * distributed under the Licence is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the Licence for the specific language governing permissions and * limitations under the Licence. * * This product combines work with different licenses. See the "NOTICE" text * file for details on the various modules and licenses. * The "NOTICE" text file is part of the distribution. Any derivative works * that you distribute must include a readable copy of the "NOTICE" text file. ******************************************************************************/ /* * Copyright 2003 Federal Chancellery Austria * MOA-ID has been developed in a cooperation between BRZ, the Federal * Chancellery Austria - ICT staff unit, and Graz University of Technology. * * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by * the European Commission - subsequent versions of the EUPL (the "Licence"); * You may not use this work except in compliance with the Licence. * You may obtain a copy of the Licence at: * http://www.osor.eu/eupl/ * * Unless required by applicable law or agreed to in writing, software * distributed under the Licence is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the Licence for the specific language governing permissions and * limitations under the Licence. * * This product combines work with different licenses. See the "NOTICE" text * file for details on the various modules and licenses. * The "NOTICE" text file is part of the distribution. Any derivative works * that you distribute must include a readable copy of the "NOTICE" text file. */ /** * */ package at.gv.egovernment.moa.id.config; import java.util.HashMap; import java.util.Map; import at.gv.egovernment.moa.id.commons.MOAIDAuthConstants; /** * @author bzwattendorfer * */ public class TargetToSectorNameMapper implements TargetsAndSectorNames { private static Map targetMap = new HashMap(41); static { targetMap.put(TARGET_AR, TARGET_AR_SECTOR); targetMap.put(TARGET_AS, TARGET_AS_SECTOR); targetMap.put(TARGET_BF, TARGET_BF_SECTOR); targetMap.put(TARGET_BR, TARGET_BR_SECTOR); targetMap.put(TARGET_BW, TARGET_BW_SECTOR); targetMap.put(TARGET_EA, TARGET_EA_SECTOR); targetMap.put(TARGET_EF, TARGET_EF_SECTOR); targetMap.put(TARGET_GH, TARGET_GH_SECTOR); targetMap.put(TARGET_GS, TARGET_GS_SECTOR); targetMap.put(TARGET_GS_RE, TARGET_GS_RE_SECTOR); targetMap.put(TARGET_HR, TARGET_HR_SECTOR); targetMap.put(TARGET_JR, TARGET_JR_SECTOR); targetMap.put(TARGET_KI, TARGET_KI_SECTOR); targetMap.put(TARGET_KL, TARGET_KL_SECTOR); targetMap.put(TARGET_KU, TARGET_KU_SECTOR); targetMap.put(TARGET_LF, TARGET_LF_SECTOR); targetMap.put(TARGET_LV, TARGET_LV_SECTOR); targetMap.put(TARGET_OI, TARGET_OI_SECTOR); targetMap.put(TARGET_PV, TARGET_PV_SECTOR); targetMap.put(TARGET_RD, TARGET_RD_SECTOR); targetMap.put(TARGET_RT, TARGET_RT_SECTOR); targetMap.put(TARGET_SA, TARGET_SA_SECTOR); targetMap.put(TARGET_SF, TARGET_SF_SECTOR); targetMap.put(TARGET_SO, TARGET_SO_SECTOR); targetMap.put(TARGET_SO_VR, TARGET_SO_VR_SECTOR); targetMap.put(TARGET_SR_RG, TARGET_SR_RG_SECTOR); targetMap.put(TARGET_SV, TARGET_SV_SECTOR); targetMap.put(TARGET_UW, TARGET_UW_SECTOR); targetMap.put(TARGET_VT, TARGET_VT_SECTOR); targetMap.put(TARGET_VV, TARGET_VV_SECTOR); targetMap.put(TARGET_WT, TARGET_WT_SECTOR); targetMap.put(TARGET_ZP, TARGET_ZP_SECTOR); targetMap.put(TARGET_BR, TARGET_BR_SECTOR); targetMap.put(TARGET_HR, TARGET_HR_SECTOR); targetMap.put(TARGET_KI, TARGET_KI_SECTOR); targetMap.put(TARGET_OI, TARGET_OI_SECTOR); targetMap.put(TARGET_PV, TARGET_PV_SECTOR); targetMap.put(TARGET_RD, TARGET_RD_SECTOR); targetMap.put(TARGET_VS, TARGET_VS_SECTOR); targetMap.put(TARGET_VS_RG, TARGET_VS_RG_SECTOR); targetMap.put(TARGET_ZU, TARGET_ZU_SECTOR); } public static String getSectorNameViaTarget(String target) { if (target.startsWith(MOAIDAuthConstants.PREFIX_CDID)) target = target.substring(MOAIDAuthConstants.PREFIX_CDID.length()); return targetMap.get(target) != null ? (String) targetMap.get(target) : ""; } }