[OLINGO-399] ODataRuntimeException -> ODataResponseError

This commit is contained in:
Francesco Chicchiriccò 2014-08-11 11:13:30 +02:00
parent bc1d13929a
commit 655dbb8c97
21 changed files with 56 additions and 56 deletions

View File

@ -21,7 +21,7 @@ package org.apache.olingo.ext.proxy.api;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
import java.util.concurrent.Future; import java.util.concurrent.Future;
import org.apache.olingo.commons.api.ODataRuntimeException; import org.apache.olingo.commons.api.ODataResponseError;
/** /**
* Interface for container operations. * 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 * @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. * bearing the error returned from the service.
*/ */
List<ODataRuntimeException> flush(); List<ODataResponseError> flush();
/** /**
* Asynchronously flushes all pending changes to the OData service. * 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) * @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. * or the exception bearing the error returned from the service.
*/ */
Future<List<ODataRuntimeException>> flushAsync(); Future<List<ODataResponseError>> flushAsync();
} }

View File

@ -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.ODataMediaEntityUpdateRequest;
import org.apache.olingo.client.api.communication.request.streamed.ODataStreamUpdateRequest; import org.apache.olingo.client.api.communication.request.streamed.ODataStreamUpdateRequest;
import org.apache.olingo.client.core.uri.URIUtils; 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.CommonODataEntity;
import org.apache.olingo.commons.api.domain.ODataLink; import org.apache.olingo.commons.api.domain.ODataLink;
import org.apache.olingo.commons.api.domain.ODataLinkType; import org.apache.olingo.commons.api.domain.ODataLinkType;
@ -71,19 +71,19 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
} }
@Override @Override
public Future<List<ODataRuntimeException>> flushAsync() { public Future<List<ODataResponseError>> flushAsync() {
return service.getClient().getConfiguration().getExecutor().submit(new Callable<List<ODataRuntimeException>>() { return service.getClient().getConfiguration().getExecutor().submit(new Callable<List<ODataResponseError>>() {
@Override @Override
public List<ODataRuntimeException> call() throws Exception { public List<ODataResponseError> call() throws Exception {
return flush(); return flush();
} }
}); });
} }
protected abstract List<ODataRuntimeException> doFlush(PersistenceChanges changes, TransactionItems items); protected abstract List<ODataResponseError> doFlush(PersistenceChanges changes, TransactionItems items);
@Override @Override
public List<ODataRuntimeException> flush() { public List<ODataResponseError> flush() {
final PersistenceChanges changes = new PersistenceChanges(); final PersistenceChanges changes = new PersistenceChanges();
final TransactionItems items = new TransactionItems(); final TransactionItems items = new TransactionItems();
@ -110,7 +110,7 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
items.put(null, pos); items.put(null, pos);
} }
final List<ODataRuntimeException> result = new ArrayList<ODataRuntimeException>(); final List<ODataResponseError> result = new ArrayList<ODataResponseError>();
if (!items.isEmpty()) { if (!items.isEmpty()) {
result.addAll(doFlush(changes, items)); result.addAll(doFlush(changes, items));
} }

View File

