• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ODataClientFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setUpODataServiceRoot

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
@BeforeClass
public static void setUpODataServiceRoot() throws IOException {
  testStaticServiceRootURL = "http://localhost:9080/stub/StaticService/V40/Static.svc";
  testDemoServiceRootURL = "http://localhost:9080/stub/StaticService/V40/Demo.svc";
  testVocabulariesServiceRootURL = "http://localhost:9080/stub/StaticService/V40/Vocabularies.svc";
  testNorthwindRootURL = "http://localhost:9080/stub/StaticService/V40/NorthWind.svc";
  testKeyAsSegmentServiceRootURL = "http://localhost:9080/stub/StaticService/V40/KeyAsSegment.svc";
  testOpenTypeServiceRootURL = "http://localhost:9080/stub/StaticService/V40/OpenType.svc";
  testLargeModelServiceRootURL = "http://localhost:9080/stub/StaticService/V40/Static.svc/large";
  testAuthServiceRootURL = "http://localhost:9080/stub/DefaultService.svc/V40/Static.svc";
  testOAuth2ServiceRootURL = "http://localhost:9080/stub/StaticService/V40/OAuth2.svc";

  edmClient = ODataClientFactory.getEdmEnabledClient(testStaticServiceRootURL, ContentType.JSON);

  edmClient.getConfiguration().setDefaultBatchAcceptFormat(ContentType.APPLICATION_OCTET_STREAM);
  client.getConfiguration().setDefaultBatchAcceptFormat(ContentType.APPLICATION_OCTET_STREAM);
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:18,代码来源:AbstractTestITCase.java


示例2: test1Olingo1064

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
@Test
public void test1Olingo1064() throws ODataDeserializerException {
  EdmMetadataRequest request = getClient().getRetrieveRequestFactory().getMetadataRequest(SERVICE_URI);
  assertNotNull(request);
  setCookieHeader(request);    
  
  ODataRetrieveResponse<Edm> response = request.execute();
  saveCookieHeader(response);
  assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode());

  Edm edm = response.getBody();
  
  EdmEnabledODataClient odataClient = ODataClientFactory.getEdmEnabledClient(SERVICE_URI, edm, null);
  final InputStream input = Thread.currentThread().getContextClassLoader().
      getResourceAsStream("ESCompAllPrimWithValueForComplexProperty.json");
  ClientEntity entity = odataClient.getReader().readEntity(input, ContentType.JSON);
  assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode());
  assertNotNull(entity.getProperty(PROPERTY_COMP).getComplexValue());
  assertEquals("olingo.odata.test1.CTAllPrim", entity.getProperty(PROPERTY_COMP).getComplexValue().getTypeName());
  assertEquals(PROPERTY_COMP, entity.getProperty(PROPERTY_COMP).getName());
  assertNull(entity.getProperty(PROPERTY_COMP).getComplexValue().get("PropertyString").
      getPrimitiveValue().toValue());
  assertNull(entity.getProperty(PROPERTY_COMP).getComplexValue().get("PropertyBoolean").
      getPrimitiveValue().toValue());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:26,代码来源:BasicITCase.java


示例3: test2Olingo1064

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
@Test
public void test2Olingo1064() throws ODataDeserializerException {
  EdmMetadataRequest request = getClient().getRetrieveRequestFactory().getMetadataRequest(SERVICE_URI);
  assertNotNull(request);
  setCookieHeader(request);    
  
  ODataRetrieveResponse<Edm> response = request.execute();
  saveCookieHeader(response);
  assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode());

  Edm edm = response.getBody();
  
  EdmEnabledODataClient odataClient = ODataClientFactory.getEdmEnabledClient(SERVICE_URI, edm, null);
  final InputStream input = Thread.currentThread().getContextClassLoader().
      getResourceAsStream("ESCompAllPrimWithNullValueForComplexProperty.json");
  ClientEntity entity = odataClient.getReader().readEntity(input, ContentType.JSON);
  assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode());
  assertNotNull(entity.getProperty(PROPERTY_COMP).getComplexValue());
  assertEquals("olingo.odata.test1.CTAllPrim", entity.getProperty(PROPERTY_COMP).getComplexValue().getTypeName());
  assertEquals(PROPERTY_COMP, entity.getProperty(PROPERTY_COMP).getName());
  assertTrue(entity.getProperty(PROPERTY_COMP).hasNullValue());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:23,代码来源:BasicITCase.java


