aboutsummaryrefslogtreecommitdiff
path: root/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java
diff options
context:
space:
mode:
Diffstat (limited to 'moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java')
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java187
1 files changed, 90 insertions, 97 deletions
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java
index c6eaa4f..474e74b 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java
@@ -21,7 +21,6 @@
* that you distribute must include a readable copy of the "NOTICE" text file.
*/
-
package at.gv.egovernment.moa.spss.server.invoke;
import java.util.ArrayList;
@@ -48,7 +47,7 @@ import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider;
/**
* Map ProfileID objects to their explicit represantation.
- *
+ *
* @author Patrick Peck
* @version $Id$
*/
@@ -58,83 +57,79 @@ public class ProfileMapper {
private static ProfileParser profileParser = new ProfileParser();
/**
- * Map a <code>CreateTransformsInfoProfile</code> to a
+ * Map a <code>CreateTransformsInfoProfile</code> to a
* <code>CreateTransformsInfoProfileExplicit</code>.
- *
+ *
* @param profile The profile object to map.
- * @param config The MOA configuration to use for looking up the profile.
+ * @param config The MOA configuration to use for looking up the profile.
* @return <code>profile</code>, if the given profile is of type
- * <code>EXPLICIT_CREATETRANSFORMSINFOPROFILE</code>, otherwise the profile
- * that is looked up and parsed from the configuration.
+ * <code>EXPLICIT_CREATETRANSFORMSINFOPROFILE</code>, 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 {
+ CreateTransformsInfoProfile profile,
+ ConfigurationProvider config)
+ throws MOAApplicationException {
switch (profile.getCreateTransformsInfoProfileType()) {
- case CreateTransformsInfoProfile.EXPLICIT_CREATETRANSFORMSINFOPROFILE :
+ case CreateTransformsInfoProfile.EXPLICIT_CREATETRANSFORMSINFOPROFILE:
return (CreateTransformsInfoProfileExplicit) profile;
- case CreateTransformsInfoProfile.ID_CREATETRANSFORMSINFOPROFILE :
- CreateTransformsInfoProfileID profileIdObj =
- (CreateTransformsInfoProfileID) profile;
- String profileID = profileIdObj.getCreateTransformsInfoProfileID();
- Element profileElem = config.getCreateTransformsInfoProfile(profileID);
+ case CreateTransformsInfoProfile.ID_CREATETRANSFORMSINFOPROFILE:
+ final CreateTransformsInfoProfileID profileIdObj =
+ (CreateTransformsInfoProfileID) profile;
+ final String profileID = profileIdObj.getCreateTransformsInfoProfileID();
+ final Element profileElem = config.getCreateTransformsInfoProfile(profileID);
if (profileElem == null) {
throw new MOAApplicationException("2234", new Object[] { profileID });
}
- return (
- CreateTransformsInfoProfileExplicit) profileParser
+ return (CreateTransformsInfoProfileExplicit) profileParser
.parseCreateTransformsInfoProfile(
- profileElem);
+ profileElem);
}
return null; // this will not happen
}
/**
- * Map a <code>CreateSignatureEnvironmentProfile</code> to a
+ * Map a <code>CreateSignatureEnvironmentProfile</code> to a
* <code>CreateSignatureEnvironmentProfileExplicit</code>.
- *
+ *
* @param profile The profile object to map.
- * @param config The MOA configuration to use for looking up the profile.
+ * @param config The MOA configuration to use for looking up the profile.
* @return <code>profile</code>, if the given profile is of type
- * <code>EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE</code>, otherwise the
- * profile that is looked up and parsed from the configuration.
+ * <code>EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE</code>, 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 {
+ CreateSignatureEnvironmentProfile profile,
+ ConfigurationProvider config)
+ throws MOAApplicationException {
switch (profile.getCreateSignatureEnvironmentProfileType()) {
- case CreateSignatureEnvironmentProfile
- .EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE :
+ case CreateSignatureEnvironmentProfile.EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE:
return (CreateSignatureEnvironmentProfileExplicit) profile;
- case CreateSignatureEnvironmentProfile
- .ID_CREATESIGNATUREENVIRONMENTPROFILE :
+ case CreateSignatureEnvironmentProfile.ID_CREATESIGNATUREENVIRONMENTPROFILE:
- CreateSignatureEnvironmentProfileID profileIdObj =
- (CreateSignatureEnvironmentProfileID) profile;
- String profileID =
- profileIdObj.getCreateSignatureEnvironmentProfileID();
- Element profileElem =
- config.getCreateSignatureEnvironmentProfile(profileID);
+ final CreateSignatureEnvironmentProfileID profileIdObj =
+ (CreateSignatureEnvironmentProfileID) profile;
+ final String profileID =
+ profileIdObj.getCreateSignatureEnvironmentProfileID();
+ final Element profileElem =
+ config.getCreateSignatureEnvironmentProfile(profileID);
if (profileElem == null) {
throw new MOAApplicationException("2236", new Object[] { profileID });
}
- return (
- CreateSignatureEnvironmentProfileExplicit) profileParser
+ return (CreateSignatureEnvironmentProfileExplicit) profileParser
.parseCreateSignatureEnvironmentProfile(
- profileElem);
+ profileElem);
}
return null;
@@ -142,25 +137,25 @@ public class ProfileMapper {
}
/**
- * Map a <code>List</code> of <code>SupplementProfile</code>s to their
- * explicit representation.
- *
+ * Map a <code>List</code> of <code>SupplementProfile</code>s to their explicit
+ * representation.
+ *
* @param profiles The profiles to map.
- * @param config The MOA configuration to use for looking up profiles.
+ * @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.
+ * profiles.
*/
public static List mapSupplementProfiles(
- List profiles,
- ConfigurationProvider config)
- throws MOAApplicationException {
+ List profiles,
+ ConfigurationProvider config)
+ throws MOAApplicationException {
- List mappedProfiles = new ArrayList();
+ final List mappedProfiles = new ArrayList();
Iterator iter;
for (iter = profiles.iterator(); iter.hasNext();) {
- SupplementProfile profile = (SupplementProfile) iter.next();
+ final SupplementProfile profile = (SupplementProfile) iter.next();
mappedProfiles.add(mapSupplementProfile(profile, config));
}
@@ -168,63 +163,62 @@ public class ProfileMapper {
}
/**
- * Map a <code>SupplementProfile</code> to a
+ * Map a <code>SupplementProfile</code> to a
* <code>SupplementProfileExplicit</code>.
- *
+ *
* @param profile The profile object to map.
- * @param config The MOA configuration to use for looking up the profile.
+ * @param config The MOA configuration to use for looking up the profile.
* @return <code>profile</code>, if the given profile is of type
- * <code>EXPLICIT_SUPPLEMENTPROFILE</code>, otherwise the
- * profile that is looked up and parsed from the configuration.
+ * <code>EXPLICIT_SUPPLEMENTPROFILE</code>, 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 {
+ SupplementProfile profile,
+ ConfigurationProvider config)
+ throws MOAApplicationException {
switch (profile.getSupplementProfileType()) {
- case SupplementProfile.EXPLICIT_SUPPLEMENTPROFILE :
+ case SupplementProfile.EXPLICIT_SUPPLEMENTPROFILE:
return (SupplementProfileExplicit) profile;
- case SupplementProfile.ID_SUPPLEMENTPROFILE :
- SupplementProfileID profileIdObj = (SupplementProfileID) profile;
- String profileID = profileIdObj.getSupplementProfileID();
- Element profileElem = config.getSupplementProfile(profileID);
+ case SupplementProfile.ID_SUPPLEMENTPROFILE:
+ final SupplementProfileID profileIdObj = (SupplementProfileID) profile;
+ final String profileID = profileIdObj.getSupplementProfileID();
+ final Element profileElem = config.getSupplementProfile(profileID);
if (profileElem == null) {
throw new MOAApplicationException("2267", new Object[] { profileID });
}
- return (
- SupplementProfileExplicit) profileParser.parseSupplementProfile(
- profileElem);
+ return (SupplementProfileExplicit) profileParser.parseSupplementProfile(
+ profileElem);
}
return null;
}
/**
- * Map a <code>List</code> of <code>VerifyTransformsInfoProfile</code>s to
- * their explicit representation.
- *
+ * Map a <code>List</code> of <code>VerifyTransformsInfoProfile</code>s to their
+ * explicit representation.
+ *
* @param profiles The profiles to map.
- * @param config The MOA configuration to use for looking up profiles.
+ * @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.
+ * profiles.
*/
public static List mapVerifyTransformsInfoProfiles(
- List profiles,
- ConfigurationProvider config)
- throws MOAApplicationException {
+ List profiles,
+ ConfigurationProvider config)
+ throws MOAApplicationException {
- List mappedProfiles = new ArrayList();
+ final List mappedProfiles = new ArrayList();
Iterator iter;
for (iter = profiles.iterator(); iter.hasNext();) {
- VerifyTransformsInfoProfile profile =
- (VerifyTransformsInfoProfile) iter.next();
+ final VerifyTransformsInfoProfile profile =
+ (VerifyTransformsInfoProfile) iter.next();
mappedProfiles.add(mapVerifyTransformsInfoProfile(profile, config));
}
@@ -232,40 +226,39 @@ public class ProfileMapper {
}
/**
- * Map a <code>VerifyTransformsInfoProfile</code> to a
+ * Map a <code>VerifyTransformsInfoProfile</code> to a
* <code>VerifyTransformsInfoProfileExplicit</code>.
- *
+ *
* @param profile The profile object to map.
- * @param config The MOA configuration to use for looking up the profile.
+ * @param config The MOA configuration to use for looking up the profile.
* @return <code>profile</code>, if the given profile is of type
- * <code>EXPLICIT_VERIFYTRANSFORMSINFOPROFILE</code>, otherwise the
- * profile that is looked up and parsed from the configuration.
+ * <code>EXPLICIT_VERIFYTRANSFORMSINFOPROFILE</code>, 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 {
+ VerifyTransformsInfoProfile profile,
+ ConfigurationProvider config)
+ throws MOAApplicationException {
switch (profile.getVerifyTransformsInfoProfileType()) {
- case VerifyTransformsInfoProfile.EXPLICIT_VERIFYTRANSFORMSINFOPROFILE :
+ case VerifyTransformsInfoProfile.EXPLICIT_VERIFYTRANSFORMSINFOPROFILE:
return (VerifyTransformsInfoProfileExplicit) profile;
- case VerifyTransformsInfoProfile.ID_VERIFYTRANSFORMSINFOPROFILE :
- VerifyTransformsInfoProfileID profileIdObj =
- (VerifyTransformsInfoProfileID) profile;
- String profileID = profileIdObj.getVerifyTransformsInfoProfileID();
- Element profileElem =
- config.getVerifyTransformsInfoProfile(profileID);
-
+ case VerifyTransformsInfoProfile.ID_VERIFYTRANSFORMSINFOPROFILE:
+ final VerifyTransformsInfoProfileID profileIdObj =
+ (VerifyTransformsInfoProfileID) profile;
+ final String profileID = profileIdObj.getVerifyTransformsInfoProfileID();
+ final Element profileElem =
+ config.getVerifyTransformsInfoProfile(profileID);
+
if (profileElem == null) {
- throw new MOAApplicationException("2268", new Object[] { profileID });
+ throw new MOAApplicationException("2268", new Object[] { profileID });
}
- return (
- VerifyTransformsInfoProfileExplicit) profileParser
+ return (VerifyTransformsInfoProfileExplicit) profileParser
.parseVerifyTransformsInfoProfile(
- profileElem);
+ profileElem);
}
return null;