/** * @return the set of all service's names present in the application */ public static Set<String> getSocialRelated() { return getServicesToQualifier().keySet(); }
/** * Set the provider qualifier for the session from the provider name * * @param providerName linked to a {@link org.agorava.api.atinject.ProviderRelated} qualifier * @return this builder * @throws ProviderMismatchException if parameter is null or if no provider exists for this name */ public Builder providerName(String providerName) throws ProviderMismatchException { qualifier = AgoravaContext.getServicesToQualifier().get(providerName); if (qualifier == null) throw new ProviderMismatchException("No provider found with name : " + providerName); return this; }
@Override public OAuthSession buildSessionFor(String providerName) { OAuthSession res; Annotation qualifier = getServicesToQualifier().get(providerName); if (qualifier == null) { throw new AgoravaException("Cannot find configured service provider with name : " + providerName); } return buildSessionFor(qualifier); }
@Produces @PicketLink @RequestScoped public Authenticator authenticatorProducer() { Annotation qualifier; if (session != OAuthSession.NULL) { qualifier = session.getServiceQualifier(); } else if (AgoravaContext.getListOfServices().contains(provider)) { qualifier = AgoravaContext.getServicesToQualifier().get(provider); } else { throw new AgoravaException("Current OAuthSession is NULL and Request doesn't contain " + AgoravaConstants .PROVIDER_PARAM + " parameter"); } if (qualifier == null) { throw new AgoravaException("No qualifier found for the following provider " + provider); } return authenticators.select(qualifier).get(); } }