Package com.dottydingo.hyperion.exception

Examples of com.dottydingo.hyperion.exception.BadRequestException


        {
            EntityPlugin<C,?,ID> plugin = getEntityPlugin(entity);
            checkMethodAllowed(plugin,HttpMethod.GET);

            if(start != null && start < 1)
                throw new BadRequestException("The start parameter must be greater than zero.");

            if(limit != null && limit < 1)
                throw new BadRequestException("The limit parameter must be greater than zero.");

            endpointAuthorizationChecker.checkAuthorization(requestContext);

            ApiVersionPlugin<C, ? extends PersistentObject> versionPlugin =
                    plugin.getApiVersionRegistry().getPluginForVersion(version);
View Full Code Here


            C clientObject = endpointMarshaller.unmarshall(httpServletRequest,apiVersionPlugin.getApiClass());

            List<ID> ids = plugin.getKeyConverter().covertKeys(id);
            if(ids.size() != 1)
                throw new BadRequestException("A single id must be provided for an update.");

            endpointAuthorizationChecker.checkAuthorization(requestContext);

            Set<String> fieldSet = requestContext.getRequestedFields();
            if(fieldSet != null)
View Full Code Here

            queryTree = RSQLParser.parse(query);

        }
        catch (ParseException ex)
        {
            throw new BadRequestException("Error parsing query.", ex);
        }
        catch (TokenMgrError er)
        {
            throw new BadRequestException("Invalid query", er);
        }
        return new InternalExpressionBuilder(cb).buildPredicate(queryTree,root);
    }
View Full Code Here

            if (expression.isComparison())
            {
                return buildPredicate((ComparisonExpression) expression,entityRoot);
            }

            throw new BadRequestException("Invalid expression.");
        }
View Full Code Here

                case OR:
                    return cb.or(
                            buildPredicate(logical.getLeft(),entityRoot),
                            buildPredicate(logical.getRight(),entityRoot));
            }
            throw new BadRequestException("Invalid expression.");
        }
View Full Code Here

                return buildPredicate(entityRoot, property, comparison.getOperator(), comparison.getArgument());

            }
            catch (ArgumentFormatException ex)
            {
                throw new BadRequestException(null,
                        new ArgumentFormatException(comparison.getSelector(), ex.getArgument(), ex.getPropertyType()));
            }
            catch (UnknownSelectorException ex)
            {
                throw new BadRequestException(null,ex);
            }
        }
View Full Code Here

            boolean desc = props.length == 2 && props[1].equalsIgnoreCase("desc");

            Map<String,SortBuilder> sortBuilders = entityPlugin.getSortBuilders();
            SortBuilder sortBuilder = sortBuilders.get(name);
            if(sortBuilder == null)
                throw new BadRequestException(String.format("%s is not a valid sort field.",name));

            Sort s = sortBuilder.buildSort(name,desc);
            if (sort == null)
            {
                sort = s;
View Full Code Here

        {
            EntityPlugin<C,?,ID> plugin = getEntityPlugin(entity);
            checkMethodAllowed(plugin,HttpMethod.GET);

            if(start != null && start < 1)
                throw new BadRequestException("The start parameter must be greater than zero.");

            if(limit != null && limit < 1)
                throw new BadRequestException("The limit parameter must be greater than zero.");

            endpointAuthorizationChecker.checkAuthorization(requestContext);

            ApiVersionPlugin<C, ? extends PersistentObject> versionPlugin =
                    plugin.getApiVersionRegistry().getPluginForVersion(version);
View Full Code Here

            C clientObject = endpointMarshaller.unmarshall(httpServletRequest,apiVersionPlugin.getApiClass());

            List<ID> ids = plugin.getKeyConverter().covertKeys(id);
            if(ids.size() != 1)
                throw new BadRequestException("A single id must be provided for an update.");

            endpointAuthorizationChecker.checkAuthorization(requestContext);

            Set<String> fieldSet = requestContext.getRequestedFields();
            if(fieldSet != null)
View Full Code Here

        {
            return objectMapper.readValue(httpServletRequest.getInputStream(),type);
        }
        catch (Exception e)
        {
            throw new BadRequestException("Error unmarshalling request.",e);
        }
    }
View Full Code Here

TOP

Related Classes of com.dottydingo.hyperion.exception.BadRequestException

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.