You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by il...@apache.org on 2014/08/11 11:13:52 UTC
git commit: [OLINGO-399] ODataRuntimeException -> ODataResponseError
Repository: olingo-odata4
Updated Branches:
refs/heads/master bc1d13929 -> 655dbb8c9
[OLINGO-399] ODataRuntimeException -> ODataResponseError
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/655dbb8c
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/655dbb8c
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/655dbb8c
Branch: refs/heads/master
Commit: 655dbb8c97a2b2dd4d7174eca0eb5099b7e7f082
Parents: bc1d139
Author: Francesco Chicchiriccò <--global>
Authored: Mon Aug 11 11:13:30 2014 +0200
Committer: Francesco Chicchiriccò <--global>
Committed: Mon Aug 11 11:13:30 2014 +0200
----------------------------------------------------------------------
.../ext/proxy/api/PersistenceManager.java | 6 ++--
.../commons/AbstractPersistenceManager.java | 14 ++++----
.../NonTransactionalPersistenceManagerImpl.java | 8 ++---
.../TransactionalPersistenceManagerImpl.java | 6 ++--
.../olingo/fit/proxy/v3/AsyncTestITCase.java | 4 +--
.../fit/proxy/v4/APIBasicDesignTestITCase.java | 4 +--
.../olingo/fit/proxy/v4/AsyncTestITCase.java | 4 +--
.../olingo/fit/proxy/v4/ContextTestITCase.java | 4 +--
.../ODataClientErrorException.java | 4 +--
.../ODataServerErrorException.java | 4 +--
.../api/communication/header/HeaderName.java | 4 +--
.../communication/header/ODataPreferences.java | 4 +--
.../header/ODataErrorResponseChecker.java | 6 ++--
.../request/AbstractODataRequest.java | 4 +--
.../communication/request/AbstractRequest.java | 6 ++--
.../response/AbstractODataResponse.java | 4 +--
.../olingo/commons/api/ODataResponseError.java | 37 ++++++++++++++++++++
.../commons/api/ODataRuntimeException.java | 37 --------------------
.../org/apache/olingo/server/api/OData.java | 4 +--
.../server/core/ODataHttpHandlerImpl.java | 6 ++--
.../olingo/server/core/uri/UriInfoImpl.java | 4 +--
.../http/SocketFactoryHttpClientFactory.java | 4 +--
22 files changed, 89 insertions(+), 89 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/PersistenceManager.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/PersistenceManager.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/PersistenceManager.java
index c37a299..9d702b0 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/PersistenceManager.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/PersistenceManager.java
@@ -21,7 +21,7 @@ package org.apache.olingo.ext.proxy.api;
import java.io.Serializable;
import java.util.List;
import java.util.concurrent.Future;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
/**
* Interface for container operations.
@@ -34,7 +34,7 @@ public interface PersistenceManager extends Serializable {
* @return a list where n-th item is either null (if corresponding request went out successfully) or the exception
* bearing the error returned from the service.
*/
- List<ODataRuntimeException> flush();
+ List<ODataResponseError> flush();
/**
* Asynchronously flushes all pending changes to the OData service.
@@ -42,5 +42,5 @@ public interface PersistenceManager extends Serializable {
* @return a future handle for a list where n-th item is either null (if corresponding request went out successfully)
* or the exception bearing the error returned from the service.
*/
- Future<List<ODataRuntimeException>> flushAsync();
+ Future<List<ODataResponseError>> flushAsync();
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractPersistenceManager.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractPersistenceManager.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractPersistenceManager.java
index 0d5e850..79350b0 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractPersistenceManager.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractPersistenceManager.java
@@ -38,7 +38,7 @@ import org.apache.olingo.client.api.communication.request.cud.v4.ODataReferenceA
import org.apache.olingo.client.api.communication.request.streamed.ODataMediaEntityUpdateRequest;
import org.apache.olingo.client.api.communication.request.streamed.ODataStreamUpdateRequest;
import org.apache.olingo.client.core.uri.URIUtils;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
import org.apache.olingo.commons.api.domain.CommonODataEntity;
import org.apache.olingo.commons.api.domain.ODataLink;
import org.apache.olingo.commons.api.domain.ODataLinkType;
@@ -71,19 +71,19 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
}
@Override
- public Future<List<ODataRuntimeException>> flushAsync() {
- return service.getClient().getConfiguration().getExecutor().submit(new Callable<List<ODataRuntimeException>>() {
+ public Future<List<ODataResponseError>> flushAsync() {
+ return service.getClient().getConfiguration().getExecutor().submit(new Callable<List<ODataResponseError>>() {
@Override
- public List<ODataRuntimeException> call() throws Exception {
+ public List<ODataResponseError> call() throws Exception {
return flush();
}
});
}
- protected abstract List<ODataRuntimeException> doFlush(PersistenceChanges changes, TransactionItems items);
+ protected abstract List<ODataResponseError> doFlush(PersistenceChanges changes, TransactionItems items);
@Override
- public List<ODataRuntimeException> flush() {
+ public List<ODataResponseError> flush() {
final PersistenceChanges changes = new PersistenceChanges();
final TransactionItems items = new TransactionItems();
@@ -110,7 +110,7 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
items.put(null, pos);
}
- final List<ODataRuntimeException> result = new ArrayList<ODataRuntimeException>();
+ final List<ODataResponseError> result = new ArrayList<ODataResponseError>();
if (!items.isEmpty()) {
result.addAll(doFlush(changes, items));
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/NonTransactionalPersistenceManagerImpl.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/NonTransactionalPersistenceManagerImpl.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/NonTransactionalPersistenceManagerImpl.java
index 9196693..52cfde6 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/NonTransactionalPersistenceManagerImpl.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/NonTransactionalPersistenceManagerImpl.java
@@ -30,7 +30,7 @@ import org.apache.olingo.client.api.communication.request.ODataStreamedRequest;
import org.apache.olingo.client.api.communication.response.ODataEntityCreateResponse;
import org.apache.olingo.client.api.communication.response.ODataEntityUpdateResponse;
import org.apache.olingo.client.api.communication.response.ODataResponse;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
import org.apache.olingo.ext.proxy.AbstractService;
/**
@@ -46,8 +46,8 @@ public class NonTransactionalPersistenceManagerImpl extends AbstractPersistenceM
}
@Override
- protected List<ODataRuntimeException> doFlush(final PersistenceChanges changes, final TransactionItems items) {
- final List<ODataRuntimeException> result = new ArrayList<ODataRuntimeException>();
+ protected List<ODataResponseError> doFlush(final PersistenceChanges changes, final TransactionItems items) {
+ final List<ODataResponseError> result = new ArrayList<ODataResponseError>();
final Map<Integer, URI> responses = new HashMap<Integer, URI>();
int virtualContentID = 0;
@@ -89,7 +89,7 @@ public class NonTransactionalPersistenceManagerImpl extends AbstractPersistenceM
}
result.add(null);
- } catch (ODataRuntimeException e) {
+ } catch (ODataResponseError e) {
LOG.error("While performing {}", entry.getKey().getURI(), e);
if (service.getClient().getConfiguration().isContinueOnError()) {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/TransactionalPersistenceManagerImpl.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/TransactionalPersistenceManagerImpl.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/TransactionalPersistenceManagerImpl.java
index 140d98a..107eb9d 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/TransactionalPersistenceManagerImpl.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/TransactionalPersistenceManagerImpl.java
@@ -37,7 +37,7 @@ import org.apache.olingo.client.api.communication.response.ODataEntityUpdateResp
import org.apache.olingo.client.api.communication.response.ODataResponse;
import org.apache.olingo.client.core.communication.header.ODataErrorResponseChecker;
import org.apache.olingo.client.core.communication.request.batch.ODataChangesetResponseItem;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
import org.apache.olingo.ext.proxy.AbstractService;
/**
@@ -57,7 +57,7 @@ public class TransactionalPersistenceManagerImpl extends AbstractPersistenceMana
* Transactional changes commit.
*/
@Override
- protected List<ODataRuntimeException> doFlush(final PersistenceChanges changes, final TransactionItems items) {
+ protected List<ODataResponseError> doFlush(final PersistenceChanges changes, final TransactionItems items) {
final CommonODataBatchRequest request =
service.getClient().getBatchRequestFactory().getBatchRequest(service.getClient().getServiceRoot());
((ODataRequest) request).setAccept(
@@ -78,7 +78,7 @@ public class TransactionalPersistenceManagerImpl extends AbstractPersistenceMana
throw new IllegalStateException("Operation failed");
}
- final List<ODataRuntimeException> result = new ArrayList<ODataRuntimeException>();
+ final List<ODataResponseError> result = new ArrayList<ODataResponseError>();
if (!items.isEmpty()) {
final Iterator<ODataBatchResponseItem> batchResItor = response.getBody();
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AsyncTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AsyncTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AsyncTestITCase.java
index 35775fb..554bde5 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AsyncTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AsyncTestITCase.java
@@ -27,7 +27,7 @@ import java.util.List;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
import org.junit.Test;
//CHECKSTYLE:OFF (Maven checkstyle)
@@ -63,7 +63,7 @@ public class AsyncTestITCase extends AbstractTestITCase {
final Product product = container.getProduct().getByKey(-10);
product.setDescription("AsyncTest#updateEntity " + random);
- final Future<List<ODataRuntimeException>> futureFlush = container.flushAsync();
+ final Future<List<ODataResponseError>> futureFlush = container.flushAsync();
assertNotNull(futureFlush);
while (!futureFlush.isDone()) {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/APIBasicDesignTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/APIBasicDesignTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/APIBasicDesignTestITCase.java
index 4804191..b39d8cf 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/APIBasicDesignTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/APIBasicDesignTestITCase.java
@@ -34,7 +34,7 @@ import java.util.TimeZone;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
import org.apache.olingo.commons.api.format.ContentType;
import org.apache.olingo.ext.proxy.AbstractService;
import org.apache.olingo.ext.proxy.api.EdmStreamValue;
@@ -601,7 +601,7 @@ public class APIBasicDesignTestITCase extends AbstractTestITCase {
getContainer().getOrders().add(order);
getContainer().getOrders().delete(order);
- List<ODataRuntimeException> res = getContainer().flush();
+ List<ODataResponseError> res = getContainer().flush();
assertTrue(res.isEmpty() || res.iterator().next() == null);
service.getContext().detachAll();
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AsyncTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AsyncTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AsyncTestITCase.java
index 855fe36..4dd7e9d 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AsyncTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AsyncTestITCase.java
@@ -27,7 +27,7 @@ import org.apache.commons.lang3.RandomStringUtils;
import org.junit.Test;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
//CHECKSTYLE:OFF (Maven checkstyle)
import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Customer;
@@ -64,7 +64,7 @@ public class AsyncTestITCase extends AbstractTestITCase {
final Person person = container.getPeople().getByKey(1);
person.setFirstName(randomFirstName);
- final Future<List<ODataRuntimeException>> futureFlush = container.flushAsync();
+ final Future<List<ODataResponseError>> futureFlush = container.flushAsync();
assertNotNull(futureFlush);
while (!futureFlush.isDone()) {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/ContextTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/ContextTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/ContextTestITCase.java
index 041d6ec..d0cc00f 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/ContextTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/ContextTestITCase.java
@@ -28,7 +28,7 @@ import java.util.List;
import java.util.TimeZone;
import org.apache.olingo.client.api.communication.ODataClientErrorException;
import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
import org.apache.olingo.commons.api.format.ContentType;
import org.apache.olingo.ext.proxy.api.PrimitiveCollection;
import org.apache.olingo.fit.proxy.v4.staticservice.Service;
@@ -70,7 +70,7 @@ public class ContextTestITCase extends AbstractTestITCase {
container.getPeople().add(employee);
- final List<ODataRuntimeException> result = container.flush();
+ final List<ODataResponseError> result = container.flush();
assertEquals(2, result.size());
assertTrue(result.get(0) instanceof ODataClientErrorException);
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/ODataClientErrorException.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/ODataClientErrorException.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/ODataClientErrorException.java
index 178241a..07a4fe6 100644
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/ODataClientErrorException.java
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/ODataClientErrorException.java
@@ -20,7 +20,7 @@ package org.apache.olingo.client.api.communication;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.StatusLine;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
import org.apache.olingo.commons.api.domain.ODataError;
/**
@@ -28,7 +28,7 @@ import org.apache.olingo.commons.api.domain.ODataError;
*
* @see ODataError
*/
-public class ODataClientErrorException extends ODataRuntimeException {
+public class ODataClientErrorException extends ODataResponseError {
private static final long serialVersionUID = -2551523202755268162L;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/ODataServerErrorException.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/ODataServerErrorException.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/ODataServerErrorException.java
index a3d2185..fdd47aa 100644
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/ODataServerErrorException.java
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/ODataServerErrorException.java
@@ -19,12 +19,12 @@
package org.apache.olingo.client.api.communication;
import org.apache.http.StatusLine;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
/**
* Represents a server error in OData.
*/
-public class ODataServerErrorException extends ODataRuntimeException {
+public class ODataServerErrorException extends ODataResponseError {
private static final long serialVersionUID = -6423014532618680135L;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/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
index ed768ec..a721ba9 100644
--- 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
@@ -18,7 +18,7 @@
*/
package org.apache.olingo.client.api.communication.header;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
import java.util.Arrays;
@@ -214,7 +214,7 @@ public enum HeaderName {
final void isSupportedBy(final ODataServiceVersion serviceVersion) {
if (!supportedVersions.contains(serviceVersion)) {
- throw new ODataRuntimeException("Unsupported header " + this.toString());
+ throw new ODataResponseError("Unsupported header " + this.toString());
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/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 94ea8ce..4aa8d0e 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
@@ -18,7 +18,7 @@
*/
package org.apache.olingo.client.api.communication.header;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
import java.util.Arrays;
@@ -411,7 +411,7 @@ public class ODataPreferences {
final PreferenceNames isSupportedBy(final ODataServiceVersion serviceVersion) {
if (!supportedVersions.contains(serviceVersion)) {
- throw new ODataRuntimeException("Unsupported header " + this.toString());
+ throw new ODataResponseError("Unsupported header " + this.toString());
}
return this;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/header/ODataErrorResponseChecker.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/header/ODataErrorResponseChecker.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/header/ODataErrorResponseChecker.java
index 967a666..209813a 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/header/ODataErrorResponseChecker.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/header/ODataErrorResponseChecker.java
@@ -23,7 +23,7 @@ import org.apache.http.StatusLine;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.communication.ODataClientErrorException;
import org.apache.olingo.client.api.communication.ODataServerErrorException;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
import org.apache.olingo.commons.api.domain.ODataError;
import org.apache.olingo.commons.api.format.ODataFormat;
import org.apache.olingo.commons.api.serialization.ODataDeserializerException;
@@ -41,11 +41,11 @@ public final class ODataErrorResponseChecker {
return error;
}
- public static ODataRuntimeException checkResponse(
+ public static ODataResponseError checkResponse(
final CommonODataClient<?> odataClient, final StatusLine statusLine, final InputStream entity,
final String accept) {
- ODataRuntimeException result = null;
+ ODataResponseError result = null;
if (entity == null) {
result = new ODataClientErrorException(statusLine);
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/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 0a8e109..d9b4362 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
@@ -42,7 +42,7 @@ import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.net.URI;
import java.util.Collection;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
/**
* Abstract representation of an OData request. Get instance by using factories.
@@ -322,7 +322,7 @@ public abstract class AbstractODataRequest extends AbstractRequest implements OD
try {
checkResponse(odataClient, response, getAccept());
- } catch (ODataRuntimeException e) {
+ } catch (ODataResponseError e) {
odataClient.getConfiguration().getHttpClientFactory().close(httpClient);
throw e;
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractRequest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractRequest.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractRequest.java
index d920a98..8c6ddf8 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractRequest.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/AbstractRequest.java
@@ -20,7 +20,7 @@ import org.apache.http.client.methods.HttpUriRequest;
import org.apache.olingo.client.api.CommonEdmEnabledODataClient;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.core.communication.header.ODataErrorResponseChecker;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
@@ -50,7 +50,7 @@ public abstract class AbstractRequest {
if (response.getStatusLine().getStatusCode() >= 400) {
try {
- final ODataRuntimeException exception = ODataErrorResponseChecker.checkResponse(
+ final ODataResponseError exception = ODataErrorResponseChecker.checkResponse(
odataClient,
response.getStatusLine(),
response.getEntity() == null ? null : response.getEntity().getContent(),
@@ -59,7 +59,7 @@ public abstract class AbstractRequest {
throw exception;
}
} catch (IOException e) {
- throw new ODataRuntimeException(
+ throw new ODataResponseError(
"Received '" + response.getStatusLine() + "' but could not extract error body", e);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/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 a748980..04a0c6b 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
@@ -46,7 +46,7 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
import java.util.TreeMap;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
/**
* Abstract representation of an OData response.
@@ -183,7 +183,7 @@ public abstract class AbstractODataResponse implements ODataResponse {
this.payload = res.getEntity() == null ? null : res.getEntity().getContent();
} catch (Exception e) {
LOG.error("Error retrieving payload", e);
- throw new ODataRuntimeException(e);
+ throw new ODataResponseError(e);
}
for (Header header : res.getAllHeaders()) {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataResponseError.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataResponseError.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataResponseError.java
new file mode 100644
index 0000000..59bed1e
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataResponseError.java
@@ -0,0 +1,37 @@
+/*
+ * 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.commons.api;
+
+public class ODataResponseError extends RuntimeException {
+
+ private static final long serialVersionUID = 5492375572049190883L;
+
+ public ODataResponseError(final String msg) {
+ super(msg);
+ }
+
+ public ODataResponseError(final String msg, final Exception cause) {
+ super(msg, cause);
+ }
+
+ public ODataResponseError(final Exception cause) {
+ super(cause);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataRuntimeException.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataRuntimeException.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataRuntimeException.java
deleted file mode 100644
index 0c8374a..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataRuntimeException.java
+++ /dev/null
@@ -1,37 +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.commons.api;
-
-public class ODataRuntimeException extends RuntimeException {
-
- private static final long serialVersionUID = 5492375572049190883L;
-
- public ODataRuntimeException(final String msg) {
- super(msg);
- }
-
- public ODataRuntimeException(final String msg, final Exception cause) {
- super(msg, cause);
- }
-
- public ODataRuntimeException(final Exception cause) {
- super(cause);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java
index d1c6698..41e0083 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java
@@ -18,7 +18,7 @@
*/
package org.apache.olingo.server.api;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.format.ODataFormat;
import org.apache.olingo.server.api.edm.provider.EdmProvider;
@@ -47,7 +47,7 @@ public abstract class OData {
return (OData) object;
} catch (final Exception e) {
- throw new ODataRuntimeException(e);
+ throw new ODataResponseError(e);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java
index 3b7a7a2..3cf1efc 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHttpHandlerImpl.java
@@ -18,7 +18,7 @@
*/
package org.apache.olingo.server.core;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.http.HttpHeader;
import org.apache.olingo.commons.api.http.HttpMethod;
@@ -109,13 +109,13 @@ public class ODataHttpHandlerImpl implements ODataHttpHandler {
}
} catch (IOException e) {
LOG.error(e.getMessage(), e);
- throw new ODataRuntimeException(e);
+ throw new ODataResponseError(e);
} finally {
if (input != null) {
try {
input.close();
} catch (IOException e) {
- throw new ODataRuntimeException(e);
+ throw new ODataResponseError(e);
}
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
index 2b4b266..8145314 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java
@@ -18,7 +18,7 @@
*/
package org.apache.olingo.server.core.uri;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
import org.apache.olingo.commons.api.edm.EdmEntityType;
import org.apache.olingo.server.api.uri.UriInfo;
import org.apache.olingo.server.api.uri.UriInfoAll;
@@ -266,7 +266,7 @@ public class UriInfoImpl implements UriInfo {
} else if (systemOption.getKind() == SystemQueryOptionKind.LEVELS) {
systemQueryOptions.put(SystemQueryOptionKind.LEVELS, systemOption);
} else {
- throw new ODataRuntimeException("Unsupported System Query Option: " + systemOption.getName());
+ throw new ODataResponseError("Unsupported System Query Option: " + systemOption.getName());
}
return this;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/655dbb8c/samples/client/src/main/java/org/apache/olingo/samples/client/core/http/SocketFactoryHttpClientFactory.java
----------------------------------------------------------------------
diff --git a/samples/client/src/main/java/org/apache/olingo/samples/client/core/http/SocketFactoryHttpClientFactory.java b/samples/client/src/main/java/org/apache/olingo/samples/client/core/http/SocketFactoryHttpClientFactory.java
index 1d41005..0207ce0 100644
--- a/samples/client/src/main/java/org/apache/olingo/samples/client/core/http/SocketFactoryHttpClientFactory.java
+++ b/samples/client/src/main/java/org/apache/olingo/samples/client/core/http/SocketFactoryHttpClientFactory.java
@@ -30,7 +30,7 @@ import org.apache.http.impl.conn.BasicClientConnectionManager;
import org.apache.http.params.CoreProtocolPNames;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.client.core.http.AbstractHttpClientFactory;
-import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.ODataResponseError;
/**
* Shows how to customize the way how the underlying network socket are managed by the HTTP component; the specific
@@ -61,7 +61,7 @@ public class SocketFactoryHttpClientFactory extends AbstractHttpClientFactory {
new SSLSocketFactory(acceptTrustStrategy, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
registry.register(new Scheme(uri.getScheme(), uri.getPort(), ssf));
} catch (Exception e) {
- throw new ODataRuntimeException(e);
+ throw new ODataResponseError(e);
}
final DefaultHttpClient httpClient = new DefaultHttpClient(new BasicClientConnectionManager(registry));