From ab3d4fc97d673afce126e62be160c2feb4e6e588 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@d688527b-c9ab-4aba-bd8d-4036d912da1d> Date: Mon, 18 Dec 2006 14:17:02 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'Build_ID-1_3_3'. git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/tags/Build_ID-1_3_3@757 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../moa/spss/server/invoke/ProfileMapper.java | 249 --------------------- 1 file changed, 249 deletions(-) delete mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java (limited to 'spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java') diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java deleted file mode 100644 index 158a3ddb5..000000000 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java +++ /dev/null @@ -1,249 +0,0 @@ -package at.gv.egovernment.moa.spss.server.invoke; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.spss.MOAApplicationException; -import at.gv.egovernment.moa.spss.api.xmlbind.ProfileParser; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfile; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfileID; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfile; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileID; -import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfile; -import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlverify.SupplementProfileID; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfile; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfileExplicit; -import at.gv.egovernment.moa.spss.api.xmlverify.VerifyTransformsInfoProfileID; -import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; - -/** - * Map ProfileID objects to their explicit represantation. - * - * @author Patrick Peck - * @version $Id$ - */ -public class ProfileMapper { - - /** The parser to parse the profiles. */ - private static ProfileParser profileParser = new ProfileParser(); - - /** - * Map a CreateTransformsInfoProfile to a - * CreateTransformsInfoProfileExplicit. - * - * @param profile The profile object to map. - * @param config The MOA configuration to use for looking up the profile. - * @return profile, if the given profile is of type - * EXPLICIT_CREATETRANSFORMSINFOPROFILE, otherwise the profile - * that is looked up and parsed from the configuration. - * @throws MOAApplicationException An error occurred parsing the profile. - */ - public static CreateTransformsInfoProfileExplicit mapCreateTransformsInfoProfile( - CreateTransformsInfoProfile profile, - ConfigurationProvider config) - throws MOAApplicationException { - - switch (profile.getCreateTransformsInfoProfileType()) { - case CreateTransformsInfoProfile.EXPLICIT_CREATETRANSFORMSINFOPROFILE : - return (CreateTransformsInfoProfileExplicit) profile; - - case CreateTransformsInfoProfile.ID_CREATETRANSFORMSINFOPROFILE : - CreateTransformsInfoProfileID profileIdObj = - (CreateTransformsInfoProfileID) profile; - String profileID = profileIdObj.getCreateTransformsInfoProfileID(); - Element profileElem = config.getCreateTransformsInfoProfile(profileID); - - if (profileElem == null) { - throw new MOAApplicationException("2234", new Object[] { profileID }); - } - - return ( - CreateTransformsInfoProfileExplicit) profileParser - .parseCreateTransformsInfoProfile( - profileElem); - } - return null; // this will not happen - } - - /** - * Map a CreateSignatureEnvironmentProfile to a - * CreateSignatureEnvironmentProfileExplicit. - * - * @param profile The profile object to map. - * @param config The MOA configuration to use for looking up the profile. - * @return profile, if the given profile is of type - * EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE, otherwise the - * profile that is looked up and parsed from the configuration. - * @throws MOAApplicationException An error occurred parsing the profile. - */ - public static CreateSignatureEnvironmentProfileExplicit mapCreateSignatureEnvironmentProfile( - CreateSignatureEnvironmentProfile profile, - ConfigurationProvider config) - throws MOAApplicationException { - - switch (profile.getCreateSignatureEnvironmentProfileType()) { - case CreateSignatureEnvironmentProfile - .EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE : - - return (CreateSignatureEnvironmentProfileExplicit) profile; - - case CreateSignatureEnvironmentProfile - .ID_CREATESIGNATUREENVIRONMENTPROFILE : - - CreateSignatureEnvironmentProfileID profileIdObj = - (CreateSignatureEnvironmentProfileID) profile; - String profileID = - profileIdObj.getCreateSignatureEnvironmentProfileID(); - Element profileElem = - config.getCreateSignatureEnvironmentProfile(profileID); - - if (profileElem == null) { - throw new MOAApplicationException("2236", new Object[] { profileID }); - } - - return ( - CreateSignatureEnvironmentProfileExplicit) profileParser - .parseCreateSignatureEnvironmentProfile( - profileElem); - - } - return null; - - } - - /** - * Map a List of SupplementProfiles to their - * explicit representation. - * - * @param profiles The profiles to map. - * @param config The MOA configuration to use for looking up profiles. - * @return The mapped profiles. - * @throws MOAApplicationException An error occurred mapping one of the - * profiles. - */ - public static List mapSupplementProfiles( - List profiles, - ConfigurationProvider config) - throws MOAApplicationException { - - List mappedProfiles = new ArrayList(); - Iterator iter; - - for (iter = profiles.iterator(); iter.hasNext();) { - SupplementProfile profile = (SupplementProfile) iter.next(); - mappedProfiles.add(mapSupplementProfile(profile, config)); - } - - return mappedProfiles; - } - - /** - * Map a SupplementProfile to a - * SupplementProfileExplicit. - * - * @param profile The profile object to map. - * @param config The MOA configuration to use for looking up the profile. - * @return profile, if the given profile is of type - * EXPLICIT_SUPPLEMENTPROFILE, otherwise the - * profile that is looked up and parsed from the configuration. - * @throws MOAApplicationException An error occurred parsing the profile. - */ - public static SupplementProfileExplicit mapSupplementProfile( - SupplementProfile profile, - ConfigurationProvider config) - throws MOAApplicationException { - - switch (profile.getSupplementProfileType()) { - case SupplementProfile.EXPLICIT_SUPPLEMENTPROFILE : - return (SupplementProfileExplicit) profile; - - case SupplementProfile.ID_SUPPLEMENTPROFILE : - SupplementProfileID profileIdObj = (SupplementProfileID) profile; - String profileID = profileIdObj.getSupplementProfileID(); - Element profileElem = config.getSupplementProfile(profileID); - - if (profileElem == null) { - throw new MOAApplicationException("2267", new Object[] { profileID }); - } - - return ( - SupplementProfileExplicit) profileParser.parseSupplementProfile( - profileElem); - } - - return null; - } - - /** - * Map a List of VerifyTransformsInfoProfiles to - * their explicit representation. - * - * @param profiles The profiles to map. - * @param config The MOA configuration to use for looking up profiles. - * @return The mapped profiles. - * @throws MOAApplicationException An error occurred mapping one of the - * profiles. - */ - public static List mapVerifyTransformsInfoProfiles( - List profiles, - ConfigurationProvider config) - throws MOAApplicationException { - - List mappedProfiles = new ArrayList(); - Iterator iter; - - for (iter = profiles.iterator(); iter.hasNext();) { - VerifyTransformsInfoProfile profile = - (VerifyTransformsInfoProfile) iter.next(); - mappedProfiles.add(mapVerifyTransformsInfoProfile(profile, config)); - } - - return mappedProfiles; - } - - /** - * Map a VerifyTransformsInfoProfile to a - * VerifyTransformsInfoProfileExplicit. - * - * @param profile The profile object to map. - * @param config The MOA configuration to use for looking up the profile. - * @return profile, if the given profile is of type - * EXPLICIT_VERIFYTRANSFORMSINFOPROFILE, otherwise the - * profile that is looked up and parsed from the configuration. - * @throws MOAApplicationException An error occurred parsing the profile. - */ - public static VerifyTransformsInfoProfileExplicit mapVerifyTransformsInfoProfile( - VerifyTransformsInfoProfile profile, - ConfigurationProvider config) - throws MOAApplicationException { - - switch (profile.getVerifyTransformsInfoProfileType()) { - case VerifyTransformsInfoProfile.EXPLICIT_VERIFYTRANSFORMSINFOPROFILE : - return (VerifyTransformsInfoProfileExplicit) profile; - - case VerifyTransformsInfoProfile.ID_VERIFYTRANSFORMSINFOPROFILE : - VerifyTransformsInfoProfileID profileIdObj = - (VerifyTransformsInfoProfileID) profile; - String profileID = profileIdObj.getVerifyTransformsInfoProfileID(); - Element profileElem = - config.getVerifyTransformsInfoProfile(profileID); - - if (profileElem == null) { - throw new MOAApplicationException("2268", new Object[] { profileID }); - } - - return ( - VerifyTransformsInfoProfileExplicit) profileParser - .parseVerifyTransformsInfoProfile( - profileElem); - } - - return null; - } -} -- cgit v1.2.3