public void registerHandler(String filterName,
Class securityHandlerClass,
Class protectionPolicyClass) throws BadSecurityHandlerException {
if(handlerNames.contains(securityHandlerClass) || handlerPolicyClasses.contains(securityHandlerClass))
{
throw new BadSecurityHandlerException("the following security handler was already registered: " +
securityHandlerClass.getName());
}
if(SecurityHandler.class.isAssignableFrom(securityHandlerClass))
{
try
{
if(handlerNames.containsKey(filterName))
{
throw new BadSecurityHandlerException("a security handler was already registered " +
"for the filter name " + filterName);
}
if(handlerPolicyClasses.containsKey(protectionPolicyClass))
{
throw new BadSecurityHandlerException("a security handler was already registered " +
"for the policy class " + protectionPolicyClass.getName());
}
handlerNames.put(filterName, securityHandlerClass);
handlerPolicyClasses.put(protectionPolicyClass, securityHandlerClass);
}
catch(Exception e)
{
throw new BadSecurityHandlerException(e);
}
}
else
{
throw new BadSecurityHandlerException("The class is not a super class of SecurityHandler");
}
}
register a security handler.
If the security handler was already registered an exception is thrown.
If another handler was previously registered for the same filter name or
for the same policy name, an exception is thrown |