@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()); }
public ODataDeltaFeed readFeed(final XMLStreamReader reader, final EntityInfoAggregator eia, final EntityProviderReadProperties readProperties) throws EntityProviderException { try { reader.require(XMLStreamConstants.START_DOCUMENT, null, null); reader.nextTag(); reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_ATOM_2005, FormatXml.ATOM_FEED); Map<String, String> foundPrefix2NamespaceUri = extractNamespacesFromTag(reader); foundPrefix2NamespaceUri.putAll(readProperties.getValidatedPrefixNamespaceUris()); checkAllMandatoryNamespacesAvailable(foundPrefix2NamespaceUri); EntityProviderReadProperties entryReadProperties = EntityProviderReadProperties.initFrom(readProperties).addValidatedPrefixes(foundPrefix2NamespaceUri).build(); return readFeedData(reader, eia, entryReadProperties); } catch (XMLStreamException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } }
XmlFeedConsumer { public ODataDeltaFeed readFeed(final XMLStreamReader reader, final EntityInfoAggregator eia, final EntityProviderReadProperties readProperties) throws EntityProviderException { try { reader.require(XMLStreamConstants.START_DOCUMENT, null, null); reader.nextTag(); reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_ATOM_2005, FormatXml.ATOM_FEED); Map<String, String> foundPrefix2NamespaceUri = extractNamespacesFromTag(reader); foundPrefix2NamespaceUri.putAll(readProperties.getValidatedPrefixNamespaceUris()); checkAllMandatoryNamespacesAvailable(foundPrefix2NamespaceUri); EntityProviderReadProperties entryReadProperties = EntityProviderReadProperties.initFrom(readProperties).addValidatedPrefixes(foundPrefix2NamespaceUri).build(); return readFeedData(reader, eia, entryReadProperties); } catch (XMLStreamException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } } }
XmlFeedConsumer { public ODataDeltaFeed readFeed(final XMLStreamReader reader, final EntityInfoAggregator eia, final EntityProviderReadProperties readProperties) throws EntityProviderException { try { reader.require(XMLStreamConstants.START_DOCUMENT, null, null); reader.nextTag(); reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_ATOM_2005, FormatXml.ATOM_FEED); Map<String, String> foundPrefix2NamespaceUri = extractNamespacesFromTag(reader); foundPrefix2NamespaceUri.putAll(readProperties.getValidatedPrefixNamespaceUris()); checkAllMandatoryNamespacesAvailable(foundPrefix2NamespaceUri); EntityProviderReadProperties entryReadProperties = EntityProviderReadProperties.initFrom(readProperties).addValidatedPrefixes(foundPrefix2NamespaceUri).build(); return readFeedData(reader, eia, entryReadProperties); } catch (XMLStreamException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } }  }
XmlFeedConsumer { public ODataDeltaFeed readFeed(final XMLStreamReader reader, final EntityInfoAggregator eia, final EntityProviderReadProperties readProperties) throws EntityProviderException { try { reader.require(XMLStreamConstants.START_DOCUMENT, null, null); reader.nextTag(); reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_ATOM_2005, FormatXml.ATOM_FEED); Map<String, String> foundPrefix2NamespaceUri = extractNamespacesFromTag(reader); foundPrefix2NamespaceUri.putAll(readProperties.getValidatedPrefixNamespaceUris()); checkAllMandatoryNamespacesAvailable(foundPrefix2NamespaceUri); EntityProviderReadProperties entryReadProperties = EntityProviderReadProperties.initFrom(readProperties).addValidatedPrefixes(foundPrefix2NamespaceUri).build(); return readFeedData(reader, eia, entryReadProperties); } catch (XMLStreamException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } }  ODataDeltaFeed readFeed(final XMLStreamReader reader, final EntityInfoAggregator eia,
      final EntityProviderReadProperties readProperties); }
XmlFeedConsumer { public ODataDeltaFeed readFeed(final XMLStreamReader reader, final EntityInfoAggregator eia, final EntityProviderReadProperties readProperties) throws EntityProviderException { try { reader.require(XMLStreamConstants.START_DOCUMENT, null, null); reader.nextTag(); reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_ATOM_2005, FormatXml.ATOM_FEED); Map<String, String> foundPrefix2NamespaceUri = extractNamespacesFromTag(reader); foundPrefix2NamespaceUri.putAll(readProperties.getValidatedPrefixNamespaceUris()); checkAllMandatoryNamespacesAvailable(foundPrefix2NamespaceUri); EntityProviderReadProperties entryReadProperties = EntityProviderReadProperties.initFrom(readProperties).addValidatedPrefixes(foundPrefix2NamespaceUri).build(); return readFeedData(reader, eia, entryReadProperties); } catch (XMLStreamException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } }  ODataDeltaFeed readFeed(final XMLStreamReader reader, final EntityInfoAggregator eia,
      final EntityProviderReadProperties readProperties);  }