diff options
Diffstat (limited to 'eaaf_core_api/src/main')
-rw-r--r-- | eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/ExtendedPvpAttributeDefinitions.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/ExtendedPvpAttributeDefinitions.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/ExtendedPvpAttributeDefinitions.java index 04cf07bb..5d7fcc07 100644 --- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/ExtendedPvpAttributeDefinitions.java +++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/data/ExtendedPvpAttributeDefinitions.java @@ -19,6 +19,9 @@ package at.gv.egiz.eaaf.core.api.data; +import java.util.NoSuchElementException; +import java.util.stream.Stream; + public interface ExtendedPvpAttributeDefinitions extends PvpAttributeDefinitions { String EIDAS_CONNECTOR_UNIQUEID_NAME = "urn:eidgvat:attributes.eidas.uniqueId"; @@ -36,6 +39,55 @@ public interface ExtendedPvpAttributeDefinitions extends PvpAttributeDefinitions String SP_USED_MANDATE_PROFILES_NAME = "urn:eidgvat:attributes.ServiceProviderMandateProfiles"; String SP_USED_MANDATE_PROFILES_FRIENDLY_NAME = "ServiceProvider-MandateProfiles"; + String SP_USED_MANDATE_TYPE_NAME = "urn:eidgvat:attributes.ServiceProviderMandateType"; + String SP_USED_MANDATE_TYPE_FRIENDLY_NAME = "ServiceProvider-MandateType"; + + enum SpMandateModes { + NONE("none"), + NATURAL("natural"), + NATURAL_FORCE("forceNatural"), + LEGAL("legal"), + LEGAL_FORCE("forceLegal"), + BOTH("all"), + BOTH_FORCE("forceAll"); + + private final String mandateMode; + + SpMandateModes(final String mandateMode) { + this.mandateMode = mandateMode; + } + + /** + * Get Service-Provider mandate-mode from String representation. + * + * @param s mandate-mode String parameter + * @return mandate mode, or {@link NoSuchElementException} if mode is unknown + */ + public static SpMandateModes fromString(final String mode) { + return Stream.of(SpMandateModes.values()) + .filter(el -> el.getMode().equals(mode)) + .findFirst() + .get(); + + } + + /** + * Get the URI based status identifier of an E-ID. + * + * @return Current mandate mode + */ + public String getMode() { + return this.mandateMode; + } + + @Override + public String toString() { + return getMode(); + + } + + } + String EID_BINDING_PUBLIC_KEY_NAME = "urn:eidgvat:attributes.binding.pubkey"; String EID_BINDING_PUBLIC_KEY_FRIENDLY_NAME = "Binding-PublicKey"; |