Package com.cuubez.core.exception

Examples of com.cuubez.core.exception.CuubezException


            }


        } catch (InvocationTargetException e) {
            log.error(e);
            throw new CuubezException(CuubezExceptionConstance.INVOCATION_EXCEPTION);
        } catch (InstantiationException e) {
            log.error(e);
            throw new CuubezException(CuubezExceptionConstance.INVOCATION_EXCEPTION);
        } catch (IllegalAccessException e) {
            log.error(e);
            throw new CuubezException(CuubezExceptionConstance.INVOCATION_EXCEPTION);
        } catch (SecurityException e) {
            log.error(e);
            throw new CuubezException(CuubezExceptionConstance.INVOCATION_EXCEPTION);
        } catch (IllegalArgumentException e) {
            log.error(e);
            throw new CuubezException(CuubezExceptionConstance.ILLEGAL_ARGUMENT_EXCEPTION);
        }

    }
View Full Code Here


                }
            }

        } else {
            log.error("unsupported response media type");
            throw new CuubezException(CuubezExceptionConstance.UNSUPPORTED_MEDIA_TYPE);
        }

        log.error("unsupported response media type");
        throw new CuubezException(CuubezExceptionConstance.UNSUPPORTED_MEDIA_TYPE);
    }
View Full Code Here

                object.getClass().equals(Boolean.class) || object.getClass().equals(Character.class)) {

            return object.toString();
        } else {
            log.error(object.getClass().getCanonicalName()+" not support to Plain Text media type");
            throw new CuubezException(CuubezExceptionConstance.UNSUPPORTED_MEDIA_TYPE);

        }

    }
View Full Code Here

    }


    public <T> T unMarshal(String rootNode, String content, Class<T> type) throws CuubezException {
        throw new CuubezException(CuubezExceptionConstance.UNSUPPORTED_CONSUMER_TYPE);
    }
View Full Code Here

                returnObject = selectedMethod.invoke(obj, interceptorRequestContext);

                if (returnObject != null) {
                    InterceptorResponseContext interceptorResponseContext = (InterceptorResponseContext) returnObject;
                    log.error(interceptorResponseContext.getMessage());
                    throw new CuubezException(interceptorResponseContext.getMessage(), interceptorResponseContext.getCode());
                }

            } catch (IllegalAccessException e) {
                log.error(e);
                throw new CuubezException(CuubezExceptionConstance.INVOCATION_EXCEPTION);
            } catch (InvocationTargetException e) {
                log.error("Exception occurred while try to invoke interceptor ", e);
                throw new CuubezException(CuubezExceptionConstance.INVOCATION_EXCEPTION);
            } catch (NoSuchMethodException e) {
                log.error(e);
                throw new CuubezException(CuubezExceptionConstance.INVOCATION_EXCEPTION);
            } catch (InstantiationException e) {
                log.error(e);
                throw new CuubezException(CuubezExceptionConstance.INVOCATION_EXCEPTION);
            }

        }

    }
View Full Code Here


        } catch (InvocationTargetException e) {
            e.printStackTrace();
            log.error(e);
            throw new CuubezException(CuubezExceptionConstance.INVOCATION_EXCEPTION);
        } catch (InstantiationException e) {
            log.error(e);
            throw new CuubezException(CuubezExceptionConstance.INVOCATION_EXCEPTION);
        } catch (IllegalAccessException e) {
            log.error(e);
            throw new CuubezException(CuubezExceptionConstance.INVOCATION_EXCEPTION);
        } catch (SecurityException e) {
            log.error(e);
            throw new CuubezException(CuubezExceptionConstance.INVOCATION_EXCEPTION);
        } catch (IllegalArgumentException e) {
            log.error(e);
            throw new CuubezException(CuubezExceptionConstance.ILLEGAL_ARGUMENT_EXCEPTION);
        }

    }
View Full Code Here

                }
            }

        } else {
            log.error("unsupported response media type");
            throw new CuubezException(CuubezExceptionConstance.UNSUPPORTED_MEDIA_TYPE);
        }

        log.error("unsupported response media type");
        throw new CuubezException(CuubezExceptionConstance.UNSUPPORTED_MEDIA_TYPE);
    }
View Full Code Here

    public SelectedResourceMetaData findResource(String path, String httpMethod) throws CuubezException {

        if (rootResources == null || path == null || httpMethod == null) {
            log.trace("resource not found");
            throw new CuubezException(CuubezException.RESOURCE_NOT_FOUND);
        }

        for (RootResource rootResource : rootResources) {

            PathMetaData rootPathMetaData = rootResource.getUriTemplate().match(path);

            if (rootPathMetaData != null) {

                log.trace("root resource found");
                List<SubResource> subResources = rootResource.getSubResources();

                for (SubResource subResource : subResources) {

                    PathMetaData subPathMetaData = null;

                    if (subResource.getUriTemplate() != null) {
                        subPathMetaData = subResource.getUriTemplate().match(rootPathMetaData.getTail());
                    }

                    if(subPathMetaData != null) {


                        String subResourceHttpMethod = subResource.getMethodMetaData().getHttpMethod();

                        if (subResourceHttpMethod.equals(httpMethod)) {

                            SelectedResourceMetaData selectedResourceMetaData = new SelectedResourceMetaData();
                            selectedResourceMetaData.setSelectedMethodMetaData(subResource.getMethodMetaData());
                            selectedResourceMetaData.addPathVariableMetaData(rootPathMetaData.getPathVariables());
                            selectedResourceMetaData.addPathVariableMetaData(subPathMetaData.getPathVariables());

                            log.trace("sub resource found");
                            return selectedResourceMetaData;
                        }
                    }
                }

            }
        }

        log.trace("resource not found");
        throw new CuubezException(CuubezException.RESOURCE_NOT_FOUND);
    }
View Full Code Here

                content = XMLTransformerUtil.getDocumentAsString(document);
            }

        } catch (ParserConfigurationException e) {
            log.error(e);
            throw new CuubezException(CuubezExceptionConstance.PARSING_EXCEPTION);
        } catch (TransformerException e) {
            log.error(e);
            throw new CuubezException(CuubezExceptionConstance.PARSING_EXCEPTION);
        }

        if (content != null) {
            Class<?> inputObjectType = messageContext.getRequestContext().getSelectedResource().getSelectedMethodMetaData().getInputObjectType();
            String rootNode = XMLTransformerUtil.getRootNodeName(document);
View Full Code Here

        try {
            output = transformer.unMarshal(new InputStreamReader(messageContext.getRequestConfigurationContext().getRequest().getInputStream()), inputObjectType);
            setInputObjectToParameterArray(messageContext, output);
        } catch (IOException e) {
            log.error(e);
            throw new CuubezException(CuubezExceptionConstance.PARSING_EXCEPTION);
        }

    }
View Full Code Here

TOP

Related Classes of com.cuubez.core.exception.CuubezException

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.