Package org.rest.common.web.exception

Examples of org.rest.common.web.exception.MyConflictException


     * @throws MyConflictException
     *             if {@code reference} is null
     */
    public static <T> T checkRequestElementNotNull(final T reference) {
        if (reference == null) {
            throw new MyConflictException();
        }
        return reference;
    }
View Full Code Here


     * @param expression
     *            a boolean expression
     */
    public static void checkRequestState(final boolean expression) {
        if (!expression) {
            throw new MyConflictException();
        }
    }
View Full Code Here

     * @param message
     *            the message to show if failed to create.
     */
    public static void propagateStatusCodeOnCreate(final ResponseEntity<?> createResponse, final String message) {
        if (createResponse.getStatusCode().value() == 409) {
            throw new MyConflictException(message);
        }
        if (createResponse.getStatusCode().value() != 201) {
            throw new IllegalStateException(message);
        }
    }
View Full Code Here

        try {
            parsedQuery = SearchCommonUtil.parseQueryString(queryString);
        } catch (final IllegalStateException illState) {
            logger.error("IllegalStateException on find operation");
            logger.warn("IllegalStateException on find operation", illState);
            throw new MyConflictException(illState);
        }

        final Page<T> resultPage = searchPaginated(page, size, parsedQuery.toArray(new ImmutableTriple[parsedQuery.size()]));
        return Lists.newArrayList(resultPage.getContent());
    }
View Full Code Here

TOP

Related Classes of org.rest.common.web.exception.MyConflictException

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.