Package org.apache.olingo.odata2.core.exception

Examples of org.apache.olingo.odata2.core.exception.ODataRuntimeException


  public ODataResponse writeErrorDocument(final ODataErrorContext context) {
    try {
      return create(context.getContentType()).writeErrorDocument(context.getHttpStatus(), context.getErrorCode(),
          context.getMessage(), context.getLocale(), context.getInnerError());
    } catch (EntityProviderException e) {
      throw new ODataRuntimeException(e);
    }
  }
View Full Code Here


        }
      }
      break;

    default:
      throw new ODataRuntimeException("Unknown or not implemented URI type: " + uriInfo.getUriType());
    }
  }
View Full Code Here

    case Time:
      return EdmTime.getInstance();
    case Null:
      return EdmNull.getInstance();
    default:
      throw new ODataRuntimeException("Invalid Type " + typeKind);
    }
  }
View Full Code Here

    if ("Bit".equals(edmSimpleType)) {
      return Bit.getInstance();
    } else if ("Uint7".equals(edmSimpleType)) {
      return Uint7.getInstance();
    } else {
      throw new ODataRuntimeException("Invalid internal Type " + edmSimpleType);
    }
  }
View Full Code Here

    } finally {// NOPMD (suppress DoNotThrowExceptionInFinally)
      scanner.close();
      try {
        in.close();
      } catch (IOException e) {
        throw new ODataRuntimeException(e);
      }
    }
    return responseList;
  }
View Full Code Here

      if (app instanceof AbstractODataApplication) {
        factoryClass = ((AbstractODataApplication) app).getServiceFactoryClass();
      } else {
        final String factoryClassName = servletConfig.getInitParameter(ODataServiceFactory.FACTORY_LABEL);
        if (factoryClassName == null) {
          throw new ODataRuntimeException("Servlet config missing: " + ODataServiceFactory.FACTORY_LABEL);
        }

        ClassLoader cl = (ClassLoader) servletRequest.getAttribute(ODataServiceFactory.FACTORY_CLASSLOADER_LABEL);
        if (cl == null) {
          factoryClass = Class.forName(factoryClassName);
        } else {
          factoryClass = Class.forName(factoryClassName, true, cl);
        }
      }
      ODataServiceFactory serviceFactory = (ODataServiceFactory) factoryClass.newInstance();
      return serviceFactory;
    } catch (Exception e) {
      throw new ODataRuntimeException("Exception during ODataServiceFactory creation occured.", e);
    }
  }
View Full Code Here

      jsonStreamWriter.endArray()
          .endObject();
      writer.flush();
      return writer.toString();
    } catch (final IOException e) {
      throw new ODataRuntimeException("IOException: ", e);
    } catch (final EdmException e) {
      throw new ODataRuntimeException("EdmException: ", e);
    }
  }
View Full Code Here

    @Override
    public ExpandSelectTreeNodeBuilder
        customExpandedLink(final String navigationPropertyName, final ExpandSelectTreeNode expandNode) {
      if (expandNode == null) {
        throw new ODataRuntimeException("ExpandNode must not be null");
      }
      if (customExpandedNavigationProperties == null) {
        customExpandedNavigationProperties = new HashMap<String, ExpandSelectTreeNode>();
      }
      customExpandedNavigationProperties.put(navigationPropertyName, expandNode);
View Full Code Here

    super(type);

    try {
      inlineBaseUri = new URI("http://hubbeldubbel.com/");
    } catch (URISyntaxException e) {
      throw new ODataRuntimeException(e);
    }
  }
View Full Code Here

    try {
      requestUri = context.getPathInfo().getRequestUri();
      errorContext.setPathInfo(context.getPathInfo());
      callback = getErrorHandlerCallbackFromContext(context);
    } catch (Exception e) {
      throw new ODataRuntimeException("Exception occurred", e);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.olingo.odata2.core.exception.ODataRuntimeException

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.