示例4: test3Olingo1064

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
@Test
public void test3Olingo1064() throws ODataDeserializerException {
  EdmMetadataRequest request = getClient().getRetrieveRequestFactory().getMetadataRequest(SERVICE_URI);
  assertNotNull(request);
  setCookieHeader(request);    
  
  ODataRetrieveResponse<Edm> response = request.execute();
  saveCookieHeader(response);
  assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode());

  Edm edm = response.getBody();
  
  EdmEnabledODataClient odataClient = ODataClientFactory.getEdmEnabledClient(SERVICE_URI, edm, null);
  final InputStream input = Thread.currentThread().getContextClassLoader().
      getResourceAsStream("ESCompAllPrimWithEmptyValueForComplexProperty.json");
  ClientEntity entity = odataClient.getReader().readEntity(input, ContentType.JSON);
  assertEquals("olingo.odata.test1.CTAllPrim", entity.getProperty(PROPERTY_COMP).getComplexValue().getTypeName());
  assertEquals(PROPERTY_COMP, entity.getProperty(PROPERTY_COMP).getName());
  assertTrue(entity.getProperty(PROPERTY_COMP).hasNullValue());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:21,代码来源:BasicITCase.java


示例5: CMODataClient

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
public CMODataClient(String serviceUrl, String serviceUser, String servicePassword) {

        checkArgument(!isBlank(serviceUrl), "Service url must not be blank.");
        checkArgument(!isBlank(serviceUser), "Service user must not be blank.");
        checkArgument(!isBlank(servicePassword), "Service password must not be blank.");
        this.serviceUrl = serviceUrl;
        this.client = ODataClientFactory.getClient();
        this.client.getConfiguration().setHttpClientFactory(
                new CMOdataHTTPFactory(serviceUser, servicePassword));
        logger.debug(format("CMClient instanciated for host '%s' with service user '%s'.", serviceUrl, serviceUser));
    }
 
开发者ID:SAP,项目名称:devops-cm-client,代码行数:12,代码来源:CMODataClient.java


示例6: RedHxServerConnectionContext

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
/**
 * Create the context for the connection to the Redfish server with no HTTP authentication.
 * Creating the class does not require a free TCP port number on the local host.
 *
 * @param redfishProtocolVersion the Redfish protocol version to used. See this class's
 *        description for the reason this shall not be null.
 * @param httpProtocol the type of TCP connection to use. This shall not be null.
 * @param hostName the hostname of the Redfish server. This shall not be null.
 * @param tcpPortNumber the TCP port number in the hostName argument to connect to.
 */
public RedHxServerConnectionContext(final RedHxRedfishProtocolVersionEnum redfishProtocolVersion,
    final RedHxTcpProtocolTypeEnum httpProtocol, final String hostName, final int tcpPortNumber) {
  this.redfishProtocolVersion = redfishProtocolVersion;
  this.httpProtocol = httpProtocol;
  this.hostName = hostName;
  this.tcpPortNumber = tcpPortNumber;
  this.userName = null;
  this.password = null;

  //
  this.client = ODataClientFactory.getClient();
  this.client.getConfiguration().setDefaultPubFormat(ContentType.JSON_NO_METADATA);
}
 
开发者ID:RedHelixOrg,项目名称:RedHelix-1,代码行数:24,代码来源:RedHxServerConnectionContext.java


示例7: onClick

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
@Override
public void onClick(final View view) {
    final Button button = (Button) findViewById(R.id.my_button);
    button.setClickable(false);

    final ODataClient client = ODataClientFactory.getV4();
    client.getConfiguration().setHttpClientFactory(new AndroidHttpClientFactory());
    new LongRunningGetIO(client).execute();
}
 
开发者ID:Tirasa,项目名称:olingoClientOnAndroidSample,代码行数:10,代码来源:Main.java


