You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2015/06/29 13:54:53 UTC

[1/2] olingo-odata4 git commit: [OLINGO-712] HeaderName is redundant (there is HttpHeader)

Repository: olingo-odata4
Updated Branches:
  refs/heads/master abf5bf79a -> b51117477


[OLINGO-712] HeaderName is redundant (there is HttpHeader)

Signed-off-by: Christian Amend <ch...@sap.com>


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/d54b0711
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/d54b0711
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/d54b0711

Branch: refs/heads/master
Commit: d54b071198b95c04e4386cd41da082ce3fd2be7a
Parents: a3fbf39
Author: Klaus Straubinger <kl...@sap.com>
Authored: Tue Jun 23 13:09:23 2015 +0200
Committer: Christian Amend <ch...@sap.com>
Committed: Tue Jun 23 13:16:11 2015 +0200

----------------------------------------------------------------------
 .../fit/tecsvc/client/ActionImportITCase.java   |   4 +-
 .../olingo/fit/tecsvc/client/BasicITCase.java   |   7 +-
 .../tecsvc/client/PrimitiveComplexITCase.java   |   3 +-
 .../tecsvc/client/SystemQueryOptionITCase.java  |   4 +-
 .../olingo/fit/v4/AuthBatchTestITCase.java      |   4 +-
 .../apache/olingo/fit/v4/BatchTestITCase.java   |   4 +-
 .../olingo/fit/v4/ConformanceTestITCase.java    |  17 +-
 .../olingo/fit/v4/MediaEntityTestITCase.java    |   4 +-
 .../api/communication/header/HeaderName.java    | 194 -------------------
 .../api/communication/header/ODataHeaders.java  |  21 --
 .../communication/header/ODataPreferences.java  |  28 +--
 .../api/communication/request/ODataRequest.java |  33 ++--
 .../communication/response/ODataResponse.java   |   9 -
 .../olingo/client/core/ODataClientImpl.java     |  10 +-
 .../communication/header/ODataHeadersImpl.java  |  17 --
 .../request/AbstractODataRequest.java           |  54 +++---
 .../request/AsyncBatchRequestWrapperImpl.java   |   8 +-
 .../request/AsyncRequestWrapperImpl.java        |  29 +--
 .../request/batch/ODataBatchRequestImpl.java    |   3 +-
 .../request/batch/ODataBatchUtilities.java      |  10 +-
 .../request/batch/ODataChangesetImpl.java       |   4 +-
 .../retrieve/EdmMetadataRequestImpl.java        |   6 -
 .../response/AbstractODataResponse.java         |  60 +-----
 .../batch/ODataBatchResponseManager.java        |  12 +-
 24 files changed, 107 insertions(+), 438 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ActionImportITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ActionImportITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ActionImportITCase.java
index f29fbe3..291ae40 100644
--- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ActionImportITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ActionImportITCase.java
@@ -33,7 +33,6 @@ import java.util.TimeZone;
 
 import org.apache.olingo.client.api.ODataClient;
 import org.apache.olingo.client.api.communication.ODataClientErrorException;
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.request.invoke.ODataInvokeRequest;
 import org.apache.olingo.client.api.communication.response.ODataInvokeResponse;
 import org.apache.olingo.client.api.domain.ClientCollectionValue;
@@ -45,6 +44,7 @@ import org.apache.olingo.client.api.domain.ClientValue;
 import org.apache.olingo.client.core.ODataClientFactory;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.http.HttpHeader;
 import org.apache.olingo.commons.api.http.HttpStatusCode;
 import org.apache.olingo.fit.AbstractBaseTestITCase;
 import org.apache.olingo.fit.tecsvc.TecSvcConst;
@@ -80,7 +80,7 @@ public class ActionImportITCase extends AbstractBaseTestITCase {
     request.setPrefer(getClient().newPreferences().returnMinimal());
     final ODataInvokeResponse<ClientProperty> response = request.execute();
     assertEquals(HttpStatusCode.NO_CONTENT.getStatusCode(), response.getStatusCode());
-    assertEquals("return=minimal", response.getHeader(HeaderName.preferenceApplied).iterator().next());
+    assertEquals("return=minimal", response.getHeader(HttpHeader.PREFERENCE_APPLIED).iterator().next());
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
index 6406241..8e44289 100644
--- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
@@ -37,7 +37,6 @@ import java.util.List;
 import org.apache.olingo.client.api.EdmEnabledODataClient;
 import org.apache.olingo.client.api.ODataClient;
 import org.apache.olingo.client.api.communication.ODataClientErrorException;
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.request.cud.ODataDeleteRequest;
 import org.apache.olingo.client.api.communication.request.cud.ODataEntityCreateRequest;
 import org.apache.olingo.client.api.communication.request.cud.ODataEntityUpdateRequest;
@@ -415,7 +414,7 @@ public class BasicITCase extends AbstractBaseTestITCase {
 
     final ODataEntityCreateResponse<ClientEntity> response = request.execute();
     assertEquals(HttpStatusCode.NO_CONTENT.getStatusCode(), response.getStatusCode());
-    assertEquals("return=minimal", response.getHeader(HeaderName.preferenceApplied).iterator().next());
+    assertEquals("return=minimal", response.getHeader(HttpHeader.PREFERENCE_APPLIED).iterator().next());
     assertEquals(SERVICE_URI + "/ESTwoPrim(1)", response.getHeader(HttpHeader.LOCATION).iterator().next());
   }
 
@@ -696,7 +695,7 @@ public class BasicITCase extends AbstractBaseTestITCase {
     final ODataEntityUpdateResponse<ClientEntity> response = request.execute();
 
     assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode());
-    assertEquals("return=representation", response.getHeader(HeaderName.preferenceApplied).iterator().next());
+    assertEquals("return=representation", response.getHeader(HttpHeader.PREFERENCE_APPLIED).iterator().next());
     assertTrue(response.getBody().getProperty("PropertyString").hasNullValue());
     assertEquals(34, response.getBody().getProperty("PropertyDecimal").getPrimitiveValue().toValue());
   }