@ -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.ODataEntityCreateResponse;
import org.apache.olingo.client.api.communication.response.ODataEntityUpdateResponse; import org.apache.olingo.client.api.communication.response.ODataEntityUpdateResponse;
import org.apache.olingo.client.api.communication.response.ODataResponse; 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; import org.apache.olingo.ext.proxy.AbstractService;
/** /**
@ -46,8 +46,8 @@ public class NonTransactionalPersistenceManagerImpl extends AbstractPersistenceM
} }
@Override @Override
protected List<ODataRuntimeException> doFlush(final PersistenceChanges changes, final TransactionItems items) { protected List<ODataResponseError> doFlush(final PersistenceChanges changes, final TransactionItems items) {
final List<ODataRuntimeException> result = new ArrayList<ODataRuntimeException>(); final List<ODataResponseError> result = new ArrayList<ODataResponseError>();
final Map<Integer, URI> responses = new HashMap<Integer, URI>(); final Map<Integer, URI> responses = new HashMap<Integer, URI>();
int virtualContentID = 0; int virtualContentID = 0;
@ -89,7 +89,7 @@ public class NonTransactionalPersistenceManagerImpl extends AbstractPersistenceM
} }
result.add(null); result.add(null);
} catch (ODataRuntimeException e) { } catch (ODataResponseError e) {
LOG.error("While performing {}", entry.getKey().getURI(), e); LOG.error("While performing {}", entry.getKey().getURI(), e);
if (service.getClient().getConfiguration().isContinueOnError()) { if (service.getClient().getConfiguration().isContinueOnError()) {

View File

@ -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.api.communication.response.ODataResponse;
import org.apache.olingo.client.core.communication.header.ODataErrorResponseChecker; import org.apache.olingo.client.core.communication.header.ODataErrorResponseChecker;
import org.apache.olingo.client.core.communication.request.batch.ODataChangesetResponseItem; 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; import org.apache.olingo.ext.proxy.AbstractService;
/** /**
@ -57,7 +57,7 @@ public class TransactionalPersistenceManagerImpl extends AbstractPersistenceMana
* Transactional changes commit. * Transactional changes commit.
*/ */
@Override @Override
protected List<ODataRuntimeException> doFlush(final PersistenceChanges changes, final TransactionItems items) { protected List<ODataResponseError> doFlush(final PersistenceChanges changes, final TransactionItems items) {
final CommonODataBatchRequest request = final CommonODataBatchRequest request =
service.getClient().getBatchRequestFactory().getBatchRequest(service.getClient().getServiceRoot()); service.getClient().getBatchRequestFactory().getBatchRequest(service.getClient().getServiceRoot());
((ODataRequest) request).setAccept( ((ODataRequest) request).setAccept(
@ -78,7 +78,7 @@ public class TransactionalPersistenceManagerImpl extends AbstractPersistenceMana
throw new IllegalStateException("Operation failed"); throw new IllegalStateException("Operation failed");
} }
final List<ODataRuntimeException> result = new ArrayList<ODataRuntimeException>(); final List<ODataResponseError> result = new ArrayList<ODataResponseError>();
if (!items.isEmpty()) { if (!items.isEmpty()) {
final Iterator<ODataBatchResponseItem> batchResItor = response.getBody(); final Iterator<ODataBatchResponseItem> batchResItor = response.getBody();

View File

@ -27,7 +27,7 @@ import java.util.List;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future; import java.util.concurrent.Future;
import org.apache.olingo.commons.api.ODataRuntimeException; import org.apache.olingo.commons.api.ODataResponseError;
import org.junit.Test; import org.junit.Test;
//CHECKSTYLE:OFF (Maven checkstyle) //CHECKSTYLE:OFF (Maven checkstyle)
@ -63,7 +63,7 @@ public class AsyncTestITCase extends AbstractTestITCase {
final Product product = container.getProduct().getByKey(-10); final Product product = container.getProduct().getByKey(-10);
product.setDescription("AsyncTest#updateEntity " + random); product.setDescription("AsyncTest#updateEntity " + random);
final Future<List<ODataRuntimeException>> futureFlush = container.flushAsync(); final Future<List<ODataResponseError>> futureFlush = container.flushAsync();
assertNotNull(futureFlush); assertNotNull(futureFlush);
while (!futureFlush.isDone()) { while (!futureFlush.isDone()) {

View File

@ -34,7 +34,7 @@ import java.util.TimeZone;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
import org.apache.olingo.client.api.v4.EdmEnabledODataClient; 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.commons.api.format.ContentType;
import org.apache.olingo.ext.proxy.AbstractService; import org.apache.olingo.ext.proxy.AbstractService;
import org.apache.olingo.ext.proxy.api.EdmStreamValue; import org.apache.olingo.ext.proxy.api.EdmStreamValue;
@ -601,7 +601,7 @@ public class APIBasicDesignTestITCase extends AbstractTestITCase {
getContainer().getOrders().add(order); getContainer().getOrders().add(order);
getContainer().getOrders().delete(order); getContainer().getOrders().delete(order);
List<ODataRuntimeException> res = getContainer().flush(); List<ODataResponseError> res = getContainer().flush();
assertTrue(res.isEmpty() || res.iterator().next() == null); assertTrue(res.isEmpty() || res.iterator().next() == null);
service.getContext().detachAll(); service.getContext().detachAll();

View File

@ -27,7 +27,7 @@ import org.apache.commons.lang3.RandomStringUtils;
import org.junit.Test; import org.junit.Test;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future; import java.util.concurrent.Future;
import org.apache.olingo.commons.api.ODataRuntimeException; import org.apache.olingo.commons.api.ODataResponseError;
//CHECKSTYLE:OFF (Maven checkstyle) //CHECKSTYLE:OFF (Maven checkstyle)
import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Customer; 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); final Person person = container.getPeople().getByKey(1);
person.setFirstName(randomFirstName); person.setFirstName(randomFirstName);
final Future<List<ODataRuntimeException>> futureFlush = container.flushAsync(); final Future<List<ODataResponseError>> futureFlush = container.flushAsync();
assertNotNull(futureFlush); assertNotNull(futureFlush);
while (!futureFlush.isDone()) { while (!futureFlush.isDone()) {

View File

@ -28,7 +28,7 @@ import java.util.List;
import java.util.TimeZone; import java.util.TimeZone;
import org.apache.olingo.client.api.communication.ODataClientErrorException; import org.apache.olingo.client.api.communication.ODataClientErrorException;
import org.apache.olingo.client.api.v4.EdmEnabledODataClient; 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.commons.api.format.ContentType;
import org.apache.olingo.ext.proxy.api.PrimitiveCollection; import org.apache.olingo.ext.proxy.api.PrimitiveCollection;
import org.apache.olingo.fit.proxy.v4.staticservice.Service; import org.apache.olingo.fit.proxy.v4.staticservice.Service;
@ -70,7 +70,7 @@ public class ContextTestITCase extends AbstractTestITCase {
container.getPeople().add(employee); container.getPeople().add(employee);
final List<ODataRuntimeException> result = container.flush(); final List<ODataResponseError> result = container.flush();
assertEquals(2, result.size()); assertEquals(2, result.size());
assertTrue(result.get(0) instanceof ODataClientErrorException); assertTrue(result.get(0) instanceof ODataClientErrorException);

View File

@ -20,7 +20,7 @@ package org.apache.olingo.client.api.communication;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.http.StatusLine; 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; import org.apache.olingo.commons.api.domain.ODataError;
/** /**
@ -28,7 +28,7 @@ import org.apache.olingo.commons.api.domain.ODataError;
* *
* @see ODataError * @see ODataError
*/ */
public class ODataClientErrorException extends ODataRuntimeException { public class ODataClientErrorException extends ODataResponseError {
private static final long serialVersionUID = -2551523202755268162L; private static final long serialVersionUID = -2551523202755268162L;

View File

@ -19,12 +19,12 @@
package org.apache.olingo.client.api.communication; package org.apache.olingo.client.api.communication;
import org.apache.http.StatusLine; 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. * Represents a server error in OData.
*/ */
public class ODataServerErrorException extends ODataRuntimeException { public class ODataServerErrorException extends ODataResponseError {
private static final long serialVersionUID = -6423014532618680135L; private static final long serialVersionUID = -6423014532618680135L;

View File

@ -18,7 +18,7 @@
*/ */
package org.apache.olingo.client.api.communication.header; 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 org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
import java.util.Arrays; import java.util.Arrays;
@ -214,7 +214,7 @@ public enum HeaderName {
final void isSupportedBy(final ODataServiceVersion serviceVersion) { final void isSupportedBy(final ODataServiceVersion serviceVersion) {
if (!supportedVersions.contains(serviceVersion)) { if (!supportedVersions.contains(serviceVersion)) {
throw new ODataRuntimeException("Unsupported header " + this.toString()); throw new ODataResponseError("Unsupported header " + this.toString());
} }
} }

View File

@ -18,7 +18,7 @@
*/ */
package org.apache.olingo.client.api.communication.header; 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 org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
import java.util.Arrays; import java.util.Arrays;
@ -411,7 +411,7 @@ public class ODataPreferences {
final PreferenceNames isSupportedBy(final ODataServiceVersion serviceVersion) { final PreferenceNames isSupportedBy(final ODataServiceVersion serviceVersion) {
if (!supportedVersions.contains(serviceVersion)) { if (!supportedVersions.contains(serviceVersion)) {
throw new ODataRuntimeException("Unsupported header " + this.toString()); throw new ODataResponseError("Unsupported header " + this.toString());
} }
return this; return this;

View File

@ -23,7 +23,7 @@ import org.apache.http.StatusLine;
import org.apache.olingo.client.api.CommonODataClient; import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.communication.ODataClientErrorException; import org.apache.olingo.client.api.communication.ODataClientErrorException;
import org.apache.olingo.client.api.communication.ODataServerErrorException; 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.domain.ODataError;
import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.api.format.ODataFormat;
import org.apache.olingo.commons.api.serialization.ODataDeserializerException; import org.apache.olingo.commons.api.serialization.ODataDeserializerException;
@ -41,11 +41,11 @@ public final class ODataErrorResponseChecker {
return error; return error;
} }
public static ODataRuntimeException checkResponse( public static ODataResponseError checkResponse(
final CommonODataClient<?> odataClient, final StatusLine statusLine, final InputStream entity, final CommonODataClient<?> odataClient, final StatusLine statusLine, final InputStream entity,
final String accept) { final String accept) {
ODataRuntimeException result = null; ODataResponseError result = null;
if (entity == null) { if (entity == null) {
result = new ODataClientErrorException(statusLine); result = new ODataClientErrorException(statusLine);

View File

@ -42,7 +42,7 @@ import java.io.InputStream;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.net.URI; import java.net.URI;
import java.util.Collection; 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. * Abstract representation of an OData request. Get instance by using factories.
@ -322,7 +322,7 @@ public abstract class AbstractODataRequest extends AbstractRequest implements OD
try { try {
checkResponse(odataClient, response, getAccept()); checkResponse(odataClient, response, getAccept());
} catch (ODataRuntimeException e) { } catch (ODataResponseError e) {
odataClient.getConfiguration().getHttpClientFactory().close(httpClient); odataClient.getConfiguration().getHttpClientFactory().close(httpClient);
throw e; throw e;
} }

View File

@ -20,7 +20,7 @@ import org.apache.http.client.methods.HttpUriRequest;
import org.apache.olingo.client.api.CommonEdmEnabledODataClient; import org.apache.olingo.client.api.CommonEdmEnabledODataClient;
import org.apache.olingo.client.api.CommonODataClient; import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.core.communication.header.ODataErrorResponseChecker; 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.io.IOException; import java.io.IOException;
@ -50,7 +50,7 @@ public abstract class AbstractRequest {
if (response.getStatusLine().getStatusCode() >= 400) { if (response.getStatusLine().getStatusCode() >= 400) {
try { try {
final ODataRuntimeException exception = ODataErrorResponseChecker.checkResponse( final ODataResponseError exception = ODataErrorResponseChecker.checkResponse(
odataClient, odataClient,
response.getStatusLine(), response.getStatusLine(),
response.getEntity() == null ? null : response.getEntity().getContent(), response.getEntity() == null ? null : response.getEntity().getContent(),
@ -59,7 +59,7 @@ public abstract class AbstractRequest {
throw exception; throw exception;
} }
} catch (IOException e) { } catch (IOException e) {
throw new ODataRuntimeException( throw new ODataResponseError(
"Received '" + response.getStatusLine() + "' but could not extract error body", e); "Received '" + response.getStatusLine() + "' but could not extract error body", e);
} }
} }

View File

@ -46,7 +46,7 @@ import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.TreeMap; import java.util.TreeMap;
import org.apache.olingo.commons.api.ODataRuntimeException; import org.apache.olingo.commons.api.ODataResponseError;
/** /**
* Abstract representation of an OData response. * 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(); this.payload = res.getEntity() == null ? null : res.getEntity().getContent();
} catch (Exception e) { } catch (Exception e) {
LOG.error("Error retrieving payload", e); LOG.error("Error retrieving payload", e);
throw new ODataRuntimeException(e); throw new ODataResponseError(e);
} }
for (Header header : res.getAllHeaders()) { for (Header header : res.getAllHeaders()) {

View File

@ -18,19 +18,19 @@
*/ */
package org.apache.olingo.commons.api; package org.apache.olingo.commons.api;
public class ODataRuntimeException extends RuntimeException { public class ODataResponseError extends RuntimeException {
private static final long serialVersionUID = 5492375572049190883L; private static final long serialVersionUID = 5492375572049190883L;
public ODataRuntimeException(final String msg) { public ODataResponseError(final String msg) {
super(msg); super(msg);
} }
public ODataRuntimeException(final String msg, final Exception cause) { public ODataResponseError(final String msg, final Exception cause) {
super(msg, cause); super(msg, cause);
} }
public ODataRuntimeException(final Exception cause) { public ODataResponseError(final Exception cause) {
super(cause); super(cause);
} }

View File

@ -18,7 +18,7 @@
*/ */
package org.apache.olingo.server.api; 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.edm.Edm;
import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.api.format.ODataFormat;
import org.apache.olingo.server.api.edm.provider.EdmProvider; import org.apache.olingo.server.api.edm.provider.EdmProvider;
@ -47,7 +47,7 @@ public abstract class OData {
return (OData) object; return (OData) object;
} catch (final Exception e) { } catch (final Exception e) {
throw new ODataRuntimeException(e); throw new ODataResponseError(e);
} }
} }

View File

@ -18,7 +18,7 @@
*/ */
package org.apache.olingo.server.core; 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.edm.Edm;
import org.apache.olingo.commons.api.http.HttpHeader; import org.apache.olingo.commons.api.http.HttpHeader;
import org.apache.olingo.commons.api.http.HttpMethod; import org.apache.olingo.commons.api.http.HttpMethod;
@ -109,13 +109,13 @@ public class ODataHttpHandlerImpl implements ODataHttpHandler {
} }
} catch (IOException e) { } catch (IOException e) {
LOG.error(e.getMessage(), e); LOG.error(e.getMessage(), e);
throw new ODataRuntimeException(e); throw new ODataResponseError(e);
} finally { } finally {
if (input != null) { if (input != null) {
try { try {
input.close(); input.close();
} catch (IOException e) { } catch (IOException e) {
throw new ODataRuntimeException(e); throw new ODataResponseError(e);
} }
} }
} }

View File

@ -18,7 +18,7 @@
*/ */
package org.apache.olingo.server.core.uri; 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.commons.api.edm.EdmEntityType;
import org.apache.olingo.server.api.uri.UriInfo; import org.apache.olingo.server.api.uri.UriInfo;
import org.apache.olingo.server.api.uri.UriInfoAll; import org.apache.olingo.server.api.uri.UriInfoAll;
@ -266,7 +266,7 @@ public class UriInfoImpl implements UriInfo {
} else if (systemOption.getKind() == SystemQueryOptionKind.LEVELS) { } else if (systemOption.getKind() == SystemQueryOptionKind.LEVELS) {
systemQueryOptions.put(SystemQueryOptionKind.LEVELS, systemOption); systemQueryOptions.put(SystemQueryOptionKind.LEVELS, systemOption);
} else { } else {
throw new ODataRuntimeException("Unsupported System Query Option: " + systemOption.getName()); throw new ODataResponseError("Unsupported System Query Option: " + systemOption.getName());
} }
return this; return this;

View File

@ -30,7 +30,7 @@ import org.apache.http.impl.conn.BasicClientConnectionManager;
import org.apache.http.params.CoreProtocolPNames; import org.apache.http.params.CoreProtocolPNames;
import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.client.core.http.AbstractHttpClientFactory; 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 * 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); new SSLSocketFactory(acceptTrustStrategy, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
registry.register(new Scheme(uri.getScheme(), uri.getPort(), ssf)); registry.register(new Scheme(uri.getScheme(), uri.getPort(), ssf));
} catch (Exception e) { } catch (Exception e) {
throw new ODataRuntimeException(e); throw new ODataResponseError(e);
} }
final DefaultHttpClient httpClient = new DefaultHttpClient(new BasicClientConnectionManager(registry)); final DefaultHttpClient httpClient = new DefaultHttpClient(new BasicClientConnectionManager(registry));