/** * @throws IllegalArgumentException if principal is not of type GenericPrincipal or User * @see RoleGenerator#generateRoles(Principal) */ public List<String> generateRoles(Principal principal) { String className = principal.getClass().getCanonicalName(); if (principal instanceof GenericPrincipal == false && principal instanceof User == false) { throw logger.wrongTypeError("principal is not tomcat principal:" + className); } List<String> userRoles = new ArrayList<String>(); if (principal instanceof GenericPrincipal) { GenericPrincipal gp = (GenericPrincipal) principal; String[] roles = gp.getRoles(); if (roles.length > 0) { userRoles.addAll(Arrays.asList(roles)); } } else if (principal instanceof User) { User tomcatUser = (User) principal; Iterator<?> iter = tomcatUser.getRoles(); while (iter.hasNext()) { Role tomcatRole = (Role) iter.next(); userRoles.add(tomcatRole.getRolename()); } } return userRoles; } }
/** * @throws IllegalArgumentException if principal is not of type GenericPrincipal or User * @see RoleGenerator#generateRoles(Principal) */ public List<String> generateRoles(Principal principal) { String className = principal.getClass().getCanonicalName(); if (principal instanceof GenericPrincipal == false && principal instanceof User == false) { throw logger.wrongTypeError("principal is not tomcat principal:" + className); } List<String> userRoles = new ArrayList<String>(); if (principal instanceof GenericPrincipal) { GenericPrincipal gp = (GenericPrincipal) principal; String[] roles = gp.getRoles(); if (roles.length > 0) { userRoles.addAll(Arrays.asList(roles)); } } else if (principal instanceof User) { User tomcatUser = (User) principal; Iterator<?> iter = tomcatUser.getRoles(); while (iter.hasNext()) { Role tomcatRole = (Role) iter.next(); userRoles.add(tomcatRole.getRolename()); } } return userRoles; } }
/** * @throws IllegalArgumentException if principal is not of type GenericPrincipal or User * @see RoleGenerator#generateRoles(Principal) */ public List<String> generateRoles(Principal principal) { String className = principal.getClass().getCanonicalName(); if (principal instanceof GenericPrincipal == false && principal instanceof User == false) { throw logger.wrongTypeError("principal is not tomcat principal:" + className); } List<String> userRoles = new ArrayList<String>(); if (principal instanceof GenericPrincipal) { GenericPrincipal gp = (GenericPrincipal) principal; String[] roles = gp.getRoles(); if (roles.length > 0) { userRoles.addAll(Arrays.asList(roles)); } } else if (principal instanceof User) { User tomcatUser = (User) principal; Iterator<?> iter = tomcatUser.getRoles(); while (iter.hasNext()) { Role tomcatRole = (Role) iter.next(); userRoles.add(tomcatRole.getRolename()); } } return userRoles; } }
String wrappingElementPrefix = wrappingElementQName.getPrefix(); if (wrappingElementPrefix == null || wrappingElementPrefix == "") throw logger.wrongTypeError("Wrapping element prefix invalid");
String wrappingElementPrefix = wrappingElementQName.getPrefix(); if (wrappingElementPrefix == null || wrappingElementPrefix == "") throw logger.wrongTypeError("Wrapping element prefix invalid");
String wrappingElementPrefix = wrappingElementQName.getPrefix(); if (wrappingElementPrefix == null || wrappingElementPrefix == "") throw logger.wrongTypeError("Wrapping element prefix invalid");
@Override public void transform(Source xmlSource, Result outputTarget) throws TransformerException { if (!(xmlSource instanceof StAXSource)) throw logger.wrongTypeError("xmlSource should be a stax source"); if (outputTarget instanceof DOMResult == false) throw logger.wrongTypeError("outputTarget should be a dom result");
@Override public void transform(Source xmlSource, Result outputTarget) throws TransformerException { if (!(xmlSource instanceof StAXSource)) throw logger.wrongTypeError("xmlSource should be a stax source"); if (outputTarget instanceof DOMResult == false) throw logger.wrongTypeError("outputTarget should be a dom result");
@Override public void transform(Source xmlSource, Result outputTarget) throws TransformerException { if (!(xmlSource instanceof StAXSource)) throw logger.wrongTypeError("xmlSource should be a stax source"); if (outputTarget instanceof DOMResult == false) throw logger.wrongTypeError("outputTarget should be a dom result");
String wrappingElementPrefix = wrappingElementQName.getPrefix(); if (wrappingElementPrefix == null || wrappingElementPrefix == "") throw logger.wrongTypeError("Wrapping element prefix invalid");
String wrappingElementPrefix = wrappingElementQName.getPrefix(); if (wrappingElementPrefix == null || wrappingElementPrefix == "") throw logger.wrongTypeError("Wrapping element prefix invalid");
String wrappingElementPrefix = wrappingElementQName.getPrefix(); if (wrappingElementPrefix == null || wrappingElementPrefix == "") throw logger.wrongTypeError("Wrapping element prefix invalid");
throw logger.wrongTypeError(samlObject.getClass().getName());
throw logger.wrongTypeError(samlObject.getClass().getName());
throw logger.wrongTypeError(samlObject.getClass().getName());
throw logger.wrongTypeError(samlObject.getClass().getName());
throw logger.wrongTypeError(samlObject.getClass().getName());
throw logger.wrongTypeError(samlObject.getClass().getName());
throw logger.wrongTypeError(samlObject.getClass().getName());
throw logger.wrongTypeError(samlObject.getClass().getName());