@Test public void readDeltaLink() throws Exception { String content = readFile("feed_with_delta_link.xml"); assertNotNull(content); EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Employees"); InputStream reqContent = createContentAsStream(content); EntityStream stream = new EntityStream(); DeserializerProperties consumerProperties = DeserializerProperties.init() .build(); stream.setReadProperties(consumerProperties); stream.setContent(reqContent); XmlEntityDeserializer xec = new XmlEntityDeserializer(); ODataFeed feed = xec.readFeed(entitySet, stream); assertNotNull(feed); FeedMetadata feedMetadata = feed.getFeedMetadata(); assertNotNull(feedMetadata); String deltaLink = feedMetadata.getDeltaLink(); assertNotNull(deltaLink); assertEquals("http: }
public ODataDeltaFeed readFeed(final EdmEntitySet entitySet, final EntityStream entity) throws EntityProviderException { XMLStreamReader reader = null; EntityProviderException cachedException = null; try { reader = XmlHelper.createStreamReader(entity.getContent()); EntityInfoAggregator eia = EntityInfoAggregator.create(entitySet); XmlFeedDeserializer xfc = new XmlFeedDeserializer(); return xfc.readFeed(reader, eia, entity.getReadProperties()); } catch (EntityProviderException e) { cachedException = e; throw cachedException; } finally { if (reader != null) { try { reader.close(); } catch (XMLStreamException e) { if (cachedException != null) { throw cachedException; } else { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED. addContent(e.getClass() .getSimpleName()), e); } } } } }
XmlEntityDeserializer { public ODataDeltaFeed readFeed(final EdmEntitySet entitySet, final EntityStream entity) throws EntityProviderException { XMLStreamReader reader = null; EntityProviderException cachedException = null; try { reader = XmlHelper.createStreamReader(entity.getContent()); EntityInfoAggregator eia = EntityInfoAggregator.create(entitySet); XmlFeedDeserializer xfc = new XmlFeedDeserializer(); return xfc.readFeed(reader, eia, entity.getReadProperties()); } catch (EntityProviderException e) { cachedException = e; throw cachedException; } finally { if (reader != null) { try { reader.close(); } catch (XMLStreamException e) { if (cachedException != null) { throw cachedException; } else { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED. addContent(e.getClass() .getSimpleName()), e); } } } } } }
XmlEntityDeserializer { public ODataDeltaFeed readFeed(final EdmEntitySet entitySet, final EntityStream entity) throws EntityProviderException { XMLStreamReader reader = null; EntityProviderException cachedException = null; try { reader = XmlHelper.createStreamReader(entity.getContent()); EntityInfoAggregator eia = EntityInfoAggregator.create(entitySet); XmlFeedDeserializer xfc = new XmlFeedDeserializer(); return xfc.readFeed(reader, eia, entity.getReadProperties()); } catch (EntityProviderException e) { cachedException = e; throw cachedException; } finally { if (reader != null) { try { reader.close(); } catch (XMLStreamException e) { if (cachedException != null) { throw cachedException; } else { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED. addContent(e.getClass() .getSimpleName()), e); } } } } } XmlEntityDeserializer(); }
XmlEntityDeserializer { public ODataDeltaFeed readFeed(final EdmEntitySet entitySet, final EntityStream entity) throws EntityProviderException { XMLStreamReader reader = null; EntityProviderException cachedException = null; try { reader = XmlHelper.createStreamReader(entity.getContent()); EntityInfoAggregator eia = EntityInfoAggregator.create(entitySet); XmlFeedDeserializer xfc = new XmlFeedDeserializer(); return xfc.readFeed(reader, eia, entity.getReadProperties()); } catch (EntityProviderException e) { cachedException = e; throw cachedException; } finally { if (reader != null) { try { reader.close(); } catch (XMLStreamException e) { if (cachedException != null) { throw cachedException; } else { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED. addContent(e.getClass() .getSimpleName()), e); } } } } } XmlEntityDeserializer(); ODataDeltaFeed readFeed(final EdmEntitySet entitySet, final EntityStream entity); ODataEntry readEntry(final EdmEntitySet entitySet, final EntityStream entity); Object readCollection(final EntityPropertyInfo info, EntityStream entityStream); Map<String, Object> readProperty(final EntityPropertyInfo propertyInfo, final EntityStream entityStream); }
XmlEntityDeserializer { public ODataDeltaFeed readFeed(final EdmEntitySet entitySet, final EntityStream entity) throws EntityProviderException { XMLStreamReader reader = null; EntityProviderException cachedException = null; try { reader = XmlHelper.createStreamReader(entity.getContent()); EntityInfoAggregator eia = EntityInfoAggregator.create(entitySet); XmlFeedDeserializer xfc = new XmlFeedDeserializer(); return xfc.readFeed(reader, eia, entity.getReadProperties()); } catch (EntityProviderException e) { cachedException = e; throw cachedException; } finally { if (reader != null) { try { reader.close(); } catch (XMLStreamException e) { if (cachedException != null) { throw cachedException; } else { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED. addContent(e.getClass() .getSimpleName()), e); } } } } } XmlEntityDeserializer(); ODataDeltaFeed readFeed(final EdmEntitySet entitySet, final EntityStream entity); ODataEntry readEntry(final EdmEntitySet entitySet, final EntityStream entity); Object readCollection(final EntityPropertyInfo info, EntityStream entityStream); Map<String, Object> readProperty(final EntityPropertyInfo propertyInfo, final EntityStream entityStream);  }