Package org.apache.amber.oauth2.common.exception

Examples of org.apache.amber.oauth2.common.exception.OAuthSystemException


                }

                responseBody = OAuthUtils.saveStreamAsString(inputStream);
            }
        } catch (IOException e) {
            throw new OAuthSystemException(e);
        }

        return OAuthClientResponseFactory
            .createCustomResponse(responseBody, c.getContentType(), responseCode, responseClass);
    }
View Full Code Here


    protected Map<ParameterStyle, Class> validators = new HashMap<ParameterStyle, Class>();

    public OAuthValidator instantiateValidator(ParameterStyle ps) throws OAuthSystemException {
        Class clazz = validators.get(ps);
        if (clazz == null) {
            throw new OAuthSystemException("Cannot instantiate a message validator.");
        }
        return (OAuthValidator)OAuthUtils.instantiateClass(clazz);
    }
View Full Code Here

    }

    public TokenExtractor instantiateExtractor(ParameterStyle ps) throws OAuthSystemException {
        Class clazz = extractors.get(ps);
        if (clazz == null) {
            throw new OAuthSystemException("Cannot instantiate a token extractor.");
        }
        return (TokenExtractor)OAuthUtils.instantiateClass(clazz);
    }
View Full Code Here

    }

    public static ResourceServer instantiateResourceServer(TokenType tokenType) throws OAuthSystemException {
        Class clazz = tokens.get(tokenType);
        if (clazz == null) {
            throw new OAuthSystemException("Cannot instantiate a resource server.");
        }
        return (ResourceServer)OAuthUtils.instantiateClass(clazz);
    }
View Full Code Here

        try {
            json = JSONUtils.buildJSON(params);
            message.setBody(json);
            return message;
        } catch (Throwable e) {
            throw new OAuthSystemException(e);
        }
    }
View Full Code Here

                return clazzConstructor.newInstance(paramValues);
            }
            return clazz.newInstance();

        } catch (NoSuchMethodException e) {
            throw new OAuthSystemException(e);
        } catch (InstantiationException e) {
            throw new OAuthSystemException(e);
        } catch (IllegalAccessException e) {
            throw new OAuthSystemException(e);
        } catch (InvocationTargetException e) {
            throw new OAuthSystemException(e);
        }

    }
View Full Code Here

            return OAuthClientResponseFactory
                .createCustomResponse(responseBody, contentType, response.getStatusLine().getStatusCode(),
                    responseClass);
        } catch (Exception e) {
            throw new OAuthSystemException(e);
        }

    }
View Full Code Here

            algorithm.reset();
            algorithm.update(param.getBytes());
            byte[] messageDigest = algorithm.digest();
            return toHexString(messageDigest);
        } catch (Exception e) {
            throw new OAuthSystemException("OAuth Token cannot be generated.", e);
        }
    }
View Full Code Here

                } else {
                    //TODO: re-create the entity from existing one and append the new content for access token
                }
            }
        } catch (UnsupportedEncodingException e) {
            throw new OAuthSystemException(e);
        }
    }
View Full Code Here

        try {
            request.setURI(URIUtils.createURI(oldUri.getScheme(), oldUri.getHost(), oldUri.getPort(),
                    oldUri.getRawPath(), requestQueryString, oldUri.getFragment()));
        } catch (URISyntaxException e) {
            throw new OAuthSystemException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.amber.oauth2.common.exception.OAuthSystemException

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.