示例8: getEdmClient

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
protected EdmEnabledODataClient getEdmClient() {
  if (_edmClient == null) {
    _edmClient = ODataClientFactory.getEdmEnabledClient(testOAuth2ServiceRootURL, ContentType.JSON);
    _edmClient.getConfiguration().setHttpClientFactory(
        new CXFOAuth2HttpClientFactory(OAUTH2_GRANT_SERVICE_URI, OAUTH2_TOKEN_SERVICE_URI));
  }

  return _edmClient;
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:10,代码来源:OAuth2TestITCase.java


示例9: test4Olingo1064

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void test4Olingo1064() throws ODataDeserializerException {
  EdmMetadataRequest request = getClient().getRetrieveRequestFactory().getMetadataRequest(SERVICE_URI);
  assertNotNull(request);
  setCookieHeader(request);    
  
  ODataRetrieveResponse<Edm> response = request.execute();
  saveCookieHeader(response);
  assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode());

  Edm edm = response.getBody();
  
  EdmEnabledODataClient odataClient = ODataClientFactory.getEdmEnabledClient(SERVICE_URI, edm, null);
  final InputStream input = Thread.currentThread().getContextClassLoader().
      getResourceAsStream("ESTwoKeyNavWithNestedComplexTypes.json");
  ClientEntity entity = odataClient.getReader().readEntity(input, ContentType.JSON);
  assertEquals("olingo.odata.test1.CTPrimComp", entity.getProperty(PROPERTY_COMP).getComplexValue().getTypeName());
  assertEquals(PROPERTY_COMP, entity.getProperty(PROPERTY_COMP).getName());
  Map<String, Object> map = entity.getProperty(PROPERTY_COMP).getComplexValue().asJavaMap();
  assertEquals(map.size(), 2);
  assertEquals(((Map<String, Object>)map.get(PROPERTY_COMP)).size(), 16);
  assertEquals("Collection(olingo.odata.test1.CTPrimComp)", entity.getProperty(COL_PROPERTY_COMP).
      getCollectionValue().getTypeName());
  assertEquals(0, entity.getProperty(COL_PROPERTY_COMP).getCollectionValue().size());
  assertEquals("olingo.odata.test1.CTNavFiveProp", entity.getProperty(PROPERTY_COMP_NAV).
      getComplexValue().getTypeName());
  assertEquals("olingo.odata.test1.CTTwoPrim", entity.getProperty(PROPERTY_COMP_TWO_PRIM).
      getComplexValue().getTypeName());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:31,代码来源:BasicITCase.java


示例10: testOLINGO975

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
@Test
public void testOLINGO975() throws ODataDeserializerException {
  EdmMetadataRequest request = getClient().getRetrieveRequestFactory().getMetadataRequest(SERVICE_URI);
  assertNotNull(request);
  setCookieHeader(request);    
  
  ODataRetrieveResponse<Edm> response = request.execute();
  saveCookieHeader(response);
  assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode());

  Edm edm = response.getBody();
  
  EdmEnabledODataClient odataClient = ODataClientFactory.getEdmEnabledClient(SERVICE_URI, edm, null);
  final InputStream input = Thread.currentThread().getContextClassLoader().
      getResourceAsStream("OdataTypesInBaseAndDerivedTypes.json");
  ClientEntity entity = odataClient.getReader().readEntity(input, ContentType.JSON);
  assertEquals("NavPropertyETTwoPrimMany", entity.getNavigationLinks().get(0).getName());
  assertNotNull(entity.getNavigationLinks().get(0).asInlineEntitySet());
  assertEquals(2, entity.getNavigationLinks().get(0).asInlineEntitySet().getEntitySet().getEntities().size());
  assertEquals(3, entity.getNavigationLinks().get(0).asInlineEntitySet().getEntitySet().getEntities().get(0).
      getProperties().size());
  assertEquals(1, entity.getNavigationLinks().get(0).asInlineEntitySet().getEntitySet().getEntities().get(1).
      getProperties().size());
  assertEquals("#olingo.odata.test1.ETBase", entity.getNavigationLinks().get(0).asInlineEntitySet().getEntitySet().
      getEntities().get(0).getTypeName().toString());
  assertEquals("#olingo.odata.test1.ETBase", entity.getNavigationLinks().get(0).asInlineEntitySet().getEntitySet().
      getEntities().get(1).getTypeName().toString());
  assertEquals("olingo.odata.test1.ETAllPrim", entity.getTypeName().toString());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:30,代码来源:BasicITCase.java


示例11: test1OLINGO753

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
@Test
public void test1OLINGO753() throws ODataDeserializerException {
  final ODataClient client = ODataClientFactory.getClient();
  final URI uri = client.newURIBuilder(SERVICE_ROOT).
      appendOperationCallSegment("functionName").count().build();
  final Map<String, ClientValue> parameters = new HashMap<String, ClientValue>();
  final ClientPrimitiveValue value = client.getObjectFactory().
      newPrimitiveValueBuilder().buildString("parameterValue");
  parameters.put("parameterName", value);
  URI newUri = URIUtils.buildFunctionInvokeURI(uri, parameters);
  assertNotNull(newUri);
  assertEquals("http://host/service/functionName(parameterName%3D'parameterValue')"
      + "/%24count", newUri.toASCIIString());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:15,代码来源:URIBuilderTest.java


示例12: test2OLINGO753

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
@Test
public void test2OLINGO753() throws ODataDeserializerException {
  final ODataClient client = ODataClientFactory.getClient();
  final URI uri = client.newURIBuilder(SERVICE_ROOT).appendOperationCallSegment("functionName").
      filter("paramName eq 1").format("json").count().build();
  final Map<String, ClientValue> parameters = new HashMap<String, ClientValue>();
  final ClientPrimitiveValue value = client.getObjectFactory().
      newPrimitiveValueBuilder().buildString("parameterValue");
  parameters.put("parameterName", value);
  URI newUri = URIUtils.buildFunctionInvokeURI(uri, parameters);
  assertNotNull(newUri);
  assertEquals("http://host/service/functionName(parameterName%3D'parameterValue')"
      + "/%24count?%24filter=paramName%20eq%201&%24format=json", newUri.toASCIIString());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:15,代码来源:URIBuilderTest.java


示例13: test3OLINGO753

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
@Test
public void test3OLINGO753() throws ODataDeserializerException {
  final ODataClient client = ODataClientFactory.getClient();
  final URI uri = client.newURIBuilder(SERVICE_ROOT).appendOperationCallSegment("functionName").
      filter("paramName eq 1").format("json").build();
  final Map<String, ClientValue> parameters = new HashMap<String, ClientValue>();
  final ClientPrimitiveValue value = client.getObjectFactory().
      newPrimitiveValueBuilder().buildString("parameterValue");
  parameters.put("parameterName", value);
  URI newUri = URIUtils.buildFunctionInvokeURI(uri, parameters);
  assertNotNull(newUri);
  assertEquals("http://host/service/functionName(parameterName%3D'parameterValue')"
      + "?%24filter=paramName%20eq%201&%24format=json", newUri.toASCIIString());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:15,代码来源:URIBuilderTest.java


示例14: test4OLINGO753

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
@Test
public void test4OLINGO753() throws ODataDeserializerException {
  final ODataClient client = ODataClientFactory.getClient();
  final URI uri = client.newURIBuilder(SERVICE_ROOT).appendEntitySetSegment("EntitySet").
      appendOperationCallSegment("functionName").count().build();
  final Map<String, ClientValue> parameters = new HashMap<String, ClientValue>();
  final ClientPrimitiveValue value = client.getObjectFactory().
      newPrimitiveValueBuilder().buildString("parameterValue");
  parameters.put("parameterName", value);
  URI newUri = URIUtils.buildFunctionInvokeURI(uri, parameters);
  assertNotNull(newUri);
  assertEquals("http://host/service/EntitySet/functionName(parameterName%3D'parameterValue')"
      + "/%24count", newUri.toASCIIString());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:15,代码来源:URIBuilderTest.java


示例15: test5OLINGO753

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
@Test
public void test5OLINGO753() throws ODataDeserializerException {
  final ODataClient client = ODataClientFactory.getClient();
  final URI uri = client.newURIBuilder(SERVICE_ROOT).appendEntitySetSegment("EntitySet").
      appendOperationCallSegment("functionName").count().filter("PropertyString eq '1'").build();
  final Map<String, ClientValue> parameters = new HashMap<String, ClientValue>();
  final ClientPrimitiveValue value = client.getObjectFactory().
      newPrimitiveValueBuilder().buildString("parameterValue");
  parameters.put("parameterName", value);
  URI newUri = URIUtils.buildFunctionInvokeURI(uri, parameters);
  assertNotNull(newUri);
  assertEquals("http://host/service/EntitySet/functionName(parameterName%3D'parameterValue')"
      + "/%24count?%24filter=PropertyString%20eq%20'1'", newUri.toASCIIString());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:15,代码来源:URIBuilderTest.java


示例16: test6OLINGO753

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
@Test
public void test6OLINGO753() throws ODataDeserializerException {
  final ODataClient client = ODataClientFactory.getClient();
  final URI uri = client.newURIBuilder(SERVICE_ROOT).
      appendOperationCallSegment("functionName").count().filter("PropertyString eq '1'").build();
  final Map<String, ClientValue> parameters = new HashMap<String, ClientValue>();
  URI newUri = URIUtils.buildFunctionInvokeURI(uri, parameters);
  assertNotNull(newUri);
  assertEquals("http://host/service/functionName()"
      + "/%24count?%24filter=PropertyString%20eq%20'1'", newUri.toASCIIString());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:12,代码来源:URIBuilderTest.java


示例17: test7OLINGO753

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
@Test
public void test7OLINGO753() throws ODataDeserializerException {
  final ODataClient client = ODataClientFactory.getClient();
  final URI uri = client.newURIBuilder(SERVICE_ROOT).appendEntitySetSegment("EntitySet").
      appendOperationCallSegment("functionName").filter("PropertyString eq '1'").
      appendNavigationSegment("NavSeg").count().build();
  final Map<String, ClientValue> parameters = new HashMap<String, ClientValue>();
  final ClientPrimitiveValue value = client.getObjectFactory().
      newPrimitiveValueBuilder().buildString("parameterValue");
  parameters.put("parameterName", value);
  URI newUri = URIUtils.buildFunctionInvokeURI(uri, parameters);
  assertNotNull(newUri);
  assertEquals("http://host/service/EntitySet/functionName(parameterName%3D'parameterValue')/NavSeg"
      + "/%24count?%24filter=PropertyString%20eq%20'1'", newUri.toASCIIString());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:16,代码来源:URIBuilderTest.java


示例18: test8OLINGO753

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
@Test
public void test8OLINGO753() throws ODataDeserializerException {
  final ODataClient client = ODataClientFactory.getClient();
  final URI uri = client.newURIBuilder(SERVICE_ROOT).appendEntitySetSegment("EntitySet").
      appendOperationCallSegment("functionName").filter("PropertyString eq '1'").
      appendNavigationSegment("NavSeg").appendActionCallSegment("ActionName").count().build();
  final Map<String, ClientValue> parameters = new HashMap<String, ClientValue>();
  final ClientPrimitiveValue value = client.getObjectFactory().
      newPrimitiveValueBuilder().buildString("parameterValue");
  parameters.put("parameterName", value);
  URI newUri = URIUtils.buildFunctionInvokeURI(uri, parameters);
  assertNotNull(newUri);
  assertEquals("http://host/service/EntitySet/functionName(parameterName%3D'parameterValue')/NavSeg/ActionName"
      + "/%24count?%24filter=PropertyString%20eq%20'1'", newUri.toASCIIString());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:16,代码来源:URIBuilderTest.java


示例19: test9OLINGO753

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
@Test
public void test9OLINGO753() throws ODataDeserializerException {
  final ODataClient client = ODataClientFactory.getClient();
  final URI uri = client.newURIBuilder(SERVICE_ROOT).appendEntitySetSegment("EntitySet").
      appendOperationCallSegment("functionName").
      appendNavigationSegment("NavSeg").appendActionCallSegment("ActionName").appendValueSegment().build();
  final Map<String, ClientValue> parameters = new HashMap<String, ClientValue>();
  final ClientPrimitiveValue value = client.getObjectFactory().
      newPrimitiveValueBuilder().buildString("parameterValue");
  parameters.put("parameterName", value);
  URI newUri = URIUtils.buildFunctionInvokeURI(uri, parameters);
  assertNotNull(newUri);
  assertEquals("http://host/service/EntitySet/functionName(parameterName%3D'parameterValue')"
      + "/NavSeg/ActionName/%24value", newUri.toASCIIString());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:16,代码来源:URIBuilderTest.java


示例20: test10OLINGO753

import org.apache.olingo.client.core.ODataClientFactory; //导入依赖的package包/类
@Test
public void test10OLINGO753() throws ODataDeserializerException {
  final ODataClient client = ODataClientFactory.getClient();
  final URI uri = client.newURIBuilder(SERVICE_ROOT).appendEntitySetSegment("EntitySet").
      appendOperationCallSegment("functionName").
      appendNavigationSegment("NavSeg").appendRefSegment().build();
  final Map<String, ClientValue> parameters = new HashMap<String, ClientValue>();
  final ClientPrimitiveValue value = client.getObjectFactory().
      newPrimitiveValueBuilder().buildString("parameterValue");
  parameters.put("parameterName", value);
  URI newUri = URIUtils.buildFunctionInvokeURI(uri, parameters);
  assertNotNull(newUri);
  assertEquals("http://host/service/EntitySet/functionName(parameterName%3D'parameterValue')"
      + "/NavSeg/%24ref", newUri.toASCIIString());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:16,代码来源:URIBuilderTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SimpleModificationTracker类代码示例发布时间:2022-05-23
下一篇:
Java RetryOperationsInterceptor类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap