From 6c7a6f8e222e4fb39a11c220b63e785f2037d428 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Thu, 16 Jan 2014 08:55:06 +0100 Subject: fix added real source of stork modules --- .../stork/peps/auth/commons/AttributeSource.java | 119 +++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeSource.java (limited to 'id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeSource.java') diff --git a/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeSource.java b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeSource.java new file mode 100644 index 000000000..4b9dc33e9 --- /dev/null +++ b/id/server/stork2-commons/src/main/java/eu/stork/peps/auth/commons/AttributeSource.java @@ -0,0 +1,119 @@ +package eu.stork.peps.auth.commons; + +/** + * This class is a bean used to store the information relative to the Attribute Source (either AttributeProvider or Country). + * + * @author Stelios Lelis (stelios.lelis@aegean.gr), Elias Pastos (ilias@aegean.gr) + * + * @version $Revision: 1.00 $, $Date: 2013-09-19 $ + */ +public final class AttributeSource { + public static final int SOURCE_LOCAL_APROVIDER = 1; + public static final int SOURCE_REMOTE_COUNTRY = 2; + + /** + * Provider source. + */ + private int sourceType; + + /** + * Provider URL. + */ + private String providerURL; + + /** + * The local Attribute Provider. + */ + private AttributeProvider provider; + + /** + * The remote Country. + */ + private Country country; + + /** + * Attribute Source Constructor. + * + * @param provider The local Attribute Provider. + * @param pURL URL of the Attribute Provider. + */ + public AttributeSource(final AttributeProvider provider, final String pURL) { + this.setSourceType(SOURCE_LOCAL_APROVIDER); + + this.setProvider(provider); + this.setProviderURL(pURL); + } + + /** + * Attribute Source Constructor. + * + * @param country The remote Country. + * @param pURL URL of the Country. + */ + public AttributeSource(final Country country, final String pURL) { + this.setSourceType(SOURCE_REMOTE_COUNTRY); + + this.setCountry(country); + this.setProviderURL(pURL); + } + + /** + * @param sourceType the sourceType to set + */ + public void setSourceType(int sourceType) { + this.sourceType = sourceType; + } + + /** + * @return the sourceType + */ + public int getSourceType() { + return sourceType; + } + + /** + * @param providerURL the providerURL to set + */ + public void setProviderURL(String providerURL) { + this.providerURL = providerURL; + } + + /** + * @return the providerURL + */ + public String getProviderURL() { + return providerURL; + } + + /** + * @param provider the provider to set + */ + public void setProvider(AttributeProvider provider) { + this.setSourceType(SOURCE_LOCAL_APROVIDER); + + this.provider = provider; + } + + /** + * @return the provider + */ + public AttributeProvider getProvider() { + return provider; + } + + /** + * @param country the country to set + */ + public void setCountry(Country country) { + this.setSourceType(SOURCE_REMOTE_COUNTRY); + + this.country = country; + } + + /** + * @return the country + */ + public Country getCountry() { + return country; + } +} -- cgit v1.2.3