Java Code Examples for org.apache.olingo.odata2.api.ep.EntityProviderException#INVALID_DELETED_ENTRY_METADATA

The following examples show how to use org.apache.olingo.odata2.api.ep.EntityProviderException#INVALID_DELETED_ENTRY_METADATA . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XmlFeedConsumer.java    From olingo-odata2 with Apache License 2.0 6 votes vote down vote up
private DeletedEntryMetadataImpl readDeletedEntryMetadata(final XMLStreamReader reader)
    throws EntityProviderException, XMLStreamException {
  try {
    DeletedEntryMetadataImpl deletedEntryMetadata = new DeletedEntryMetadataImpl();

    String uri = reader.getAttributeValue(null, FormatXml.ATOM_TOMBSTONE_REF);
    String whenStr = reader.getAttributeValue(null, FormatXml.ATOM_TOMBSTONE_WHEN);
    Date when;
    when = EdmDateTimeOffset.getInstance().valueOfString(whenStr, EdmLiteralKind.DEFAULT, null,
        Date.class);

    deletedEntryMetadata.setUri(uri);
    deletedEntryMetadata.setWhen(when);
    return deletedEntryMetadata;
  } catch (EdmSimpleTypeException e) {
    throw new EntityProviderException(EntityProviderException.INVALID_DELETED_ENTRY_METADATA);
  }
}
 
Example 2
Source File: XmlFeedDeserializer.java    From olingo-odata2 with Apache License 2.0 6 votes vote down vote up
private DeletedEntryMetadataImpl readDeletedEntryMetadata(final XMLStreamReader reader)
    throws EntityProviderException {
  try {
    DeletedEntryMetadataImpl deletedEntryMetadata = new DeletedEntryMetadataImpl();

    String uri = reader.getAttributeValue(null, FormatXml.ATOM_TOMBSTONE_REF);
    String whenStr = reader.getAttributeValue(null, FormatXml.ATOM_TOMBSTONE_WHEN);
    Date when;
    when = EdmDateTimeOffset.getInstance().valueOfString(whenStr, EdmLiteralKind.DEFAULT, null,
        Date.class);

    deletedEntryMetadata.setUri(uri);
    deletedEntryMetadata.setWhen(when);
    return deletedEntryMetadata;
  } catch (EdmSimpleTypeException e) {
    throw new EntityProviderException(EntityProviderException.INVALID_DELETED_ENTRY_METADATA, e);
  }
}