olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chri...@apache.org
Subject [1/2] olingo-odata4 git commit: [OLINGO-712] HeaderName is redundant (there is HttpHeader)
Date Mon, 29 Jun 2015 11:54:53 GMT
Repository: olingo-odata4
Updated Branches:
  refs/heads/master abf5bf79a -> b51117477


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

Signed-off-by: Christian Amend <christian.amend@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 <klaus.straubinger@sap.com>
Authored: Tue Jun 23 13:09:23 2015 +0200
Committer: Christian Amend <christian.amend@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:


Mime
View raw message