use of org.apereo.portal.portlet.om.IPortletDescriptorKey in project uPortal by Jasig.
the class WebAppNameContainsStringPredicate method test.
@Override
public boolean test(final HttpServletRequest request) {
try {
final IPortletDefinition portletDefinition = utils.getPortletDefinitionFromServletRequest(request);
IPortletDescriptorKey portletDescriptorKey = portletDefinition.getPortletDescriptorKey();
String portletWebAppName = portletDescriptorKey.getWebAppName();
boolean doesMatch = portletWebAppName.contains(this.webAppNameToMatch);
if (logger.isDebugEnabled()) {
if (doesMatch) {
logger.debug("Predicate is true: observed web app name [{}]" + " does match configured name [{}].", portletWebAppName, this.webAppNameToMatch);
} else {
logger.debug("Predicate is false: observed web app name [{}]" + " does not match configured name [{}].", portletWebAppName, this.webAppNameToMatch);
}
}
return doesMatch;
} catch (Exception e) {
logger.error("Failed to process web app name contains string check for redirect during pipeline. Failing gracefully by returning false.", e);
}
return false;
}
Aggregations