protected void removeHttpIdentityResponseFactory(HttpIdentityResponseFactory factory) { FrameworkServiceDataHolder.getInstance().getHttpIdentityResponseFactories().remove(factory); if (log.isDebugEnabled()) { log.debug("Removed HttpIdentityResponseFactory : " + factory.getName()); } }
responseBuilder = responseFactory.create(identityResponse); if(responseBuilder == null) { throw FrameworkRuntimeException.error("HttpIdentityResponseBuilder is Null. Cannot proceed!!"); } catch (FrameworkException e) { responseFactory = getIdentityResponseFactory(e); responseBuilder = responseFactory.handleException(e); if(responseBuilder == null) { throw FrameworkRuntimeException.error("HttpIdentityResponseBuilder is Null. Cannot proceed!!", e); } catch (RuntimeException e) { responseFactory = getIdentityResponseFactory(e); responseBuilder = responseFactory.handleException(e); if(responseBuilder == null) { throw FrameworkRuntimeException.error("HttpIdentityResponseBuilder is Null. Cannot proceed!!", e);
/** * Get the {@link HttpIdentityResponseFactory} to handle this {@link FrameworkException}. * * @param exception {@link FrameworkException} * @return {@link HttpIdentityResponseFactory} */ private HttpIdentityResponseFactory getIdentityResponseFactory(FrameworkException exception) { List<HttpIdentityResponseFactory> factories = FrameworkServiceDataHolder.getInstance() .getHttpIdentityResponseFactories(); for (HttpIdentityResponseFactory responseFactory : factories) { if (responseFactory.canHandle(exception)) { return responseFactory; } } throw FrameworkRuntimeException.error("No HttpIdentityResponseFactory found to create the response", exception); }
responseBuilder = responseFactory.create(identityResponse); if(responseBuilder == null) { throw FrameworkRuntimeException.error("HttpIdentityResponseBuilder is Null. Cannot proceed!!"); } catch (FrameworkException e) { responseFactory = getIdentityResponseFactory(e); responseBuilder = responseFactory.handleException(e); if(responseBuilder == null) { throw FrameworkRuntimeException.error("HttpIdentityResponseBuilder is Null. Cannot proceed!!");
/** * Get the {@link HttpIdentityResponseFactory} to handle this {@link IdentityResponse}. * * @param identityResponse IdentityResponse * @return HttpIdentityResponseFactory */ private HttpIdentityResponseFactory getHttpIdentityResponseFactory(IdentityResponse identityResponse) { List<HttpIdentityResponseFactory> factories = FrameworkServiceDataHolder.getInstance() .getHttpIdentityResponseFactories(); for (HttpIdentityResponseFactory responseFactory : factories) { if (responseFactory.canHandle(identityResponse)) { return responseFactory; } } throw FrameworkRuntimeException.error("No HttpIdentityResponseFactory found to create the request"); }
responseBuilder = responseFactory.create(identityResponse); if(responseBuilder == null) { throw FrameworkRuntimeException.error("HttpIdentityResponseBuilder is Null. Cannot proceed!!"); } catch (FrameworkException e) { responseFactory = getIdentityResponseFactory(e); responseBuilder = responseFactory.handleException(e); if(responseBuilder == null) { throw FrameworkRuntimeException.error("HttpIdentityResponseBuilder is Null. Cannot proceed!!", e); } catch (RuntimeException e) { responseFactory = getIdentityResponseFactory(e); responseBuilder = responseFactory.handleException(e); if(responseBuilder == null) { throw FrameworkRuntimeException.error("HttpIdentityResponseBuilder is Null. Cannot proceed!!", e);
/** * Get the {@link HttpIdentityResponseFactory} to handle this {@link RuntimeException}. * * @param exception {@link RuntimeException} * @return {@link HttpIdentityResponseFactory} */ private HttpIdentityResponseFactory getIdentityResponseFactory(RuntimeException exception) { List<HttpIdentityResponseFactory> factories = FrameworkServiceDataHolder.getInstance() .getHttpIdentityResponseFactories(); for (HttpIdentityResponseFactory responseFactory : factories) { if (responseFactory.canHandle(exception)) { return responseFactory; } } throw FrameworkRuntimeException.error("No HttpIdentityResponseFactory found to create the response", exception); }
protected void removeHttpIdentityResponseFactory(HttpIdentityResponseFactory factory) { FrameworkServiceDataHolder.getInstance().getHttpIdentityResponseFactories().remove(factory); if (log.isDebugEnabled()) { log.debug("Removed HttpIdentityResponseFactory : " + factory.getName()); } }
/** * Get the HttpIdentityResponseFactory. * * @param identityResponse IdentityResponse * @return HttpIdentityResponseFactory */ private HttpIdentityResponseFactory getHttpIdentityResponseFactory(IdentityResponse identityResponse) { List<HttpIdentityResponseFactory> factories = FrameworkServiceDataHolder.getInstance() .getHttpIdentityResponseFactories(); for (HttpIdentityResponseFactory responseFactory : factories) { if (responseFactory.canHandle(identityResponse)) { return responseFactory; } } throw FrameworkRuntimeException.error("No HttpIdentityResponseFactory found to create the request"); }
protected void removeHttpIdentityResponseFactory(HttpIdentityResponseFactory factory) { FrameworkServiceDataHolder.getInstance().getHttpIdentityResponseFactories().remove(factory); if (log.isDebugEnabled()) { log.debug("Removed HttpIdentityResponseFactory : " + factory.getName()); } }
/** * Get the {@link HttpIdentityResponseFactory} to handle this {@link FrameworkException}. * * @param exception {@link FrameworkException} * @return {@link HttpIdentityResponseFactory} */ private HttpIdentityResponseFactory getIdentityResponseFactory(FrameworkException exception) { List<HttpIdentityResponseFactory> factories = FrameworkServiceDataHolder.getInstance() .getHttpIdentityResponseFactories(); for (HttpIdentityResponseFactory responseFactory : factories) { if (responseFactory.canHandle(exception)) { return responseFactory; } } throw FrameworkRuntimeException.error("No HttpIdentityResponseFactory found to create the response", exception); }
@Reference( name = "identity.response.factory", service = HttpIdentityResponseFactory.class, cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC, unbind = "removeHttpIdentityResponseFactory" ) protected void addHttpIdentityResponseFactory(HttpIdentityResponseFactory factory) { FrameworkServiceDataHolder.getInstance().getHttpIdentityResponseFactories().add(factory); Collections.sort(FrameworkServiceDataHolder.getInstance().getHttpIdentityResponseFactories(), new HandlerComparator()); Collections.reverse(FrameworkServiceDataHolder.getInstance().getHttpIdentityResponseFactories()); if (log.isDebugEnabled()) { log.debug("Added HttpIdentityResponseFactory : " + factory.getName()); } }
/** * Get the {@link HttpIdentityResponseFactory} to handle this {@link RuntimeException}. * * @param exception {@link RuntimeException} * @return {@link HttpIdentityResponseFactory} */ private HttpIdentityResponseFactory getIdentityResponseFactory(RuntimeException exception) { List<HttpIdentityResponseFactory> factories = FrameworkServiceDataHolder.getInstance() .getHttpIdentityResponseFactories(); for (HttpIdentityResponseFactory responseFactory : factories) { if (responseFactory.canHandle(exception)) { return responseFactory; } } throw FrameworkRuntimeException.error("No HttpIdentityResponseFactory found to create the response", exception); }
@Reference( name = "identity.response.factory", service = org.wso2.carbon.identity.application.authentication.framework.inbound.HttpIdentityResponseFactory.class, cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC, unbind = "removeHttpIdentityResponseFactory" ) protected void addHttpIdentityResponseFactory(HttpIdentityResponseFactory factory) { FrameworkServiceDataHolder.getInstance().getHttpIdentityResponseFactories().add(factory); Collections.sort(FrameworkServiceDataHolder.getInstance().getHttpIdentityResponseFactories(), new HandlerComparator()); Collections.reverse(FrameworkServiceDataHolder.getInstance().getIdentityProcessors()); if (log.isDebugEnabled()) { log.debug("Added HttpIdentityResponseFactory : " + factory.getName()); } }
/** * Get the HttpIdentityResponseFactory. * * @param exception FrameworkException * @return HttpIdentityResponseFactory */ private HttpIdentityResponseFactory getIdentityResponseFactory(FrameworkException exception) { List<HttpIdentityResponseFactory> factories = FrameworkServiceDataHolder.getInstance() .getHttpIdentityResponseFactories(); for (HttpIdentityResponseFactory responseFactory : factories) { if (responseFactory.canHandle(exception)) { return responseFactory; } } throw FrameworkRuntimeException.error("No HttpIdentityResponseFactory found to create the request"); }
@Reference( name = "identity.response.factory", service = HttpIdentityResponseFactory.class, cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC, unbind = "removeHttpIdentityResponseFactory" ) protected void addHttpIdentityResponseFactory(HttpIdentityResponseFactory factory) { FrameworkServiceDataHolder.getInstance().getHttpIdentityResponseFactories().add(factory); Collections.sort(FrameworkServiceDataHolder.getInstance().getHttpIdentityResponseFactories(), new HandlerComparator()); Collections.reverse(FrameworkServiceDataHolder.getInstance().getHttpIdentityResponseFactories()); if (log.isDebugEnabled()) { log.debug("Added HttpIdentityResponseFactory : " + factory.getName()); } }
/** * Get the {@link HttpIdentityResponseFactory} to handle this {@link IdentityResponse}. * * @param identityResponse IdentityResponse * @return HttpIdentityResponseFactory */ private HttpIdentityResponseFactory getHttpIdentityResponseFactory(IdentityResponse identityResponse) { List<HttpIdentityResponseFactory> factories = FrameworkServiceDataHolder.getInstance() .getHttpIdentityResponseFactories(); for (HttpIdentityResponseFactory responseFactory : factories) { if (responseFactory.canHandle(identityResponse)) { return responseFactory; } } throw FrameworkRuntimeException.error("No HttpIdentityResponseFactory found to create the request"); }