Package org.agorava.api.exception

Examples of org.agorava.api.exception.AgoravaException


    public static ResourceBundle retrievePropertyBundle(String bundleName) {
            ClassLoader cl=Thread.currentThread().getContextClassLoader();
            InputStream is =cl.getResourceAsStream(bundleName+".properties");
        if(is==null) {
            throw new AgoravaException("Property file : " +bundleName+".properties, not found");
        }
           
            try {
                return new PropertyResourceBundle(is);
            } catch (IOException e) {
                throw new AgoravaException("Didn't found Agorava properties file",e);
            }
        }
View Full Code Here



        for (String k : bindingKeys) {
            key = pref + k;
            if (!rb.containsKey(key)) {
                throw new AgoravaException("Unable to find binding key: " + key + " in bundle " + bundleName + " to build " +
                        "settings");
            }
            value = rb.getString(key);

            invokeSetter(k, value);
View Full Code Here

            if (internalCallBack.startsWith("/"))
                internalCallBack = req.getContextPath() + internalCallBack;
            internalCallBack = resp.encodeRedirectURL(internalCallBack + "?" + req.getQueryString());
            resp.sendRedirect(internalCallBack);
        } catch (IOException e) {
            throw new AgoravaException(e);
        }
    }
View Full Code Here

        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();

    }
View Full Code Here

            msg = resp.getBody();
            if (clazz.equals(String.class))
                return (T) msg;
            return objectMapper.readValue(msg, clazz);
        } catch (IOException e) {
            throw new AgoravaException("Unable to map Json response for this response " + msg, e);
        }
    }
View Full Code Here

        try {
            if (obj.getClass().equals(String.class))
                return (String) obj;
            return objectMapper.writeValueAsString(obj);
        } catch (Exception e) {
            throw new AgoravaException("Unable to map a " + obj.getClass().getName() + " to json", e);
        }
    }
View Full Code Here

        Set<Annotation> annotations = getAnnotationsWithMeta(qualifiers, ProviderRelated.class);
        if (annotations.size() == 0)
            if (emptyAccepted)
                return null;
            else
                throw new AgoravaException("No ProviderRelated qualifier found");
        else if (annotations.size() > 1)
            throw new AgoravaException("Type should not have more than one ProviderRelated Qualifier");
        return annotations.iterator().next();
    }
View Full Code Here

            throw new UnsupportedOperationException("Cannot resolve session for a null InjectionPoint");
        }
        Annotation qual = AnnotationUtils.getSingleProviderRelatedQualifier(ip.getQualifiers(), false);
        OAuthSession res = repository.getForProvider(qual);
        if (res.isNull()) {
            throw new AgoravaException("There's no active session for requested provider");
        }
        return res;
    }
View Full Code Here

        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        InputStream is = cl.getResourceAsStream(bundleName + ".properties");
        try {
            return new PropertyResourceBundle(is);
        } catch (IOException e) {
            throw new AgoravaException("Didn't found Agorava properties file", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.agorava.api.exception.AgoravaException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.