@@ -843,7 +842,7 @@ public class BasicITCase extends AbstractBaseTestITCase {
     request.setPrefer(getClient().newPreferences().returnMinimal());
     final ODataEntityUpdateResponse<ClientEntity> response = request.execute();
     assertEquals(HttpStatusCode.NO_CONTENT.getStatusCode(), response.getStatusCode());
-    assertEquals("return=minimal", response.getHeader(HeaderName.preferenceApplied).iterator().next());
+    assertEquals("return=minimal", response.getHeader(HttpHeader.PREFERENCE_APPLIED).iterator().next());
     final String cookie = response.getHeader(HttpHeader.SET_COOKIE).iterator().next();
 
     final ODataEntityRequest<ClientEntity> entityRequest = client.getRetrieveRequestFactory()

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/PrimitiveComplexITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/PrimitiveComplexITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/PrimitiveComplexITCase.java
index 02d7708..f6f68cc 100644
--- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/PrimitiveComplexITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/PrimitiveComplexITCase.java
@@ -33,7 +33,6 @@ import java.util.Iterator;
 import org.apache.commons.io.IOUtils;
 import org.apache.olingo.client.api.ODataClient;
 import org.apache.olingo.client.api.communication.ODataClientErrorException;
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.request.cud.ODataDeleteRequest;
 import org.apache.olingo.client.api.communication.request.cud.ODataPropertyUpdateRequest;
 import org.apache.olingo.client.api.communication.request.cud.ODataValueUpdateRequest;
@@ -380,7 +379,7 @@ public class PrimitiveComplexITCase extends AbstractBaseTestITCase {
 
     final ODataValueUpdateResponse response = request.execute();
     assertEquals(HttpStatusCode.NO_CONTENT.getStatusCode(), response.getStatusCode());
-    assertEquals("return=minimal", response.getHeader(HeaderName.preferenceApplied).iterator().next());
+    assertEquals("return=minimal", response.getHeader(HttpHeader.PREFERENCE_APPLIED).iterator().next());
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java
index 13ca917..7fa83be 100644
--- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java
@@ -25,13 +25,13 @@ import java.net.URI;
 
 import org.apache.olingo.client.api.ODataClient;
 import org.apache.olingo.client.api.communication.ODataClientErrorException;
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.request.retrieve.ODataEntitySetRequest;
 import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
 import org.apache.olingo.client.api.domain.ClientEntity;
 import org.apache.olingo.client.api.domain.ClientEntitySet;
 import org.apache.olingo.client.core.ODataClientFactory;
 import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.http.HttpHeader;
 import org.apache.olingo.commons.api.http.HttpStatusCode;
 import org.apache.olingo.fit.AbstractBaseTestITCase;
 import org.apache.olingo.fit.tecsvc.TecSvcConst;
@@ -268,7 +268,7 @@ public class SystemQueryOptionITCase extends AbstractBaseTestITCase {
     request.setPrefer(getClient().newPreferences().maxPageSize(7));
 
     final ODataRetrieveResponse<ClientEntitySet> response = request.execute();
-    assertEquals("odata.maxpagesize=7", response.getHeader(HeaderName.preferenceApplied).iterator().next());
+    assertEquals("odata.maxpagesize=7", response.getHeader(HttpHeader.PREFERENCE_APPLIED).iterator().next());
     assertEquals(SERVICE_URI + '/' + ES_SERVER_SIDE_PAGING + "?%24skiptoken=1%2A" + 7,
         response.getBody().getNext().toASCIIString());
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java
index 47d50c0..f6964b3 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java
@@ -23,7 +23,6 @@ import static org.junit.Assert.assertEquals;
 import java.net.URI;
 
 import org.apache.olingo.client.api.ODataClient;
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.request.batch.BatchManager;
 import org.apache.olingo.client.api.communication.request.batch.ODataBatchRequest;
 import org.apache.olingo.client.api.communication.request.batch.ODataChangeset;
@@ -40,6 +39,7 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
 import org.apache.olingo.commons.api.format.ContentType;
 import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.http.HttpHeader;
 import org.junit.Test;
 
 public class AuthBatchTestITCase extends AbstractTestITCase {
@@ -71,7 +71,7 @@ public class AuthBatchTestITCase extends AbstractTestITCase {
     final ODataBatchRequest request = client.getBatchRequestFactory().getBatchRequest(baseURL);
     request.setAccept(ACCEPT.toContentTypeString());
     request.addCustomHeader("User-Agent", "Apache Olingo OData Client");
-    request.addCustomHeader(HeaderName.acceptCharset, "UTF-8");
+    request.addCustomHeader(HttpHeader.ACCEPT_CHARSET, "UTF-8");
 
     final BatchManager streamManager = request.payloadManager();
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java
index 50a6260..26c38f9 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java
@@ -35,7 +35,6 @@ import java.util.concurrent.TimeUnit;
 
 import org.apache.http.HttpResponse;
 import org.apache.olingo.client.api.ODataBatchConstants;
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.request.AsyncBatchRequestWrapper;
 import org.apache.olingo.client.api.communication.request.ODataPayloadManager;
 import org.apache.olingo.client.api.communication.request.batch.BatchManager;
@@ -68,6 +67,7 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
 import org.apache.olingo.commons.api.format.ContentType;
 import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.http.HttpHeader;
 import org.junit.Test;
 
 public class BatchTestITCase extends AbstractTestITCase {
@@ -570,7 +570,7 @@ public class BatchTestITCase extends AbstractTestITCase {
     assertEquals(202, res.getStatusCode());
     assertEquals("Accepted", res.getStatusMessage());
 
-    final Collection<String> newMonitorLocation = res.getHeader(HeaderName.location);
+    final Collection<String> newMonitorLocation = res.getHeader(HttpHeader.LOCATION);
     if (newMonitorLocation != null && !newMonitorLocation.isEmpty()) {
       responseWrapper.forceNextMonitorCheck(URI.create(newMonitorLocation.iterator().next()));
       // .... now you can start again with isDone() and getODataResponse().

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java
index 472928f..9579239 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java
@@ -28,7 +28,6 @@ import java.net.URI;
 import java.util.Calendar;
 import java.util.TimeZone;
 
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.request.AsyncRequestWrapper;
 import org.apache.olingo.client.api.communication.request.cud.ODataDeleteRequest;
 import org.apache.olingo.client.api.communication.request.cud.ODataEntityCreateRequest;
@@ -55,6 +54,7 @@ import org.apache.olingo.client.core.uri.URIUtils;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
 import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.http.HttpHeader;
 import org.junit.Test;
 
 /**
@@ -75,8 +75,7 @@ public class ConformanceTestITCase extends AbstractTestITCase {
     final ODataEntityRequest<ClientEntity> req =
         client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
 
-    assertEquals("4.0", req.getHeader("OData-MaxVersion"));
-    assertEquals("4.0", req.getHeader(HeaderName.odataMaxVersion.toString()));
+    assertEquals("4.0", req.getHeader(HttpHeader.ODATA_MAX_VERSION));
 
     assertNotNull(req.execute().getBody());
   }
@@ -121,16 +120,12 @@ public class ConformanceTestITCase extends AbstractTestITCase {
     req.setFormat(ODataFormat.JSON_FULL_METADATA);
 
     // check for OData-Version
-    assertEquals("4.0", req.getHeader("OData-Version"));
-    assertEquals("4.0", req.getHeader(HeaderName.odataVersion.toString()));
+    assertEquals("4.0", req.getHeader(HttpHeader.ODATA_VERSION));
 
     // check for Content-Type
     assertEquals(
         ODataFormat.JSON_FULL_METADATA.getContentType().toContentTypeString(),
-        req.getHeader("Content-Type"));
-    assertEquals(
-        ODataFormat.JSON_FULL_METADATA.getContentType().toContentTypeString(),
-        req.getHeader(HeaderName.contentType.toString()));
+        req.getHeader(HttpHeader.CONTENT_TYPE));
     assertEquals(
         ODataFormat.JSON_FULL_METADATA.getContentType().toContentTypeString(),
         req.getContentType());
@@ -158,8 +153,7 @@ public class ConformanceTestITCase extends AbstractTestITCase {
     final ODataEntityRequest<ClientEntity> req =
         client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
 
-    assertEquals("4.0", req.getHeader("OData-MaxVersion"));
-    assertEquals("4.0", req.getHeader(HeaderName.odataMaxVersion.toString()));
+    assertEquals("4.0", req.getHeader(HttpHeader.ODATA_MAX_VERSION));
 
     final ODataRetrieveResponse<ClientEntity> res = req.execute();
     final ClientEntity entity = res.getBody();
@@ -411,7 +405,6 @@ public class ConformanceTestITCase extends AbstractTestITCase {
     req.setFormat(ODataFormat.JSON);
 
     assertEquals("application/json;odata.metadata=minimal", req.getHeader("Accept"));
-    assertEquals("application/json;odata.metadata=minimal", req.getHeader(HeaderName.accept.toString()));
     assertEquals("application/json;odata.metadata=minimal", req.getAccept());
 
     final ODataRetrieveResponse<ClientEntity> res = req.execute();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java
index a39e71b..cdc3c12 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java
@@ -32,7 +32,6 @@ import java.util.UUID;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.olingo.client.api.ODataClient;
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.request.cud.ODataEntityUpdateRequest;
 import org.apache.olingo.client.api.communication.request.cud.UpdateType;
 import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest;
@@ -53,6 +52,7 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
 import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.http.HttpHeader;
 import org.junit.Test;
 
 public class MediaEntityTestITCase extends AbstractTestITCase {
@@ -108,7 +108,7 @@ public class MediaEntityTestITCase extends AbstractTestITCase {
     final ODataMediaEntityCreateResponse<ClientEntity> createRes = streamManager.getResponse();
     assertEquals(201, createRes.getStatusCode());
 
-    final Collection<String> location = createRes.getHeader(HeaderName.location);
+    final Collection<String> location = createRes.getHeader(HttpHeader.LOCATION);
     assertNotNull(location);
     final URI createdLocation = URI.create(location.iterator().next());
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/header/HeaderName.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/header/HeaderName.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/header/HeaderName.java
deleted file mode 100644
index 646a8e8..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/header/HeaderName.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.api.communication.header;
-
-
-/**
- * Major OData request/response header names.
- */
-public enum HeaderName {
-
-  /**
-   * The OData protocol uses the Accept request-header field, as specified in [RFC2616].
-   */
-  accept("Accept"),
-  /**
-   * As specified in [RFC2616], the client MAY specify the set of accepted character sets with the Accept-Charset
-   * header.
-   */
-  acceptCharset("Accept-Charset"),
-  /**
-   * As specified in [RFC2616], the client MAY specify the set of accepted natural languages with the Accept-Language
-   * header.
-   */
-  acceptLanguage("Accept-Language"),
-  /**
-   * The Content-Type header is used as specified in [RFC2616].
-   * <br/>
-   * OData request/response supports the following types:
-   * <ul>
-   * <li>application/atom+xml</li>
-   * <li>application/atom+xml;type=entry</li>
-   * <li>application/atom+xml;type=feed</li>
-   * <li>application/json; odata.metadata=full</li>
-   * <li>application/json; odata.metadata=minimal</li>
-   * <li>application/json; odata.metadata=none</li>
-   * <li>application/json</li>
-   * <li>application/xml</li>
-   * <li>text/plain</li>
-   * <li>text/xml</li>
-   * <li>octet/stream</li>
-   * <li>multipart/mixed</li>
-   * </ul>
-   */
-  contentType("Content-Type"),
-
-  /**
-   * This header is a custom HTTP header defined for protocol versioning purposes. This header MAY be present on any
-   * request or response message.
-   */
-  odataVersion("OData-Version"),
-  /**
-   * A response to a create operation that returns 204 No Content MUST include an OData-EntityId response header. The
-   * value of the header is the entity-id of the entity that was acted on by the request. The syntax of the
-   * OData-EntityId preference is specified in [OData-ABNF].
-   */
-  odataEntityId("OData-EntityId"),
-  /**
-   * An ETag (entity tag) is an HTTP response header returned by an HTTP/1.1 compliant web server used to determine
-   * change in content of a resource at a given URL. The value of the header is an opaque string representing the state
-   * of the resource at the time the response was generated.
-   */
-  etag("ETag"),
-  /**
-   * The If-Match request-header field is used with a method to make it conditional. As specified in [RFC2616], "the
-   * purpose of this feature is to allow efficient updates of cached information with a minimum amount of transaction
-   * overhead. It is also used, on updating requests, to prevent inadvertent modification of the wrong version of a
-   * resource".
-   */
-  ifMatch("If-Match"),
-  /**
-   * The If-None-Match request header is used with a method to make it conditional. As specified in [RFC2616], "The
-   * purpose of this feature is to allow efficient updates of cached information with a minimum amount of transaction
-   * overhead. It is also used to prevent a method (for example, PUT) from inadvertently modifying an existing resource
-   * when the client believes that the resource does not exist."
-   */
-  ifNoneMatch("If-None-Match"),
-  /**
-   * Clients SHOULD specify an OData-MaxVersion request header.
-   * <br />
-   * If specified the service MUST generate a response with an OData-Version less than or equal to the specified
-   * OData-MaxVersion.
-   * <br />
-   * If OData-MaxVersion is not specified, then the service SHOULD interpret the request as having an OData-MaxVersion
-   * equal to the maximum version supported by the service.
-   */
-  odataMaxVersion("OData-MaxVersion"),
-
-  /**
-   * The OData-Isolation header specifies the isolation of the current request from external changes. The only supported
-   * value for this header is snapshot.
-   * <br />
-   * If the service doesn’t support OData-Isolation:snapshot and this header was specified on the request, the service
-   * MUST NOT process the request and MUST respond with 412 Precondition Failed.
-   * <br />
-   * Snapshot isolation guarantees that all data returned for a request, including multiple requests within a batch or
-   * results retrieved across multiple pages, will be consistent as of a single point in time. Only data modifications
-   * made within the request (for example, by a data modification request within the same batch) are visible. The effect
-   * is as if the request generates a "snapshot" of the committed data as it existed at the start of the request.
-   * <br />
-   * The OData-Isolation header may be specified on a single or batch request. If it is specified on a batch then the
-   * value is applied to all statements within the batch.
-   * <br />
-   * Next links returned within a snapshot return results within the same snapshot as the initial request; the client is
-   * not required to repeat the header on each individual page request.
-   * <br />
-   * The OData-Isolation header has no effect on links other than the next link. Navigation links, read links, and edit
-   * links return the current version of the data.
-   * <br />
-   * A service returns 410 Gone or 404 Not Found if a consumer tries to follow a next link referring to a snapshot that
-   * is no longer available.
-   * <br />
-   * The syntax of the OData-Isolation header is specified in [OData-ABNF].
-   * <br />
-   * A service MAY specify the support for OData-Isolation:snapshot using an annotation with term
-   * Capabilities.IsolationSupport, see [OData-VocCap].
-   */
-  odataIsolation("OData-Isolation"),
-  /**
-   * A Prefer header is included in a request to state the client’s preferred, but not required, server behavior (that
-   * is, a hint to the server). The Prefer header MAY be included on any request type (within a standalone or batch
-   * request), and a server MAY honor the header for HTTP POST, PUT, PATCH, and MERGE requests. A Prefer header with a
-   * value of “return-content” MUST NOT be specified on a DELETE request, a batch request as a whole, or a PUT request
-   * to update a named stream.
-   */
-  prefer("Prefer"),
-  /**
-   * When a Prefer header value is successfully honored by the server, it MAY include a Preference-Applied response
-   * header that states which preference values were honored by the server.
-   */
-  preferenceApplied("Preference-Applied"),
-
-  /**
-   * Location header is used to specify the URL of an entity modified through a Data Modification request, or the
-   * request URL to check on the status of an asynchronous operation as described in
-   * <code>202 Accepted</code>.
-   */
-  location("Location"),
-  /**
-   * A service must include a
-   * <code>Retry-After</code> header in a
-   * <code>202 Accepted</code>.
-   */
-  retryAfter("Retry-After"),
-
-  /**
-   * This header is a custom HTTP request header.
-   * <br/>
-   * It is possible to instruct network intermediaries (proxies, firewalls, and so on) inspecting traffic at the
-   * application protocol layer (for example, HTTP) to block requests that contain certain HTTP verbs. In practice, GET
-   * and POST verbs are rarely blocked (traditional web pages rely heavily on these HTTP methods), while, for a variety
-   * of reasons (such as security vulnerabilities in prior protocols), other HTTP methods (PUT, DELETE, and so on) are
-   * at times blocked by intermediaries. Additionally, some existing HTTP libraries do not allow creation of requests
-   * using verbs other than GET or POST. Therefore, an alternative way of specifying request types which use verbs other
-   * than GET and POST is needed to ensure that this document works well in a wide range of environments.
-   * <br/>
-   * To address this need, the X-HTTP-Method header can be added to a POST request that signals that the server MUST
-   * process the request not as a POST, but as if the HTTP verb specified as the value of the header was used as the
-   * method on the HTTP request's request line, as specified in [RFC2616] section 5.1. This technique is often referred
-   * to as "verb tunneling".
-   * <br/>
-   * This header is only valid when on POST requests.
-   */
-  xHttpMethod("X-HTTP-METHOD"),
-
-  //TODO: Delete
-  dataServiceUrlConventions("DataServiceUrlConventions");
-  
-  private final String headerName;
-
-  private HeaderName(final String headerName) {
-    this.headerName = headerName;
-  }
-
-  @Override
-  public String toString() {
-    return headerName;
-  }
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/header/ODataHeaders.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/header/ODataHeaders.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/header/ODataHeaders.java
index 484d9a6..fb515d2 100644
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/header/ODataHeaders.java
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/header/ODataHeaders.java
@@ -36,16 +36,6 @@ public interface ODataHeaders {
    * @param name name of the header to be retrieved.
    * @return header value.
    */
-  String getHeader(final HeaderName name);
-
-  /**
-   * Gets the value of the header identified by the given name.
-   * <br/>
-   * Please note that header name is case-insensitive.
-   *
-   * @param name name of the header to be retrieved.
-   * @return header value.
-   */
   String getHeader(final String name);
 
   /**
@@ -67,15 +57,6 @@ public interface ODataHeaders {
   ODataHeaders setHeader(String name, String value);
 
   /**
-   * Add the specified header.
-   *
-   * @param name header key.
-   * @param value header value.
-   * @return the current updated header instance.
-   */
-  ODataHeaders setHeader(HeaderName name, String value);
-
-  /**
    * Removes the header identified by the given name.
    * <br/>
    * Please note that header name is case-insensitive.
@@ -83,8 +64,6 @@ public interface ODataHeaders {
    * @param name name of the header to be retrieved.
    * @return header name (if found).
    */
-  String removeHeader(HeaderName name);
-
   String removeHeader(String name);
 
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/header/ODataPreferences.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/header/ODataPreferences.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/header/ODataPreferences.java
index 1a659de..be8f4fa 100644
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/header/ODataPreferences.java
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/header/ODataPreferences.java
@@ -28,7 +28,7 @@ public class ODataPreferences {
   /**
    * <code>Prefer</code> header, return content.
    *
-   * @see HeaderName#prefer
+   * @see org.apache.olingo.commons.api.http.HttpHeader#PREFER
    */
   public String returnContent() {
     return PreferenceNames.returnContent.toString();
@@ -37,14 +37,16 @@ public class ODataPreferences {
   /**
    * <code>Prefer</code> header, return no content.
    *
-   * @see HeaderName#prefer
+   * @see org.apache.olingo.commons.api.http.HttpHeader#PREFER
    */
   public String returnNoContent() {
     return PreferenceNames.returnNoContent.toString();
   }
 
   /**
-   * @see HeaderName#dataServiceUrlConventions
+   * Gets the value of the non-standard preference that the URL should follow the convention
+   * that keys are formatted as separate segments.
+   * @see org.apache.olingo.commons.api.http.HttpHeader#PREFER
    */
   public String keyAsSegment() {
     return PreferenceNames.keyAsSegment.toString();
@@ -64,7 +66,7 @@ public class ODataPreferences {
    * <br/><br/>
    * Supported by OData version 4.0 only.
    *
-   * @see HeaderName#prefer
+   * @see org.apache.olingo.commons.api.http.HttpHeader#PREFER
    * @return preference.
    */
   public String allowEntityReferences() {
@@ -127,7 +129,7 @@ public class ODataPreferences {
    * <br/><br/>
    * Supported by OData version 4.0 only.
    *
-   * @see HeaderName#prefer
+   * @see org.apache.olingo.commons.api.http.HttpHeader#PREFER
    * @return preference.
    */
   public String callback(final String url) {
@@ -148,7 +150,7 @@ public class ODataPreferences {
    * <br/><br/>
    * Supported by OData version 4.0 only.
    *
-   * @see HeaderName#prefer
+   * @see org.apache.olingo.commons.api.http.HttpHeader#PREFER
    * @return preference.
    */
   public String continueOnError() {
@@ -195,7 +197,7 @@ public class ODataPreferences {
    * <br/><br/>
    * Supported by OData version 4.0 only.
    *
-   * @see HeaderName#prefer
+   * @see org.apache.olingo.commons.api.http.HttpHeader#PREFER
    * @return preference.
    */
   public String includeAnnotations(final String value) {
@@ -228,7 +230,7 @@ public class ODataPreferences {
    * <br/><br/>
    * Supported by OData version 4.0 only.
    *
-   * @see HeaderName#prefer
+   * @see org.apache.olingo.commons.api.http.HttpHeader#PREFER
    * @return preference.
    */
   public String maxPageSize(final int size) {
@@ -253,7 +255,7 @@ public class ODataPreferences {
    * <br/><br/>
    * Supported by OData version 4.0 only.
    *
-   * @see HeaderName#prefer
+   * @see org.apache.olingo.commons.api.http.HttpHeader#PREFER
    * @return preference.
    */
   public String trackChanges() {
@@ -288,7 +290,7 @@ public class ODataPreferences {
    * <br/><br/>
    * Supported by OData version 4.0 only.
    *
-   * @see HeaderName#prefer
+   * @see org.apache.olingo.commons.api.http.HttpHeader#PREFER
    * @return preference.
    */
   public String respondAsync() {
@@ -308,7 +310,7 @@ public class ODataPreferences {
    * <br/><br/>
    * Supported by OData version 4.0 only.
    *
-   * @see HeaderName#prefer
+   * @see org.apache.olingo.commons.api.http.HttpHeader#PREFER
    * @return preference.
    */
   public String wait(final int value) {
@@ -338,7 +340,7 @@ public class ODataPreferences {
    * <br/><br/>
    * Supported by OData version 4.0 only.
    *
-   * @see HeaderName#prefer
+   * @see org.apache.olingo.commons.api.http.HttpHeader#PREFER
    * @return preference.
    */
   public String returnMinimal() {
@@ -368,7 +370,7 @@ public class ODataPreferences {
    * <br/><br/>
    * Supported by OData version 4.0 only.
    *
-   * @see HeaderName#prefer
+   * @see org.apache.olingo.commons.api.http.HttpHeader#PREFER
    * @return preference.
    */
   public String returnRepresentation() {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/ODataRequest.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/ODataRequest.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/ODataRequest.java
index 55831b7..ffc70b7 100644
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/ODataRequest.java
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/ODataRequest.java
@@ -22,7 +22,6 @@ import java.io.InputStream;
 import java.net.URI;
 import java.util.Collection;
 
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.commons.api.http.HttpMethod;
 
 /**
@@ -75,7 +74,7 @@ public interface ODataRequest {
    *
    * @param value header value.
    * @return current object
-   * @see org.apache.olingo.client.api.communication.header.HeaderName#accept
+   * @see org.apache.olingo.commons.api.http.HttpHeader#ACCEPT
    */
   ODataRequest setAccept(final String value);
 
@@ -83,7 +82,7 @@ public interface ODataRequest {
    * Gets <tt>Accept</tt> OData request header.
    *
    * @return header value.
-   * @see org.apache.olingo.client.api.communication.header.HeaderName#accept
+   * @see org.apache.olingo.commons.api.http.HttpHeader#ACCEPT
    */
   String getAccept();
 
@@ -92,7 +91,7 @@ public interface ODataRequest {
    *
    * @param value header value.
    * @return current object
-   * @see org.apache.olingo.client.api.communication.header.HeaderName#ifMatch
+   * @see org.apache.olingo.commons.api.http.HttpHeader#IF_MATCH
    */
   ODataRequest setIfMatch(final String value);
 
@@ -100,7 +99,7 @@ public interface ODataRequest {
    * Gets <tt>If-Match</tt> OData request header.
    *
    * @return header value.
-   * @see org.apache.olingo.client.api.communication.header.HeaderName#ifMatch
+   * @see org.apache.olingo.commons.api.http.HttpHeader#IF_MATCH
    */
   String getIfMatch();
 
@@ -109,7 +108,7 @@ public interface ODataRequest {
    *
    * @param value header value.
    * @return current object
-   * @see org.apache.olingo.client.api.communication.header.HeaderName#ifNoneMatch
+   * @see org.apache.olingo.commons.api.http.HttpHeader#IF_NONE_MATCH
    */
   ODataRequest setIfNoneMatch(final String value);
 
@@ -117,7 +116,7 @@ public interface ODataRequest {
    * Gets <tt>If-None-Match</tt> OData request header.
    *
    * @return header value.
-   * @see org.apache.olingo.client.api.communication.header.HeaderName#ifNoneMatch
+   * @see org.apache.olingo.commons.api.http.HttpHeader#IF_NONE_MATCH
    */
   String getIfNoneMatch();
 
@@ -126,7 +125,7 @@ public interface ODataRequest {
    *
    * @param value header value.
    * @return current object
-   * @see org.apache.olingo.client.api.communication.header.HeaderName#prefer
+   * @see org.apache.olingo.commons.api.http.HttpHeader#PREFER
    */
   ODataRequest setPrefer(final String value);
 
@@ -134,7 +133,7 @@ public interface ODataRequest {
    * Gets <tt>Prefer</tt> OData request header.
    *
    * @return header value.
-   * @see org.apache.olingo.client.api.communication.header.HeaderName#prefer
+   * @see org.apache.olingo.commons.api.http.HttpHeader#PREFER
    */
   String getPrefer();
 
@@ -143,7 +142,7 @@ public interface ODataRequest {
    *
    * @param value header value.
    * @return current object
-   * @see org.apache.olingo.client.api.communication.header.HeaderName#contentType
+   * @see org.apache.olingo.commons.api.http.HttpHeader#CONTENT_TYPE
    */
   ODataRequest setContentType(final String value);
 
@@ -151,7 +150,7 @@ public interface ODataRequest {
    * Gets <tt>contentType</tt> OData request header.
    *
    * @return header value.
-   * @see org.apache.olingo.client.api.communication.header.HeaderName#contentType
+   * @see org.apache.olingo.commons.api.http.HttpHeader#CONTENT_TYPE
    */
   String getContentType();
 
@@ -160,7 +159,7 @@ public interface ODataRequest {
    *
    * @param value header value.
    * @return current object
-   * @see org.apache.olingo.client.api.communication.header.HeaderName#xHttpMethod
+   * @see org.apache.olingo.commons.api.http.HttpHeader#X_HTTP_METHOD
    */
   ODataRequest setXHTTPMethod(final String value);
 
@@ -174,16 +173,6 @@ public interface ODataRequest {
   ODataRequest addCustomHeader(final String name, final String value);
 
   /**
-   * Adds a custom OData request header. The method fails in case of the header name is not supported by the current
-   * working version.
-   *
-   * @param name header name.
-   * @param value header value.
-   * @return current object
-   */
-  ODataRequest addCustomHeader(final HeaderName name, final String value);
-
-  /**
    * Gets byte array representation of the full request header.
    *
    * @return full request header.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/response/ODataResponse.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/response/ODataResponse.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/response/ODataResponse.java
index f2e0765..2bbee88 100644
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/response/ODataResponse.java
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/response/ODataResponse.java
@@ -23,7 +23,6 @@ import java.util.Collection;
 import java.util.Map;
 
 import org.apache.http.HttpResponse;
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.request.batch.ODataBatchLineIterator;
 
 /**
@@ -47,14 +46,6 @@ public interface ODataResponse {
   Collection<String> getHeader(final String name);
 
   /**
-   * Gets header value of the given header.
-   *
-   * @param name header to be retrieved.
-   * @return response header value.
-   */
-  Collection<String> getHeader(final HeaderName name);
-
-  /**
    * Gets 'ETag' header value.
    *
    * @return ETag header value, if provided

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientImpl.java
index c490dae..4ee8924 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientImpl.java
@@ -20,7 +20,6 @@ package org.apache.olingo.client.core;
 
 import org.apache.olingo.client.api.Configuration;
 import org.apache.olingo.client.api.ODataClient;
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.header.ODataHeaders;
 import org.apache.olingo.client.api.communication.header.ODataPreferences;
 import org.apache.olingo.client.api.communication.request.AsyncRequestFactory;
@@ -28,6 +27,7 @@ import org.apache.olingo.client.api.communication.request.batch.BatchRequestFact
 import org.apache.olingo.client.api.communication.request.cud.CUDRequestFactory;
 import org.apache.olingo.client.api.communication.request.invoke.InvokeRequestFactory;
 import org.apache.olingo.client.api.communication.request.retrieve.RetrieveRequestFactory;
+import org.apache.olingo.client.api.domain.ClientObjectFactory;
 import org.apache.olingo.client.api.serialization.ClientODataDeserializer;
 import org.apache.olingo.client.api.serialization.ODataBinder;
 import org.apache.olingo.client.api.serialization.ODataReader;
@@ -42,6 +42,7 @@ import org.apache.olingo.client.core.communication.request.batch.BatchRequestFac
 import org.apache.olingo.client.core.communication.request.cud.CUDRequestFactoryImpl;
 import org.apache.olingo.client.core.communication.request.invoke.InvokeRequestFactoryImpl;
 import org.apache.olingo.client.core.communication.request.retrieve.RetrieveRequestFactoryImpl;
+import org.apache.olingo.client.core.domain.ClientObjectFactoryImpl;
 import org.apache.olingo.client.core.serialization.AtomSerializer;
 import org.apache.olingo.client.core.serialization.ClientODataDeserializerImpl;
 import org.apache.olingo.client.core.serialization.JsonSerializer;
@@ -50,10 +51,9 @@ import org.apache.olingo.client.core.serialization.ODataReaderImpl;
 import org.apache.olingo.client.core.serialization.ODataWriterImpl;
 import org.apache.olingo.client.core.uri.FilterFactoryImpl;
 import org.apache.olingo.client.core.uri.URIBuilderImpl;
-import org.apache.olingo.client.api.domain.ClientObjectFactory;
 import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
 import org.apache.olingo.commons.api.format.ODataFormat;
-import org.apache.olingo.client.core.domain.ClientObjectFactoryImpl;
+import org.apache.olingo.commons.api.http.HttpHeader;
 
 public class ODataClientImpl implements ODataClient {
 
@@ -104,8 +104,8 @@ public class ODataClientImpl implements ODataClient {
   @Override
   public ODataHeaders newVersionHeaders() {
     final ODataHeadersImpl odataHeaders = new ODataHeadersImpl();
-    odataHeaders.setHeader(HeaderName.odataMaxVersion, ODataServiceVersion.V40.toString());
-    odataHeaders.setHeader(HeaderName.odataVersion, ODataServiceVersion.V40.toString());
+    odataHeaders.setHeader(HttpHeader.ODATA_MAX_VERSION, ODataServiceVersion.V40.toString());
+    odataHeaders.setHeader(HttpHeader.ODATA_VERSION, ODataServiceVersion.V40.toString());
     return odataHeaders;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/header/ODataHeadersImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/header/ODataHeadersImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/header/ODataHeadersImpl.java
index 5a30624..9f79fbb 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/header/ODataHeadersImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/header/ODataHeadersImpl.java
@@ -22,7 +22,6 @@ import java.util.Collection;
 import java.util.Map;
 import java.util.TreeMap;
 
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.header.ODataHeaders;
 
 public class ODataHeadersImpl implements ODataHeaders {
@@ -39,27 +38,11 @@ public class ODataHeadersImpl implements ODataHeaders {
   }
 
   @Override
-  public ODataHeaders setHeader(final HeaderName name, final String value) {
-    headers.put(name.toString(), value);
-    return this;
-  }
-
-  @Override
-  public String getHeader(final HeaderName name) {
-    return headers.get(name.toString());
-  }
-
-  @Override
   public String getHeader(final String name) {
     return headers.get(name);
   }
 
   @Override
-  public String removeHeader(final HeaderName name) {
-    return headers.remove(name.toString());
-  }
-
-  @Override
   public String removeHeader(final String name) {
     return headers.remove(name);
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractODataRequest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractODataRequest.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractODataRequest.java
index bdfd118..bf198de 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractODataRequest.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractODataRequest.java
@@ -34,7 +34,6 @@ import org.apache.http.client.HttpClient;
 import org.apache.http.client.methods.HttpUriRequest;
 import org.apache.http.impl.client.DecompressingHttpClient;
 import org.apache.olingo.client.api.ODataClient;
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.header.ODataHeaders;
 import org.apache.olingo.client.api.communication.request.ODataRequest;
 import org.apache.olingo.client.api.communication.request.ODataStreamer;
@@ -42,6 +41,7 @@ import org.apache.olingo.client.api.communication.response.ODataResponse;
 import org.apache.olingo.client.api.http.HttpClientException;
 import org.apache.olingo.commons.api.ODataRuntimeException;
 import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.http.HttpHeader;
 import org.apache.olingo.commons.api.http.HttpMethod;
 
 /**
@@ -128,37 +128,37 @@ public abstract class AbstractODataRequest extends AbstractRequest implements OD
 
   @Override
   public ODataRequest setAccept(final String value) {
-    odataHeaders.setHeader(HeaderName.accept, value);
+    odataHeaders.setHeader(HttpHeader.ACCEPT, value);
     return this;
   }
 
   @Override
   public ODataRequest setIfMatch(final String value) {
-    odataHeaders.setHeader(HeaderName.ifMatch, value);
+    odataHeaders.setHeader(HttpHeader.IF_MATCH, value);
     return this;
   }
 
   @Override
   public ODataRequest setIfNoneMatch(final String value) {
-    odataHeaders.setHeader(HeaderName.ifNoneMatch, value);
+    odataHeaders.setHeader(HttpHeader.IF_NONE_MATCH, value);
     return this;
   }
 
   @Override
   public ODataRequest setPrefer(final String value) {
-    odataHeaders.setHeader(HeaderName.prefer, value);
+    odataHeaders.setHeader(HttpHeader.PREFER, value);
     return this;
   }
 
   @Override
   public ODataRequest setXHTTPMethod(final String value) {
-    odataHeaders.setHeader(HeaderName.xHttpMethod, value);
+    odataHeaders.setHeader(HttpHeader.X_HTTP_METHOD, value);
     return this;
   }
 
   @Override
   public ODataRequest setContentType(final String value) {
-    odataHeaders.setHeader(HeaderName.contentType, value);
+    odataHeaders.setHeader(HttpHeader.CONTENT_TYPE, value);
     return this;
   }
 
@@ -169,40 +169,34 @@ public abstract class AbstractODataRequest extends AbstractRequest implements OD
   }
 
   @Override
-  public ODataRequest addCustomHeader(final HeaderName name, final String value) {
-    odataHeaders.setHeader(name, value);
-    return this;
-  }
-
-  @Override
   public String getAccept() {
-    final String acceptHead = odataHeaders.getHeader(HeaderName.accept);
-    return StringUtils.isBlank(acceptHead)
-            ? getDefaultFormat().getContentType().toContentTypeString()
-            : acceptHead;
+    final String acceptHead = odataHeaders.getHeader(HttpHeader.ACCEPT);
+    return StringUtils.isBlank(acceptHead) ?
+        getDefaultFormat().getContentType().toContentTypeString() :
+        acceptHead;
   }
 
   @Override
   public String getIfMatch() {
-    return odataHeaders.getHeader(HeaderName.ifMatch);
+    return odataHeaders.getHeader(HttpHeader.IF_MATCH);
   }
 
   @Override
   public String getIfNoneMatch() {
-    return odataHeaders.getHeader(HeaderName.ifNoneMatch);
+    return odataHeaders.getHeader(HttpHeader.IF_NONE_MATCH);
   }
 
   @Override
   public String getPrefer() {
-    return odataHeaders.getHeader(HeaderName.prefer);
+    return odataHeaders.getHeader(HttpHeader.PREFER);
   }
 
   @Override
   public String getContentType() {
-    final String contentTypeHead = odataHeaders.getHeader(HeaderName.contentType);
-    return StringUtils.isBlank(contentTypeHead)
-            ? getDefaultFormat().getContentType().toContentTypeString()
-            : contentTypeHead;
+    final String contentTypeHead = odataHeaders.getHeader(HttpHeader.CONTENT_TYPE);
+    return StringUtils.isBlank(contentTypeHead) ?
+        getDefaultFormat().getContentType().toContentTypeString() :
+        contentTypeHead;
   }
 
   @Override
@@ -231,10 +225,10 @@ public abstract class AbstractODataRequest extends AbstractRequest implements OD
       baos.write(ODataStreamer.CRLF);
 
       // Set Content-Type and Accept headers with default values, if not yet set
-      if (StringUtils.isBlank(odataHeaders.getHeader(HeaderName.contentType))) {
+      if (StringUtils.isBlank(odataHeaders.getHeader(HttpHeader.CONTENT_TYPE))) {
         setContentType(getContentType());
       }
-      if (StringUtils.isBlank(odataHeaders.getHeader(HeaderName.accept))) {
+      if (StringUtils.isBlank(odataHeaders.getHeader(HttpHeader.ACCEPT))) {
         setAccept(getAccept());
       }
 
@@ -277,18 +271,16 @@ public abstract class AbstractODataRequest extends AbstractRequest implements OD
     checkRequest(odataClient, request);
 
     // Set Content-Type and Accept headers with default values, if not yet set
-    if (StringUtils.isBlank(odataHeaders.getHeader(HeaderName.contentType))) {
+    if (StringUtils.isBlank(odataHeaders.getHeader(HttpHeader.CONTENT_TYPE))) {
       setContentType(getContentType());
     }
-    if (StringUtils.isBlank(odataHeaders.getHeader(HeaderName.accept))) {
+    if (StringUtils.isBlank(odataHeaders.getHeader(HttpHeader.ACCEPT))) {
       setAccept(getAccept());
     }
 
     // Add header for KeyAsSegment management
     if (odataClient.getConfiguration().isKeyAsSegment()) {
-      addCustomHeader(
-              HeaderName.dataServiceUrlConventions.toString(),
-              odataClient.newPreferences().keyAsSegment());
+      addCustomHeader("DataServiceUrlConventions", odataClient.newPreferences().keyAsSegment());
     }
 
     // Add all available headers

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AsyncBatchRequestWrapperImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AsyncBatchRequestWrapperImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AsyncBatchRequestWrapperImpl.java
index d64ea3f..d4821b5 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AsyncBatchRequestWrapperImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AsyncBatchRequestWrapperImpl.java
@@ -23,7 +23,6 @@ import java.util.Collection;
 
 import org.apache.commons.io.IOUtils;
 import org.apache.olingo.client.api.ODataClient;
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.header.ODataPreferences;
 import org.apache.olingo.client.api.communication.request.AsyncBatchRequestWrapper;
 import org.apache.olingo.client.api.communication.request.ODataBatchableRequest;
@@ -32,6 +31,7 @@ import org.apache.olingo.client.api.communication.request.batch.ODataBatchReques
 import org.apache.olingo.client.api.communication.request.batch.ODataChangeset;
 import org.apache.olingo.client.api.communication.response.AsyncResponseWrapper;
 import org.apache.olingo.client.api.communication.response.ODataBatchResponse;
+import org.apache.olingo.commons.api.http.HttpHeader;
 
 public class AsyncBatchRequestWrapperImpl extends AsyncRequestWrapperImpl<ODataBatchResponse>
         implements AsyncBatchRequestWrapper {
@@ -91,19 +91,19 @@ public class AsyncBatchRequestWrapperImpl extends AsyncRequestWrapperImpl<ODataB
     }
 
     private void retrieveMonitorDetails(final ODataBatchResponse res) {
-      Collection<String> headers = res.getHeader(HeaderName.location.toString());
+      Collection<String> headers = res.getHeader(HttpHeader.LOCATION);
       if (headers == null || headers.isEmpty()) {
         throw new AsyncRequestException("Invalid async request response. Monitor URL not found");
       } else {
         this.location = URI.create(headers.iterator().next());
       }
 
-      headers = res.getHeader(HeaderName.retryAfter.toString());
+      headers = res.getHeader(HttpHeader.RETRY_AFTER);
       if (headers != null && !headers.isEmpty()) {
         this.retryAfter = Integer.parseInt(headers.iterator().next());
       }
 
-      headers = res.getHeader(HeaderName.preferenceApplied.toString());
+      headers = res.getHeader(HttpHeader.PREFERENCE_APPLIED);
       if (headers != null && !headers.isEmpty()) {
         for (String header : headers) {
           if (header.equalsIgnoreCase(new ODataPreferences().respondAsync())) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AsyncRequestWrapperImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AsyncRequestWrapperImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AsyncRequestWrapperImpl.java
index dd8456f..5c8d1e9 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AsyncRequestWrapperImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AsyncRequestWrapperImpl.java
@@ -32,7 +32,6 @@ import org.apache.http.impl.client.DecompressingHttpClient;
 import org.apache.http.util.EntityUtils;
 import org.apache.olingo.client.api.ODataClient;
 import org.apache.olingo.client.api.communication.ODataClientErrorException;
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.header.ODataPreferences;
 import org.apache.olingo.client.api.communication.request.AsyncRequestWrapper;
 import org.apache.olingo.client.api.communication.request.ODataRequest;
@@ -41,7 +40,9 @@ import org.apache.olingo.client.api.communication.response.AsyncResponseWrapper;
 import org.apache.olingo.client.api.communication.response.ODataDeleteResponse;
 import org.apache.olingo.client.api.communication.response.ODataResponse;
 import org.apache.olingo.client.api.http.HttpClientException;
+import org.apache.olingo.commons.api.http.HttpHeader;
 import org.apache.olingo.commons.api.http.HttpMethod;
+import org.apache.olingo.commons.api.http.HttpStatusCode;
 
 public class AsyncRequestWrapperImpl<R extends ODataResponse> extends AbstractRequest
         implements AsyncRequestWrapper<R> {
@@ -75,7 +76,7 @@ public class AsyncRequestWrapperImpl<R extends ODataResponse> extends AbstractRe
     this.odataRequest.setAccept(this.odataRequest.getAccept());
     this.odataRequest.setContentType(this.odataRequest.getContentType());
 
-    extendHeader(HeaderName.prefer.toString(), new ODataPreferences().respondAsync());
+    extendHeader(HttpHeader.PREFER, new ODataPreferences().respondAsync());
 
     this.odataClient = odataClient;
     final HttpMethod method = odataRequest.getMethod();
@@ -94,14 +95,13 @@ public class AsyncRequestWrapperImpl<R extends ODataResponse> extends AbstractRe
 
   @Override
   public final AsyncRequestWrapper<R> wait(final int waitInSeconds) {
-    extendHeader(HeaderName.prefer.toString(), new ODataPreferences().wait(waitInSeconds));
+    extendHeader(HttpHeader.PREFER, new ODataPreferences().wait(waitInSeconds));
     return this;
   }
 
   @Override
   public final AsyncRequestWrapper<R> callback(URI url) {
-    extendHeader(HeaderName.prefer.toString(),
-            new ODataPreferences().callback(url.toASCIIString()));
+    extendHeader(HttpHeader.PREFER, new ODataPreferences().callback(url.toASCIIString()));
     return this;
   }
 
@@ -184,9 +184,9 @@ public class AsyncRequestWrapperImpl<R extends ODataResponse> extends AbstractRe
       for (int i = 0; response == null && i < MAX_RETRY; i++) {
         res = checkMonitor(location);
 
-        if (res.getStatusLine().getStatusCode() == 202) {
+        if (res.getStatusLine().getStatusCode() == HttpStatusCode.ACCEPTED.getStatusCode()) {
 
-          final Header[] headers = res.getHeaders(HeaderName.retryAfter.toString());
+          final Header[] headers = res.getHeaders(HttpHeader.RETRY_AFTER);
           if (ArrayUtils.isNotEmpty(headers)) {
             this.retryAfter = Integer.parseInt(headers[0].getValue());
           }
@@ -211,27 +211,18 @@ public class AsyncRequestWrapperImpl<R extends ODataResponse> extends AbstractRe
       return response;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public ODataDeleteResponse delete() {
       final ODataDeleteRequest deleteRequest = odataClient.getCUDRequestFactory().getDeleteRequest(location);
       return deleteRequest.execute();
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public AsyncResponseWrapper<ODataDeleteResponse> asyncDelete() {
       return odataClient.getAsyncRequestFactory().<ODataDeleteResponse>getAsyncRequestWrapper(
               odataClient.getCUDRequestFactory().getDeleteRequest(location)).execute();
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public AsyncResponseWrapper<R> forceNextMonitorCheck(final URI uri) {
       this.location = uri;
@@ -255,7 +246,7 @@ public class AsyncRequestWrapperImpl<R extends ODataResponse> extends AbstractRe
     }
 
     private void retrieveMonitorDetails(final HttpResponse res) {
-      Header[] headers = res.getHeaders(HeaderName.location.toString());
+      Header[] headers = res.getHeaders(HttpHeader.LOCATION);
       if (ArrayUtils.isNotEmpty(headers)) {
         this.location = URI.create(headers[0].getValue());
       } else {
@@ -263,12 +254,12 @@ public class AsyncRequestWrapperImpl<R extends ODataResponse> extends AbstractRe
                 "Invalid async request response. Monitor URL '" + headers[0].getValue() + "'");
       }
 
-      headers = res.getHeaders(HeaderName.retryAfter.toString());
+      headers = res.getHeaders(HttpHeader.RETRY_AFTER);
       if (ArrayUtils.isNotEmpty(headers)) {
         this.retryAfter = Integer.parseInt(headers[0].getValue());
       }
 
-      headers = res.getHeaders(HeaderName.preferenceApplied.toString());
+      headers = res.getHeaders(HttpHeader.PREFERENCE_APPLIED);
       if (ArrayUtils.isNotEmpty(headers)) {
         for (Header header : headers) {
           if (header.getValue().equalsIgnoreCase(new ODataPreferences().respondAsync())) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/ODataBatchRequestImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/ODataBatchRequestImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/ODataBatchRequestImpl.java
index 8893c5e..3b9e621 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/ODataBatchRequestImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/ODataBatchRequestImpl.java
@@ -26,7 +26,6 @@ import java.util.concurrent.TimeUnit;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.HttpClient;
 import org.apache.olingo.client.api.ODataClient;
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.header.ODataPreferences;
 import org.apache.olingo.client.api.communication.request.ODataBatchableRequest;
 import org.apache.olingo.client.api.communication.request.batch.BatchManager;
@@ -68,7 +67,7 @@ public class ODataBatchRequestImpl
   @Override
   protected HttpResponse doExecute() {
     if (odataClient.getConfiguration().isContinueOnError()) {
-      addCustomHeader(HeaderName.prefer, new ODataPreferences().continueOnError());
+      setPrefer(new ODataPreferences().continueOnError());
     }
 
     return super.doExecute();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/ODataBatchUtilities.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/ODataBatchUtilities.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/ODataBatchUtilities.java
index f746849..bca612f 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/ODataBatchUtilities.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/ODataBatchUtilities.java
@@ -34,11 +34,11 @@ import org.apache.commons.io.IOUtils;
 import org.apache.commons.io.LineIterator;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.olingo.client.api.ODataBatchConstants;
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.request.ODataStreamer;
 import org.apache.olingo.client.api.communication.request.batch.ODataBatchLineIterator;
 import org.apache.olingo.commons.api.Constants;
 import org.apache.olingo.commons.api.format.ContentType;
+import org.apache.olingo.commons.api.http.HttpHeader;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -48,12 +48,11 @@ import org.slf4j.LoggerFactory;
 public class ODataBatchUtilities {
 
   public static enum BatchItemType {
-
     NONE,
     CHANGESET,
     RETRIEVE
-
   }
+
   /**
    * Logger.
    */
@@ -300,8 +299,9 @@ public class ODataBatchUtilities {
 
     final BatchItemType nextItemType;
 
-    final String contentType = headers.containsKey(HeaderName.contentType.toString())
-            ? headers.get(HeaderName.contentType.toString()).toString() : StringUtils.EMPTY;
+    final String contentType = headers.containsKey(HttpHeader.CONTENT_TYPE) ?
+        headers.get(HttpHeader.CONTENT_TYPE).toString() :
+        StringUtils.EMPTY;
 
     if (contentType.contains(ContentType.MULTIPART_MIXED.toContentTypeString())) {
       nextItemType = BatchItemType.CHANGESET;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/ODataChangesetImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/ODataChangesetImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/ODataChangesetImpl.java
index ce6155a..51a55ab 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/ODataChangesetImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/batch/ODataChangesetImpl.java
@@ -20,12 +20,12 @@ package org.apache.olingo.client.core.communication.request.batch;
 
 import java.util.UUID;
 
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.request.ODataBatchableRequest;
 import org.apache.olingo.client.api.communication.request.batch.ODataBatchRequest;
 import org.apache.olingo.client.api.communication.request.batch.ODataChangeset;
 import org.apache.olingo.client.core.communication.request.AbstractODataRequest;
 import org.apache.olingo.commons.api.format.ContentType;
+import org.apache.olingo.commons.api.http.HttpHeader;
 import org.apache.olingo.commons.api.http.HttpMethod;
 
 /**
@@ -99,7 +99,7 @@ public class ODataChangesetImpl extends AbstractODataBatchRequestItem
     }
 
     if (!hasStreamedSomething) {
-      stream((HeaderName.contentType.toString() + ": "
+      stream((HttpHeader.CONTENT_TYPE + ": "
               + ContentType.MULTIPART_MIXED + ";boundary=" + boundary).getBytes());
 
       newLine();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/EdmMetadataRequestImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/EdmMetadataRequestImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/EdmMetadataRequestImpl.java
index ee5e2e7..e3eef12 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/EdmMetadataRequestImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/EdmMetadataRequestImpl.java
@@ -23,7 +23,6 @@ import java.util.Collection;
 
 import org.apache.http.client.HttpClient;
 import org.apache.olingo.client.api.ODataClient;
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.request.retrieve.EdmMetadataRequest;
 import org.apache.olingo.client.api.communication.request.retrieve.XMLMetadataRequest;
 import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
@@ -112,11 +111,6 @@ class EdmMetadataRequestImpl extends AbstractMetadataRequestImpl<Edm> implements
       return xmlMetadataResponse.getHeader(name);
     }
 
-    @Override
-    public Collection<String> getHeader(final HeaderName name) {
-      return xmlMetadataResponse.getHeader(name);
-    }
-
     public XMLMetadata getXMLMetadata() {
       if (metadata == null) {
         try {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/response/AbstractODataResponse.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/response/AbstractODataResponse.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/response/AbstractODataResponse.java
index 210ae7c..d3ca7e4 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/response/AbstractODataResponse.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/response/AbstractODataResponse.java
@@ -35,7 +35,6 @@ import org.apache.http.HttpResponse;
 import org.apache.http.HttpStatus;
 import org.apache.http.client.HttpClient;
 import org.apache.olingo.client.api.ODataClient;
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.request.ODataStreamer;
 import org.apache.olingo.client.api.communication.request.batch.ODataBatchLineIterator;
 import org.apache.olingo.client.api.communication.response.ODataResponse;
@@ -45,6 +44,7 @@ import org.apache.olingo.client.core.communication.request.batch.ODataBatchLineI
 import org.apache.olingo.client.core.communication.request.batch.ODataBatchUtilities;
 import org.apache.olingo.commons.api.Constants;
 import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.http.HttpHeader;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -112,76 +112,46 @@ public abstract class AbstractODataResponse implements ODataResponse {
     }
   }
 
-  /**
-   * {@inheritDoc}
-   */
   @Override
   public Collection<String> getHeaderNames() {
     return headers.keySet();
   }
 
-  /**
-   * {@inheritDoc}
-   */
   @Override
   public Collection<String> getHeader(final String name) {
     return headers.get(name);
   }
 
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public Collection<String> getHeader(final HeaderName name) {
-    return headers.get(name.toString());
-  }
-
-  /**
-   * {@inheritDoc}
-   */
   @Override
   public String getETag() {
-    final Collection<String> etag = getHeader(HeaderName.etag);
-    return etag == null || etag.isEmpty()
-            ? null
-            : etag.iterator().next();
+    final Collection<String> etag = getHeader(HttpHeader.ETAG);
+    return etag == null || etag.isEmpty() ? null : etag.iterator().next();
   }
 
-  /**
-   * {@inheritDoc}
-   */
   @Override
   public String getContentType() {
-    final Collection<String> contentTypes = getHeader(HeaderName.contentType);
-    return contentTypes == null || contentTypes.isEmpty()
-            ? null
-            : contentTypes.iterator().next();
+    final Collection<String> contentTypes = getHeader(HttpHeader.CONTENT_TYPE);
+    return contentTypes == null || contentTypes.isEmpty() ? null : contentTypes.iterator().next();
   }
 
-  /**
-   * {@inheritDoc}
-   */
   @Override
   public int getStatusCode() {
     return statusCode;
   }
 
-  /**
-   * {@inheritDoc}
-   */
   @Override
   public String getStatusMessage() {
     return statusMessage;
   }
 
-  /**
-   * {@inheritDoc}
-   */
   @Override
   public final ODataResponse initFromHttpResponse(final HttpResponse res) {
     try {
       this.payload = res.getEntity() == null ? null : res.getEntity().getContent();
-    } catch (Exception e) {
+    } catch (final IllegalStateException e) {
+      LOG.error("Error retrieving payload", e);
+      throw new ODataRuntimeException(e);
+    } catch (final IOException e) {
       LOG.error("Error retrieving payload", e);
       throw new ODataRuntimeException(e);
     }
@@ -205,9 +175,6 @@ public abstract class AbstractODataResponse implements ODataResponse {
     return this;
   }
 
-  /**
-   * {@inheritDoc}
-   */
   @Override
   public ODataResponse initFromBatch(
           final Map.Entry<Integer, String> responseLine,
@@ -229,9 +196,6 @@ public abstract class AbstractODataResponse implements ODataResponse {
     return this;
   }
 
-  /**
-   * {@inheritDoc}
-   */
   @Override
   public ODataResponse initFromEnclosedPart(final InputStream part) {
     try {
@@ -275,9 +239,6 @@ public abstract class AbstractODataResponse implements ODataResponse {
     }
   }
 
-  /**
-   * {@inheritDoc }
-   */
   @Override
   public void close() {
     odataClient.getConfiguration().getHttpClientFactory().close(httpClient);
@@ -287,9 +248,6 @@ public abstract class AbstractODataResponse implements ODataResponse {
     }
   }
 
-  /**
-   * {@inheritDoc}
-   */
   @Override
   public InputStream getRawResponse() {
     if (HttpStatus.SC_NO_CONTENT == getStatusCode()) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d54b0711/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/response/batch/ODataBatchResponseManager.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/response/batch/ODataBatchResponseManager.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/response/batch/ODataBatchResponseManager.java
index f7fbef0..8404076 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/response/batch/ODataBatchResponseManager.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/response/batch/ODataBatchResponseManager.java
@@ -26,7 +26,6 @@ import java.util.Map;
 import java.util.NoSuchElementException;
 
 import org.apache.commons.io.IOUtils;
-import org.apache.olingo.client.api.communication.header.HeaderName;
 import org.apache.olingo.client.api.communication.request.batch.ODataBatchLineIterator;
 import org.apache.olingo.client.api.communication.request.batch.ODataBatchResponseItem;
 import org.apache.olingo.client.api.communication.response.ODataBatchResponse;
@@ -34,6 +33,7 @@ import org.apache.olingo.client.core.communication.request.batch.ODataBatchLineI
 import org.apache.olingo.client.core.communication.request.batch.ODataBatchUtilities;
 import org.apache.olingo.client.core.communication.request.batch.ODataChangesetResponseItem;
 import org.apache.olingo.commons.api.Constants;
+import org.apache.olingo.commons.api.http.HttpHeader;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -96,7 +96,7 @@ public class ODataBatchResponseManager implements Iterator<ODataBatchResponseIte
 
       // search for boundary
       batchBoundary = ODataBatchUtilities.getBoundaryFromHeader(
-              res.getHeader(HeaderName.contentType));
+          res.getHeader(HttpHeader.CONTENT_TYPE));
       LOG.debug("Retrieved batch response bondary '{}'", batchBoundary);
     } catch (IOException e) {
       LOG.error("Error parsing batch response", e);
@@ -104,17 +104,11 @@ public class ODataBatchResponseManager implements Iterator<ODataBatchResponseIte
     }
   }
 
-  /**
-   * {@inheritDoc }
-   */
   @Override
   public boolean hasNext() {
     return (current == null || continueOnError || !current.isBreaking()) && expectedItemsIterator.hasNext();
   }
 
-  /**
-   * {@inheritDoc }
-   */
   @Override
   public ODataBatchResponseItem next() {
     if (current != null) {
@@ -138,7 +132,7 @@ public class ODataBatchResponseManager implements Iterator<ODataBatchResponseIte
 
         current.initFromBatch(
                 batchLineIterator,
-                ODataBatchUtilities.getBoundaryFromHeader(nextItemHeaders.get(HeaderName.contentType.toString())));
+                ODataBatchUtilities.getBoundaryFromHeader(nextItemHeaders.get(HttpHeader.CONTENT_TYPE)));
         break;
 
       case RETRIEVE:


[2/2] olingo-odata4 git commit: [OLINGO-712] Merge branch 'master' into olingo712

Posted by ch...@apache.org.
[OLINGO-712] Merge branch 'master' into olingo712

Conflicts:
	fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ActionImportITCase.java
	fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
	fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java
	fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java
	fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java
	fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java
	fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java
	lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientImpl.java
	lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractODataRequest.java


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/b5111747
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/b5111747
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/b5111747

Branch: refs/heads/master
Commit: b51117477bcee797fdc6d3b989f7cf7f37bfc8c2
Parents: d54b071 abf5bf7
Author: Christian Amend <ch...@sap.com>
Authored: Mon Jun 29 13:48:14 2015 +0200
Committer: Christian Amend <ch...@sap.com>
Committed: Mon Jun 29 13:48:14 2015 +0200

----------------------------------------------------------------------
 .../olingo/ext/proxy/AbstractService.java       |   4 +-
 .../EntityContainerInvocationHandler.java       |   1 +
 .../proxy/commons/EntityInvocationHandler.java  |   6 +-
 .../commons/EntitySetInvocationHandler.java     |   6 +-
 ext/karaf/karaf-features/pom.xml                |  81 ++++
 .../src/main/resources/features.xml             |  59 +++
 ext/karaf/karaf-fit/pom.xml                     | 152 ++++++++
 .../apache/olingo/osgi/itests/BundlesTest.java  |  55 +++
 .../osgi/itests/OlingoOSGiTestSupport.java      | 134 +++++++
 .../osgi/itests/server/CarServiceTest.java      | 105 ++++++
 ext/karaf/pom.xml                               |  41 ++
 .../olingo/ext/pojogen/AbstractPOJOGenMojo.java |   4 +-
 ext/pom.xml                                     |   9 +
 .../org/apache/olingo/fit/AbstractServices.java |   2 +-
 .../olingo/fit/utils/AbstractUtilities.java     |   3 +-
 .../org/apache/olingo/fit/utils/FSManager.java  |   3 +-
 .../olingo/fit/AbstractBaseTestITCase.java      |  11 +-
 .../fit/tecsvc/client/ActionImportITCase.java   |  23 +-
 .../BasicHttpExceptionHandlingITCase.java       |   4 +-
 .../olingo/fit/tecsvc/client/BasicITCase.java   | 376 ++++++++++++++++++-
 .../fit/tecsvc/client/BatchClientITCase.java    | 119 +++---
 .../olingo/fit/tecsvc/client/BindingITCase.java |   6 +-
 .../fit/tecsvc/client/ConditionalITCase.java    |   4 +-
 .../fit/tecsvc/client/DeepInsertITCase.java     |   6 +-
 .../tecsvc/client/EdmEnabledClientITCase.java   |  63 ----
 .../tecsvc/client/EntityReferencesITCase.java   |   4 +-
 .../fit/tecsvc/client/ExpandSelectITCase.java   |  12 +
 .../ExpandWithSystemQueryOptionsITCase.java     |   4 +-
 .../tecsvc/client/FilterSystemQueryITCase.java  |   4 +-
 .../fit/tecsvc/client/FunctionImportITCase.java |   4 +-
 .../olingo/fit/tecsvc/client/MediaITCase.java   |   3 +-
 .../fit/tecsvc/client/NavigationITCase.java     |   4 +-
 .../tecsvc/client/OrderBySystemQueryITCase.java |   4 +-
 .../tecsvc/client/PrimitiveComplexITCase.java   |   3 +-
 .../tecsvc/client/SystemQueryOptionITCase.java  |   4 +-
 .../fit/tecsvc/http/BasicBatchITCase.java       |  15 +-
 .../olingo/fit/tecsvc/http/BasicHttpITCase.java |  79 ++--
 .../fit/tecsvc/http/EntityReferenceITCase.java  |  54 +--
 .../olingo/fit/tecsvc/http/PingITCase.java      |  12 +-
 .../olingo/fit/v4/AbstractTestITCase.java       |  17 +-
 .../apache/olingo/fit/v4/AsyncTestITCase.java   |  20 +-
 .../olingo/fit/v4/AuthBatchTestITCase.java      |   5 +-
 .../apache/olingo/fit/v4/BatchTestITCase.java   |  21 +-
 .../fit/v4/BoundOperationInvokeTestITCase.java  |  52 +--
 .../olingo/fit/v4/ConformanceTestITCase.java    |  30 +-
 .../apache/olingo/fit/v4/DeltaTestITCase.java   |   8 +-
 .../olingo/fit/v4/DerivedTypeTestITCase.java    |  22 +-
 .../olingo/fit/v4/EntityCreateTestITCase.java   |  26 +-
 .../olingo/fit/v4/EntityRetrieveTestITCase.java |  90 ++---
 .../olingo/fit/v4/EntitySetTestITCase.java      |  38 +-
 .../olingo/fit/v4/EntityUpdateTestITCase.java   |  32 +-
 .../olingo/fit/v4/ErrorResponseTestITCase.java  |   4 +-
 .../olingo/fit/v4/FilterFactoryTestITCase.java  |   4 +-
 .../fit/v4/JSONFormatConformanceTestITCase.java |  12 +-
 .../olingo/fit/v4/KeyAsSegmentTestITCase.java   |  24 +-
 .../olingo/fit/v4/MediaEntityTestITCase.java    |  28 +-
 .../apache/olingo/fit/v4/OAuth2TestITCase.java  |  14 +-
 .../olingo/fit/v4/OpenTypeTestITCase.java       |  26 +-
 .../fit/v4/OperationImportInvokeTestITCase.java |  38 +-
 .../olingo/fit/v4/PropertyTestITCase.java       |  42 +--
 .../olingo/fit/v4/PropertyValueTestITCase.java  |  22 +-
 .../olingo/fit/v4/QueryOptionsTestITCase.java   |   6 +-
 .../fit/v4/ServiceDocumentTestITCase.java       |  10 +-
 .../olingo/fit/v4/SingletonTestITCase.java      |  30 +-
 .../apache/olingo/client/api/Configuration.java |  17 +-
 .../apache/olingo/client/api/ODataClient.java   |   9 +-
 .../olingo/client/api/ODataClientBuilder.java   |   8 +-
 .../request/ODataBasicRequest.java              |   8 +-
 .../streamed/ODataStreamedEntityRequest.java    |   7 +-
 .../api/domain/ClientEntitySetIterator.java     |  32 +-
 .../client/api/domain/ClientPrimitiveValue.java |   3 +
 .../client/api/serialization/ODataReader.java   |  28 +-
 .../client/api/serialization/ODataWriter.java   |  26 +-
 .../olingo/client/core/ConfigurationImpl.java   |  31 +-
 .../olingo/client/core/ODataClientFactory.java  |   4 +-
 .../olingo/client/core/ODataClientImpl.java     |  19 +-
 .../header/ODataErrorResponseChecker.java       |  37 +-
 .../request/AbstractODataBasicRequest.java      |   8 +-
 .../request/AbstractODataRequest.java           |   8 +-
 .../request/cud/ODataDeleteRequestImpl.java     |   4 +-
 .../cud/ODataEntityCreateRequestImpl.java       |  10 +-
 .../cud/ODataEntityUpdateRequestImpl.java       |  10 +-
 .../cud/ODataPropertyUpdateRequestImpl.java     |  10 +-
 .../cud/ODataReferenceAddingRequestImpl.java    |   6 +-
 .../cud/ODataValueUpdateRequestImpl.java        |  12 +-
 .../invoke/AbstractODataInvokeRequest.java      |  30 +-
 .../request/invoke/ODataInvokeRequestImpl.java  |  14 +-
 .../retrieve/AbstractMetadataRequestImpl.java   |   5 +-
 .../request/retrieve/ODataDeltaRequestImpl.java |   8 +-
 .../retrieve/ODataEntityRequestImpl.java        |   8 +-
 .../ODataEntitySetIteratorRequestImpl.java      |   8 +-
 .../retrieve/ODataEntitySetRequestImpl.java     |   8 +-
 .../request/retrieve/ODataMediaRequestImpl.java |   8 +-
 .../retrieve/ODataPropertyRequestImpl.java      |   8 +-
 .../request/retrieve/ODataRawRequestImpl.java   |   4 +-
 .../ODataServiceDocumentRequestImpl.java        |   8 +-
 .../request/retrieve/ODataValueRequestImpl.java |  10 +-
 .../retrieve/XMLMetadataRequestImpl.java        |   4 +-
 .../AbstractODataStreamedEntityRequest.java     |  16 +-
 .../streamed/AbstractODataStreamedRequest.java  |   3 +-
 .../core/domain/ClientPrimitiveValueImpl.java   |   6 +
 .../ClientODataDeserializerImpl.java            |  25 +-
 .../serialization/JsonEntitySerializer.java     |  16 +-
 .../serialization/JsonEntitySetSerializer.java  |   7 +-
 .../serialization/JsonPropertySerializer.java   |   5 +-
 .../core/serialization/JsonSerializer.java      |  57 +--
 .../core/serialization/ODataBinderImpl.java     |  16 +-
 .../core/serialization/ODataReaderImpl.java     |  50 +--
 .../core/serialization/ODataWriterImpl.java     |  30 +-
 .../apache/olingo/client/core/AbstractTest.java |   8 +-
 .../apache/olingo/client/core/v4/AtomTest.java  |  22 +-
 .../olingo/client/core/v4/EntitySetTest.java    |  42 +--
 .../olingo/client/core/v4/EntityTest.java       | 105 +++---
 .../apache/olingo/client/core/v4/ErrorTest.java |  22 +-
 .../apache/olingo/client/core/v4/JSONTest.java  |  52 +--
 .../olingo/client/core/v4/MetadataTest.java     |  14 +-
 .../olingo/client/core/v4/PropertyTest.java     |  58 +--
 .../client/core/v4/ServiceDocumentTest.java     |  34 +-
 .../olingo/commons/api/format/AcceptType.java   |  33 +-
 .../olingo/commons/api/format/ContentType.java  | 146 ++++---
 .../olingo/commons/api/format/ODataFormat.java  | 126 -------
 .../olingo/commons/api/format/TypeUtil.java     |  36 +-
 .../olingo/commons/api/http/HttpHeader.java     |  63 ++--
 .../commons/api/format/AcceptTypeTest.java      |   6 +-
 .../commons/api/format/ContentTypeTest.java     |  17 +-
 .../org/apache/olingo/server/api/OData.java     |  10 +-
 .../exception/BatchDeserializerException.java   |  65 ----
 .../exception/BatchSerializerException.java     |  46 ---
 .../deserializer/FixedFormatDeserializer.java   |   9 +-
 .../batch/BatchDeserializerException.java       |  77 ++++
 .../server/api/processor/DefaultProcessor.java  |   7 +-
 .../serializer/BatchSerializerException.java    |  45 +++
 .../serializer/ComplexSerializerOptions.java    |   6 +-
 .../EntityCollectionSerializerOptions.java      |   4 +-
 .../api/serializer/EntitySerializerOptions.java |   4 +-
 .../api/serializer/FixedFormatSerializer.java   |   8 +-
 .../server/api/serializer/ODataSerializer.java  |  15 +-
 .../serializer/PrimitiveSerializerOptions.java  |   6 +-
 .../ReferenceCollectionSerializerOptions.java   |  71 ++++
 .../serializer/ReferenceSerializerOptions.java  |  57 +++
 .../apache/olingo/server/core/ErrorHandler.java |  10 +-
 .../olingo/server/core/ServiceRequest.java      |  16 +-
 .../server/core/requests/BatchRequest.java      |  14 +-
 .../server/core/requests/DataRequest.java       |  12 +-
 .../olingo/server/example/TripPinDataModel.java |   3 +-
 .../olingo/server/core/ContentNegotiator.java   |  41 +-
 .../apache/olingo/server/core/ODataHandler.java |   3 +-
 .../apache/olingo/server/core/ODataImpl.java    |  61 +--
 .../core/batchhandler/BatchFacadeImpl.java      |   5 +-
 .../server/core/batchhandler/BatchHandler.java  |  14 +-
 .../core/batchhandler/BatchPartHandler.java     |   8 +-
 .../BatchReferenceRewriter.java                 |  13 +-
 .../FixedFormatDeserializerImpl.java            |   2 +-
 .../core/deserializer/batch/BatchBodyPart.java  |  35 +-
 .../deserializer/batch/BatchChangeSetPart.java  |   2 +-
 .../core/deserializer/batch/BatchParser.java    |   2 +-
 .../deserializer/batch/BatchParserCommon.java   | 121 +++---
 .../deserializer/batch/BatchQueryOperation.java |   2 +-
 .../batch/BatchRequestTransformator.java        |  35 +-
 .../batch/BatchTransformatorCommon.java         |  38 +-
 .../server/core/deserializer/batch/Header.java  |   9 -
 .../batch/HttpRequestStatusLine.java            |  32 +-
 .../json/ODataJsonDeserializer.java             |  60 ++-
 .../serializer/BatchResponseSerializer.java     |  18 +-
 .../serializer/FixedFormatSerializerImpl.java   |   2 +-
 .../serializer/json/ODataJsonSerializer.java    | 250 ++++++------
 .../json/ServiceDocumentJsonSerializer.java     |  32 +-
 .../serializer/utils/ContentTypeHelper.java     |  28 ++
 .../serializer/xml/ODataXmlSerializerImpl.java  |   8 +-
 .../olingo/server/core/uri/parser/Parser.java   |  10 +-
 .../server/core/ContentNegotiatorTest.java      |  49 +--
 .../olingo/server/core/ODataImplTest.java       |  57 +++
 .../batchhandler/MockedBatchHandlerTest.java    |  18 +-
 .../batch/BatchParserCommonTest.java            |   4 +-
 .../batch/BatchRequestParserTest.java           |  32 +-
 .../core/deserializer/batch/HeaderTest.java     |  16 -
 .../batch/HttpRequestStatusLineTest.java        |   4 +-
 .../json/ODataJsonDeserializerBasicTest.java    | 106 +++---
 .../serializer/BatchResponseSerializerTest.java |  16 +-
 .../json/ODataJsonSerializerTest.java           |   4 +-
 .../json/ServerErrorSerializerTest.java         |   6 +-
 .../xml/MetadataDocumentXmlSerializerTest.java  |   4 +-
 .../processor/TechnicalActionProcessor.java     |  53 ++-
 .../processor/TechnicalEntityProcessor.java     |  80 ++--
 .../TechnicalPrimitiveComplexProcessor.java     |  15 +-
 .../tecsvc/processor/TechnicalProcessor.java    |  10 +-
 .../olingo/server/core/ODataHandlerTest.java    |   3 +-
 .../json/AbstractODataDeserializerTest.java     |   6 +-
 .../json/ODataDeserializerDeepInsertTest.java   |  24 +-
 .../ODataDeserializerEntityCollectionTest.java  |  31 +-
 ...ataJsonDeserializerActionParametersTest.java |   5 +-
 .../json/ODataJsonDeserializerEntityTest.java   | 225 ++++++++---
 .../json/ODataJsonSerializerTest.java           | 299 ++++++++++++++-
 .../serializer/json/ServiceDocumentTest.java    |  15 +-
 .../serializer/xml/MetadataDocumentTest.java    |   4 +-
 pom.xml                                         |   7 +
 samples/osgi/server/README.txt                  | 183 +++++++++
 samples/osgi/server/pom.xml                     | 112 ++++++
 samples/pom.xml                                 |   1 +
 .../server/sample/processor/CarsProcessor.java  |  21 +-
 samples/tutorials/p4_navigation/pom.xml         |  80 ++++
 .../myservice/mynamespace/data/Storage.java     | 260 +++++++++++++
 .../mynamespace/service/DemoEdmProvider.java    | 216 +++++++++++
 .../service/DemoEntityCollectionProcessor.java  | 154 ++++++++
 .../service/DemoEntityProcessor.java            | 189 ++++++++++
 .../service/DemoPrimitiveProcessor.java         | 154 ++++++++
 .../java/myservice/mynamespace/util/Util.java   | 145 +++++++
 .../myservice/mynamespace/web/DemoServlet.java  |  76 ++++
 .../src/main/webapp/WEB-INF/web.xml             |  34 ++
 .../p4_navigation/src/main/webapp/index.jsp     |  26 ++
 samples/tutorials/pom.xml                       |   1 +
 211 files changed, 5373 insertions(+), 2227 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ActionImportITCase.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
----------------------------------------------------------------------
diff --cc fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
index 8e44289,2efba8a..96413cd
--- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
@@@ -414,8 -434,10 +433,10 @@@ public class BasicITCase extends Abstra
  
      final ODataEntityCreateResponse<ClientEntity> response = request.execute();
      assertEquals(HttpStatusCode.NO_CONTENT.getStatusCode(), response.getStatusCode());
 -    assertEquals("return=minimal", response.getHeader(HeaderName.preferenceApplied).iterator().next());
 +    assertEquals("return=minimal", response.getHeader(HttpHeader.PREFERENCE_APPLIED).iterator().next());
-     assertEquals(SERVICE_URI + "/ESTwoPrim(1)", response.getHeader(HttpHeader.LOCATION).iterator().next());
+     final String location = SERVICE_URI + "/ESTwoPrim(1)";
+     assertEquals(location, response.getHeader(HttpHeader.LOCATION).iterator().next());
+     assertEquals(location, response.getHeader(HttpHeader.ODATA_ENTITY_ID).iterator().next());
    }
  
    @Test

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/PrimitiveComplexITCase.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java
----------------------------------------------------------------------
diff --cc fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java
index 7fa83be,94f0d11..3944f34
--- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java
@@@ -30,8 -31,7 +30,8 @@@ import org.apache.olingo.client.api.com
  import org.apache.olingo.client.api.domain.ClientEntity;
  import org.apache.olingo.client.api.domain.ClientEntitySet;
  import org.apache.olingo.client.core.ODataClientFactory;
- import org.apache.olingo.commons.api.format.ODataFormat;
 +import org.apache.olingo.commons.api.http.HttpHeader;
+ import org.apache.olingo.commons.api.format.ContentType;
  import org.apache.olingo.commons.api.http.HttpStatusCode;
  import org.apache.olingo.fit.AbstractBaseTestITCase;
  import org.apache.olingo.fit.tecsvc.TecSvcConst;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java
----------------------------------------------------------------------
diff --cc fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java
index f6964b3,123dcd9..81050a4
--- a/fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/AuthBatchTestITCase.java
@@@ -38,8 -39,6 +38,7 @@@ import org.apache.olingo.client.core.ht
  import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
  import org.apache.olingo.commons.api.edm.FullQualifiedName;
  import org.apache.olingo.commons.api.format.ContentType;
- import org.apache.olingo.commons.api.format.ODataFormat;
 +import org.apache.olingo.commons.api.http.HttpHeader;
  import org.junit.Test;
  
  public class AuthBatchTestITCase extends AbstractTestITCase {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java
----------------------------------------------------------------------
diff --cc fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java
index 26c38f9,d039ab2..5007c2c
--- a/fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/BatchTestITCase.java
@@@ -66,8 -67,6 +66,7 @@@ import org.apache.olingo.commons.api.ed
  import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
  import org.apache.olingo.commons.api.edm.FullQualifiedName;
  import org.apache.olingo.commons.api.format.ContentType;
- import org.apache.olingo.commons.api.format.ODataFormat;
 +import org.apache.olingo.commons.api.http.HttpHeader;
  import org.junit.Test;
  
  public class BatchTestITCase extends AbstractTestITCase {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java
----------------------------------------------------------------------
diff --cc fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java
index 9579239,2e9fe5a..32ce435
--- a/fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/ConformanceTestITCase.java
@@@ -53,8 -54,7 +53,8 @@@ import org.apache.olingo.client.core.ht
  import org.apache.olingo.client.core.uri.URIUtils;
  import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
  import org.apache.olingo.commons.api.edm.FullQualifiedName;
- import org.apache.olingo.commons.api.format.ODataFormat;
 +import org.apache.olingo.commons.api.http.HttpHeader;
+ import org.apache.olingo.commons.api.format.ContentType;
  import org.junit.Test;
  
  /**
@@@ -117,17 -118,21 +117,17 @@@ public class ConformanceTestITCase exte
      final ODataEntityCreateRequest<ClientEntity> req = getClient().getCUDRequestFactory().getEntityCreateRequest(
          getClient().newURIBuilder(testStaticServiceRootURL).
          appendEntitySetSegment("Orders").build(), order);
-     req.setFormat(ODataFormat.JSON_FULL_METADATA);
+     req.setFormat(ContentType.JSON_FULL_METADATA);
  
      // check for OData-Version
 -    assertEquals("4.0", req.getHeader("OData-Version"));
 -    assertEquals("4.0", req.getHeader(HeaderName.odataVersion.toString()));
 +    assertEquals("4.0", req.getHeader(HttpHeader.ODATA_VERSION));
  
      // check for Content-Type
      assertEquals(
-         ODataFormat.JSON_FULL_METADATA.getContentType().toContentTypeString(),
-         req.getHeader(HttpHeader.CONTENT_TYPE));
+         ContentType.JSON_FULL_METADATA.toContentTypeString(),
+         req.getHeader("Content-Type"));
      assertEquals(
-         ODataFormat.JSON_FULL_METADATA.getContentType().toContentTypeString(),
+         ContentType.JSON_FULL_METADATA.toContentTypeString(),
 -        req.getHeader(HeaderName.contentType.toString()));
 -    assertEquals(
 -        ContentType.JSON_FULL_METADATA.toContentTypeString(),
          req.getContentType());
  
      final ClientEntity created = req.execute().getBody();
@@@ -402,9 -408,10 +402,9 @@@
  
      final ODataEntityRequest<ClientEntity> req =
          client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
-     req.setFormat(ODataFormat.JSON);
+     req.setFormat(ContentType.JSON);
  
      assertEquals("application/json;odata.metadata=minimal", req.getHeader("Accept"));
 -    assertEquals("application/json;odata.metadata=minimal", req.getHeader(HeaderName.accept.toString()));
      assertEquals("application/json;odata.metadata=minimal", req.getAccept());
  
      final ODataRetrieveResponse<ClientEntity> res = req.execute();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java
----------------------------------------------------------------------
diff --cc fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java
index cdc3c12,0c6352d..268939e
--- a/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/MediaEntityTestITCase.java
@@@ -51,8 -52,7 +51,8 @@@ import org.apache.olingo.client.core.OD
  import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
  import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
  import org.apache.olingo.commons.api.edm.FullQualifiedName;
- import org.apache.olingo.commons.api.format.ODataFormat;
 +import org.apache.olingo.commons.api.http.HttpHeader;
+ import org.apache.olingo.commons.api.format.ContentType;
  import org.junit.Test;
  
  public class MediaEntityTestITCase extends AbstractTestITCase {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientImpl.java
----------------------------------------------------------------------
diff --cc lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientImpl.java
index 4ee8924,6c3bb4c..811b63f
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientImpl.java
@@@ -52,8 -53,7 +52,8 @@@ import org.apache.olingo.client.core.se
  import org.apache.olingo.client.core.uri.FilterFactoryImpl;
  import org.apache.olingo.client.core.uri.URIBuilderImpl;
  import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
- import org.apache.olingo.commons.api.format.ODataFormat;
 +import org.apache.olingo.commons.api.http.HttpHeader;
+ import org.apache.olingo.commons.api.format.ContentType;
  
  public class ODataClientImpl implements ODataClient {
  

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/b5111747/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractODataRequest.java
----------------------------------------------------------------------
diff --cc lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractODataRequest.java
index bf198de,4037a6f..4bd2d83
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractODataRequest.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractODataRequest.java
@@@ -40,8 -41,7 +40,8 @@@ import org.apache.olingo.client.api.com
  import org.apache.olingo.client.api.communication.response.ODataResponse;
  import org.apache.olingo.client.api.http.HttpClientException;
  import org.apache.olingo.commons.api.ODataRuntimeException;
- import org.apache.olingo.commons.api.format.ODataFormat;
 +import org.apache.olingo.commons.api.http.HttpHeader;
+ import org.apache.olingo.commons.api.format.ContentType;
  import org.apache.olingo.commons.api.http.HttpMethod;
  
  /**
@@@ -169,11 -169,17 +169,11 @@@ public abstract class AbstractODataRequ
    }
  
    @Override
 -  public ODataRequest addCustomHeader(final HeaderName name, final String value) {
 -    odataHeaders.setHeader(name, value);
 -    return this;
 -  }
 -
 -  @Override
    public String getAccept() {
 -    final String acceptHead = odataHeaders.getHeader(HeaderName.accept);
 -    return StringUtils.isBlank(acceptHead)
 -            ? getDefaultFormat().toContentTypeString()
 -            : acceptHead;
 +    final String acceptHead = odataHeaders.getHeader(HttpHeader.ACCEPT);
 +    return StringUtils.isBlank(acceptHead) ?
-         getDefaultFormat().getContentType().toContentTypeString() :
++        getDefaultFormat().toContentTypeString() :
 +        acceptHead;
    }
  
    @Override
@@@ -193,10 -199,10 +193,10 @@@
  
    @Override
    public String getContentType() {
 -    final String contentTypeHead = odataHeaders.getHeader(HeaderName.contentType);
 -    return StringUtils.isBlank(contentTypeHead)
 -            ? getDefaultFormat().toContentTypeString()
 -            : contentTypeHead;
 +    final String contentTypeHead = odataHeaders.getHeader(HttpHeader.CONTENT_TYPE);
 +    return StringUtils.isBlank(contentTypeHead) ?
-         getDefaultFormat().getContentType().toContentTypeString() :
++        getDefaultFormat().toContentTypeString() :
 +        contentTypeHead;
    }
  
    @Override