@Override public int compare(IdentityHandler o1, IdentityHandler o2) { if (o1.getPriority() > o2.getPriority()) { return 1; } else if (o1.getPriority() == o2.getPriority()) { return 0; } else { return -1; } } }
@Override public int compare(IdentityMessageHandler o1, IdentityMessageHandler o2) { if (o1.getPriority(messageContext) > o2.getPriority(messageContext)) { return 1; } else if (o1.getPriority(messageContext) == o2.getPriority(messageContext)) { return 0; } else { return -1; } } }
public int getPriority(MessageContext messageContext, int defaultValue) { int priority = super.getPriority(messageContext); return priority != -1 ? priority : defaultValue; }
/** * Adds a post authentication handler. * * @param postAuthenticationHandler Post authentication handler implementation. */ public void addPostAuthenticationHandler(PostAuthenticationHandler postAuthenticationHandler) { synchronized (postAuthenticationHandlers) { this.postAuthenticationHandlers.add(postAuthenticationHandler); postAuthenticationHandlers.sort(new HandlerComparator()); } }
/** * Sort and filter enabled handlers. * * @param identityHandlers * @param isEnableHandlersOnly * @return List<IdentityHandler> */ public <T extends IdentityHandler> List<T> sortHandlers(List<T> identityHandlers, boolean isEnableHandlersOnly) { if(log.isDebugEnabled()){ log.debug("Sort the handler list."); } if(identityHandlers == null || identityHandlers.isEmpty()){ return new ArrayList<T>() ; } List<T> identityHandlersList = identityHandlers; sort(identityHandlersList, new HandlerComparator()); if (isEnableHandlersOnly) { identityHandlersList = new ArrayList<>(); for (IdentityHandler identityHandler : identityHandlers) { if (identityHandler.isEnabled()) { identityHandlersList.add((T)identityHandler); } } } return identityHandlersList; }
public void addAuthenticationHandler(AuthenticationHandler authenticationHandler) { authenticationHandlers.add(authenticationHandler); sort(authenticationHandlers, new MessageHandlerComparator(null)); }
/** * Default constructor will initialize property values read from identity.xml */ public AbstractOAuthClientAuthenticator() { init(new InitConfig()); }
public static void addAuthenticationHandler(OAuthClientAuthenticator clientAuthenticator) { authenticationHandlers.add(clientAuthenticator); authenticationHandlers.sort(new HandlerComparator()); }
public void addAuthenticationHandler(AuthenticationHandler authenticationHandler) { authenticationHandlers.add(authenticationHandler); sort(authenticationHandlers, new MessageHandlerComparator(null)); }
@Override public int compare(IdentityHandler o1, IdentityHandler o2) { if (o1.getPriority() > o2.getPriority()) { return 1; } else if (o1.getPriority() == o2.getPriority()) { return 0; } else { return -1; } } }
@Override public int compare(IdentityMessageHandler o1, IdentityMessageHandler o2) { if (o1.getPriority(messageContext) > o2.getPriority(messageContext)) { return 1; } else if (o1.getPriority(messageContext) == o2.getPriority(messageContext)) { return 0; } else { return -1; } } }
/** * Adds a post authentication handler. * * @param postAuthenticationHandler Post authentication handler implementation. */ public void addPostAuthenticationHandler(PostAuthenticationHandler postAuthenticationHandler) { synchronized (postAuthenticationHandlers) { this.postAuthenticationHandlers.add(postAuthenticationHandler); postAuthenticationHandlers.sort(new HandlerComparator()); } }
@Override public int compare(IdentityHandler o1, IdentityHandler o2) { if (o1.getPriority() > o2.getPriority()) { return 1; } else if (o1.getPriority() == o2.getPriority()) { return 0; } else { return -1; } } }
@Override public int compare(IdentityMessageHandler o1, IdentityMessageHandler o2) { if (o1.getPriority(messageContext) > o2.getPriority(messageContext)) { return 1; } else if (o1.getPriority(messageContext) == o2.getPriority(messageContext)) { return 0; } else { return -1; } } }
protected void addResourceHandler(ResourceHandler resourceHandler) { if ( log.isDebugEnabled() ) { log.debug("ResourceHandler acquired"); } List<ResourceHandler> resourceHandlers = AuthenticationServiceHolder.getInstance().getResourceHandlers(); resourceHandlers.add(resourceHandler); Collections.sort(resourceHandlers, new HandlerComparator()); }
protected void setResourceHandler(ResourceHandler resourceHandler) { if ( log.isDebugEnabled() ) { log.debug("ResourceHandler acquired"); } List<ResourceHandler> resourceHandlerList = AuthorizationServiceHolder.getInstance().getResourceHandlerList(); resourceHandlerList.add(resourceHandler); Collections.sort(resourceHandlerList, new HandlerComparator()); }
protected void setAuthorizationHandler(AuthorizationHandler authorizationHandler) { if ( log.isDebugEnabled() ) { log.debug("AuthorizationHandler acquired"); } List<AuthorizationHandler> authorizationHandlerList = AuthorizationServiceHolder.getInstance().getAuthorizationHandlerList(); authorizationHandlerList.add(authorizationHandler); Collections.sort(authorizationHandlerList, new HandlerComparator()); }
protected void setAuthorizationManager(AuthorizationManager authorizationManager) { if ( log.isDebugEnabled() ) { log.debug("AuthorizationManager acquired"); } List<AuthorizationManager> authorizationManagerList = AuthorizationValveServiceHolder.getInstance().getAuthorizationManagerList(); authorizationManagerList.add(authorizationManager); sort(authorizationManagerList,new HandlerComparator()); }
protected void addResourceHandler(ResourceHandler resourceHandler) { if ( log.isDebugEnabled() ) { log.debug("ResourceHandler acquired"); } List<ResourceHandler> resourceHandlers = AuthenticationServiceHolder.getInstance().getResourceHandlers(); resourceHandlers.add(resourceHandler); Collections.sort(resourceHandlers, new HandlerComparator()); }
protected void setResourceHandler(ResourceHandler resourceHandler) { if ( log.isDebugEnabled() ) { log.debug("ResourceHandler acquired"); } List<ResourceHandler> resourceHandlerList = AuthorizationServiceHolder.getInstance().getResourceHandlerList(); resourceHandlerList.add(resourceHandler); Collections.sort(resourceHandlerList, new HandlerComparator()); }