当前位置: 首页>>代码示例>>Java>>正文


Java EdmxReference类代码示例

本文整理汇总了Java中org.apache.olingo.server.api.edmx.EdmxReference的典型用法代码示例。如果您正苦于以下问题:Java EdmxReference类的具体用法?Java EdmxReference怎么用?Java EdmxReference使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EdmxReference类属于org.apache.olingo.server.api.edmx包,在下文中一共展示了EdmxReference类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: prepareHandler

import org.apache.olingo.server.api.edmx.EdmxReference; //导入依赖的package包/类
private ODataHttpHandler prepareHandler() {
    OData oData = OData.newInstance();

    ServiceMetadata edm = oData.createServiceMetadata(new CarsEdmProvider(), new ArrayList<EdmxReference>());
    ODataHttpHandler handler = oData.createHandler(edm);

    return handler;
}
 
开发者ID:sbcd90,项目名称:olingo-jersey,代码行数:9,代码来源:CarServiceImpl.java

示例2: process

import org.apache.olingo.server.api.edmx.EdmxReference; //导入依赖的package包/类
/**
 * Process.
 *
 * @param req the req
 * @return the response entity
 */
@RequestMapping(value = "*")
public ResponseEntity<String> process(HttpServletRequest req) {

	try {
		OData odata = OData.newInstance();
		ServiceMetadata edm = odata.createServiceMetadata(edmProvider,
				new ArrayList<EdmxReference>());

		ODataHandler handler = new ODataHandler(odata, edm);
		handler.register(enityCollectionProcessor);

		ODataResponse response = handler.process(createODataRequest(req,
				split));
		String responseStr = StreamUtils.copyToString(
				response.getContent(), Charset.defaultCharset());
		MultiValueMap<String, String> headers = new HttpHeaders();
		for (String key : response.getHeaders().keySet()) {
			headers.add(key, response.getHeaders().get(key).toString());
		}
		return new ResponseEntity<String>(responseStr, headers,
				HttpStatus.valueOf(response.getStatusCode()));
	} catch (Exception ex) {
		throw new EdmException();
	}

}
 
开发者ID:rohitghatol,项目名称:spring-boot-Olingo-oData,代码行数:33,代码来源:EDMController.java

示例3: service

import org.apache.olingo.server.api.edmx.EdmxReference; //导入依赖的package包/类
@Override
protected void service(final HttpServletRequest req, final HttpServletResponse resp)
    throws ServletException, IOException {
  try {

    /*
     * create odata handler and configure it with CsdlEdmProvider and Processor. todo: this needs
     * to be rewritten the list does not have to be recreated each time. The advantage of this is
     * that the multiple threads calling this are seperated.
     */
    OData odata = OData.newInstance();
    ServiceMetadata edm = odata.createServiceMetadata(new RedHxServiceEdmProvider(),
        new ArrayList<EdmxReference>());
    ODataHttpHandler handler = odata.createHandler(edm);

    System.out.println("HFB5: in service call. " + req.getAuthType() + ", " + req.getContentType()
        + ", " + req.getPathInfo());
    handler.register(new RedHxChassisCollectionProcessor());
    handler.register(new RedHxDiscoveryProcessor(odata, edm.getEdm()));

    // let the handler do the work
    handler.process(req, resp);

    /**
     * todo Olingo source. fix ODataHandler line 203 public void register(final Processor
     * processor) { processors.add(0, processor); }
     *
     * so that it can not insert duplicte Processor classes.
     */
  } catch (RuntimeException ex) {
    LOG.error("Server Error occurred in RedHxServlet", ex);

    throw new ServletException(ex);
  }
}
 
开发者ID:RedHelixOrg,项目名称:RedHelix-1,代码行数:36,代码来源:RedHxServlet.java


注:本文中的org.apache.olingo.server.api.edmx.EdmxReference类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。