diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/AbstractService.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/AbstractService.java index 0fd8c46e6..6a2d8ce0e 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/AbstractService.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/AbstractService.java @@ -31,7 +31,7 @@ import org.apache.olingo.client.api.EdmEnabledODataClient; import org.apache.olingo.client.api.edm.xml.XMLMetadata; import org.apache.olingo.client.core.ODataClientFactory; import org.apache.olingo.client.core.edm.ClientCsdlEdmProvider; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; import org.apache.olingo.commons.api.format.ContentType; diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/ODataFlushException.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/ODataFlushException.java index 13edbd04e..8cd5b026d 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/ODataFlushException.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/ODataFlushException.java @@ -19,7 +19,7 @@ package org.apache.olingo.ext.proxy.api; import java.util.List; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; public class ODataFlushException extends ODataRuntimeException { diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/ODataResponseError.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/ODataResponseError.java index ead17f514..732d436ec 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/ODataResponseError.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/ODataResponseError.java @@ -19,7 +19,7 @@ package org.apache.olingo.ext.proxy.api; import org.apache.olingo.client.api.communication.request.ODataRequest; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; public class ODataResponseError { 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 04d1851cf..91f8cbee1 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 @@ -29,7 +29,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.ex.ODataRuntimeException; import org.apache.olingo.ext.proxy.AbstractService; import org.apache.olingo.ext.proxy.api.ODataFlushException; import org.apache.olingo.ext.proxy.api.ODataResponseError; diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java index c4efe2173..a8c39415b 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java @@ -69,7 +69,7 @@ import org.apache.olingo.client.api.domain.ClientValue; import org.apache.olingo.client.api.edm.xml.Reference; import org.apache.olingo.client.api.edm.xml.XMLMetadata; import org.apache.olingo.client.core.ODataClientFactory; -import org.apache.olingo.commons.api.ODataError; +import org.apache.olingo.commons.api.ex.ODataError; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; import org.apache.olingo.commons.api.edm.FullQualifiedName; diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BatchClientITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BatchClientITCase.java index f3c7e7eda..66456cccb 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BatchClientITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BatchClientITCase.java @@ -50,7 +50,7 @@ import org.apache.olingo.client.api.domain.ClientObjectFactory; import org.apache.olingo.client.api.http.HttpClientException; import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.client.core.communication.request.batch.ODataChangesetResponseItem; -import org.apache.olingo.commons.api.ODataPreferenceNames; +import org.apache.olingo.commons.api.format.PreferenceName; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.format.ContentType; @@ -317,7 +317,7 @@ public class BatchClientITCase extends AbstractTestITCase { // Fetch result final ODataBatchResponse response = payload.getResponse(); assertEquals(HttpStatusCode.ACCEPTED.getStatusCode(), response.getStatusCode()); - assertEquals(ODataPreferenceNames.CONTINUE_ON_ERROR.toString(), + assertEquals(PreferenceName.CONTINUE_ON_ERROR.getName(), response.getHeader(HttpHeader.PREFERENCE_APPLIED).iterator().next()); final Iterator bodyIterator = response.getBody(); diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java index 983957669..b241ef60b 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java @@ -25,8 +25,8 @@ import java.net.URI; import java.util.Map; import org.apache.olingo.client.api.communication.ODataClientErrorException; -import org.apache.olingo.commons.api.ODataError; -import org.apache.olingo.commons.api.ODataErrorDetail; +import org.apache.olingo.commons.api.ex.ODataError; +import org.apache.olingo.commons.api.ex.ODataErrorDetail; import org.apache.olingo.commons.api.format.ContentType; import org.junit.Test; diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/MetadataTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/MetadataTestITCase.java index 41c64f27b..099368282 100644 --- a/fit/src/test/java/org/apache/olingo/fit/v4/MetadataTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/v4/MetadataTestITCase.java @@ -109,7 +109,7 @@ public class MetadataTestITCase extends AbstractTestITCase { final EdmAnnotation description = core.getAnnotation(descriptionTerm); assertNotNull(description); // assertEquals("Core terms needed to write vocabularies", - // description.getExpression().asConstant().getValue().asPrimitive().toString()); + // description.getExpression().asConstant().getValue().asPrimitive().getName()); assertEquals("Core terms needed to write vocabularies", description.getExpression().asConstant().getValueAsString()); diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClientBuilder.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClientBuilder.java index 7ad81a4b0..2b7279a64 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClientBuilder.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClientBuilder.java @@ -21,7 +21,7 @@ package org.apache.olingo.client.api; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.format.ContentType; 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 64faf35d1..c37e2c293 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,8 +20,8 @@ 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.ODataError; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataError; /** * Represents a client error in OData. 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..932e3cb3b 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,7 +19,7 @@ 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.ex.ODataRuntimeException; /** * Represents a server error in OData. 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 be8f4fa44..45d8ddc24 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.ODataPreferenceNames; +import org.apache.olingo.commons.api.format.PreferenceName; /** * Values of the Prefer header. @@ -31,7 +31,7 @@ public class ODataPreferences { * @see org.apache.olingo.commons.api.http.HttpHeader#PREFER */ public String returnContent() { - return PreferenceNames.returnContent.toString(); + return PreferenceName.RETURN.getName(); } /** @@ -40,7 +40,7 @@ public class ODataPreferences { * @see org.apache.olingo.commons.api.http.HttpHeader#PREFER */ public String returnNoContent() { - return PreferenceNames.returnNoContent.toString(); + return PreferenceName.RETURN_NO_CONTENT.getName(); } /** @@ -49,7 +49,7 @@ public class ODataPreferences { * @see org.apache.olingo.commons.api.http.HttpHeader#PREFER */ public String keyAsSegment() { - return PreferenceNames.keyAsSegment.toString(); + return PreferenceName.KEY_AS_SEGMENT.getName(); } /** @@ -70,7 +70,7 @@ public class ODataPreferences { * @return preference. */ public String allowEntityReferences() { - return ODataPreferenceNames.ALLOW_ENTITY_REFERENCES.toString(); + return PreferenceName.ALLOW_ENTITY_REFERENCES.getName(); } /** @@ -133,7 +133,7 @@ public class ODataPreferences { * @return preference. */ public String callback(final String url) { - return ODataPreferenceNames.CALLBACK.toString() + ";url=\"" + url + "\""; + return PreferenceName.CALLBACK.getName() + ";url=\"" + url + "\""; } /** @@ -154,7 +154,7 @@ public class ODataPreferences { * @return preference. */ public String continueOnError() { - return ODataPreferenceNames.CONTINUE_ON_ERROR.toString(); + return PreferenceName.CONTINUE_ON_ERROR.getName(); } /** @@ -201,7 +201,7 @@ public class ODataPreferences { * @return preference. */ public String includeAnnotations(final String value) { - return ODataPreferenceNames.INCLUDE_ANNOTATIONS.toString() + "=" + value; + return PreferenceName.INCLUDE_ANNOTATIONS.getName() + "=" + value; } /** @@ -234,7 +234,7 @@ public class ODataPreferences { * @return preference. */ public String maxPageSize(final int size) { - return ODataPreferenceNames.MAX_PAGE_SIZE.toString() + "=" + size; + return PreferenceName.MAX_PAGE_SIZE.getName() + "=" + size; } /** @@ -259,7 +259,7 @@ public class ODataPreferences { * @return preference. */ public String trackChanges() { - return ODataPreferenceNames.TRACK_CHANGES.toString(); + return PreferenceName.TRACK_CHANGES.getName(); } /** @@ -294,7 +294,7 @@ public class ODataPreferences { * @return preference. */ public String respondAsync() { - return ODataPreferenceNames.RESPOND_ASYNC.toString(); + return PreferenceName.RESPOND_ASYNC.getName(); } /** @@ -314,7 +314,7 @@ public class ODataPreferences { * @return preference. */ public String wait(final int value) { - return ODataPreferenceNames.WAIT.toString() + "=" + value; + return PreferenceName.WAIT.getName() + "=" + value; } /** @@ -344,7 +344,7 @@ public class ODataPreferences { * @return preference. */ public String returnMinimal() { - return ODataPreferenceNames.RETURN.toString() + "=minimal"; + return PreferenceName.RETURN.getName() + "=minimal"; } /** @@ -374,25 +374,6 @@ public class ODataPreferences { * @return preference. */ public String returnRepresentation() { - return ODataPreferenceNames.RETURN.toString() + "=representation"; - } - - /** Preferences not in the OData 4.0 standard. */ - private static enum PreferenceNames { - - returnContent("return-content"), - returnNoContent("return-no-content"), - keyAsSegment("KeyAsSegment"); - - private final String preferenceName; - - private PreferenceNames(final String preferenceName) { - this.preferenceName = preferenceName; - } - - @Override - public String toString() { - return preferenceName; - } + return PreferenceName.RETURN.getName() + "=representation"; } } diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientException.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientException.java index 12e432bac..81159cb7d 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientException.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientException.java @@ -31,7 +31,7 @@ public class HttpClientException extends RuntimeException { /** * Constructs a new client-side runtime exception with the specified cause and a detail message of - * {@code (cause==null ? null : cause.toString())} (which typically contains the class and detail message of + * {@code (cause==null ? null : cause.getName())} (which typically contains the class and detail message of * {@code cause}). This constructor is useful for runtime exceptions that are little more than wrappers for other * throwables. * diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataDeserializer.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataDeserializer.java index e91ba93c0..1e01a067a 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataDeserializer.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataDeserializer.java @@ -20,7 +20,7 @@ package org.apache.olingo.client.api.serialization; import java.io.InputStream; -import org.apache.olingo.commons.api.ODataError; +import org.apache.olingo.commons.api.ex.ODataError; import org.apache.olingo.commons.api.data.Entity; import org.apache.olingo.commons.api.data.EntityCollection; import org.apache.olingo.commons.api.data.Property; diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataDeserializerException.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataDeserializerException.java index c21b8cbdc..b24915c69 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataDeserializerException.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataDeserializerException.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.client.api.serialization; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; public class ODataDeserializerException extends ODataException { diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataReader.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataReader.java index 07342ebd3..20de874dc 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataReader.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataReader.java @@ -25,7 +25,7 @@ import org.apache.olingo.client.api.domain.ClientEntity; import org.apache.olingo.client.api.domain.ClientEntitySet; import org.apache.olingo.client.api.domain.ClientProperty; import org.apache.olingo.client.api.domain.ClientServiceDocument; -import org.apache.olingo.commons.api.ODataError; +import org.apache.olingo.commons.api.ex.ODataError; import org.apache.olingo.commons.api.data.ResWrap; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.provider.CsdlSchema; diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataSerializerException.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataSerializerException.java index b54696e05..e11d68b19 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataSerializerException.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/serialization/ODataSerializerException.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.client.api.serialization; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; public class ODataSerializerException extends ODataException { 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 53f35d5e9..d83b8fbfa 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 @@ -24,8 +24,8 @@ import org.apache.http.StatusLine; import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.api.communication.ODataClientErrorException; import org.apache.olingo.client.api.communication.ODataServerErrorException; -import org.apache.olingo.commons.api.ODataError; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataError; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.client.api.serialization.ODataDeserializerException; 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 4bd2d831e..6666ebab0 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 @@ -39,7 +39,7 @@ import org.apache.olingo.client.api.communication.request.ODataRequest; import org.apache.olingo.client.api.communication.request.ODataStreamer; import org.apache.olingo.client.api.communication.response.ODataResponse; import org.apache.olingo.client.api.http.HttpClientException; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.commons.api.http.HttpHeader; import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.commons.api.http.HttpMethod; 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 9c004e240..b273a718a 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 @@ -22,7 +22,7 @@ import org.apache.http.client.methods.HttpUriRequest; import org.apache.olingo.client.api.EdmEnabledODataClient; import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.core.communication.header.ODataErrorResponseChecker; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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 d3ca7e4e9..58923cd48 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 @@ -43,7 +43,7 @@ import org.apache.olingo.client.core.communication.request.batch.ODataBatchContr import org.apache.olingo.client.core.communication.request.batch.ODataBatchLineIteratorImpl; import org.apache.olingo.client.core.communication.request.batch.ODataBatchUtilities; import org.apache.olingo.commons.api.Constants; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.commons.api.http.HttpHeader; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientCsdlEdmProvider.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientCsdlEdmProvider.java index 28536ba03..3c805e77c 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientCsdlEdmProvider.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientCsdlEdmProvider.java @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider; import org.apache.olingo.commons.api.edm.provider.CsdlAction; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/AtomDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/AtomDeserializer.java index e75d74a46..d48e1b990 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/AtomDeserializer.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/AtomDeserializer.java @@ -40,8 +40,8 @@ import org.apache.commons.lang3.StringUtils; import org.apache.olingo.client.api.serialization.ODataDeserializer; import org.apache.olingo.client.api.serialization.ODataDeserializerException; import org.apache.olingo.commons.api.Constants; -import org.apache.olingo.commons.api.ODataError; -import org.apache.olingo.commons.api.ODataPropertyType; +import org.apache.olingo.commons.api.ex.ODataError; +import org.apache.olingo.commons.api.data.PropertyType; import org.apache.olingo.commons.api.data.AbstractODataObject; import org.apache.olingo.commons.api.data.Annotation; import org.apache.olingo.commons.api.data.ComplexValue; @@ -63,7 +63,6 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.geo.Geospatial; import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.commons.core.edm.EdmTypeInfo; -import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; import com.fasterxml.aalto.stax.InputFactoryImpl; @@ -222,7 +221,7 @@ public class AtomDeserializer extends AbstractAtomDealer implements ODataDeseria valuable.setValue(valueType, values); } - private ODataPropertyType guessPropertyType(final XMLEventReader reader, final EdmTypeInfo typeInfo) + private PropertyType guessPropertyType(final XMLEventReader reader, final EdmTypeInfo typeInfo) throws XMLStreamException { XMLEvent child = null; @@ -235,24 +234,24 @@ public class AtomDeserializer extends AbstractAtomDealer implements ODataDeseria } } - final ODataPropertyType type; + final PropertyType type; if (child == null) { - type = typeInfo == null || typeInfo.isPrimitiveType() ? ODataPropertyType.PRIMITIVE : ODataPropertyType.ENUM; + type = typeInfo == null || typeInfo.isPrimitiveType() ? PropertyType.PRIMITIVE : PropertyType.ENUM; } else { if (child.isStartElement()) { if (Constants.NS_GML.equals(child.asStartElement().getName().getNamespaceURI())) { - type = ODataPropertyType.PRIMITIVE; + type = PropertyType.PRIMITIVE; } else if (elementQName.equals(child.asStartElement().getName())) { - type = ODataPropertyType.COLLECTION; + type = PropertyType.COLLECTION; } else { - type = ODataPropertyType.COMPLEX; + type = PropertyType.COMPLEX; } } else if (child.isCharacters()) { type = typeInfo == null || typeInfo.isPrimitiveType() - ? ODataPropertyType.PRIMITIVE - : ODataPropertyType.ENUM; + ? PropertyType.PRIMITIVE + : PropertyType.ENUM; } else { - type = ODataPropertyType.EMPTY; + type = PropertyType.EMPTY; } } @@ -294,9 +293,9 @@ public class AtomDeserializer extends AbstractAtomDealer implements ODataDeseria valuable.setType(typeInfo.internal()); } - final ODataPropertyType propType = typeInfo == null ? guessPropertyType(reader, typeInfo) : - typeInfo.isCollection() ? ODataPropertyType.COLLECTION : - typeInfo.isPrimitiveType() ? ODataPropertyType.PRIMITIVE : ODataPropertyType.COMPLEX; + final PropertyType propType = typeInfo == null ? guessPropertyType(reader, typeInfo) : + typeInfo.isCollection() ? PropertyType.COLLECTION : + typeInfo.isPrimitiveType() ? PropertyType.PRIMITIVE : PropertyType.COMPLEX; if (nullAttr == null) { switch (propType) { @@ -324,10 +323,10 @@ public class AtomDeserializer extends AbstractAtomDealer implements ODataDeseria valuable.setValue(ValueType.PRIMITIVE, StringUtils.EMPTY); } } else { - valuable.setValue(propType == ODataPropertyType.PRIMITIVE ? ValueType.PRIMITIVE : - propType == ODataPropertyType.ENUM ? ValueType.ENUM : - propType == ODataPropertyType.COMPLEX ? ValueType.COMPLEX : - propType == ODataPropertyType.COLLECTION ? ValueType.COLLECTION_PRIMITIVE : ValueType.PRIMITIVE, + valuable.setValue(propType == PropertyType.PRIMITIVE ? ValueType.PRIMITIVE : + propType == PropertyType.ENUM ? ValueType.ENUM : + propType == PropertyType.COMPLEX ? ValueType.COMPLEX : + propType == PropertyType.COLLECTION ? ValueType.COLLECTION_PRIMITIVE : ValueType.PRIMITIVE, null); } } diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/AtomSerializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/AtomSerializer.java index 3c12f5abf..0f6555a0f 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/AtomSerializer.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/AtomSerializer.java @@ -35,7 +35,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.olingo.client.api.serialization.ODataSerializer; import org.apache.olingo.client.api.serialization.ODataSerializerException; import org.apache.olingo.commons.api.Constants; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.commons.api.data.AbstractODataObject; import org.apache.olingo.commons.api.data.Annotation; import org.apache.olingo.commons.api.data.ComplexValue; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ClientODataDeserializerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ClientODataDeserializerImpl.java index 4a2f07881..d84863c97 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ClientODataDeserializerImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ClientODataDeserializerImpl.java @@ -32,7 +32,7 @@ import org.apache.olingo.client.core.data.JSONServiceDocumentDeserializer; import org.apache.olingo.client.core.data.XMLServiceDocumentDeserializer; import org.apache.olingo.client.core.edm.ClientCsdlXMLMetadata; import org.apache.olingo.client.core.edm.xml.ClientCsdlEdmx; -import org.apache.olingo.commons.api.ODataError; +import org.apache.olingo.commons.api.ex.ODataError; import org.apache.olingo.commons.api.data.Delta; import org.apache.olingo.commons.api.data.Entity; import org.apache.olingo.commons.api.data.EntityCollection; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/JsonDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/JsonDeserializer.java index ab7093174..4dfd729a1 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/JsonDeserializer.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/JsonDeserializer.java @@ -34,8 +34,8 @@ import org.apache.commons.lang3.StringUtils; import org.apache.olingo.client.api.serialization.ODataDeserializer; import org.apache.olingo.client.api.serialization.ODataDeserializerException; import org.apache.olingo.commons.api.Constants; -import org.apache.olingo.commons.api.ODataError; -import org.apache.olingo.commons.api.ODataPropertyType; +import org.apache.olingo.commons.api.ex.ODataError; +import org.apache.olingo.commons.api.data.PropertyType; import org.apache.olingo.commons.api.data.Annotatable; import org.apache.olingo.commons.api.data.Annotation; import org.apache.olingo.commons.api.data.ComplexValue; @@ -188,32 +188,32 @@ public class JsonDeserializer implements ODataDeserializer { } } - private Map.Entry guessPropertyType(final JsonNode node) { - ODataPropertyType type; + private Map.Entry guessPropertyType(final JsonNode node) { + PropertyType type; String typeExpression = null; if (node.isValueNode() || node.isNull()) { - type = ODataPropertyType.PRIMITIVE; + type = PropertyType.PRIMITIVE; typeExpression = guessPrimitiveTypeKind(node).getFullQualifiedName().toString(); } else if (node.isArray()) { - type = ODataPropertyType.COLLECTION; + type = PropertyType.COLLECTION; if (node.has(0) && node.get(0).isValueNode()) { typeExpression = "Collection(" + guessPrimitiveTypeKind(node.get(0)) + ')'; } } else if (node.isObject()) { if (node.has(Constants.ATTR_TYPE)) { - type = ODataPropertyType.PRIMITIVE; + type = PropertyType.PRIMITIVE; typeExpression = "Edm.Geography" + node.get(Constants.ATTR_TYPE).asText(); } else { - type = ODataPropertyType.COMPLEX; + type = PropertyType.COMPLEX; } } else { - type = ODataPropertyType.EMPTY; + type = PropertyType.EMPTY; } final EdmTypeInfo typeInfo = typeExpression == null ? null : new EdmTypeInfo.Builder().setTypeExpression(typeExpression).build(); - return new SimpleEntry(type, typeInfo); + return new SimpleEntry(type, typeInfo); } private EdmPrimitiveTypeKind guessPrimitiveTypeKind(final JsonNode node) { @@ -336,15 +336,15 @@ public class JsonDeserializer implements ODataDeserializer { EdmTypeInfo typeInfo = StringUtils.isBlank(valuable.getType()) ? null : new EdmTypeInfo.Builder().setTypeExpression(valuable.getType()).build(); - final Map.Entry guessed = guessPropertyType(node); + final Map.Entry guessed = guessPropertyType(node); if (typeInfo == null) { typeInfo = guessed.getValue(); } - final ODataPropertyType propType = typeInfo == null ? guessed.getKey() - : typeInfo.isCollection() ? ODataPropertyType.COLLECTION - : typeInfo.isPrimitiveType() ? ODataPropertyType.PRIMITIVE - : node.isValueNode() ? ODataPropertyType.ENUM : ODataPropertyType.COMPLEX; + final PropertyType propType = typeInfo == null ? guessed.getKey() + : typeInfo.isCollection() ? PropertyType.COLLECTION + : typeInfo.isPrimitiveType() ? PropertyType.PRIMITIVE + : node.isValueNode() ? PropertyType.ENUM : PropertyType.COMPLEX; switch (propType) { case COLLECTION: diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/JsonODataErrorDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/JsonODataErrorDeserializer.java index 2d1f59f54..65a473e0a 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/JsonODataErrorDeserializer.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/JsonODataErrorDeserializer.java @@ -25,8 +25,8 @@ import java.util.Iterator; import java.util.List; import org.apache.olingo.commons.api.Constants; -import org.apache.olingo.commons.api.ODataError; -import org.apache.olingo.commons.api.ODataErrorDetail; +import org.apache.olingo.commons.api.ex.ODataError; +import org.apache.olingo.commons.api.ex.ODataErrorDetail; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.JsonNode; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/JsonODataErrorDetailDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/JsonODataErrorDetailDeserializer.java index 27a8eb9ef..7457d820f 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/JsonODataErrorDetailDeserializer.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/JsonODataErrorDetailDeserializer.java @@ -22,7 +22,7 @@ import java.io.IOException; import java.net.URI; import org.apache.olingo.commons.api.Constants; -import org.apache.olingo.commons.api.ODataErrorDetail; +import org.apache.olingo.commons.api.ex.ODataErrorDetail; import org.apache.olingo.commons.api.data.ResWrap; import com.fasterxml.jackson.core.JsonParser; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java index aba93579a..13674541e 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java @@ -35,7 +35,7 @@ import org.apache.olingo.client.api.edm.xml.XMLMetadata; import org.apache.olingo.client.api.serialization.ODataDeserializerException; import org.apache.olingo.client.api.serialization.ODataReader; import org.apache.olingo.client.core.edm.ClientCsdlEdmProvider; -import org.apache.olingo.commons.api.ODataError; +import org.apache.olingo.commons.api.ex.ODataError; import org.apache.olingo.commons.api.data.Entity; import org.apache.olingo.commons.api.data.EntityCollection; import org.apache.olingo.commons.api.data.Property; diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/URIUtils.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/URIUtils.java index 60c807424..9d52f5cf2 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/URIUtils.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/URIUtils.java @@ -262,7 +262,7 @@ public final class URIUtils { : obj.toString(); } } catch (Exception e) { - LOG.warn("While escaping '{}', using toString()", obj, e); + LOG.warn("While escaping '{}', using getName()", obj, e); if (obj == null) { value = "null"; } else { diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ErrorTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ErrorTest.java index 217f1d142..917676b46 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ErrorTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ErrorTest.java @@ -24,7 +24,7 @@ import static org.junit.Assert.assertNotNull; import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.api.serialization.ODataDeserializerException; import org.apache.olingo.client.core.AbstractTest; -import org.apache.olingo.commons.api.ODataError; +import org.apache.olingo.commons.api.ex.ODataError; import org.apache.olingo.commons.api.format.ContentType; import org.junit.Test; diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/Constants.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/Constants.java index 93ff3bc67..291e2e594 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/Constants.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/Constants.java @@ -29,279 +29,279 @@ import org.apache.olingo.commons.api.format.ContentType; public interface Constants { // Other stuff - public final static String UTF8 = "UTF-8"; + String UTF8 = "UTF-8"; - public final static String METADATA = "$metadata"; + String METADATA = "$metadata"; - public final static Integer DEFAULT_PRECISION = 40; + Integer DEFAULT_PRECISION = 40; - public final static Integer DEFAULT_SCALE = 25; + Integer DEFAULT_SCALE = 25; // Common Namespaces - public final static String NS_BASE = "http://docs.oasis-open.org/odata/ns/"; + String NS_BASE = "http://docs.oasis-open.org/odata/ns/"; - public final static String NS_DATASERVICES = "http://docs.oasis-open.org/odata/ns/data"; + String NS_DATASERVICES = "http://docs.oasis-open.org/odata/ns/data"; - public final static String NS_METADATA = "http://docs.oasis-open.org/odata/ns/metadata"; + String NS_METADATA = "http://docs.oasis-open.org/odata/ns/metadata"; - public final static String NS_SCHEME = "http://docs.oasis-open.org/odata/ns/scheme"; + String NS_SCHEME = "http://docs.oasis-open.org/odata/ns/scheme"; - public final static String NS_NAVIGATION_LINK_REL = "http://docs.oasis-open.org/odata/ns/related/"; + String NS_NAVIGATION_LINK_REL = "http://docs.oasis-open.org/odata/ns/related/"; - public final static String NS_ASSOCIATION_LINK_REL = "http://docs.oasis-open.org/odata/ns/relatedlinks/"; + String NS_ASSOCIATION_LINK_REL = "http://docs.oasis-open.org/odata/ns/relatedlinks/"; - public final static String NS_MEDIA_EDIT_LINK_REL = "http://docs.oasis-open.org/odata/ns/edit-media/"; + String NS_MEDIA_EDIT_LINK_REL = "http://docs.oasis-open.org/odata/ns/edit-media/"; - public final static String NS_DELTA_LINK_REL = "http://docs.oasis-open.org/odata/ns/delta"; + String NS_DELTA_LINK_REL = "http://docs.oasis-open.org/odata/ns/delta"; // XML namespaces and prefixes - public final static String NS_ATOM = "http://www.w3.org/2005/Atom"; + String NS_ATOM = "http://www.w3.org/2005/Atom"; - public static final String NS_GEORSS = "http://www.georss.org/georss"; + String NS_GEORSS = "http://www.georss.org/georss"; - public static final String NS_GML = "http://www.opengis.net/gml"; + String NS_GML = "http://www.opengis.net/gml"; - public static final String NS_ATOM_TOMBSTONE = "http://purl.org/atompub/tombstones/1.0"; + String NS_ATOM_TOMBSTONE = "http://purl.org/atompub/tombstones/1.0"; - public static final String PREFIX_DATASERVICES = "d"; + String PREFIX_DATASERVICES = "d"; - public static final String PREFIX_METADATA = "m"; + String PREFIX_METADATA = "m"; - public static final String PREFIX_GEORSS = "georss"; + String PREFIX_GEORSS = "georss"; - public static final String PREFIX_GML = "gml"; + String PREFIX_GML = "gml"; - public final static String SRS_URLPREFIX = "http://www.opengis.net/def/crs/EPSG/0/"; + String SRS_URLPREFIX = "http://www.opengis.net/def/crs/EPSG/0/"; // Link rel(s) - public static final String EDIT_LINK_REL = "edit"; + String EDIT_LINK_REL = "edit"; - public static final String SELF_LINK_REL = "self"; + String SELF_LINK_REL = "self"; - public static final String EDITMEDIA_LINK_REL = "edit-media"; + String EDITMEDIA_LINK_REL = "edit-media"; - public static final String NEXT_LINK_REL = "next"; + String NEXT_LINK_REL = "next"; // XML elements and attributes - public static final String PROPERTIES = "properties"; + String PROPERTIES = "properties"; - public static final String ELEM_ELEMENT = "element"; + String ELEM_ELEMENT = "element"; - public final static String ATTR_TYPE = "type"; + String ATTR_TYPE = "type"; - public final static String ATTR_NULL = "null"; + String ATTR_NULL = "null"; - public static final String ATTR_XML_BASE = "base"; + String ATTR_XML_BASE = "base"; - public static final QName QNAME_ATTR_XML_BASE = new QName(XMLConstants.XML_NS_URI, ATTR_XML_BASE); + QName QNAME_ATTR_XML_BASE = new QName(XMLConstants.XML_NS_URI, ATTR_XML_BASE); - public static final String CONTEXT = "context"; + String CONTEXT = "context"; - public static final String ATTR_REL = "rel"; + String ATTR_REL = "rel"; - public static final String ATTR_TITLE = "title"; + String ATTR_TITLE = "title"; - public static final String ATTR_METADATA = "metadata"; + String ATTR_METADATA = "metadata"; - public static final String ATTR_HREF = "href"; + String ATTR_HREF = "href"; - public static final String ATTR_REF = "ref"; + String ATTR_REF = "ref"; - public static final String ATTR_TARGET = "target"; + String ATTR_TARGET = "target"; - public static final String ATTR_SRSNAME = "srsName"; + String ATTR_SRSNAME = "srsName"; - public static final QName QNAME_ATTR_SRSNAME = new QName(NS_GML, ATTR_SRSNAME); + QName QNAME_ATTR_SRSNAME = new QName(NS_GML, ATTR_SRSNAME); - public static final String ELEM_POINT = "Point"; + String ELEM_POINT = "Point"; - public static final String ELEM_MULTIPOINT = "MultiPoint"; + String ELEM_MULTIPOINT = "MultiPoint"; - public static final String ELEM_POINTMEMBERS = "pointMembers"; + String ELEM_POINTMEMBERS = "pointMembers"; - public static final QName QNAME_POINTMEMBERS = new QName(NS_GML, ELEM_POINTMEMBERS); + QName QNAME_POINTMEMBERS = new QName(NS_GML, ELEM_POINTMEMBERS); - public static final String ELEM_LINESTRING = "LineString"; + String ELEM_LINESTRING = "LineString"; - public static final QName QNAME_LINESTRING = new QName(NS_GML, ELEM_LINESTRING); + QName QNAME_LINESTRING = new QName(NS_GML, ELEM_LINESTRING); - public static final String ELEM_MULTILINESTRING = "MultiCurve"; + String ELEM_MULTILINESTRING = "MultiCurve"; - public static final String ELEM_LINESTRINGMEMBERS = "curveMembers"; + String ELEM_LINESTRINGMEMBERS = "curveMembers"; - public static final String ELEM_POLYGON = "Polygon"; + String ELEM_POLYGON = "Polygon"; - public static final QName QNAME_POLYGON = new QName(NS_GML, ELEM_POLYGON); + QName QNAME_POLYGON = new QName(NS_GML, ELEM_POLYGON); - public static final String ELEM_POLYGON_EXTERIOR = "exterior"; + String ELEM_POLYGON_EXTERIOR = "exterior"; - public static final QName QNAME_POLYGON_EXTERIOR = new QName(NS_GML, ELEM_POLYGON_EXTERIOR); + QName QNAME_POLYGON_EXTERIOR = new QName(NS_GML, ELEM_POLYGON_EXTERIOR); - public static final String ELEM_POLYGON_INTERIOR = "interior"; + String ELEM_POLYGON_INTERIOR = "interior"; - public static final QName QNAME_POLYGON_INTERIOR = new QName(NS_GML, ELEM_POLYGON_INTERIOR); + QName QNAME_POLYGON_INTERIOR = new QName(NS_GML, ELEM_POLYGON_INTERIOR); - public static final String ELEM_POLYGON_LINEARRING = "LinearRing"; + String ELEM_POLYGON_LINEARRING = "LinearRing"; - public static final String ELEM_MULTIPOLYGON = "MultiSurface"; + String ELEM_MULTIPOLYGON = "MultiSurface"; - public static final String ELEM_SURFACEMEMBERS = "surfaceMembers"; + String ELEM_SURFACEMEMBERS = "surfaceMembers"; - public static final String ELEM_GEOCOLLECTION = "MultiGeometry"; + String ELEM_GEOCOLLECTION = "MultiGeometry"; - public static final String ELEM_GEOMEMBERS = "geometryMembers"; + String ELEM_GEOMEMBERS = "geometryMembers"; - public static final QName QNAME_GEOMEMBERS = new QName(NS_GML, ELEM_GEOMEMBERS); + QName QNAME_GEOMEMBERS = new QName(NS_GML, ELEM_GEOMEMBERS); - public static final String ELEM_POS = "pos"; + String ELEM_POS = "pos"; - public static final String ELEM_PROPERTY = "property"; + String ELEM_PROPERTY = "property"; - public static final String ELEM_LINKS = "links"; + String ELEM_LINKS = "links"; - public static final String ELEM_URI = "uri"; + String ELEM_URI = "uri"; - public final static String ELEM_REASON = "reason"; + String ELEM_REASON = "reason"; - public static final String ELEM_DELETED_LINK = "deleted-link"; + String ELEM_DELETED_LINK = "deleted-link"; - public static final String ATTR_SOURCE = "source"; + String ATTR_SOURCE = "source"; - public static final String ATTR_RELATIONSHIP = "relationship"; + String ATTR_RELATIONSHIP = "relationship"; - public static final String ANNOTATION = "annotation"; + String ANNOTATION = "annotation"; // JSON stuff - public final static String JSON_METADATA = "odata.metadata"; + String JSON_METADATA = "odata.metadata"; - public final static String JSON_TYPE = "@odata.type"; + String JSON_TYPE = "@odata.type"; - public final static String JSON_ID = "@odata.id"; + String JSON_ID = "@odata.id"; - public final static String JSON_READ_LINK = "@odata.readLink"; + String JSON_READ_LINK = "@odata.readLink"; - public final static String JSON_EDIT_LINK = "@odata.editLink"; + String JSON_EDIT_LINK = "@odata.editLink"; - public final static String JSON_CONTEXT = "@odata.context"; + String JSON_CONTEXT = "@odata.context"; - public final static String JSON_ETAG = "@odata.etag"; + String JSON_ETAG = "@odata.etag"; - public final static String JSON_MEDIA_ETAG = "@odata.mediaEtag"; + String JSON_MEDIA_ETAG = "@odata.mediaEtag"; - public final static String JSON_MEDIA_CONTENT_TYPE = "@odata.mediaContentType"; + String JSON_MEDIA_CONTENT_TYPE = "@odata.mediaContentType"; - public final static String JSON_MEDIA_READ_LINK = "@odata.mediaReadLink"; + String JSON_MEDIA_READ_LINK = "@odata.mediaReadLink"; - public final static String JSON_MEDIA_EDIT_LINK = "@odata.mediaEditLink"; + String JSON_MEDIA_EDIT_LINK = "@odata.mediaEditLink"; - public final static String JSON_METADATA_ETAG = "@odata.metadataEtag"; + String JSON_METADATA_ETAG = "@odata.metadataEtag"; - public final static String JSON_BIND_LINK_SUFFIX = "@odata.bind"; + String JSON_BIND_LINK_SUFFIX = "@odata.bind"; - public final static String JSON_ASSOCIATION_LINK = "@odata.associationLink"; + String JSON_ASSOCIATION_LINK = "@odata.associationLink"; - public final static String JSON_NAVIGATION_LINK = "@odata.navigationLink"; + String JSON_NAVIGATION_LINK = "@odata.navigationLink"; - public final static String JSON_COUNT = "@odata.count"; + String JSON_COUNT = "@odata.count"; - public final static String JSON_NEXT_LINK = "@odata.nextLink"; + String JSON_NEXT_LINK = "@odata.nextLink"; - public final static String JSON_DELTA_LINK = "@odata.deltaLink"; + String JSON_DELTA_LINK = "@odata.deltaLink"; - public final static String JSON_ERROR = "error"; + String JSON_ERROR = "error"; - public final static String JSON_NULL = "odata.null"; + String JSON_NULL = "odata.null"; - public final static String VALUE = "value"; + String VALUE = "value"; - public final static String JSON_URL = "url"; + String JSON_URL = "url"; - public final static String JSON_COORDINATES = "coordinates"; + String JSON_COORDINATES = "coordinates"; - public final static String JSON_GEOMETRIES = "geometries"; + String JSON_GEOMETRIES = "geometries"; - public final static String JSON_CRS = "crs"; + String JSON_CRS = "crs"; - public final static String JSON_NAME = "name"; + String JSON_NAME = "name"; // Atom stuff - public final static String ATOM_ELEM_ENTRY = "entry"; + String ATOM_ELEM_ENTRY = "entry"; - public static final QName QNAME_ATOM_ELEM_ENTRY = new QName(NS_ATOM, ATOM_ELEM_ENTRY); + QName QNAME_ATOM_ELEM_ENTRY = new QName(NS_ATOM, ATOM_ELEM_ENTRY); - public final static String ATOM_ELEM_ENTRY_REF = "ref"; + String ATOM_ELEM_ENTRY_REF = "ref"; - public final static String ATOM_ATTR_ID = "id"; + String ATOM_ATTR_ID = "id"; - public final static QName QNAME_ATOM_ATTR_ID = new QName(ATOM_ATTR_ID); + QName QNAME_ATOM_ATTR_ID = new QName(ATOM_ATTR_ID); - public final static String ATOM_ELEM_FEED = "feed"; + String ATOM_ELEM_FEED = "feed"; - public static final QName QNAME_ATOM_ELEM_FEED = new QName(NS_ATOM, ATOM_ELEM_FEED); + QName QNAME_ATOM_ELEM_FEED = new QName(NS_ATOM, ATOM_ELEM_FEED); - public final static String ATOM_ELEM_CATEGORY = "category"; + String ATOM_ELEM_CATEGORY = "category"; - public static final QName QNAME_ATOM_ELEM_CATEGORY = new QName(NS_ATOM, ATOM_ELEM_CATEGORY); + QName QNAME_ATOM_ELEM_CATEGORY = new QName(NS_ATOM, ATOM_ELEM_CATEGORY); - public static final String ATOM_ELEM_COUNT = "count"; + String ATOM_ELEM_COUNT = "count"; - public final static String ATOM_ELEM_ID = "id"; + String ATOM_ELEM_ID = "id"; - public static final QName QNAME_ATOM_ELEM_ID = new QName(NS_ATOM, ATOM_ELEM_ID); + QName QNAME_ATOM_ELEM_ID = new QName(NS_ATOM, ATOM_ELEM_ID); - public static final String ATOM_ELEM_TITLE = "title"; + String ATOM_ELEM_TITLE = "title"; - public static final QName QNAME_ATOM_ELEM_TITLE = new QName(NS_ATOM, ATOM_ELEM_TITLE); + QName QNAME_ATOM_ELEM_TITLE = new QName(NS_ATOM, ATOM_ELEM_TITLE); - public static final String ATOM_ELEM_SUMMARY = "summary"; + String ATOM_ELEM_SUMMARY = "summary"; - public static final QName QNAME_ATOM_ELEM_SUMMARY = new QName(NS_ATOM, ATOM_ELEM_SUMMARY); + QName QNAME_ATOM_ELEM_SUMMARY = new QName(NS_ATOM, ATOM_ELEM_SUMMARY); - public static final String ATOM_ELEM_UPDATED = "updated"; + String ATOM_ELEM_UPDATED = "updated"; - public static final QName QNAME_ATOM_ELEM_UPDATED = new QName(NS_ATOM, ATOM_ELEM_UPDATED); + QName QNAME_ATOM_ELEM_UPDATED = new QName(NS_ATOM, ATOM_ELEM_UPDATED); - public final static String ATOM_ELEM_LINK = "link"; + String ATOM_ELEM_LINK = "link"; - public static final QName QNAME_ATOM_ELEM_LINK = new QName(NS_ATOM, ATOM_ELEM_LINK); + QName QNAME_ATOM_ELEM_LINK = new QName(NS_ATOM, ATOM_ELEM_LINK); - public final static String ATOM_ELEM_CONTENT = "content"; + String ATOM_ELEM_CONTENT = "content"; - public static final QName QNAME_ATOM_ELEM_CONTENT = new QName(NS_ATOM, ATOM_ELEM_CONTENT); + QName QNAME_ATOM_ELEM_CONTENT = new QName(NS_ATOM, ATOM_ELEM_CONTENT); - public static final String ATOM_ELEM_ACTION = "action"; + String ATOM_ELEM_ACTION = "action"; - public static final String ATOM_ELEM_INLINE = "inline"; + String ATOM_ELEM_INLINE = "inline"; - public static final String ATOM_ATTR_TERM = "term"; + String ATOM_ATTR_TERM = "term"; - public static final String ATOM_ATTR_SCHEME = "scheme"; + String ATOM_ATTR_SCHEME = "scheme"; - public static final String ATOM_ATTR_SRC = "src"; + String ATOM_ATTR_SRC = "src"; - public static final String ATOM_ATTR_ETAG = "etag"; + String ATOM_ATTR_ETAG = "etag"; - public static final String ATOM_ATTR_METADATAETAG = "metadata-etag"; + String ATOM_ATTR_METADATAETAG = "metadata-etag"; - public static final String ATOM_ELEM_DELETED_ENTRY = "deleted-entry"; + String ATOM_ELEM_DELETED_ENTRY = "deleted-entry"; // error stuff - public static final String ERROR_CODE = "code"; + String ERROR_CODE = "code"; - public static final String ERROR_MESSAGE = "message"; + String ERROR_MESSAGE = "message"; - public static final String ERROR_TARGET = "target"; + String ERROR_TARGET = "target"; - public static final String ERROR_DETAILS = "details"; + String ERROR_DETAILS = "details"; - public static final String ERROR_INNERERROR = "innererror"; + String ERROR_INNERERROR = "innererror"; // canonical functions to be applied via dynamic annotation Apply - public static final String CANONICAL_FUNCTION_CONCAT = "odata.concat"; + String CANONICAL_FUNCTION_CONCAT = "odata.concat"; - public static final String CANONICAL_FUNCTION_FILLURITEMPLATE = "odata.fillUriTemplate"; + String CANONICAL_FUNCTION_FILLURITEMPLATE = "odata.fillUriTemplate"; - public static final String CANONICAL_FUNCTION_URIENCODE = "odata.uriEncode"; + String CANONICAL_FUNCTION_URIENCODE = "odata.uriEncode"; String MEDIA_EDIT_LINK_TYPE = "*/*"; String ENTITY_NAVIGATION_LINK_TYPE = ContentType.APPLICATION_ATOM_XML_ENTRY.toContentTypeString(); diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataPropertyType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/PropertyType.java similarity index 89% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataPropertyType.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/PropertyType.java index 4d6d2b1ee..70e918694 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataPropertyType.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/PropertyType.java @@ -16,9 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.commons.api; +package org.apache.olingo.commons.api.data; -public enum ODataPropertyType { +/** + * Enumeration for all OData property types. + */ +public enum PropertyType { /** * Primitive (including geospatial). @@ -40,5 +43,4 @@ public enum ODataPropertyType { * Empty type (possibly, no type information could be retrieved). */ EMPTY - } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveTypeException.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveTypeException.java index 92da8dbd5..fb865cb7b 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveTypeException.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveTypeException.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.commons.api.edm; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; public class EdmPrimitiveTypeException extends ODataException { diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/SRID.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/SRID.java index 112dd2ff1..fc5484883 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/SRID.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/geo/SRID.java @@ -85,7 +85,7 @@ public final class SRID implements Serializable { // return value == null ? dimension == Dimension.GEOMETRY // ? "0" // : "4326" -// : value.toString(); +// : value.getName(); } private boolean isVariable() { diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmProvider.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmProvider.java index cb53478c2..335836e22 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmProvider.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmProvider.java @@ -20,7 +20,7 @@ package org.apache.olingo.commons.api.edm.provider; import java.util.List; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; public abstract class CsdlAbstractEdmProvider implements CsdlEdmProvider { diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEdmProvider.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEdmProvider.java index cc92d8616..61be99c81 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEdmProvider.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEdmProvider.java @@ -20,7 +20,7 @@ package org.apache.olingo.commons.api.edm.provider; import java.util.List; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; public interface CsdlEdmProvider { diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataError.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ex/ODataError.java similarity index 98% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataError.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/ex/ODataError.java index b51fcc185..4c29e0a70 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataError.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ex/ODataError.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.commons.api; +package org.apache.olingo.commons.api.ex; import java.util.List; import java.util.Map; diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataErrorDetail.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ex/ODataErrorDetail.java similarity index 90% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataErrorDetail.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/ex/ODataErrorDetail.java index 10dd1daa5..53c4de67f 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataErrorDetail.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ex/ODataErrorDetail.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.commons.api; +package org.apache.olingo.commons.api.ex; /** * OData details, for example { "error": {..., "details":[ @@ -66,6 +66,12 @@ public class ODataErrorDetail { return target; } + /** + * Set the error target. + * + * @param target the error target + * @return this ODataErrorDetail instance (fluent builder) + */ public ODataErrorDetail setTarget(final String target) { this.target = target; return this; diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataException.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ex/ODataException.java similarity index 96% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataException.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/ex/ODataException.java index dce61114a..2c191815d 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataException.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ex/ODataException.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.commons.api; +package org.apache.olingo.commons.api.ex; public class ODataException extends Exception { 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/ex/ODataRuntimeException.java similarity index 71% 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/ex/ODataRuntimeException.java index b8b6964e0..fe9001df7 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/ex/ODataRuntimeException.java @@ -16,20 +16,39 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.commons.api; +package org.apache.olingo.commons.api.ex; +/** + * Core runtime exception for OData. + */ public class ODataRuntimeException extends RuntimeException { private static final long serialVersionUID = 5492375572049190883L; + /** + * Create with message. + * + * @param msg message text for exception + */ public ODataRuntimeException(final String msg) { super(msg); } + /** + * Create with message for and cause of exception. + * + * @param msg message text for exception + * @param cause cause of exception + */ public ODataRuntimeException(final String msg, final Exception cause) { super(msg, cause); } + /** + * Create with cause of exception. + * + * @param cause cause of exception + */ public ODataRuntimeException(final Exception cause) { super(cause); } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataPreferenceNames.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/format/PreferenceName.java similarity index 81% rename from lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataPreferenceNames.java rename to lib/commons-api/src/main/java/org/apache/olingo/commons/api/format/PreferenceName.java index 28d152353..f77e61571 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataPreferenceNames.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/format/PreferenceName.java @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.olingo.commons.api; +package org.apache.olingo.commons.api.format; /** * Names of preferences defined in the OData standard. */ -public enum ODataPreferenceNames { +public enum PreferenceName { ALLOW_ENTITY_REFERENCES("odata.allow-entityreferences"), CALLBACK("odata.callback"), @@ -31,16 +31,23 @@ public enum ODataPreferenceNames { TRACK_CHANGES("odata.track-changes"), RETURN("return"), RESPOND_ASYNC("respond-async"), - WAIT("wait"); + WAIT("wait"), + RETURN_CONTENT("return-content"), + RETURN_NO_CONTENT("return-no-content"), + KEY_AS_SEGMENT("KeyAsSegment"); private final String preferenceName; - ODataPreferenceNames(final String preferenceName) { + PreferenceName(final String preferenceName) { this.preferenceName = preferenceName; } + public String getName() { + return preferenceName; + } + @Override public String toString() { - return preferenceName; + return getName(); } } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/format/TypeUtil.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/format/TypeUtil.java index d1e7a1a15..5fc7ce106 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/format/TypeUtil.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/format/TypeUtil.java @@ -23,6 +23,9 @@ import java.util.Locale; import java.util.Map; import java.util.TreeMap; +/** + * Helper class which is only used within this package (AcceptType and ContentType handling). + */ final class TypeUtil { static final String MEDIA_TYPE_WILDCARD = "*"; @@ -37,7 +40,7 @@ final class TypeUtil { private TypeUtil() { /* static helper class */} /** Creates a parameter map with predictable order. */ - protected static Map createParameterMap() { + static Map createParameterMap() { return new TreeMap(new Comparator() { @Override public int compare(final String o1, final String o2) { @@ -58,10 +61,10 @@ final class TypeUtil { * depending on its definition within the media type registry. *

* - * @param parameters - * @param parameterMap + * @param parameters as ; separated key=value pairs + * @param parameterMap map to which all parsed parameters are added */ - protected static void parseParameters(final String parameters, final Map parameterMap) { + static void parseParameters(final String parameters, final Map parameterMap) { if (parameters != null) { for (String parameter : parameters.split(TypeUtil.PARAMETER_SEPARATOR)) { final String[] keyValue = parseParameter(parameter); @@ -70,7 +73,21 @@ final class TypeUtil { } } - protected static String[] parseParameter(final String parameter) { + /** + * Valid input is one key=value pair without spaces between key and value. + *

+ * See RFC 7231: + * The type, subtype, and parameter name tokens are case-insensitive. + * Parameter values might or might not be case-sensitive, depending on + * the semantics of the parameter name. The presence or absence of a + * parameter might be significant to the processing of a media-type, + * depending on its definition within the media type registry. + *

+ * + * @param parameter as key=value pair + * @return key as first array value (as lower case) and value as second array value + */ + static String[] parseParameter(final String parameter) { if (parameter.isEmpty()) { throw new IllegalArgumentException("An empty parameter is not allowed."); } @@ -84,11 +101,23 @@ final class TypeUtil { return keyValue; } - protected static void validateParameterNameAndValue(final String parameterName, final String parameterValue) + /** + * Validate that parameter name and parameter value are valid . + * + * @param parameterName must be not null, not empty and contains no whitespace + * characters + * @param parameterValue must be not null, not empty and not start with a whitespace + * character + * @throws IllegalArgumentException if one of the above requirements are not met + */ + static void validateParameterNameAndValue(final String parameterName, final String parameterValue) throws IllegalArgumentException { if (parameterName == null || parameterName.isEmpty() || parameterName.indexOf(WHITESPACE_CHAR) >= 0) { throw new IllegalArgumentException("Illegal parameter name '" + parameterName + "'."); } + if (parameterValue == null || parameterValue.isEmpty()) { + throw new IllegalArgumentException("Value parameter is NULL or empty."); + } if (Character.isWhitespace(parameterValue.charAt(0))) { throw new IllegalArgumentException("Value of parameter '" + parameterName + "' starts with whitespace."); } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/format/package-info.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/format/package-info.java new file mode 100644 index 000000000..ef5c906ad --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/format/package-info.java @@ -0,0 +1,23 @@ +/* + * 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. + */ +/** + * Contains all the format related objects (also related to http headers Prefer, Accepted + * and Content-Type) which are used for handling of an OData responses and OData requests. + */ +package org.apache.olingo.commons.api.format; \ No newline at end of file diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/http/HttpStatusCode.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/http/HttpStatusCode.java index 0d7784b09..f33942926 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/http/HttpStatusCode.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/http/HttpStatusCode.java @@ -81,7 +81,7 @@ public enum HttpStatusCode { * @return the status code info */ public String getInfo() { - return toString(); + return info; } /** @@ -91,7 +91,6 @@ public enum HttpStatusCode { */ @Override public String toString() { - return info; + return getInfo(); } - } diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/http/package-info.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/http/package-info.java new file mode 100644 index 000000000..df854343d --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/http/package-info.java @@ -0,0 +1,22 @@ +/* + * 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. + */ +/** + * Contains all the http related objects which are used for handling of an OData responses and OData requests. + */ +package org.apache.olingo.commons.api.http; \ No newline at end of file diff --git a/lib/commons-api/src/test/java/org/apache/olingo/commons/api/format/ContentTypeTest.java b/lib/commons-api/src/test/java/org/apache/olingo/commons/api/format/ContentTypeTest.java index f173a767b..2c21ae5ad 100644 --- a/lib/commons-api/src/test/java/org/apache/olingo/commons/api/format/ContentTypeTest.java +++ b/lib/commons-api/src/test/java/org/apache/olingo/commons/api/format/ContentTypeTest.java @@ -100,6 +100,9 @@ public class ContentTypeTest { @Test public void testParse() { assertNull(ContentType.parse("a")); + assertNull(ContentType.parse("a/b;c")); + assertNull(ContentType.parse("a/b;c=")); + assertNull(ContentType.parse("a/b;c= ")); } @Test(expected = IllegalArgumentException.class) diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntityContainerImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntityContainerImpl.java index 027364a31..48f088942 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntityContainerImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntityContainerImpl.java @@ -24,7 +24,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmActionImport; import org.apache.olingo.commons.api.edm.EdmEntityContainer; diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmProviderImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmProviderImpl.java index 39c66aab6..53dc4e78e 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmProviderImpl.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmProviderImpl.java @@ -25,7 +25,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.EdmAction; import org.apache.olingo.commons.api.edm.EdmAnnotation; import org.apache.olingo.commons.api.edm.EdmAnnotations; diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java index 816a9afb6..ab295bf4e 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java @@ -216,7 +216,7 @@ public final class EdmDateTimeOffset extends SingletonPrimitiveType { if (value instanceof Date) { // Although java.util.Date, as stated in its documentation, // "is intended to reflect coordinated universal time (UTC)", - // its toString() method uses the default time zone. And so do we. + // its getName() method uses the default time zone. And so do we. dateTimeValue = Calendar.getInstance(); dateTimeValue.setTime((Date) value); } else if (value instanceof Calendar) { 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 6c37ea81f..c8e5eee97 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 @@ -21,7 +21,7 @@ package org.apache.olingo.server.api; import java.util.Collection; import java.util.List; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.commons.api.edm.EdmPrimitiveType; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider; diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataApplicationException.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataApplicationException.java index db2712198..15e600eee 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataApplicationException.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataApplicationException.java @@ -20,7 +20,7 @@ package org.apache.olingo.server.api; import java.util.Locale; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.http.HttpStatusCode; /** diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataLibraryException.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataLibraryException.java index 013280aab..f7f5dee6b 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataLibraryException.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataLibraryException.java @@ -25,7 +25,7 @@ import java.util.MissingFormatArgumentException; import java.util.MissingResourceException; import java.util.ResourceBundle; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; /** * Abstract superclass of all translatable server exceptions. diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataServerError.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataServerError.java index 9365d7e7b..5e74af98b 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataServerError.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/ODataServerError.java @@ -22,8 +22,8 @@ import java.util.List; import java.util.Locale; import java.util.Map; -import org.apache.olingo.commons.api.ODataError; -import org.apache.olingo.commons.api.ODataErrorDetail; +import org.apache.olingo.commons.api.ex.ODataError; +import org.apache.olingo.commons.api.ex.ODataErrorDetail; /** * Server error. diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/PreferencesApplied.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/PreferencesApplied.java index e97f8779e..5aa04c133 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/PreferencesApplied.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/prefer/PreferencesApplied.java @@ -25,7 +25,7 @@ import java.util.Locale; import java.util.Map; import java.util.Set; -import org.apache.olingo.commons.api.ODataPreferenceNames; +import org.apache.olingo.commons.api.format.PreferenceName; import org.apache.olingo.server.api.prefer.Preferences.Return; /** @@ -72,14 +72,14 @@ public final class PreferencesApplied { private boolean isSafe(String key) { if(SAFE_PREFERENCE_NAMES.isEmpty()) { - SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.ALLOW_ENTITY_REFERENCES.toString()); - SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.CALLBACK.toString()); - SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.CONTINUE_ON_ERROR.toString()); - SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.MAX_PAGE_SIZE.toString()); - SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.TRACK_CHANGES.toString()); - SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.RETURN.toString()); - SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.RESPOND_ASYNC.toString()); - SAFE_PREFERENCE_NAMES.add(ODataPreferenceNames.WAIT.toString()); + SAFE_PREFERENCE_NAMES.add(PreferenceName.ALLOW_ENTITY_REFERENCES.getName()); + SAFE_PREFERENCE_NAMES.add(PreferenceName.CALLBACK.getName()); + SAFE_PREFERENCE_NAMES.add(PreferenceName.CONTINUE_ON_ERROR.getName()); + SAFE_PREFERENCE_NAMES.add(PreferenceName.MAX_PAGE_SIZE.getName()); + SAFE_PREFERENCE_NAMES.add(PreferenceName.TRACK_CHANGES.getName()); + SAFE_PREFERENCE_NAMES.add(PreferenceName.RETURN.getName()); + SAFE_PREFERENCE_NAMES.add(PreferenceName.RESPOND_ASYNC.getName()); + SAFE_PREFERENCE_NAMES.add(PreferenceName.WAIT.getName()); } return SAFE_PREFERENCE_NAMES.contains(key); } @@ -105,49 +105,49 @@ public final class PreferencesApplied { /** Sets odata.allow-entityreferences. */ public Builder allowEntityReferences() { - add(ODataPreferenceNames.ALLOW_ENTITY_REFERENCES.toString(), null); + add(PreferenceName.ALLOW_ENTITY_REFERENCES.getName(), null); return this; } /** Sets odata.callback. */ public Builder callback() { - add(ODataPreferenceNames.CALLBACK.toString(), null); + add(PreferenceName.CALLBACK.getName(), null); return this; } /** Sets odata.continue-on-error. */ public Builder continueOnError() { - add(ODataPreferenceNames.CONTINUE_ON_ERROR.toString(), null); + add(PreferenceName.CONTINUE_ON_ERROR.getName(), null); return this; } /** Sets the value of the applied preference odata.maxpagesize. */ public Builder maxPageSize(final Integer maxPageSize) { - add(ODataPreferenceNames.MAX_PAGE_SIZE.toString(), Integer.toString(maxPageSize)); + add(PreferenceName.MAX_PAGE_SIZE.getName(), Integer.toString(maxPageSize)); return this; } /** Sets odata.track-changes. */ public Builder trackChanges() { - add(ODataPreferenceNames.TRACK_CHANGES.toString(), null); + add(PreferenceName.TRACK_CHANGES.getName(), null); return this; } /** Sets the value of the applied preference return. */ public Builder returnRepresentation(final Return returnRepresentation) { - add(ODataPreferenceNames.RETURN.toString(), returnRepresentation.name().toLowerCase(Locale.ROOT)); + add(PreferenceName.RETURN.getName(), returnRepresentation.name().toLowerCase(Locale.ROOT)); return this; } /** Sets odata.respond-async. */ public Builder respondAsync() { - add(ODataPreferenceNames.RESPOND_ASYNC.toString(), null); + add(PreferenceName.RESPOND_ASYNC.getName(), null); return this; } /** Sets the value of the applied preference wait. */ public Builder waitPreference(final Integer wait) { - add(ODataPreferenceNames.WAIT.toString(), Integer.toString(wait)); + add(PreferenceName.WAIT.getName(), Integer.toString(wait)); return this; } diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitException.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitException.java index c114c65d8..956b06ff8 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitException.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitException.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.server.api.uri.queryoption.expression; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; /** * Exception class used by the {@link ExpressionVisitor} to throw exceptions while traversing the expression tree diff --git a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/OData4Impl.java b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/OData4Impl.java index bde9c966c..29cb55142 100644 --- a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/OData4Impl.java +++ b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/OData4Impl.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.server.core; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.server.api.OData; import org.apache.olingo.server.api.ODataHttpHandler; import org.apache.olingo.server.api.ServiceMetadata; diff --git a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/SchemaBasedEdmProvider.java b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/SchemaBasedEdmProvider.java index a35f3bcf6..3256bf4b0 100644 --- a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/SchemaBasedEdmProvider.java +++ b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/SchemaBasedEdmProvider.java @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.provider.CsdlAction; import org.apache.olingo.commons.api.edm.provider.CsdlActionImport; diff --git a/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/MetadataParserTest.java b/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/MetadataParserTest.java index 10502ad6b..1c2b28feb 100644 --- a/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/MetadataParserTest.java +++ b/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/MetadataParserTest.java @@ -27,7 +27,7 @@ import static org.junit.Assert.assertTrue; import java.io.FileReader; import java.util.List; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.provider.CsdlAction; import org.apache.olingo.commons.api.edm.provider.CsdlActionImport; diff --git a/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/ServiceDispatcherTest.java b/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/ServiceDispatcherTest.java index 0d0c6ad30..636a6b6a6 100644 --- a/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/ServiceDispatcherTest.java +++ b/lib/server-core-ext/src/test/java/org/apache/olingo/server/core/ServiceDispatcherTest.java @@ -189,9 +189,9 @@ public class ServiceDispatcherTest { Mockito.verify(handler).read(arg1.capture(), arg2.capture()); DataRequest request = arg1.getValue(); - // Need toString on ContextURL class + // Need getName on ContextURL class // assertEquals("", - // request.getContextURL(request.getOdata()).toString()); + // request.getContextURL(request.getOdata()).getName()); assertEquals("application/json;odata.metadata=minimal", request.getResponseContentType() .toContentTypeString()); } @@ -209,9 +209,9 @@ public class ServiceDispatcherTest { Mockito.verify(handler).read(arg1.capture(), arg2.capture()); DataRequest request = arg1.getValue(); - // Need toString on ContextURL class + // Need getName on ContextURL class // assertEquals("", - // request.getContextURL(request.getOdata()).toString()); + // request.getContextURL(request.getOdata()).getName()); assertEquals("text/plain", request.getResponseContentType().toContentTypeString()); } }); 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 517018569..050f285f2 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 @@ -34,7 +34,7 @@ import java.util.Map.Entry; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.commons.api.http.HttpHeader; import org.apache.olingo.commons.api.http.HttpMethod; import org.apache.olingo.server.api.OData; diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/referenceRewriting/BatchReferenceRewriter.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/referenceRewriting/BatchReferenceRewriter.java index a941c336d..a05b1e9a0 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/referenceRewriting/BatchReferenceRewriter.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/batchhandler/referenceRewriting/BatchReferenceRewriter.java @@ -23,7 +23,7 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.commons.api.http.HttpHeader; import org.apache.olingo.commons.api.http.HttpMethod; import org.apache.olingo.server.api.ODataRequest; diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugResponseHelperImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugResponseHelperImpl.java index f81a256aa..5510c546a 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugResponseHelperImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/debug/DebugResponseHelperImpl.java @@ -31,7 +31,7 @@ import java.util.Locale; import java.util.Map; import java.util.Map.Entry; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.commons.api.http.HttpHeader; import org.apache.olingo.commons.api.http.HttpStatusCode; diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchParser.java index 3aeb1b564..243cbe0ca 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchParser.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/batch/BatchParser.java @@ -23,7 +23,7 @@ import java.io.InputStream; import java.util.LinkedList; import java.util.List; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.server.api.deserializer.batch.BatchDeserializerException; import org.apache.olingo.server.api.deserializer.batch.BatchOptions; import org.apache.olingo.server.api.deserializer.batch.BatchRequestPart; diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/prefer/PreferencesImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/prefer/PreferencesImpl.java index 50cf89e4d..ecafdc45f 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/prefer/PreferencesImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/prefer/PreferencesImpl.java @@ -23,7 +23,7 @@ import java.util.Collection; import java.util.Locale; import java.util.Map; -import org.apache.olingo.commons.api.ODataPreferenceNames; +import org.apache.olingo.commons.api.format.PreferenceName; import org.apache.olingo.server.api.prefer.Preferences; /** @@ -46,15 +46,15 @@ public class PreferencesImpl implements Preferences { } public boolean hasAllowEntityReferences() { - return preferences.containsKey(ODataPreferenceNames.ALLOW_ENTITY_REFERENCES.toString()); + return preferences.containsKey(PreferenceName.ALLOW_ENTITY_REFERENCES.getName()); } public URI getCallback() { - if (preferences.containsKey(ODataPreferenceNames.CALLBACK.toString()) - && preferences.get(ODataPreferenceNames.CALLBACK.toString()).getParameters() != null - && preferences.get(ODataPreferenceNames.CALLBACK.toString()).getParameters().get(URL) != null) { + if (preferences.containsKey(PreferenceName.CALLBACK.getName()) + && preferences.get(PreferenceName.CALLBACK.getName()).getParameters() != null + && preferences.get(PreferenceName.CALLBACK.getName()).getParameters().get(URL) != null) { try { - return URI.create(preferences.get(ODataPreferenceNames.CALLBACK.toString()).getParameters().get(URL)); + return URI.create(preferences.get(PreferenceName.CALLBACK.getName()).getParameters().get(URL)); } catch (final IllegalArgumentException e) { return null; } @@ -63,20 +63,20 @@ public class PreferencesImpl implements Preferences { } public boolean hasContinueOnError() { - return preferences.containsKey(ODataPreferenceNames.CONTINUE_ON_ERROR.toString()); + return preferences.containsKey(PreferenceName.CONTINUE_ON_ERROR.getName()); } public Integer getMaxPageSize() { - return getNonNegativeIntegerPreference(ODataPreferenceNames.MAX_PAGE_SIZE.toString()); + return getNonNegativeIntegerPreference(PreferenceName.MAX_PAGE_SIZE.getName()); } public boolean hasTrackChanges() { - return preferences.containsKey(ODataPreferenceNames.TRACK_CHANGES.toString()); + return preferences.containsKey(PreferenceName.TRACK_CHANGES.getName()); } public Return getReturn() { - if (preferences.containsKey(ODataPreferenceNames.RETURN.toString())) { - final String value = preferences.get(ODataPreferenceNames.RETURN.toString()).getValue(); + if (preferences.containsKey(PreferenceName.RETURN.getName())) { + final String value = preferences.get(PreferenceName.RETURN.getName()).getValue(); if (Return.REPRESENTATION.toString().toLowerCase(Locale.ROOT).equals(value)) { return Return.REPRESENTATION; } else if (Return.MINIMAL.toString().toLowerCase(Locale.ROOT).equals(value)) { @@ -87,11 +87,11 @@ public class PreferencesImpl implements Preferences { } public boolean hasRespondAsync() { - return preferences.containsKey(ODataPreferenceNames.RESPOND_ASYNC.toString()); + return preferences.containsKey(PreferenceName.RESPOND_ASYNC.getName()); } public Integer getWait() { - return getNonNegativeIntegerPreference(ODataPreferenceNames.WAIT.toString()); + return getNonNegativeIntegerPreference(PreferenceName.WAIT.getName()); } private Integer getNonNegativeIntegerPreference(final String name) { diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/BatchResponseSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/BatchResponseSerializer.java index 95a33f5cd..f7fd01d28 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/BatchResponseSerializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/BatchResponseSerializer.java @@ -31,7 +31,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.commons.api.http.HttpContentType; import org.apache.olingo.commons.api.http.HttpHeader; import org.apache.olingo.commons.api.http.HttpStatusCode; diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataErrorSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataErrorSerializer.java index 97faaa079..c3c39d0ea 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataErrorSerializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataErrorSerializer.java @@ -21,8 +21,8 @@ package org.apache.olingo.server.core.serializer.json; import java.io.IOException; import org.apache.olingo.commons.api.Constants; -import org.apache.olingo.commons.api.ODataError; -import org.apache.olingo.commons.api.ODataErrorDetail; +import org.apache.olingo.commons.api.ex.ODataError; +import org.apache.olingo.commons.api.ex.ODataErrorDetail; import org.apache.olingo.server.api.serializer.SerializerException; import com.fasterxml.jackson.core.JsonGenerator; diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java index 899226feb..f998fe7b4 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java @@ -31,7 +31,7 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; import org.apache.olingo.commons.api.Constants; -import org.apache.olingo.commons.api.ODataErrorDetail; +import org.apache.olingo.commons.api.ex.ODataErrorDetail; import org.apache.olingo.commons.api.data.ComplexValue; import org.apache.olingo.commons.api.data.ContextURL; import org.apache.olingo.commons.api.data.Entity; 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 15a70bec8..6b42a9935 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 @@ -25,7 +25,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.server.api.uri.UriInfo; import org.apache.olingo.server.api.uri.UriInfoAll; diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java index b2dfff87f..794948e88 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java @@ -30,7 +30,7 @@ import org.antlr.v4.runtime.RecognitionException; import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.atn.PredictionMode; import org.antlr.v4.runtime.misc.ParseCancellationException; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.server.api.uri.UriInfo; import org.apache.olingo.server.api.uri.UriInfoKind; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/ServerCoreDebuggerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/ServerCoreDebuggerTest.java index 32ec1954f..0ec0fceaf 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/ServerCoreDebuggerTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/debug/ServerCoreDebuggerTest.java @@ -29,7 +29,7 @@ import java.io.IOException; import javax.servlet.http.HttpServletRequest; import org.apache.commons.io.IOUtils; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.server.api.OData; import org.apache.olingo.server.api.ODataResponse; import org.apache.olingo.server.api.debug.DebugInformation; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityContainerImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityContainerImplTest.java index b7017ec53..82aa145d8 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityContainerImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmEntityContainerImplTest.java @@ -29,7 +29,7 @@ import static org.mockito.Mockito.when; import java.util.ArrayList; import java.util.List; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.EdmActionImport; import org.apache.olingo.commons.api.edm.EdmEntityContainer; import org.apache.olingo.commons.api.edm.EdmEntitySet; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplTest.java index 1456c37e3..c094b1dfc 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmProviderImplTest.java @@ -30,7 +30,7 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmComplexType; import org.apache.olingo.commons.api.edm.EdmEntityContainer; @@ -125,24 +125,24 @@ public class EdmProviderImplTest { try { localEdm.getUnboundAction(fqn); } catch (EdmException e) { - assertEquals("org.apache.olingo.commons.api.ODataException: msg", e.getMessage()); + assertEquals("org.apache.olingo.commons.api.ex.ODataException: msg", e.getMessage()); } try { localEdm.getUnboundFunction(fqn, null); } catch (EdmException e) { - assertEquals("org.apache.olingo.commons.api.ODataException: msg", e.getMessage()); + assertEquals("org.apache.olingo.commons.api.ex.ODataException: msg", e.getMessage()); } try { localEdm.getBoundAction(fqn, fqn, true); } catch (EdmException e) { - assertEquals("org.apache.olingo.commons.api.ODataException: msg", e.getMessage()); + assertEquals("org.apache.olingo.commons.api.ex.ODataException: msg", e.getMessage()); } try { localEdm.getBoundFunction(fqn, fqn, true, null); } catch (EdmException e) { - assertEquals("org.apache.olingo.commons.api.ODataException: msg", e.getMessage()); + assertEquals("org.apache.olingo.commons.api.ex.ODataException: msg", e.getMessage()); } } diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSchemaImplTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSchemaImplTest.java index 3714046fa..fd344c523 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSchemaImplTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/edm/provider/EdmSchemaImplTest.java @@ -27,7 +27,7 @@ import static org.mockito.Mockito.when; import java.util.ArrayList; import java.util.List; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAction; import org.apache.olingo.commons.api.edm.EdmActionImport; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ComplexTypeHelper.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ComplexTypeHelper.java index 567e3a528..eff637f7c 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ComplexTypeHelper.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ComplexTypeHelper.java @@ -24,7 +24,7 @@ import static org.mockito.Mockito.when; import java.util.ArrayList; import java.util.List; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.EdmComplexType; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java index 1994e0c66..4be074b02 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java @@ -27,7 +27,7 @@ import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.data.ComplexValue; import org.apache.olingo.commons.api.data.ContextURL; import org.apache.olingo.commons.api.data.Property; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ServerErrorSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ServerErrorSerializerTest.java index 324207689..8f5cb8749 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ServerErrorSerializerTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ServerErrorSerializerTest.java @@ -26,7 +26,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.commons.io.IOUtils; -import org.apache.olingo.commons.api.ODataErrorDetail; +import org.apache.olingo.commons.api.ex.ODataErrorDetail; import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.server.api.OData; import org.apache.olingo.server.api.ODataServerError; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java index 9e9a04d3e..52fc7737a 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java @@ -32,7 +32,7 @@ import java.util.Collections; import java.util.List; import org.apache.commons.io.IOUtils; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmComplexType; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/ServerErrorXmlSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/ServerErrorXmlSerializerTest.java index 6968b2b9d..aea1fdbda 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/ServerErrorXmlSerializerTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/ServerErrorXmlSerializerTest.java @@ -25,7 +25,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.commons.io.IOUtils; -import org.apache.olingo.commons.api.ODataErrorDetail; +import org.apache.olingo.commons.api.ex.ODataErrorDetail; import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.server.api.OData; import org.apache.olingo.server.api.ODataServerError; diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/async/AsyncProcessor.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/async/AsyncProcessor.java index da16f9b63..4e070832b 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/async/AsyncProcessor.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/async/AsyncProcessor.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.server.tecsvc.async; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.commons.api.http.HttpHeader; import org.apache.olingo.server.api.ODataApplicationException; import org.apache.olingo.server.api.ODataLibraryException; diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/async/TechnicalAsyncService.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/async/TechnicalAsyncService.java index 857a45ff7..ce08e5203 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/async/TechnicalAsyncService.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/async/TechnicalAsyncService.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.server.tecsvc.async; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.commons.api.http.HttpHeader; import org.apache.olingo.commons.api.http.HttpStatusCode; diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/queryoptions/options/SystemQueryOptionsRuntimeException.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/queryoptions/options/SystemQueryOptionsRuntimeException.java index 57bb20464..469052d2e 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/queryoptions/options/SystemQueryOptionsRuntimeException.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/queryoptions/options/SystemQueryOptionsRuntimeException.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.server.tecsvc.processor.queryoptions.options; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; public class SystemQueryOptionsRuntimeException extends ODataRuntimeException { diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java index 1365a4554..2227315ba 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java @@ -22,7 +22,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.provider.CsdlAction; import org.apache.olingo.commons.api.edm.provider.CsdlParameter; diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java index 819c19f2c..b3b9864fe 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java @@ -21,7 +21,7 @@ package org.apache.olingo.server.tecsvc.provider; import java.util.ArrayList; import java.util.Arrays; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty; diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java index 3a1777556..ff53d09a5 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.provider.CsdlActionImport; import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer; diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EdmTechProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EdmTechProvider.java index 37951a341..ffb1946cb 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EdmTechProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EdmTechProvider.java @@ -22,7 +22,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider; import org.apache.olingo.commons.api.edm.provider.CsdlAction; diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java index 6ee0d2d0f..a1067ca50 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java @@ -20,7 +20,7 @@ package org.apache.olingo.server.tecsvc.provider; import java.util.Arrays; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty; diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EnumTypeProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EnumTypeProvider.java index bc382cf74..7479c28fb 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EnumTypeProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EnumTypeProvider.java @@ -20,7 +20,7 @@ package org.apache.olingo.server.tecsvc.provider; import java.util.Arrays; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.provider.CsdlEnumMember; diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java index 1694d1370..df4cfbd20 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java @@ -23,7 +23,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.provider.CsdlFunction; import org.apache.olingo.commons.api.edm.provider.CsdlParameter; diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java index 7891556dc..b07ae60f6 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java @@ -21,7 +21,7 @@ package org.apache.olingo.server.tecsvc.provider; import java.util.ArrayList; import java.util.List; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.provider.CsdlAction; import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java index 8cd470655..b6c6a81fd 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java @@ -33,7 +33,7 @@ import java.util.Collections; import java.util.Locale; import org.apache.commons.io.IOUtils; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider; diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java index 56870352c..9448b406b 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java @@ -24,7 +24,7 @@ import static org.junit.Assert.assertNotNull; import java.util.ArrayList; import java.util.List; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.commons.core.edm.EdmProviderImpl; diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java index e3a5eb332..e3250ea63 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java @@ -21,7 +21,7 @@ package org.apache.olingo.server.core.uri.testutil; import java.util.Arrays; import java.util.List; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; 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 65521e18b..538e1190d 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.commons.api.http.HttpMethod; import org.apache.olingo.client.core.http.AbstractHttpClientFactory; -import org.apache.olingo.commons.api.ODataRuntimeException; +import org.apache.olingo.commons.api.ex.ODataRuntimeException; /** * Shows how to customize the way how the underlying network socket are managed by the HTTP component; the specific diff --git a/samples/server/src/main/java/org/apache/olingo/server/sample/data/DataProvider.java b/samples/server/src/main/java/org/apache/olingo/server/sample/data/DataProvider.java index 69a4530c7..d3608563c 100644 --- a/samples/server/src/main/java/org/apache/olingo/server/sample/data/DataProvider.java +++ b/samples/server/src/main/java/org/apache/olingo/server/sample/data/DataProvider.java @@ -21,7 +21,7 @@ package org.apache.olingo.server.sample.data; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.data.Entity; import org.apache.olingo.commons.api.data.EntityCollection; import org.apache.olingo.commons.api.data.Property; diff --git a/samples/server/src/main/java/org/apache/olingo/server/sample/edmprovider/CarsEdmProvider.java b/samples/server/src/main/java/org/apache/olingo/server/sample/edmprovider/CarsEdmProvider.java index 4d3ba9d70..628ad7d2c 100644 --- a/samples/server/src/main/java/org/apache/olingo/server/sample/edmprovider/CarsEdmProvider.java +++ b/samples/server/src/main/java/org/apache/olingo/server/sample/edmprovider/CarsEdmProvider.java @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.ex.ODataException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider;