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

Java ODataFeed类代码示例

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

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



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

示例1: readFeed

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
/**
 * Reads a feed (the content of an EntitySet).
 * 
 * @param resource_path the resource path to the parent of the requested
 *    EntitySet, as defined in {@link #getResourcePath(URI)}.
 * @param query_parameters Query parameters, as defined in {@link URI}.
 * 
 * @return an ODataFeed containing the ODataEntries for the given 
 *    {@code resource_path}.
 * 
 * @throws HttpException if the server emits an HTTP error code.
 * @throws IOException if the connection with the remote service fails.
 * @throws EdmException if the EDM does not contain the given entitySetName.
 * @throws EntityProviderException if reading of data (de-serialization)
 *    fails.
 * @throws UriSyntaxException violation of the OData URI construction rules.
 * @throws UriNotMatchingException URI parsing exception.
 * @throws ODataException encapsulate the OData exceptions described above.
 * @throws InterruptedException if running thread has been interrupted.
 */
public ODataFeed readFeed(String resource_path,
   Map<String, String> query_parameters) throws IOException, ODataException, InterruptedException
{
   if (resource_path == null || resource_path.isEmpty ())
      throw new IllegalArgumentException (
         "resource_path must not be null or empty.");
   
   ContentType contentType = ContentType.APPLICATION_ATOM_XML;
   
   String absolutUri = serviceRoot.toString () + '/' + resource_path;
   
   // Builds the query parameters string part of the URL.
   absolutUri = appendQueryParam (absolutUri, query_parameters);
   
   InputStream content = execute (absolutUri, contentType, "GET");
   
   return EntityProvider.readFeed (contentType.type (),
      getEntitySet (resource_path), content,
      EntityProviderReadProperties.init ().build ());
}
 
开发者ID:SentinelDataHub,项目名称:dhus-core,代码行数:41,代码来源:ODataClient.java


