aboutsummaryrefslogtreecommitdiff
path: root/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvider.java
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2014-03-21 14:45:05 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2014-03-21 14:45:05 +0100
commitf3f35663f362ce6722eaa26598fb5aa8c4c6d962 (patch)
treebc9d66ebe1b5b840c6e3bf0087a8dd58040528a1 /id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvider.java
parent05212e955f2c44bd3150b47d9d534c5a73eb71d1 (diff)
parent658cb68c445d5b73815c43b66dd717483a425ea5 (diff)
downloadmoa-id-spss-f3f35663f362ce6722eaa26598fb5aa8c4c6d962.tar.gz
moa-id-spss-f3f35663f362ce6722eaa26598fb5aa8c4c6d962.tar.bz2
moa-id-spss-f3f35663f362ce6722eaa26598fb5aa8c4c6d962.zip
Merge remote-tracking branch 'remotes/origin/vidp' into moa2_0_tlenz
Conflicts: id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties id/server/moa-id-commons/pom.xml id/server/stork2-saml-engine/pom.xml pom.xml repository/iaik/iaik_tsl/1.0/iaik_tsl-1.0.jar repository/iaik/iaik_tsl/1.0/iaik_tsl-1.0.pom
Diffstat (limited to 'id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvider.java')
-rw-r--r--id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvider.java123
1 files changed, 123 insertions, 0 deletions
diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvider.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvider.java
new file mode 100644
index 000000000..575732e27
--- /dev/null
+++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeProvider.java
@@ -0,0 +1,123 @@
+package eu.stork.peps.auth.commons;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * This class is a bean used to store the information relative to the Attribute Provider.
+ *
+ * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr)
+ *
+ * @version $Revision: 1.01 $, $Date: 2014-01-13 $
+ */
+public final class AttributeProvider implements Serializable {
+ /**
+ * Unique identifier.
+ */
+ private static final long serialVersionUID = 7210186241917444559L;
+
+ /**
+ * Provider Id.
+ */
+ private String providerId;
+
+ /**
+ * Provider Name.
+ */
+ private String providerName;
+
+ /**
+ * Allowed groups of attribute names.
+ */
+ private List<String> allowedGroups;
+
+ /**
+ * Attribute Provider Constructor.
+ *
+ * @param pId Id of the Attribute Provider.
+ * @param pName Name of the Attribute Provider.
+ */
+ public AttributeProvider(final String pId, final String pName, final List<String> pAllowedGroups) {
+
+ this.providerId = pId;
+ this.providerName = pName;
+ this.allowedGroups = pAllowedGroups;
+ }
+
+ /**
+ * Getter for the providerId value.
+ *
+ * @return The providerId value.
+ */
+ public String getProviderId() {
+
+ return providerId;
+ }
+
+ /**
+ * Setter for the providerId value.
+ *
+ * @param pId Id of the Attribute Provider.
+ */
+ public void setProviderId(final String pId) {
+
+ this.providerId = pId;
+ }
+
+ /**
+ * Getter for the providerName value.
+ *
+ * @return The providerName value.
+ */
+ public String getProviderName() {
+
+ return providerName;
+ }
+
+ /**
+ * Setter for the providerName value.
+ *
+ * @param name Name of the Attribute Provider.
+ */
+ public void setProviderName(final String name) {
+
+ this.providerName = name;
+ }
+
+ /**
+ * Getter for the allowedGroups value.
+ *
+ * @return The allowedGroups value.
+ */
+ public List<String> getAllowedGroups() {
+
+ return allowedGroups;
+ }
+
+ /**
+ * Setter for the allowedGroups value.
+ *
+ * @param name AllowedGroups of the Attribute Provider.
+ */
+ public void setAllowedGroups(final List<String> pAllowedGroups) {
+
+ this.allowedGroups = pAllowedGroups;
+ }
+
+ /**
+ * Check if an attribute name is allowed for this Attribute Provider
+ *
+ * @param pAttrName the Attribute Name to check
+ * @return true if the name is allowed, false otherwise
+ */
+ public boolean isAttributeNameAllowed(final String pAttrName) {
+ if ( allowedGroups==null || pAttrName==null )
+ return false;
+ else if ( allowedGroups.contains(PEPSParameters.ATTRIBUTE_GROUPS_ALL.toString()) )
+ return true;
+ else if ( allowedGroups.contains(PEPSParameters.ATTRIBUTE_GROUPS_NONE.toString()) )
+ return false;
+ else
+ return allowedGroups.contains(pAttrName);
+ }
+}