public class CountryRestrictionsService
extends atg.nucleus.GenericService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
Constructor and Description |
---|
CountryRestrictionsService() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkCountryInPermittedList(java.lang.String countryCode,
java.util.List pPermittedCountryList)
Checks if country is in permitted country list
|
static java.lang.String |
getCountryName(java.lang.String pCountryCode,
java.util.Locale pUserLocale)
This static method gets localized country name from the Resource Bundle based on the input locale.
|
java.lang.String |
getDisplayNameForCode(java.util.ResourceBundle pResourceBundle,
java.lang.String pCode,
java.lang.String pDefault)
This method returns the localized display name for the country code
provided as input.
|
java.util.List |
getPermittedCountryList(atg.servlet.DynamoHttpServletRequest pRequest,
java.util.List pPermittedCountryCodes,
java.util.List pRestrictedCountryCodes,
atg.core.i18n.CountryList pCountryList)
Gets the list of permitted country codes
|
java.util.ResourceBundle |
getResourceBundle(atg.servlet.DynamoHttpServletRequest pRequest)
Gets the resource bundle for user local, specified in request
|
boolean |
isPermittedCountry(java.util.List pResultCountryList,
java.lang.String pCountryCode)
Check if country code is permitted.
|
java.util.List |
removeCountryWithCode(java.util.ResourceBundle pResourceBundle,
java.util.List pCodesToDelete,
java.util.List pCountryList)
This method removes the country codes (codesToDelete) from the
country list (countryList) and returns the resultant list having
localized country names.
|
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService, toString
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static final java.lang.String CLASS_VERSION
public boolean isPermittedCountry(java.util.List pResultCountryList, java.lang.String pCountryCode)
pResultCountryList
- the results country listpCountryCode
- the country codepublic java.util.List removeCountryWithCode(java.util.ResourceBundle pResourceBundle, java.util.List pCodesToDelete, java.util.List pCountryList)
pResourceBundle
- Resource Bundle used for country names localization.pCodesToDelete
- ArrayList Country codes to delete.pCountryList
- ArrayList List of countries.public java.lang.String getDisplayNameForCode(java.util.ResourceBundle pResourceBundle, java.lang.String pCode, java.lang.String pDefault)
pResourceBundle
- Resource Bundle used for country name localization.pCode
- String Country code.pDefault
- String Default value if localized country name is not found.public java.util.ResourceBundle getResourceBundle(atg.servlet.DynamoHttpServletRequest pRequest)
pRequest
- the DynamoHttpServletRequestpublic boolean checkCountryInPermittedList(java.lang.String countryCode, java.util.List pPermittedCountryList)
countryCode
- code of country to look in permitted country listpPermittedCountryList
- list of permitted country codespublic java.util.List getPermittedCountryList(atg.servlet.DynamoHttpServletRequest pRequest, java.util.List pPermittedCountryCodes, java.util.List pRestrictedCountryCodes, atg.core.i18n.CountryList pCountryList)
pRequest
- the DynamoHttpServletRequestpPermittedCountryCodes
- the permitted country codespRestrictedCountryCodes
- the restricted country codespCountryList
- the country listpublic static java.lang.String getCountryName(java.lang.String pCountryCode, java.util.Locale pUserLocale) throws atg.droplet.DropletException
pCountryCode
- String Country Code.pUserLocale
- Locale user locale.atg.droplet.DropletException
- an exception within Droplet