示例2: normalizeInlineEntries

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
private void normalizeInlineEntries(final Map<String, Object> oDataEntryProperties) throws ODataJPARuntimeException {
  List<ODataEntry> entries = null;
  try {
    for (String navigationPropertyName : oDataEntityType.getNavigationPropertyNames()) {
      Object inline = oDataEntryProperties.get(navigationPropertyName);
      if (inline instanceof ODataFeed) {
        entries = ((ODataFeed) inline).getEntries();
      } else if (inline instanceof ODataEntry) {
        entries = new ArrayList<ODataEntry>();
        entries.add((ODataEntry) inline);
      }
      if (entries != null) {
        oDataEntryProperties.put(navigationPropertyName, entries);
        entries = null;
      }
    }
  } catch (EdmException e) {
    throw ODataJPARuntimeException
        .throwException(ODataJPARuntimeException.GENERAL
            .addContent(e.getMessage()), e);
  }
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:23,代码来源:JPAEntity.java


示例3: unbalancedPropertyFeedWithSelect

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
@Test
public void unbalancedPropertyFeedWithSelect() throws Exception {
  final EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Companys");
  List<Map<String, Object>> originalData = createData(true);
  List<String> selectedPropertyNames = new ArrayList<String>();
  selectedPropertyNames.add("Id");
  selectedPropertyNames.add("Location");
  ExpandSelectTreeNode select =
      ExpandSelectTreeNode.entitySet(entitySet).selectedProperties(selectedPropertyNames).build();
  
  ODataResponse response = new AtomEntityProvider().writeFeed(entitySet, originalData,
      EntityProviderWriteProperties.serviceRoot(BASE_URI).expandSelectTree(select).
      isDataBasedPropertySerialization(true).build());

  EntityProviderReadProperties readProperties = EntityProviderReadProperties.init().mergeSemantic(false).build();
  XmlEntityConsumer consumer = new XmlEntityConsumer();
  ODataFeed feed = consumer.readFeed(entitySet, (InputStream) response.getEntity(), readProperties);

  compareList(originalData, feed.getEntries());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:21,代码来源:AtomFeedProducerTest.java


示例4: unbalancedPropertyFeedWithSelect

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
@Test
public void unbalancedPropertyFeedWithSelect() throws Exception {
  final EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Companys");
  List<Map<String, Object>> originalData = createData(true);
  List<String> selectedPropertyNames = new ArrayList<String>();
  selectedPropertyNames.add("Id");
  selectedPropertyNames.add("Location");
  ExpandSelectTreeNode select =
      ExpandSelectTreeNode.entitySet(entitySet).selectedProperties(selectedPropertyNames).build();
  
  final ODataResponse response = new JsonEntityProvider().writeFeed(entitySet, originalData,
      EntityProviderWriteProperties.serviceRoot(URI.create(BASE_URI)).expandSelectTree(select).
      isDataBasedPropertySerialization(true).build());

  EntityProviderReadProperties readProperties = EntityProviderReadProperties.init().mergeSemantic(false).build();
  JsonEntityConsumer consumer = new JsonEntityConsumer();
  ODataFeed feed = consumer.readFeed(entitySet, (InputStream) response.getEntity(), readProperties);

  compareList(originalData, feed.getEntries());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:21,代码来源:JsonFeedEntityProducerTest.java


示例5: roomsFeedWithEtagEntries

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
@Test
public void roomsFeedWithEtagEntries() throws Exception {
  InputStream stream = getFileAsStream("feed_rooms_small.xml");
  assertNotNull(stream);

  ODataFeed feed =
      EntityProvider.readFeed("application/atom+xml", MockFacade.getMockEdm().getDefaultEntityContainer()
          .getEntitySet(
              "Rooms"), stream, DEFAULT_PROPERTIES);
  assertNotNull(feed);

  FeedMetadata feedMetadata = feed.getFeedMetadata();
  assertNotNull(feedMetadata);
  assertNotNull(feedMetadata.getNextLink());

  List<ODataEntry> entries = feed.getEntries();
  assertEquals(3, entries.size());
  ODataEntry singleRoom = entries.get(0);
  EntryMetadata roomMetadata = singleRoom.getMetadata();
  assertNotNull(roomMetadata);

  assertEquals("W/\"1\"", roomMetadata.getEtag());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:24,代码来源:XmlFeedConsumerTest.java


示例6: readEmployeesFeedWithInlineCountValid

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
@Test
public void readEmployeesFeedWithInlineCountValid() throws Exception {
  // prepare
  String content = readFile("feed_employees_full.xml");
  assertNotNull(content);

  EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Employees");
  InputStream reqContent = createContentAsStream(content);

  // execute
  XmlEntityConsumer xec = new XmlEntityConsumer();
  EntityProviderReadProperties consumerProperties = EntityProviderReadProperties.init()
      .mergeSemantic(false).build();

  ODataFeed feed = xec.readFeed(entitySet, reqContent, consumerProperties);
  assertNotNull(feed);

  FeedMetadata feedMetadata = feed.getFeedMetadata();
  assertNotNull(feedMetadata);

  int inlineCount = feedMetadata.getInlineCount();
  // Null means no inlineCount found
  assertNotNull(inlineCount);

  assertEquals(6, inlineCount);
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:27,代码来源:XmlFeedConsumerTest.java


示例7: roomsFeedWithRoomsToEmployeesInlineTeams

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
/**
 * Rooms navigate to Employees and has inline entry Teams
 * E.g: Rooms('1')/nr_Employees?$expand=ne_Team
 * @throws Exception
 */
@Test
public void roomsFeedWithRoomsToEmployeesInlineTeams() throws Exception {
  InputStream stream = getFileAsStream("RoomsToEmployeesWithInlineTeams.xml");
  assertNotNull(stream);
  FeedCallback callback = new FeedCallback();

  EntityProviderReadProperties readProperties = EntityProviderReadProperties.init()
      .mergeSemantic(false).callback(callback).build();

  ODataFeed feed =
      EntityProvider.readFeed("application/atom+xml", MockFacade.getMockEdm().getDefaultEntityContainer()
          .getEntitySet(
              "Employees"), stream, readProperties);
  assertNotNull(feed);
  assertEquals(2, feed.getEntries().size());

  Map<String, Object> inlineEntries = callback.getNavigationProperties();
  getExpandedData(inlineEntries, feed);
  for (ODataEntry entry : feed.getEntries()) {
    assertEquals(10, entry.getProperties().size());
    assertEquals(3, ((ODataEntry)entry.getProperties().get("ne_Team")).getProperties().size());
  }
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:29,代码来源:XmlFeedConsumerTest.java


示例8: getExpandedData

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
/**
 * @param inlineEntries
 * @param feed
 * @param entry
 */
private void getExpandedData(Map<String, Object> inlineEntries, ODataEntry entry) {
  assertNotNull(entry);
  Map<String, ExpandSelectTreeNode> expandNodes = entry.getExpandSelectTree().getLinks();
  for (Entry<String, ExpandSelectTreeNode> expand : expandNodes.entrySet()) {
    assertNotNull(expand.getKey());
    if (inlineEntries.containsKey(expand.getKey() + entry.getMetadata().getId())) {
      if (inlineEntries.get(expand.getKey() + entry.getMetadata().getId()) instanceof ODataFeed) {
        ODataFeed innerFeed = (ODataFeed) inlineEntries.get(expand.getKey() + entry.getMetadata().getId());
        assertNotNull(innerFeed);
        getExpandedData(inlineEntries, innerFeed);
        entry.getProperties().put(expand.getKey(), innerFeed);
      } else if (inlineEntries.get(expand.getKey() + entry.getMetadata().getId()) instanceof ODataEntry) {
        ODataEntry innerEntry = (ODataEntry) inlineEntries.get(expand.getKey() + entry.getMetadata().getId());
        assertNotNull(innerEntry);
        getExpandedData(inlineEntries, innerEntry);
        entry.getProperties().put(expand.getKey(), innerEntry);
      }
    }
  }
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:26,代码来源:XmlFeedConsumerTest.java


示例9: readDeltaLink

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
@Test
public void readDeltaLink() throws Exception {
  // prepare
  String content = readFile("feed_with_delta_link.xml");
  assertNotNull(content);

  EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Employees");
  InputStream reqContent = createContentAsStream(content);

  // execute
  XmlEntityConsumer xec = new XmlEntityConsumer();
  EntityProviderReadProperties consumerProperties = EntityProviderReadProperties.init()
      .mergeSemantic(false).build();

  ODataFeed feed = xec.readFeed(entitySet, reqContent, consumerProperties);
  assertNotNull(feed);

  FeedMetadata feedMetadata = feed.getFeedMetadata();
  assertNotNull(feedMetadata);

  String deltaLink = feedMetadata.getDeltaLink();
  // Null means no deltaLink found
  assertNotNull(deltaLink);

  assertEquals("http://thisisadeltalink", deltaLink);
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:27,代码来源:XmlEntityConsumerTest.java


示例10: RoomEntryWithInlineEmployeeInlineTeam

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
/**
 * Room has inline entity to Employees and has inline entry To Team
 * Scenario of 1:n:1 navigation 
 * E.g: Rooms('1')?$expand=nr_Employees/ne_Team
 * @throws Exception
 */
@Test
public void RoomEntryWithInlineEmployeeInlineTeam() throws Exception {
  InputStream stream = getFileAsStream("Room_InlineEmployeesToTeam.xml");
  assertNotNull(stream);
  FeedCallback callback = new FeedCallback();

  EntityProviderReadProperties readProperties = EntityProviderReadProperties.init()
      .mergeSemantic(false).callback(callback).build();

  EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms");
  XmlEntityConsumer xec = new XmlEntityConsumer();
  ODataEntry result =
      xec.readEntry(entitySet, stream, readProperties);
  assertNotNull(result);
  assertEquals(4, result.getProperties().size());

  Map<String, Object> inlineEntries = callback.getNavigationProperties();
  getExpandedData(inlineEntries, result);
  assertEquals(5, result.getProperties().size());
  for (ODataEntry employeeEntry : ((ODataFeed)result.getProperties().get("nr_Employees")).getEntries()) {
    assertEquals(10, employeeEntry.getProperties().size());
    assertEquals(3, ((ODataEntry)employeeEntry.getProperties().get("ne_Team")).getProperties().size());
  }
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:31,代码来源:XmlEntityConsumerTest.java


示例11: RoomEntryWithEmptyInlineEmployeeInlineTeam

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
/**
 * Room has empty inline entity to Employees and has inline entry To Team
 * E.g: Rooms('10')?$expand=nr_Employees/ne_Team
 * @throws Exception
 */
@Test
public void RoomEntryWithEmptyInlineEmployeeInlineTeam() throws Exception {
  InputStream stream = getFileAsStream("Room_EmptyInlineEmployeesToTeam.xml");
  assertNotNull(stream);
  FeedCallback callback = new FeedCallback();

  EntityProviderReadProperties readProperties = EntityProviderReadProperties.init()
      .mergeSemantic(false).callback(callback).build();

  EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms");
  XmlEntityConsumer xec = new XmlEntityConsumer();
  ODataEntry result =
      xec.readEntry(entitySet, stream, readProperties);
  assertNotNull(result);
  assertEquals(4, result.getProperties().size());

  Map<String, Object> inlineEntries = callback.getNavigationProperties();
  getExpandedData(inlineEntries, result);
  assertEquals(5, result.getProperties().size());
  assertEquals(0, ((ODataFeed)result.getProperties().get("nr_Employees")).getEntries().size());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:27,代码来源:XmlEntityConsumerTest.java


示例12: RoomEntryWithInlineEmployeeInlineTeam

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
/**
 * Room has inline entity to Employees and has inline entry To Team
 * Scenario of 1:n:1 navigation 
 * E.g: Rooms('1')?$expand=nr_Employees/ne_Team
 * @throws Exception
 */
@Test
public void RoomEntryWithInlineEmployeeInlineTeam() throws Exception {
  InputStream stream = getFileAsStream("JsonRoom_InlineEmployeesToTeam.json");
  assertNotNull(stream);
  FeedCallback callback = new FeedCallback();

  EntityProviderReadProperties readProperties = EntityProviderReadProperties.init()
      .mergeSemantic(false).callback(callback).build();

  EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms");
  JsonEntityConsumer xec = new JsonEntityConsumer();
  ODataEntry result =
      xec.readEntry(entitySet, stream, readProperties);
  assertNotNull(result);
  assertEquals(4, result.getProperties().size());

  Map<String, Object> inlineEntries = callback.getNavigationProperties();
  getExpandedData(inlineEntries, result);
  assertEquals(5, result.getProperties().size());
  for (ODataEntry employeeEntry : ((ODataFeed)result.getProperties().get("nr_Employees")).getEntries()) {
    assertEquals(10, employeeEntry.getProperties().size());
    assertEquals(3, ((ODataEntry)employeeEntry.getProperties().get("ne_Team")).getProperties().size());
  }
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:31,代码来源:JsonEntryConsumerTest.java


示例13: RoomEntryWithEmptyInlineEmployeeInlineTeam

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
/**
 * Room has empty inline entity to Employees and has inline entry To Team
 * E.g: Rooms('10')?$expand=nr_Employees/ne_Team
 * @throws Exception
 */
@Test
public void RoomEntryWithEmptyInlineEmployeeInlineTeam() throws Exception {
  InputStream stream = getFileAsStream("JsonRoom_EmptyInlineEmployeesToTeam.json");
  assertNotNull(stream);
  FeedCallback callback = new FeedCallback();

  EntityProviderReadProperties readProperties = EntityProviderReadProperties.init()
      .mergeSemantic(false).callback(callback).build();

  EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms");
  JsonEntityConsumer xec = new JsonEntityConsumer();
  ODataEntry result =
      xec.readEntry(entitySet, stream, readProperties);
  assertNotNull(result);
  assertEquals(4, result.getProperties().size());

  Map<String, Object> inlineEntries = callback.getNavigationProperties();
  getExpandedData(inlineEntries, result);
  assertEquals(5, result.getProperties().size());
  assertEquals(0, ((ODataFeed)result.getProperties().get("nr_Employees")).getEntries().size());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:27,代码来源:JsonEntryConsumerTest.java


示例14: emptyFeed

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
@Test
public void emptyFeed() throws Exception {
  EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Teams");
  String content = "{\"d\":{\"results\":[]}}";
  InputStream contentBody = createContentAsStream(content);

  // execute
  JsonEntityConsumer xec = new JsonEntityConsumer();
  ODataFeed feed = xec.readFeed(entitySet, contentBody, DEFAULT_PROPERTIES);
  assertNotNull(feed);

  List<ODataEntry> entries = feed.getEntries();
  assertNotNull(entries);
  assertEquals(0, entries.size());

  FeedMetadata feedMetadata = feed.getFeedMetadata();
  assertNotNull(feedMetadata);
  assertNull(feedMetadata.getInlineCount());
  assertNull(feedMetadata.getNextLink());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:21,代码来源:JsonFeedConsumerTest.java


示例15: roomsFeedWithRoomInlineEmployeesInlineBuildings

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
/**
 * Rooms has an inline feed Employees and Rooms has Inline entry Buildings
 * E.g: Rooms?$expand=nr_Employees,nr_Building
 * Empty Inline entity is also part of payload
 * @throws Exception
 */
@Test
public void roomsFeedWithRoomInlineEmployeesInlineBuildings() throws Exception {
  InputStream stream = getFileAsStream("JsonRooms_InlineEmployees_InlineBuilding.json");
  assertNotNull(stream);
  FeedCallback callback = new FeedCallback();

  EntityProviderReadProperties readProperties = EntityProviderReadProperties.init()
      .mergeSemantic(false).callback(callback).build();

  EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms");
  JsonEntityConsumer xec = new JsonEntityConsumer();
  ODataDeltaFeed feed = xec.readDeltaFeed(entitySet, stream, readProperties);
  assertNotNull(feed);
  assertEquals(3, feed.getEntries().size());

  Map<String, Object> inlineEntries = callback.getNavigationProperties();
  getExpandedData(inlineEntries, feed);
  for (ODataEntry entry : feed.getEntries()) {
    assertEquals(6, entry.getProperties().size());
    for (ODataEntry employeeEntry : ((ODataFeed)entry.getProperties().get("nr_Employees")).getEntries()) {
      assertEquals(9, employeeEntry.getProperties().size());
    }
    assertEquals(3, ((ODataEntry)entry.getProperties().get("nr_Building")).getProperties().size());
  }
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:32,代码来源:JsonFeedConsumerTest.java


示例16: innerFeedNoMediaResourceWithoutCallbackContainsNextLinkAndCount

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
@Test
public void innerFeedNoMediaResourceWithoutCallbackContainsNextLinkAndCount() throws Exception {
  ODataEntry outerEntry =
      prepareAndExecuteEntry(BUILDING_WITH_INLINE_ROOMS_NEXTLINK_AND_COUNT, "Buildings", DEFAULT_PROPERTIES);

  ODataFeed innerRoomFeed = (ODataFeed) outerEntry.getProperties().get("nb_Rooms");
  assertNotNull(innerRoomFeed);

  List<ODataEntry> rooms = innerRoomFeed.getEntries();
  assertNotNull(rooms);
  assertEquals(1, rooms.size());

  FeedMetadata roomsMetadata = innerRoomFeed.getFeedMetadata();
  assertEquals(Integer.valueOf(1), roomsMetadata.getInlineCount());
  assertEquals("nextLink", roomsMetadata.getNextLink());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:17,代码来源:JsonEntryDeepInsertFeedTest.java


示例17: innerFeedNoMediaResourceWithCallbackContainsNextLinkAndCount

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
@Test
public void innerFeedNoMediaResourceWithCallbackContainsNextLinkAndCount() throws Exception {
  ODataEntry outerEntry =
      prepareAndExecuteEntry(BUILDING_WITH_INLINE_ROOMS_NEXTLINK_AND_COUNT, "Buildings", DEFAULT_PROPERTIES);

  ODataFeed innerRoomFeed = (ODataFeed) outerEntry.getProperties().get("nb_Rooms");
  assertNotNull(innerRoomFeed);

  List<ODataEntry> rooms = innerRoomFeed.getEntries();
  assertNotNull(rooms);
  assertEquals(1, rooms.size());

  FeedMetadata roomsMetadata = innerRoomFeed.getFeedMetadata();
  assertEquals(Integer.valueOf(1), roomsMetadata.getInlineCount());
  assertEquals("nextLink", roomsMetadata.getNextLink());

}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:18,代码来源:JsonEntryDeepInsertFeedTest.java


示例18: testDeltaFeedWithZeroEntries

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
private void testDeltaFeedWithZeroEntries(final String contentType) throws Exception {
  roomDataCount = 0;
  deletedRoomDataCount = 0;

  ODataFeed feed = client.readFeed("Container1", "Rooms", contentType);
  String deltaLink = feed.getFeedMetadata().getDeltaLink();

  assertNotNull(feed);
  assertEquals(roomDataCount, feed.getEntries().size());
  assertEquals(getEndpoint().toASCIIString() + "Rooms?" + DELTATOKEN_1234, feed.getFeedMetadata().getDeltaLink());

  ODataDeltaFeed deltaFeed = client.readDeltaFeed("Container1", "Rooms", contentType, deltaLink);

  assertNotNull(deltaFeed);
  assertEquals(roomDataCount, deltaFeed.getEntries().size());
  assertEquals(deltaLink, deltaFeed.getFeedMetadata().getDeltaLink());

  List<DeletedEntryMetadata> deletedEntries = deltaFeed.getDeletedEntries();
  assertNotNull(deletedEntries);
  assertEquals(deletedRoomDataCount, deletedEntries.size());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:22,代码来源:ClientDeltaResponseTest.java


示例19: readFeedLogPerf

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
/** Logs how much time an OData command consumed. */
private ODataFeed readFeedLogPerf(String query, Map<String, String>params)
      throws IOException, ODataException, InterruptedException
{
   long delta_time = System.currentTimeMillis();
   ODataFeed feed = client.readFeed(query, params);
   delta_time = System.currentTimeMillis() - delta_time;
   log(Level.DEBUG, "query(" + query + ") done in " + delta_time + "ms");
   return feed;
}
 
开发者ID:SentinelDataHub,项目名称:dhus-core,代码行数:11,代码来源:ODataUserSynchronizer.java


示例20: readFeed

import org.apache.olingo.odata2.api.ep.feed.ODataFeed; //导入依赖的package包/类
protected ODataFeed readFeed(String serviceUri, String contentType, String entitySetName)
		throws IOException, ODataException {
	initialize(serviceUri);
	EdmEntityContainer entityContainer = edm.getDefaultEntityContainer();
	String absolutUri = createUri(serviceUri, entitySetName, null);

	InputStream content = (InputStream) connect(absolutUri, contentType, GET).getContent();
	return EntityProvider.readFeed(contentType, entityContainer.getEntitySet(entitySetName), content,
			EntityProviderReadProperties.init().build());
}
 
开发者ID:sapmentors,项目名称:lemonaid,代码行数:11,代码来源:GenericODataClient.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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