@NotThreadSafe public class LocalizationHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
private boolean |
localeEnforcement
Whether the preferred is enforced or not.
|
private Logger |
logger
Class logger.
|
private org.opensaml.saml.metadata.resolver.MetadataResolver |
metadataResolver
The
MetadataProvider used for resolving localized information. |
private Locale |
preferredLocale
Preferred locale.
|
| Constructor and Description |
|---|
LocalizationHelper() |
| Modifier and Type | Method and Description |
|---|---|
private org.opensaml.saml.saml2.metadata.AttributeConsumingService |
getAttributeConsumingService(String entityId)
Gets the attribute consuming service for a specific relying party.
|
String |
getAttributeDescription(net.shibboleth.idp.attribute.IdPAttribute attribute,
Locale userLocale)
Gets the localized description of an attribute.
|
String |
getAttributeName(net.shibboleth.idp.attribute.IdPAttribute attribute,
Locale userLocale)
Gets the localized name of an attribute.
|
private Collection<Locale> |
getAvailableDescriptionLocales(List<org.opensaml.saml.saml2.metadata.ServiceDescription> serviceDescriptions)
Gets all available locales for relying party descriptions.
|
private Collection<Locale> |
getAvailableNameLocales(List<org.opensaml.saml.saml2.metadata.ServiceName> serviceNames)
Gets all available locales for relying party names.
|
private String |
getRelyingPartyDescription(List<org.opensaml.saml.saml2.metadata.ServiceDescription> serviceDescriptions,
Locale locale)
Gets the localized name of a list of service descriptions.
|
String |
getRelyingPartyDescription(String relyingPartyId,
Locale userLocale)
Gets the localized description of a relying party.
|
private String |
getRelyingPartyName(List<org.opensaml.saml.saml2.metadata.ServiceName> serviceNames,
Locale locale)
Gets the localized name of a list of service names.
|
String |
getRelyingPartyName(String relyingPartyId,
Locale userLocale)
Gets the localized name of a relying party.
|
private List<org.opensaml.saml.saml2.metadata.ServiceDescription> |
getServiceDescriptions(String entityId)
Gets a list of all service descriptions for a relying party.
|
private List<org.opensaml.saml.saml2.metadata.ServiceName> |
getServiceNames(String entityId)
Gets a list of all service names for a relying party.
|
Locale |
selectLocale(Collection<Locale> availableLocales,
Locale userLocale)
Selects the right locale from a collection of available locales.
|
void |
setLocaleEnforcement(boolean localeEnforced)
Sets or unsets locale enforcement.
|
void |
setMetadataProvider(org.opensaml.saml.metadata.resolver.MetadataResolver newMetadataProvider)
Sets the metadata provider.
|
void |
setPreferredLocale(Locale newPreferredLocale)
Sets the preferred locale.
|
private final Logger logger
private Locale preferredLocale
private boolean localeEnforcement
private org.opensaml.saml.metadata.resolver.MetadataResolver metadataResolver
MetadataProvider used for resolving localized information.public void setPreferredLocale(Locale newPreferredLocale)
newPreferredLocale - The preferred locale to set.public void setLocaleEnforcement(boolean localeEnforced)
localeEnforced - The locale enforced to set.public void setMetadataProvider(org.opensaml.saml.metadata.resolver.MetadataResolver newMetadataProvider)
newMetadataProvider - The metadata provider to set.public String getRelyingPartyName(String relyingPartyId, Locale userLocale)
relyingPartyId - The entityId of the relying party.userLocale - The user's preferred locale.public String getRelyingPartyDescription(String relyingPartyId, Locale userLocale)
relyingPartyId - The entityId of the relying party.userLocale - The user's preferred locale.public String getAttributeName(net.shibboleth.idp.attribute.IdPAttribute attribute, Locale userLocale)
attribute - The attributeuserLocale - The user's preferred locale.public String getAttributeDescription(net.shibboleth.idp.attribute.IdPAttribute attribute, Locale userLocale)
attribute - The attributeuserLocale - The user's preferred locale.public Locale selectLocale(Collection<Locale> availableLocales, Locale userLocale)
availableLocales - A collection of all available locales.userLocale - The user's preferred locale.private Collection<Locale> getAvailableNameLocales(List<org.opensaml.saml.saml2.metadata.ServiceName> serviceNames)
serviceNames - A list of all service names of the relying party .private Collection<Locale> getAvailableDescriptionLocales(List<org.opensaml.saml.saml2.metadata.ServiceDescription> serviceDescriptions)
serviceDescriptions - A list of all service descriptions of the relying party.private String getRelyingPartyName(List<org.opensaml.saml.saml2.metadata.ServiceName> serviceNames, Locale locale)
serviceNames - A list of all service names.locale - The locale which should be used.private String getRelyingPartyDescription(List<org.opensaml.saml.saml2.metadata.ServiceDescription> serviceDescriptions, Locale locale)
serviceDescriptions - A list of all service descriptions.locale - The locale which should be used.private List<org.opensaml.saml.saml2.metadata.ServiceName> getServiceNames(String entityId)
entityId - The entityId of the relying party.private List<org.opensaml.saml.saml2.metadata.ServiceDescription> getServiceDescriptions(String entityId)
entityId - The entityId of the relying party.private org.opensaml.saml.saml2.metadata.AttributeConsumingService getAttributeConsumingService(String entityId)
entityId - The entityId of the relying party.Copyright © 1999–2014. All rights reserved.