From 655dbb8c97a2b2dd4d7174eca0eb5099b7e7f082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesco=20Chicchiricc=C3=B2?= <--global> Date: Mon, 11 Aug 2014 11:13:30 +0200 Subject: [PATCH] [OLINGO-399] ODataRuntimeException -> ODataResponseError --- .../olingo/ext/proxy/api/PersistenceManager.java | 6 +++--- .../proxy/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 ++-- .../communication/ODataClientErrorException.java | 4 ++-- .../communication/ODataServerErrorException.java | 4 ++-- .../api/communication/header/HeaderName.java | 4 ++-- .../api/communication/header/ODataPreferences.java | 4 ++-- .../header/ODataErrorResponseChecker.java | 6 +++--- .../request/AbstractODataRequest.java | 4 ++-- .../communication/request/AbstractRequest.java | 6 +++--- .../response/AbstractODataResponse.java | 4 ++-- ...ntimeException.java => ODataResponseError.java} | 8 ++++---- .../java/org/apache/olingo/server/api/OData.java | 4 ++-- .../olingo/server/core/ODataHttpHandlerImpl.java | 6 +++--- .../apache/olingo/server/core/uri/UriInfoImpl.java | 4 ++-- .../core/http/SocketFactoryHttpClientFactory.java | 4 ++-- 21 files changed, 56 insertions(+), 56 deletions(-) rename lib/commons-api/src/main/java/org/apache/olingo/commons/api/{ODataRuntimeException.java => ODataResponseError.java} (80%) 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 c37a2997c..9d702b034 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 flush(); + List 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> flushAsync(); + Future> flushAsync(); } 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 0d5e850b2..79350b0d6 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> flushAsync() { - return service.getClient().getConfiguration().getExecutor().submit(new Callable>() { + public Future> flushAsync() { + return service.getClient().getConfiguration().getExecutor().submit(new Callable>() { @Override - public List call() throws Exception { + public List call() throws Exception { return flush(); } }); } - protected abstract List doFlush(PersistenceChanges changes, TransactionItems items); + protected abstract List doFlush(PersistenceChanges changes, TransactionItems items); @Override - public List flush() { + public List 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 result = new ArrayList(); + final List result = new ArrayList(); if (!items.isEmpty()) { result.addAll(doFlush(changes, items)); } 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 919669365..52cfde63e 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 doFlush(final PersistenceChanges changes, final TransactionItems items) { - final List result = new ArrayList(); + protected List doFlush(final PersistenceChanges changes, final TransactionItems items) { + final List result = new ArrayList(); final Map responses = new HashMap(); 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()) { 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 140d98a7c..107eb9de1 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 doFlush(final PersistenceChanges changes, final TransactionItems items) { + protected List 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 result = new ArrayList(); + final List result = new ArrayList(); if (!items.isEmpty()) { final Iterator batchResItor = response.getBody(); 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 35775fb18..554bde52f 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> futureFlush = container.flushAsync(); + final Future> futureFlush = container.flushAsync(); assertNotNull(futureFlush); while (!futureFlush.isDone()) { 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 4804191e2..b39d8cf0d 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 res = getContainer().flush(); + List res = getContainer().flush(); assertTrue(res.isEmpty() || res.iterator().next() == null); service.getContext().detachAll(); 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 855fe36bd..4dd7e9d12 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> futureFlush = container.flushAsync(); + final Future> futureFlush = container.flushAsync(); assertNotNull(futureFlush); while (!futureFlush.isDone()) { 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 041d6ec99..d0cc00fb7 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 result = container.flush(); + final List result = container.flush(); assertEquals(2, result.size()); assertTrue(result.get(0) instanceof ODataClientErrorException); 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 178241a3b..07a4fe60d 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; 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 a3d218586..fdd47aa5c 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; 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 ed768ec8e..a721ba9c3 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()); } } 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 94ea8ceab..4aa8d0ed3 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; 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 967a66649..209813ac4 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); 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 0a8e109c0..d9b436288 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; } 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 d920a98d5..8c6ddf8b9 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); } } 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 a748980cc..04a0c6b6b 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()) { 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/ODataResponseError.java similarity index 80% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataRuntimeException.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataResponseError.java index 0c8374aa6..59bed1e6d 100644 --- 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/ODataResponseError.java @@ -18,19 +18,19 @@ */ package org.apache.olingo.commons.api; -public class ODataRuntimeException extends RuntimeException { +public class ODataResponseError extends RuntimeException { private static final long serialVersionUID = 5492375572049190883L; - public ODataRuntimeException(final String msg) { + public ODataResponseError(final String msg) { super(msg); } - public ODataRuntimeException(final String msg, final Exception cause) { + public ODataResponseError(final String msg, final Exception cause) { super(msg, cause); } - public ODataRuntimeException(final Exception cause) { + public ODataResponseError(final Exception cause) { super(cause); } 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 d1c669820..41e0083b6 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); } } 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 3b7a7a289..3cf1efc0e 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); } } } 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 2b4b266e3..8145314cd 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; 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 1d4100520..0207ce093 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));