[OLINGO-575] Delete abstract client class
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/f38d54dc Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/f38d54dc Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/f38d54dc Branch: refs/heads/master Commit: f38d54dcf3e5a938ffcb55cb1cebfe344a0af403 Parents: 55c7d10 Author: Christian Amend <[email protected]> Authored: Mon Mar 2 14:58:56 2015 +0100 Committer: Christian Amend <[email protected]> Committed: Mon Mar 2 15:55:14 2015 +0100 ---------------------------------------------------------------------- .../olingo/ext/proxy/AbstractService.java | 6 +- .../commons/AbstractInvocationHandler.java | 4 +- .../TransactionalPersistenceManagerImpl.java | 5 +- .../olingo/ext/proxy/utils/CoreUtils.java | 34 +-- .../olingo/ext/pojogen/AbstractPOJOGenMojo.java | 5 +- .../src/main/resources/service.vm | 6 +- .../olingo/fit/AbstractBaseTestITCase.java | 4 +- .../olingo/fit/proxy/v4/AbstractTestITCase.java | 4 +- .../olingo/fit/proxy/v4/demo/Service.java | 9 +- .../olingo/fit/proxy/v4/opentype/Service.java | 13 +- .../fit/proxy/v4/staticservice/Service.java | 13 +- .../client/BasicHttpExceptionHandling.java | 4 +- .../fit/tecsvc/client/ExpandSelectITCase.java | 10 +- .../olingo/fit/tecsvc/client/MediaITCase.java | 11 +- .../fit/tecsvc/client/NavigationITCase.java | 5 +- .../tecsvc/client/PrimitiveComplexITCase.java | 3 +- .../tecsvc/client/SystemQueryOptionITCase.java | 23 +- .../fit/tecsvc/http/BasicBatchITCase.java | 7 +- .../olingo/fit/tecsvc/http/BasicHttpITCase.java | 4 +- .../olingo/fit/tecsvc/http/PingITCase.java | 14 +- .../client/api/CommonEdmEnabledODataClient.java | 57 ----- .../olingo/client/api/CommonODataClient.java | 77 ------- .../client/api/EdmEnabledODataClient.java | 24 +- .../apache/olingo/client/api/ODataClient.java | 48 ++-- .../request/ODataBatchableRequest.java | 6 +- .../request/batch/BatchRequestFactory.java | 8 +- .../batch/CommonBatchRequestFactory.java | 33 --- .../request/batch/CommonODataBatchRequest.java | 55 ----- .../request/batch/ODataBatchRequest.java | 47 +++- .../request/cud/CUDRequestFactory.java | 136 +++++++++++- .../request/cud/CommonCUDRequestFactory.java | 163 -------------- .../request/cud/CommonUpdateType.java | 31 --- .../communication/request/cud/UpdateType.java | 5 +- .../api/domain/ODataEntitySetIterator.java | 6 +- .../olingo/client/core/AbstractODataClient.java | 49 ---- .../olingo/client/core/ODataClientFactory.java | 2 +- .../olingo/client/core/ODataClientImpl.java | 26 ++- .../header/ODataErrorResponseChecker.java | 4 +- .../request/AbstractODataBasicRequest.java | 10 +- .../request/AbstractODataRequest.java | 8 +- .../communication/request/AbstractRequest.java | 14 +- .../request/batch/AbstractBatchManager.java | 6 +- .../batch/AbstractBatchRequestFactory.java | 28 --- .../batch/AbstractODataBatchRequest.java | 8 +- .../batch/AbstractODataBatchRequestItem.java | 6 +- .../request/batch/BatchRequestFactoryImpl.java | 23 +- .../request/batch/ODataBatchRequestImpl.java | 3 +- .../request/batch/ODataChangesetImpl.java | 4 +- .../request/batch/ODataSingleRequestImpl.java | 4 +- .../request/cud/AbstractCUDRequestFactory.java | 221 ------------------- .../request/cud/CUDRequestFactoryImpl.java | 209 +++++++++++++++++- .../request/cud/ODataDeleteRequestImpl.java | 6 +- .../cud/ODataEntityCreateRequestImpl.java | 6 +- .../cud/ODataEntityUpdateRequestImpl.java | 6 +- .../cud/ODataPropertyUpdateRequestImpl.java | 6 +- .../cud/ODataReferenceAddingRequestImpl.java | 6 +- .../cud/ODataValueUpdateRequestImpl.java | 6 +- .../AbstractEdmEnabledInvokeRequestFactory.java | 6 +- .../invoke/AbstractODataInvokeRequest.java | 7 +- .../request/invoke/ODataInvokeRequestImpl.java | 4 +- .../retrieve/AbstractMetadataRequestImpl.java | 4 +- .../retrieve/AbstractODataRetrieveRequest.java | 6 +- .../retrieve/EdmMetadataRequestImpl.java | 6 +- .../request/retrieve/ODataDeltaRequestImpl.java | 5 +- .../retrieve/ODataEntityRequestImpl.java | 6 +- .../ODataEntitySetIteratorRequestImpl.java | 6 +- .../retrieve/ODataEntitySetRequestImpl.java | 6 +- .../request/retrieve/ODataMediaRequestImpl.java | 6 +- .../retrieve/ODataPropertyRequestImpl.java | 6 +- .../request/retrieve/ODataRawRequestImpl.java | 6 +- .../ODataServiceDocumentRequestImpl.java | 6 +- .../request/retrieve/ODataValueRequestImpl.java | 6 +- .../retrieve/XMLMetadataRequestImpl.java | 5 +- .../AbstractODataStreamedEntityRequest.java | 4 +- .../streamed/AbstractODataStreamedRequest.java | 10 +- .../ODataMediaEntityCreateRequestImpl.java | 6 +- .../ODataMediaEntityUpdateRequestImpl.java | 6 +- .../streamed/ODataStreamUpdateRequestImpl.java | 6 +- .../response/AbstractODataResponse.java | 6 +- .../response/AsyncResponseImpl.java | 4 +- .../core/serialization/ODataReaderImpl.java | 5 +- .../core/serialization/ODataWriterImpl.java | 8 +- .../apache/olingo/client/core/uri/URIUtils.java | 6 +- .../apache/olingo/client/core/AbstractTest.java | 6 +- .../olingo/client/core/ODataClientTest.java | 10 +- 85 files changed, 696 insertions(+), 1013 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/AbstractService.java ---------------------------------------------------------------------- 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 db80e72..aaed37a 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 @@ -27,7 +27,7 @@ import java.util.zip.GZIPInputStream; import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.IOUtils; -import org.apache.olingo.client.api.CommonEdmEnabledODataClient; +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.EdmClientImpl; @@ -49,13 +49,13 @@ import org.slf4j.LoggerFactory; * * @param <C> actual client class */ -public abstract class AbstractService<C extends CommonEdmEnabledODataClient<?>> { +public abstract class AbstractService<C extends EdmEnabledODataClient> { protected static final Logger LOG = LoggerFactory.getLogger(AbstractService.class); private final Map<Class<?>, Object> ENTITY_CONTAINERS = new ConcurrentHashMap<Class<?>, Object>(); - private final CommonEdmEnabledODataClient<?> client; + private final EdmEnabledODataClient client; private final Context context; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractInvocationHandler.java ---------------------------------------------------------------------- diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractInvocationHandler.java index 0ed0080..d0d26d3 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractInvocationHandler.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractInvocationHandler.java @@ -31,7 +31,7 @@ import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; -import org.apache.olingo.client.api.CommonEdmEnabledODataClient; +import org.apache.olingo.client.api.EdmEnabledODataClient; import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.commons.api.domain.ODataEntity; import org.apache.olingo.commons.api.domain.ODataValue; @@ -64,7 +64,7 @@ abstract class AbstractInvocationHandler implements InvocationHandler { this.service = service; } - protected CommonEdmEnabledODataClient<?> getClient() { + protected EdmEnabledODataClient getClient() { return service.getClient(); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/TransactionalPersistenceManagerImpl.java ---------------------------------------------------------------------- diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/TransactionalPersistenceManagerImpl.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/TransactionalPersistenceManagerImpl.java index ae76f8a..5f42127 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/TransactionalPersistenceManagerImpl.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/TransactionalPersistenceManagerImpl.java @@ -22,12 +22,13 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; + import org.apache.olingo.client.api.communication.ODataServerErrorException; import org.apache.olingo.client.api.communication.request.ODataBatchableRequest; import org.apache.olingo.client.api.communication.request.ODataRequest; import org.apache.olingo.client.api.communication.request.ODataStreamedRequest; import org.apache.olingo.client.api.communication.request.batch.BatchManager; -import org.apache.olingo.client.api.communication.request.batch.CommonODataBatchRequest; +import org.apache.olingo.client.api.communication.request.batch.ODataBatchRequest; import org.apache.olingo.client.api.communication.request.batch.ODataBatchResponseItem; import org.apache.olingo.client.api.communication.request.batch.ODataChangeset; import org.apache.olingo.client.api.communication.response.ODataBatchResponse; @@ -58,7 +59,7 @@ public class TransactionalPersistenceManagerImpl extends AbstractPersistenceMana */ @Override protected void doFlush(final PersistenceChanges changes, final TransactionItems items) { - final CommonODataBatchRequest request = + final ODataBatchRequest request = service.getClient().getBatchRequestFactory().getBatchRequest(service.getClient().getServiceRoot()); ((ODataRequest) request).setAccept( service.getClient().getConfiguration().getDefaultBatchAcceptFormat().toContentTypeString()); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/CoreUtils.java ---------------------------------------------------------------------- diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/CoreUtils.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/CoreUtils.java index fb4f92e..7ab03a6 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/CoreUtils.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/CoreUtils.java @@ -37,7 +37,7 @@ import java.util.Set; import java.util.TreeSet; import org.apache.commons.lang3.StringUtils; -import org.apache.olingo.client.api.CommonEdmEnabledODataClient; +import org.apache.olingo.client.api.EdmEnabledODataClient; import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.client.core.uri.URIUtils; import org.apache.olingo.commons.api.domain.ODataAnnotatable; @@ -92,7 +92,7 @@ public final class CoreUtils { } public static ODataValue getODataValue( - final CommonEdmEnabledODataClient<?> client, final EdmTypeInfo type, final Object obj) { + final EdmEnabledODataClient client, final EdmTypeInfo type, final Object obj) { final ODataValue value; @@ -150,7 +150,7 @@ public final class CoreUtils { } private static ODataProperty getODataEntityProperty( - final CommonEdmEnabledODataClient<?> client, + final EdmEnabledODataClient client, final FullQualifiedName entity, final String property, final Object obj) { @@ -160,7 +160,7 @@ public final class CoreUtils { } private static ODataProperty getODataComplexProperty( - final CommonEdmEnabledODataClient<?> client, + final EdmEnabledODataClient client, final FullQualifiedName complex, final String property, final Object obj) { @@ -170,7 +170,7 @@ public final class CoreUtils { } private static ODataProperty getODataProperty( - final CommonEdmEnabledODataClient<?> client, + final EdmEnabledODataClient client, final EdmElement edmProperty, final String property, final Object obj) { @@ -192,7 +192,7 @@ public final class CoreUtils { } public static ODataAnnotation getODataAnnotation( - final CommonEdmEnabledODataClient<?> client, final String term, final EdmType type, final Object obj) { + final EdmEnabledODataClient client, final String term, final EdmType type, final Object obj) { ODataAnnotation annotation; @@ -212,7 +212,7 @@ public final class CoreUtils { } public static ODataProperty getODataProperty( - final CommonEdmEnabledODataClient<?> client, final String name, final EdmTypeInfo type, final Object obj) { + final EdmEnabledODataClient client, final String name, final EdmTypeInfo type, final Object obj) { ODataProperty property; @@ -246,7 +246,7 @@ public final class CoreUtils { } private static EdmTypeInfo guessTypeFromObject( - final CommonEdmEnabledODataClient<?> client, final Object obj) { + final EdmEnabledODataClient client, final Object obj) { final EdmTypeInfo.Builder edmTypeInfo = new EdmTypeInfo.Builder().setEdm(client.getCachedEdm()); @@ -269,7 +269,7 @@ public final class CoreUtils { } } - private static EdmTypeInfo guessPrimitiveType(final CommonEdmEnabledODataClient<?> client, final Class<?> clazz) { + private static EdmTypeInfo guessPrimitiveType(final EdmEnabledODataClient client, final Class<?> clazz) { EdmPrimitiveTypeKind bckCandidate = null; for (EdmPrimitiveTypeKind kind : EdmPrimitiveTypeKind.values()) { @@ -295,7 +295,7 @@ public final class CoreUtils { } public static void addProperties( - final CommonEdmEnabledODataClient<?> client, + final EdmEnabledODataClient client, final Map<String, Object> changes, final ODataEntity entity) { @@ -306,7 +306,7 @@ public final class CoreUtils { } public static void addProperties( - final CommonEdmEnabledODataClient<?> client, + final EdmEnabledODataClient client, final Map<String, Object> changes, final ODataComplexValue<ODataProperty> entity) { @@ -320,7 +320,7 @@ public final class CoreUtils { } public static void addAnnotations( - final CommonEdmEnabledODataClient<?> client, + final EdmEnabledODataClient client, final Map<Class<? extends AbstractTerm>, Object> annotations, final ODataAnnotatable annotatable) { @@ -386,7 +386,7 @@ public final class CoreUtils { } public static URIBuilder buildEditLink( - final CommonEdmEnabledODataClient<?> client, + final EdmEnabledODataClient client, final String entitySetURI, final ODataEntity entity, final Object key) { @@ -435,7 +435,7 @@ public final class CoreUtils { } public static Object getKey( - final CommonEdmEnabledODataClient<?> client, + final EdmEnabledODataClient client, final EntityInvocationHandler typeHandler, final Class<?> entityTypeRef, final ODataEntity entity) { @@ -465,7 +465,7 @@ public final class CoreUtils { } private static void populate( - final CommonEdmEnabledODataClient<?> client, + final EdmEnabledODataClient client, final EntityInvocationHandler typeHandler, final Object bean, final Class<? extends Annotation> getterAnn, @@ -489,7 +489,7 @@ public final class CoreUtils { @SuppressWarnings({ "unchecked" }) private static void populate( - final CommonEdmEnabledODataClient<?> client, + final EdmEnabledODataClient client, final EntityInvocationHandler typeHandler, final Object bean, final Class<?> typeRef, @@ -662,7 +662,7 @@ public final class CoreUtils { } public static URI getTargetEntitySetURI( - final CommonEdmEnabledODataClient<?> client, final NavigationProperty property) { + final EdmEnabledODataClient client, final NavigationProperty property) { final Edm edm = client.getCachedEdm(); final FullQualifiedName containerName = http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractPOJOGenMojo.java ---------------------------------------------------------------------- diff --git a/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractPOJOGenMojo.java b/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractPOJOGenMojo.java index dda303a..5caeafb 100644 --- a/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractPOJOGenMojo.java +++ b/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractPOJOGenMojo.java @@ -33,6 +33,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.zip.GZIPOutputStream; + import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; @@ -42,7 +43,7 @@ import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Parameter; -import org.apache.olingo.client.api.CommonODataClient; +import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.api.communication.request.retrieve.EdmMetadataRequest; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; import org.apache.olingo.client.api.edm.xml.XMLMetadata; @@ -195,7 +196,7 @@ public abstract class AbstractPOJOGenMojo extends AbstractMojo { protected abstract AbstractUtility getUtility(); - protected abstract CommonODataClient<?> getClient(); + protected abstract ODataClient getClient(); private Triple<XMLMetadata, String, Edm> getMetadata() throws FileNotFoundException { if (StringUtils.isEmpty(serviceRootURL) && StringUtils.isEmpty(localEdm)) { http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/ext/pojogen-maven-plugin/src/main/resources/service.vm ---------------------------------------------------------------------- diff --git a/ext/pojogen-maven-plugin/src/main/resources/service.vm b/ext/pojogen-maven-plugin/src/main/resources/service.vm index 292ba8f..e4762e2 100644 --- a/ext/pojogen-maven-plugin/src/main/resources/service.vm +++ b/ext/pojogen-maven-plugin/src/main/resources/service.vm @@ -23,12 +23,12 @@ package ${package}; import java.util.HashMap; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.apache.olingo.client.api.CommonEdmEnabledODataClient; +import org.apache.olingo.client.api.EdmEnabledODataClient; import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.AbstractService; -public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractService<C> { +public class Service<C extends EdmEnabledODataClient> extends AbstractService<C> { //CHECKSTYLE:OFF (Maven checkstyle) private static final String COMPRESSED_METADATA = "$metadata"; @@ -38,7 +38,7 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS private static final Map<String, Service<?>> SERVICES = new ConcurrentHashMap<String, Service<?>>(); @SuppressWarnings("unchecked") - private static <C extends CommonEdmEnabledODataClient<?>> Service<C> getInstance( + private static <C extends EdmEnabledODataClient> Service<C> getInstance( final ODataServiceVersion version, final String serviceRoot, final boolean transactional) { if (!SERVICES.containsKey(serviceRoot)) { http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/fit/src/test/java/org/apache/olingo/fit/AbstractBaseTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/AbstractBaseTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/AbstractBaseTestITCase.java index 3856318..64ed4eb 100644 --- a/fit/src/test/java/org/apache/olingo/fit/AbstractBaseTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/AbstractBaseTestITCase.java @@ -29,7 +29,7 @@ import javax.servlet.http.HttpServletResponse; import org.apache.catalina.LifecycleException; import org.apache.commons.io.IOUtils; -import org.apache.olingo.client.api.CommonODataClient; +import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.commons.api.data.Entity; import org.apache.olingo.commons.api.data.EntitySet; import org.apache.olingo.commons.api.domain.ODataEntity; @@ -50,7 +50,7 @@ public abstract class AbstractBaseTestITCase { */ protected static final Logger LOG = LoggerFactory.getLogger(AbstractBaseTestITCase.class); - protected abstract CommonODataClient<?> getClient(); + protected abstract ODataClient getClient(); @BeforeClass public static void init() http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTestITCase.java index 70b34f5..e907a67 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTestITCase.java @@ -29,8 +29,8 @@ import java.sql.Timestamp; import java.util.Calendar; import java.util.TimeZone; -import org.apache.olingo.client.api.CommonODataClient; import org.apache.olingo.client.api.EdmEnabledODataClient; +import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.ext.proxy.AbstractService; import org.apache.olingo.ext.proxy.api.PrimitiveCollection; @@ -142,7 +142,7 @@ public abstract class AbstractTestITCase extends AbstractBaseTestITCase { } @Override - protected CommonODataClient<?> getClient() { + protected ODataClient getClient() { throw new RuntimeException("This method should not be used from proxy tests."); } } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/fit/src/test/java/org/apache/olingo/fit/proxy/v4/demo/Service.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/demo/Service.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/demo/Service.java index 8f13726..3711d65 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/demo/Service.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/demo/Service.java @@ -21,12 +21,13 @@ package org.apache.olingo.fit.proxy.v4.demo; import java.util.HashMap; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.apache.olingo.client.api.CommonEdmEnabledODataClient; + +import org.apache.olingo.client.api.EdmEnabledODataClient; import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; -import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.AbstractService; +import org.apache.olingo.ext.proxy.api.AbstractTerm; -public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractService<C> { +public class Service<C extends EdmEnabledODataClient> extends AbstractService<C> { //CHECKSTYLE:OFF (Maven checkstyle) private static final String COMPRESSED_METADATA = "H4sIAAAAAAAAAMVaDYwcVR1/t7f3fW2PaylShS6mFFrLbq+9lsJhy/Z2e6zs0eP2esHjw8zNvNsbmZ0Z3ry92yVS1ERiwA8aFCFVVKIEI42mRgIYI6ggmjQmfAUTglHRhAgGAyGKJvp/b753ZvZmrhUbcuzMzvt//N7v/b9mH3kTdRkE7dNINSvogriIs5oiq1UtKyoyVmlW1AjOYqmWbdSU7NJo9rrJ8iSmgiRQoVTTlco3v7/r+D/OqacQahB0WTwx+XmDEkGkHlmPfWff7JrfnPxuCnWUURoebFD0kTKIy5nicqa4nCkObso5eCgH0nJFeHgMlO9JphyWlSiudV73hzfu3//CW8wBHZAYiY0E08sgePh7Gwrfvv4eiZveT/ACJlgVsUHRUPmTwpKQq1NZyZVlgzIrdyW2sjG+Dt02c8mml1MoVUaDDK0KJksyV7E7HkYFz6KxMupZwsSQNZWiYdNERVCruQolsH6scQs6ijqN2LsJUHjFM0gu/9gd194g7niBQ9JjgICaYDCx3YDA5ckQ8Mr++ZufvfTEqfwxjsSwB4lZ0x+moq+Mzq4JjUL4l6ZzOtvp9czzLNucbJ4Qocl2qPGZ5867/1fCNzpRRwmlDflW3NARQh3LafYXFu2OjUmFe83Q2PS5u15MP/qLm1NoANAAl8AYEw3YTkFVNQq2zitsO9d5GDMp6LBVQ9YDsGaCaHXdXjjg3ndkiRpow42Zpo7te+vANJk2x2GvBVnFhKLL4jFmaTRX9C8FYwZMaV4FfVit13w3Fuqqz8UuiknNsYfCowW8IKuy+wyQYjQZKUxwH/rJvb9+6lPp2zkdugRFNkkGDOhThRo2QBz27jpFfYcZLwq4pvEn18KupvjephLtbZ47yPa29LvX77vp6ZGHU6hrDnXNa3VVKqM1JkwVTKcEumiZlGYmWZ/7dYHA FQBj4wJxg9aJyoCkaDT2Fk07q1hsuSK+AxaOeZd9u187fsQYe+JafmYD7LKCgg0a4qChRgdg2luQDREcpyGQ7o1t0ZSNCEN1/lRja26uluEbG8L0tEFkiaIdYThptRo86ABVxVquMl0qMHwuTUYyx6S/jx28L5+q/DKFuudQr1pXFAYYsAziTBmrVbpI0XpPIC2pFFf5gfFuep9OsCjbkegCYKwhCgq2LtLsYHjIypDt0Ykm1UWqw+ezHOZmp8y7gc0wY8P5CJ4elqw9mcJEBAeFKmZC+iCdZMG63buCixtGbIBgu1zisf2a/dOrj2eLNzwTDZDl5QoYsG1lnzcH8UC6zjzoZx4UtDoLl+z+OQFHmPtDJVUkWDBwRVAEImPDecqO5A5S/Xp8hHQLYnY3ze+mE9VOeZfIDLUTxc+/cXLXay9HnLjE5ZRH/Pa7/mL88Mk/l/gB6rulDrFxQcbEYmI3FUgVU39oPNslGPtjp9xW4JKQxDWIuXv1S3f/dudPX78lhTrLaIPrbrEBpDDMcqQUO/K563P5EFFjIW6nWSJynT43sMPg3Exs51wDspAiDSqoNMwQ5vnkP++euf3KsYv5bnBiUzS7Gk/bKdrCswCcqCVBqVsnh6Cp1fgTJJSr5ulLJr5EssX/sHqZU+doO9DAlVVgxl1B1r9h3lms5cUai67ZIhQc3i+Bu91m6UrRzplF2cjAf0LGEFgxlOGszhgmmzPLMl3MLGmiMF83AwMszhwG6/ljWchkuiI0s7MjcAYMkcg6M6zBibK3fRD2BpaxILPYjQPsT5Gi7XlFydjrM+CXzMNlRlYzdBFnNBUgxBmDwgYlM29jwLzcNawOWoWNg5aADBMQbYX5kT3jWrE5NJDkKnVdB1IQNxb3c8X9ccxZNymLRDO0BZoZ14ieBTVbXYumIB3IoskrsIpfGouYOM6vID09WTk0AyK3rCyyJMURuLOkLgH9NdLckbH93pHJS9B2URm4aMBtS Hvwv0OyKkCzCMoviFR+NW4ua0Qy4mg+e5FS/fJcbnl5OauxBinLwgyIvyhSfJ7C4Zmvs8sjRImjZD0jMJGri0BfOLKwwVgCFbk4KjzEPS1/tkcqK2hivcYyuuVR5jRciibZDGtqDi8cMXBM0CI92RbNOiIvCWJzCmKq2Iyppnc0tyu3a+fIbpB8YaTksmDQSU1i2TEWoSON/3CkilINSioGf6MRLttfVcSvosbdLpcl131fufTA5hsfepvXnsOCPTdxGlUoSDUd81I1tJfonYc6ccYuNqEyUYUlucofgRiosxPr9Lb9uv9O8hrNY/y6Z2979MY3P3SxOfJyGgUzq0Lxn5cklg8Riij0QwHt4jfYSC/mOIy1XqZTTYbmgaEn9n91wx0PRdakMTs6p4eyZP+18s6FI3c/9uUU6vN0CHOop67KoiZhNtjCC0JdobNO+RLSPyTop9r0Eh0dulU0YEzdtsIsIsKx/Zq5Jj0OrEq0oqsCAOJES3rmZH0cMEm2aJy1e2Rl4xqszI0/KWgZAjGOXLP11cFN7527PoW6ymiNYM9CNELbDKf6nZmIMwqyB0X+tf0GmKNg6uHcRxPOTP0mv3Xn1j1vjTx/JIXSc2ijxbKWZyByKMKtzbImSCC+qDJyShAbPoEbFKuSPVZqPaWIdZAD7dul+FPUvAcNhvO2K5459dSJ6iu8Yeo2cba576AZblmwt6Fok1uXtbbHYS1zm6jdw2/0JJrvFG2DmWcn33jwvutLzw+CZ3PoA7IqKnUJl1QLRDuBh/JoUyA8Nw/KqmQzvTv5mMexbHnzD46fLL1wiLdp/e6oM2Lzw9oByL92Yd8RjZ87OzgUG79rotxmeD4wdM8N5xe++I7ZYOru0DHY6bNK0LH6EBZonWDJ7hacCpXBT9Fa37VZfz4J0WUcIlpVYyTxXdjf99olL0V9/qofvlxj6SpgOHkK6PBdW6x7nKJzAthGrGiDs7ffAdU9wU1y1A276iyHmj 7f4mtxZK+gJgykM6RlyIMdSGWDlR7zQwINg+YKG/U13ktX1cZWVeHPx1fb3WpxGCPa8zS+snUtB8ALZpv4F7hhd7JJhmNuhcpO8LMnFi666djOf/FYHxL2ElalMavpfKBaHvrx+pcrf3z3bf4+I7Sa7lsUDFY5CTVfZd1aRnfejOEE7YmecjFD3He4XAE0ugwL8w3kMffAArZ6/PczPlk9+/aNHXsw+zyvZwctoJrTeCH0tYabtWNWz1OuQKZtw+8f+PdzJ156N/hCqjV5QMZNlQptKNXJb7DXsAdOI0cwo/YfLVa/declj7QO58N6IXZgofbC0MzHm08ethawl8q6QKjqTFs3Wm/CqSwofNhHoNJyqjxPSU7QlcnYGnRz9v6nfvSFD2b2A+5zaK1oVnXGDM99IVXbCpFd94SBkDrq/HFNUTCvxi4OZo1tbEXHGuRJg4k1hGQJR6o/f4aKto9NiOSorBqs7XhrgXhrAUTVV3g34uuR+MgwSe8y4BkKxVxoWjYwDeSDuFOwW6xh/noIrmbkGj68sGDgIApezUP83SVwVK1jaRVSTDO6p4GNatUH0sjetku6pghUuqGvtHzNGt93FMxU8GVY/dlmMuBJfSaRfEkzlEitStsTyicvPLJ1BAjMQzv7pivU0F6GqLWgbbhs9c4+A6F++U0I8SoIrKvJfrnt2UzXwiTnpMdSv3LHbkPXawcZ8HQl1Npnl1a42nQterDG94N1Xmg8tARuawvc/ySyuHDZwTMGyc4kXL3eoL1KsOw53vsZhu2Jo97yewPrdtu1vWXNHP3yn1ZtD0no5u8ynDeCVQzJbbpUoD975bZ7K4/UeeHbJ0HAVc1XwVfE/HHHBNYM6HihythSsFf7XoNeAHXNkkBkVvX4f6dxUNMgfahjDf1o+M/SQmwOU4esf8PWO9ECbNJE8fDEdH7qqo8zPM5y315aOk9lyKdf/Pp7f4O6dM6ytaF3WKkHdFSJoC82pzRZbZ9 6BqC0EuuE/eKwuRI7nINh9Vhn/Fj4WsbQo2FpDjkYEY3k/zN8jNcNqtV4+Ajpqduk2rZtp2X74AzU3kqxAQ2UYRo1wOsALMo1IZiTXKuKUNJrTYxP3yq7xfBY1W9Lb0F272hbFvZeJZPVFGFW+cRHjt7JNZ8AR2Pg41kMFveazyfissXUUBb79IdwObArrppu/lC3DzzbunhcNhd15qsm2L3s+YNNGoTLB/EEViVMXJ5ZYajteemaWtTU9yOFIEcd1XzqsFCLZoG/gEUdZziYtRa/4ZWkf/IUpMK5kcPWtufQjmx8dyfqsnTGUj2y9kkmic5ronFY5A0ApHM0uzNw/78+E7hjhjAAAA=="; @@ -36,7 +37,7 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS private static final Map<String, Service<?>> SERVICES = new ConcurrentHashMap<String, Service<?>>(); @SuppressWarnings("unchecked") - private static <C extends CommonEdmEnabledODataClient<?>> Service<C> getInstance( + private static <C extends EdmEnabledODataClient> Service<C> getInstance( final ODataServiceVersion version, final String serviceRoot, final boolean transactional) { if (!SERVICES.containsKey(serviceRoot)) { http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/fit/src/test/java/org/apache/olingo/fit/proxy/v4/opentype/Service.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/opentype/Service.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/opentype/Service.java index 1b1a0ba..6fd3bda 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/opentype/Service.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/opentype/Service.java @@ -21,12 +21,13 @@ package org.apache.olingo.fit.proxy.v4.opentype; import java.util.HashMap; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.apache.olingo.client.api.CommonEdmEnabledODataClient; + +import org.apache.olingo.client.api.EdmEnabledODataClient; import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; -import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.AbstractService; +import org.apache.olingo.ext.proxy.api.AbstractTerm; -public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractService<C> { +public class Service<C extends EdmEnabledODataClient> extends AbstractService<C> { // CHECKSTYLE:OFF (Maven checkstyle) private static final String COMPRESSED_METADATA = @@ -37,7 +38,7 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS private static final Map<String, Service<?>> SERVICES = new ConcurrentHashMap<String, Service<?>>(); @SuppressWarnings("unchecked") - private static <C extends CommonEdmEnabledODataClient<?>> Service<C> getInstance( + private static <C extends EdmEnabledODataClient> Service<C> getInstance( final ODataServiceVersion version, final String serviceRoot, final boolean transactional) { if (!SERVICES.containsKey(serviceRoot)) { @@ -55,7 +56,7 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS * @param serviceRoot OData service root * @return OData 4.0 instance for given service root, operating in transactions (with batch requests) */ - public static Service<org.apache.olingo.client.api.EdmEnabledODataClient> getV4( + public static Service<EdmEnabledODataClient> getV4( final String serviceRoot) { return getV4(serviceRoot, true); @@ -68,7 +69,7 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS * @param transactional whether operating in transactions (with batch requests) or not * @return OData 4.0 instance for given service root */ - public static Service<org.apache.olingo.client.api.EdmEnabledODataClient> getV4( + public static Service<EdmEnabledODataClient> getV4( final String serviceRoot, final boolean transactional) { return getInstance(ODataServiceVersion.V40, serviceRoot, transactional); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/Service.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/Service.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/Service.java index 1fbc53f..ecea080 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/Service.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/Service.java @@ -21,12 +21,13 @@ package org.apache.olingo.fit.proxy.v4.staticservice; import java.util.HashMap; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.apache.olingo.client.api.CommonEdmEnabledODataClient; + +import org.apache.olingo.client.api.EdmEnabledODataClient; import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; -import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.AbstractService; +import org.apache.olingo.ext.proxy.api.AbstractTerm; -public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractService<C> { +public class Service<C extends EdmEnabledODataClient> extends AbstractService<C> { // CHECKSTYLE:OFF (Maven checkstyle) private static final String COMPRESSED_METADATA = @@ -37,7 +38,7 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS private static final Map<String, Service<?>> SERVICES = new ConcurrentHashMap<String, Service<?>>(); @SuppressWarnings("unchecked") - private static <C extends CommonEdmEnabledODataClient<?>> Service<C> getInstance( + private static <C extends EdmEnabledODataClient> Service<C> getInstance( final ODataServiceVersion version, final String serviceRoot, final boolean transactional) { if (!SERVICES.containsKey(serviceRoot)) { @@ -55,7 +56,7 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS * @param serviceRoot OData service root * @return OData 4.0 instance for given service root, operating in transactions (with batch requests) */ - public static Service<org.apache.olingo.client.api.EdmEnabledODataClient> getV4( + public static Service<EdmEnabledODataClient> getV4( final String serviceRoot) { return getV4(serviceRoot, true); @@ -68,7 +69,7 @@ public class Service<C extends CommonEdmEnabledODataClient<?>> extends AbstractS * @param transactional whether operating in transactions (with batch requests) or not * @return OData 4.0 instance for given service root */ - public static Service<org.apache.olingo.client.api.EdmEnabledODataClient> getV4( + public static Service<EdmEnabledODataClient> getV4( final String serviceRoot, final boolean transactional) { return getInstance(ODataServiceVersion.V40, serviceRoot, transactional); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicHttpExceptionHandling.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicHttpExceptionHandling.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicHttpExceptionHandling.java index df208c5..8248ee5 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicHttpExceptionHandling.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicHttpExceptionHandling.java @@ -23,7 +23,7 @@ import static org.junit.Assert.assertEquals; import java.net.HttpURLConnection; import java.net.URL; -import org.apache.olingo.client.api.CommonODataClient; +import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.commons.api.http.HttpHeader; import org.apache.olingo.fit.AbstractBaseTestITCase; import org.apache.olingo.fit.tecsvc.TecSvcConst; @@ -49,7 +49,7 @@ public class BasicHttpExceptionHandling extends AbstractBaseTestITCase { } @Override - protected CommonODataClient<?> getClient() { + protected ODataClient getClient() { return null; } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ExpandSelectITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ExpandSelectITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ExpandSelectITCase.java index a4773ee..4265c40 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ExpandSelectITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/ExpandSelectITCase.java @@ -24,7 +24,7 @@ import static org.junit.Assert.assertNull; import java.util.List; -import org.apache.olingo.client.api.CommonODataClient; +import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; import org.apache.olingo.client.core.ODataClientFactory; @@ -43,7 +43,7 @@ public final class ExpandSelectITCase extends AbstractBaseTestITCase { @Test public void readSelect() { - final CommonODataClient<?> client = getClient(); + final ODataClient client = getClient(); final ODataEntityRequest<ODataEntity> request = client.getRetrieveRequestFactory() .getEntityRequest(client.newURIBuilder(TecSvcConst.BASE_URI) .appendEntitySetSegment("ESAllPrim").appendKeySegment(Short.MAX_VALUE) @@ -74,7 +74,7 @@ public final class ExpandSelectITCase extends AbstractBaseTestITCase { @Test public void readExpandSelect() { - final CommonODataClient<?> client = getClient(); + final ODataClient client = getClient(); final ODataEntityRequest<ODataEntity> request = client.getRetrieveRequestFactory() .getEntityRequest(client.newURIBuilder(TecSvcConst.BASE_URI) .appendEntitySetSegment("ESTwoPrim").appendKeySegment(-365) @@ -115,7 +115,7 @@ public final class ExpandSelectITCase extends AbstractBaseTestITCase { @Test public void readExpandTwoLevels() { - final CommonODataClient<?> client = getClient(); + final ODataClient client = getClient(); final ODataEntityRequest<ODataEntity> request = client.getRetrieveRequestFactory() .getEntityRequest(client.newURIBuilder(TecSvcConst.BASE_URI) .appendEntitySetSegment("ESTwoPrim").appendKeySegment(32767) @@ -150,7 +150,7 @@ public final class ExpandSelectITCase extends AbstractBaseTestITCase { } @Override - protected CommonODataClient<?> getClient() { + protected ODataClient getClient() { return ODataClientFactory.getEdmEnabledV4(TecSvcConst.BASE_URI); } } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/MediaITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/MediaITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/MediaITCase.java index f4c9e93..e931203 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/MediaITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/MediaITCase.java @@ -28,7 +28,6 @@ import java.io.InputStream; import java.net.URI; import org.apache.commons.io.IOUtils; -import org.apache.olingo.client.api.CommonODataClient; import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.api.communication.ODataClientErrorException; import org.apache.olingo.client.api.communication.request.cud.ODataDeleteRequest; @@ -54,7 +53,7 @@ public final class MediaITCase extends AbstractBaseTestITCase { @Test public void read() throws Exception { - final CommonODataClient<?> client = getClient(); + final ODataClient client = getClient(); final ODataMediaRequest request = client.getRetrieveRequestFactory().getMediaRequest( client.newURIBuilder(TecSvcConst.BASE_URI) .appendEntitySetSegment("ESMedia").appendKeySegment(1).appendValueSegment().build()); @@ -71,7 +70,7 @@ public final class MediaITCase extends AbstractBaseTestITCase { @Test public void delete() { - final CommonODataClient<?> client = getClient(); + final ODataClient client = getClient(); final URI uri = client.newURIBuilder(TecSvcConst.BASE_URI) .appendEntitySetSegment("ESMedia").appendKeySegment(4).appendValueSegment().build(); final ODataDeleteRequest request = client.getCUDRequestFactory().getDeleteRequest(uri); @@ -94,7 +93,7 @@ public final class MediaITCase extends AbstractBaseTestITCase { @Test public void update() throws Exception { - final CommonODataClient<?> client = getClient(); + final ODataClient client = getClient(); final URI uri = client.newURIBuilder(TecSvcConst.BASE_URI) .appendEntitySetSegment("ESMedia").appendKeySegment(4).appendValueSegment().build(); ODataMediaEntityUpdateRequest<ODataEntity> request = @@ -118,7 +117,7 @@ public final class MediaITCase extends AbstractBaseTestITCase { @Test public void create() throws Exception { - final CommonODataClient<?> client = getClient(); + final ODataClient client = getClient(); ODataMediaEntityCreateRequest<ODataEntity> request = client.getCUDRequestFactory().getMediaEntityCreateRequest( client.newURIBuilder(TecSvcConst.BASE_URI).appendEntitySetSegment("ESMedia").build(), @@ -149,7 +148,7 @@ public final class MediaITCase extends AbstractBaseTestITCase { } @Override - protected CommonODataClient<?> getClient() { + protected ODataClient getClient() { ODataClient odata = ODataClientFactory.getV4(); odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON); return odata; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/NavigationITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/NavigationITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/NavigationITCase.java index 4c6b848..79abd09 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/NavigationITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/NavigationITCase.java @@ -21,7 +21,6 @@ package org.apache.olingo.fit.tecsvc.client; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -import org.apache.olingo.client.api.CommonODataClient; import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; import org.apache.olingo.client.core.ODataClientFactory; @@ -36,7 +35,7 @@ import org.junit.Test; public final class NavigationITCase extends AbstractBaseTestITCase { - private final CommonODataClient<?> client = getClient(); + private final ODataClient client = getClient(); @Test public void oneLevelToEntity() throws Exception { @@ -134,7 +133,7 @@ public final class NavigationITCase extends AbstractBaseTestITCase { } @Override - protected CommonODataClient<?> getClient() { + protected ODataClient getClient() { ODataClient odata = ODataClientFactory.getV4(); odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON); return odata; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/PrimitiveComplexITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/PrimitiveComplexITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/PrimitiveComplexITCase.java index 49396cb..2155c08 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/PrimitiveComplexITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/PrimitiveComplexITCase.java @@ -28,7 +28,6 @@ import static org.junit.Assert.fail; import java.net.URI; import org.apache.commons.io.IOUtils; -import org.apache.olingo.client.api.CommonODataClient; import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.api.communication.ODataClientErrorException; import org.apache.olingo.client.api.communication.request.cud.ODataDeleteRequest; @@ -226,7 +225,7 @@ public class PrimitiveComplexITCase extends AbstractBaseTestITCase { } @Override - protected CommonODataClient<?> getClient() { + protected ODataClient getClient() { ODataClient odata = ODataClientFactory.getV4(); odata.getConfiguration().setDefaultPubFormat(ODataFormat.JSON); return odata; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java index a49562e..f319c50 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/SystemQueryOptionITCase.java @@ -23,7 +23,6 @@ import static org.junit.Assert.fail; import java.net.URI; -import org.apache.olingo.client.api.CommonODataClient; import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.api.communication.ODataClientErrorException; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; @@ -45,7 +44,7 @@ public class SystemQueryOptionITCase extends AbstractBaseTestITCase { @Test public void testCountSimple() { - CommonODataClient<?> client = getClient(); + ODataClient client = getClient(); URI uri = client.newURIBuilder(SERVICE_URI) .appendEntitySetSegment(ES_ALL_PRIM) .addQueryOption(QueryOption.COUNT, "true") @@ -61,7 +60,7 @@ public class SystemQueryOptionITCase extends AbstractBaseTestITCase { @Test public void testServerSidePagingCount() { - CommonODataClient<?> client = getClient(); + ODataClient client = getClient(); URI uri = client.newURIBuilder(SERVICE_URI) .appendEntitySetSegment(ES_SERVER_SIDE_PAGING) .addQueryOption(QueryOption.COUNT, "true") @@ -77,7 +76,7 @@ public class SystemQueryOptionITCase extends AbstractBaseTestITCase { @Test public void testTopSimple() { - CommonODataClient<?> client = getClient(); + ODataClient client = getClient(); URI uri = client.newURIBuilder(SERVICE_URI) .appendEntitySetSegment(ES_SERVER_SIDE_PAGING) .addQueryOption(QueryOption.TOP, new Integer(5).toString()) @@ -97,7 +96,7 @@ public class SystemQueryOptionITCase extends AbstractBaseTestITCase { @Test public void testSkipSimple() { - CommonODataClient<?> client = getClient(); + ODataClient client = getClient(); URI uri = client.newURIBuilder(SERVICE_URI) .appendEntitySetSegment(ES_SERVER_SIDE_PAGING) .addQueryOption(QueryOption.SKIP, new Integer(5).toString()) @@ -117,7 +116,7 @@ public class SystemQueryOptionITCase extends AbstractBaseTestITCase { @Test public void testTopNothing() { - CommonODataClient<?> client = getClient(); + ODataClient client = getClient(); URI uri = client.newURIBuilder(SERVICE_URI) .appendEntitySetSegment(ES_SERVER_SIDE_PAGING) .addQueryOption(QueryOption.TOP, new Integer(20).toString()) @@ -133,7 +132,7 @@ public class SystemQueryOptionITCase extends AbstractBaseTestITCase { @Test public void testSkipNothing() { - CommonODataClient<?> client = getClient(); + ODataClient client = getClient(); URI uri = client.newURIBuilder(SERVICE_URI) .appendEntitySetSegment(ES_SERVER_SIDE_PAGING) .addQueryOption(QueryOption.SKIP, new Integer(10000).toString()) @@ -148,7 +147,7 @@ public class SystemQueryOptionITCase extends AbstractBaseTestITCase { @Test public void testFilterWithTopSkipOrderByAndServerSidePaging() { - CommonODataClient<?> client = getClient(); + ODataClient client = getClient(); URI uri = client.newURIBuilder(SERVICE_URI) .appendEntitySetSegment(ES_SERVER_SIDE_PAGING) .filter("PropertyInt16 le 105") // 1, 2, ... , 105 @@ -202,7 +201,7 @@ public class SystemQueryOptionITCase extends AbstractBaseTestITCase { @Test public void testNextLinkFormat() { - CommonODataClient<?> client = getClient(); + ODataClient client = getClient(); URI uri = client.newURIBuilder(SERVICE_URI) .appendEntitySetSegment(ES_SERVER_SIDE_PAGING) .build(); @@ -228,7 +227,7 @@ public class SystemQueryOptionITCase extends AbstractBaseTestITCase { @Test public void testNextLinkFormatWithQueryOptions() { - CommonODataClient<?> client = getClient(); + ODataClient client = getClient(); URI uri = client.newURIBuilder(SERVICE_URI) .appendEntitySetSegment(ES_SERVER_SIDE_PAGING) .addQueryOption(QueryOption.COUNT, Boolean.TRUE.toString()) @@ -266,7 +265,7 @@ public class SystemQueryOptionITCase extends AbstractBaseTestITCase { @Test @SuppressWarnings("unused") public void testNegativeSkip() { - CommonODataClient<?> client = getClient(); + ODataClient client = getClient(); URI uri = client.newURIBuilder(SERVICE_URI) .appendEntitySetSegment(ES_ALL_PRIM) .addQueryOption(QueryOption.SKIP, new Integer(-5).toString()) @@ -285,7 +284,7 @@ public class SystemQueryOptionITCase extends AbstractBaseTestITCase { @Test @SuppressWarnings("unused") public void testNegativeTop() { - CommonODataClient<?> client = getClient(); + ODataClient client = getClient(); URI uri = client.newURIBuilder(SERVICE_URI) .appendEntitySetSegment(ES_ALL_PRIM) .addQueryOption(QueryOption.TOP, new Integer(-5).toString()) http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicBatchITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicBatchITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicBatchITCase.java index 4663c69..1c1b869 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicBatchITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicBatchITCase.java @@ -18,7 +18,8 @@ */ package org.apache.olingo.fit.tecsvc.http; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import java.io.BufferedReader; import java.io.IOException; @@ -29,7 +30,7 @@ import java.net.MalformedURLException; import java.net.ProtocolException; import java.net.URL; -import org.apache.olingo.client.api.CommonODataClient; +import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.commons.api.http.HttpHeader; import org.apache.olingo.commons.api.http.HttpMethod; import org.apache.olingo.commons.api.http.HttpStatusCode; @@ -154,7 +155,7 @@ public class BasicBatchITCase extends AbstractBaseTestITCase { } @Override - protected CommonODataClient<?> getClient() { + protected ODataClient getClient() { // TODO Auto-generated method stub return null; } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicHttpITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicHttpITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicHttpITCase.java index ba008d6..3084b64 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicHttpITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/BasicHttpITCase.java @@ -23,7 +23,7 @@ import static org.junit.Assert.assertEquals; import java.net.HttpURLConnection; import java.net.URL; -import org.apache.olingo.client.api.CommonODataClient; +import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.commons.api.http.HttpHeader; import org.apache.olingo.fit.AbstractBaseTestITCase; @@ -118,7 +118,7 @@ public class BasicHttpITCase extends AbstractBaseTestITCase{ } @Override - protected CommonODataClient<?> getClient() { + protected ODataClient getClient() { return null; } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/PingITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/PingITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/PingITCase.java index a8251ef..5146db9 100644 --- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/PingITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/http/PingITCase.java @@ -18,7 +18,12 @@ */ package org.apache.olingo.fit.tecsvc.http; -import org.apache.olingo.client.api.CommonODataClient; +import static org.junit.Assert.assertEquals; + +import java.net.HttpURLConnection; +import java.net.URL; + +import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.commons.api.http.HttpHeader; import org.apache.olingo.fit.AbstractBaseTestITCase; import org.apache.olingo.fit.tecsvc.TecSvcConst; @@ -26,11 +31,6 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.net.HttpURLConnection; -import java.net.URL; - -import static org.junit.Assert.assertEquals; - public class PingITCase extends AbstractBaseTestITCase{ private static final Logger LOG = LoggerFactory.getLogger(PingITCase.class); @@ -70,7 +70,7 @@ public class PingITCase extends AbstractBaseTestITCase{ } @Override - protected CommonODataClient<?> getClient() { + protected ODataClient getClient() { return null; } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/lib/client-api/src/main/java/org/apache/olingo/client/api/CommonEdmEnabledODataClient.java ---------------------------------------------------------------------- diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/CommonEdmEnabledODataClient.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/CommonEdmEnabledODataClient.java deleted file mode 100644 index 7a16e97..0000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/CommonEdmEnabledODataClient.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api; - -import org.apache.olingo.client.api.communication.request.cud.CommonUpdateType; -import org.apache.olingo.client.api.communication.request.invoke.EdmEnabledInvokeRequestFactory; -import org.apache.olingo.client.api.uri.URIBuilder; -import org.apache.olingo.commons.api.edm.Edm; - -/** - * Client interface that caches the Edm metadata information for a given service root. - * <br/> - * Be aware that any request generated via this client instance will be performed against the given service root. - * - * @param <UT> concrete update type, depending on the protocol version - */ -public interface CommonEdmEnabledODataClient<UT extends CommonUpdateType> extends CommonODataClient<UT> { - - String getServiceRoot(); - - /** - * Checks if the cached Edm matadata information matches the argument and, if not, updates the cache against the - * configured service root. - * - * @param metadataETag metadata ETag to be compared against the cache - * @return Edm - */ - Edm getEdm(String metadataETag); - - /** - * Return the cached Edm matadata information. - * - * @return Edm - */ - Edm getCachedEdm(); - - URIBuilder newURIBuilder(); - - @Override - EdmEnabledInvokeRequestFactory getInvokeRequestFactory(); -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/lib/client-api/src/main/java/org/apache/olingo/client/api/CommonODataClient.java ---------------------------------------------------------------------- diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/CommonODataClient.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/CommonODataClient.java deleted file mode 100644 index 05b3f7a..0000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/CommonODataClient.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api; - -import org.apache.olingo.client.api.communication.header.ODataHeaders; -import org.apache.olingo.client.api.communication.header.ODataPreferences; -import org.apache.olingo.client.api.communication.request.batch.CommonBatchRequestFactory; -import org.apache.olingo.client.api.communication.request.cud.CommonCUDRequestFactory; -import org.apache.olingo.client.api.communication.request.cud.CommonUpdateType; -import org.apache.olingo.client.api.communication.request.invoke.InvokeRequestFactory; -import org.apache.olingo.client.api.communication.request.retrieve.RetrieveRequestFactory; -import org.apache.olingo.client.api.serialization.ClientODataDeserializer; -import org.apache.olingo.client.api.serialization.ODataBinder; -import org.apache.olingo.client.api.serialization.ODataReader; -import org.apache.olingo.client.api.serialization.ODataWriter; -import org.apache.olingo.client.api.uri.FilterFactory; -import org.apache.olingo.client.api.uri.URIBuilder; -import org.apache.olingo.commons.api.domain.ODataObjectFactory; -import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; -import org.apache.olingo.commons.api.format.ODataFormat; -import org.apache.olingo.commons.api.serialization.ODataSerializer; - -/** - * Generic client interface (common to all supported OData protocol versions). - * - * @param <UT> concrete update type, depending on the protocol version - */ -public interface CommonODataClient<UT extends CommonUpdateType> { - - ODataServiceVersion getServiceVersion(); - - ODataHeaders newVersionHeaders(); - - Configuration getConfiguration(); - - ODataPreferences newPreferences(); - - URIBuilder newURIBuilder(String serviceRoot); - - FilterFactory getFilterFactory(); - - ODataSerializer getSerializer(ODataFormat format); - - ClientODataDeserializer getDeserializer(ODataFormat format); - - ODataReader getReader(); - - ODataWriter getWriter(); - - ODataBinder getBinder(); - - ODataObjectFactory getObjectFactory(); - - RetrieveRequestFactory getRetrieveRequestFactory(); - - CommonCUDRequestFactory<UT> getCUDRequestFactory(); - - InvokeRequestFactory getInvokeRequestFactory(); - - CommonBatchRequestFactory getBatchRequestFactory(); -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/lib/client-api/src/main/java/org/apache/olingo/client/api/EdmEnabledODataClient.java ---------------------------------------------------------------------- diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/EdmEnabledODataClient.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/EdmEnabledODataClient.java index 0a5b1fb..cce6b6c 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/EdmEnabledODataClient.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/EdmEnabledODataClient.java @@ -18,15 +18,31 @@ */ package org.apache.olingo.client.api; -import org.apache.olingo.client.api.communication.request.cud.UpdateType; import org.apache.olingo.client.api.communication.request.invoke.EdmEnabledInvokeRequestFactory; import org.apache.olingo.client.api.uri.URIBuilder; +import org.apache.olingo.commons.api.edm.Edm; -public interface EdmEnabledODataClient extends CommonEdmEnabledODataClient<UpdateType>, ODataClient { +public interface EdmEnabledODataClient extends ODataClient { - @Override + String getServiceRoot(); + + /** + * Checks if the cached Edm matadata information matches the argument and, if not, updates the cache against the + * configured service root. + * + * @param metadataETag metadata ETag to be compared against the cache + * @return Edm + */ + Edm getEdm(String metadataETag); + + /** + * Return the cached Edm matadata information. + * + * @return Edm + */ + Edm getCachedEdm(); + URIBuilder newURIBuilder(); - @Override EdmEnabledInvokeRequestFactory getInvokeRequestFactory(); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClient.java ---------------------------------------------------------------------- diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClient.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClient.java index b67d64f..24b5119 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClient.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClient.java @@ -1,67 +1,77 @@ /* * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * 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 - * + * 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 + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.olingo.client.api; +import org.apache.olingo.client.api.communication.header.ODataHeaders; +import org.apache.olingo.client.api.communication.header.ODataPreferences; import org.apache.olingo.client.api.communication.request.AsyncRequestFactory; import org.apache.olingo.client.api.communication.request.batch.BatchRequestFactory; import org.apache.olingo.client.api.communication.request.cud.CUDRequestFactory; -import org.apache.olingo.client.api.communication.request.cud.UpdateType; +import org.apache.olingo.client.api.communication.request.invoke.InvokeRequestFactory; import org.apache.olingo.client.api.communication.request.retrieve.RetrieveRequestFactory; import org.apache.olingo.client.api.serialization.ClientODataDeserializer; import org.apache.olingo.client.api.serialization.ODataBinder; import org.apache.olingo.client.api.serialization.ODataReader; +import org.apache.olingo.client.api.serialization.ODataWriter; import org.apache.olingo.client.api.uri.FilterFactory; import org.apache.olingo.client.api.uri.SearchFactory; import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.commons.api.domain.ODataObjectFactory; +import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; import org.apache.olingo.commons.api.format.ODataFormat; +import org.apache.olingo.commons.api.serialization.ODataSerializer; -public interface ODataClient extends CommonODataClient<UpdateType> { +public interface ODataClient { + + ODataServiceVersion getServiceVersion(); + + ODataHeaders newVersionHeaders(); + + Configuration getConfiguration(); + + ODataPreferences newPreferences(); + + ODataSerializer getSerializer(ODataFormat format); + + ODataWriter getWriter(); + + InvokeRequestFactory getInvokeRequestFactory(); - @Override ClientODataDeserializer getDeserializer(ODataFormat format); - @Override ODataReader getReader(); - @Override ODataBinder getBinder(); - @Override URIBuilder newURIBuilder(String serviceRoot); - - @Override + FilterFactory getFilterFactory(); SearchFactory getSearchFactory(); - @Override ODataObjectFactory getObjectFactory(); AsyncRequestFactory getAsyncRequestFactory(); - @Override RetrieveRequestFactory getRetrieveRequestFactory(); - @Override CUDRequestFactory getCUDRequestFactory(); - @Override BatchRequestFactory getBatchRequestFactory(); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/ODataBatchableRequest.java ---------------------------------------------------------------------- diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/ODataBatchableRequest.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/ODataBatchableRequest.java index 87a91ff..0d62837 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/ODataBatchableRequest.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/ODataBatchableRequest.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.client.api.communication.request; -import org.apache.olingo.client.api.communication.request.batch.CommonODataBatchRequest; +import org.apache.olingo.client.api.communication.request.batch.ODataBatchRequest; /** * Object request that can be sent embedded into a batch request. @@ -32,7 +32,7 @@ public interface ODataBatchableRequest extends ODataRequest { * * @param req destination batch request. */ - void batch(final CommonODataBatchRequest req); + void batch(final ODataBatchRequest req); /** * Writes (and consume) the request onto the given batch stream. @@ -42,5 +42,5 @@ public interface ODataBatchableRequest extends ODataRequest { * @param req destination batch request. * @param contentId ContentId header value to be added to the serialization. Use this in case of changeset items. */ - void batch(final CommonODataBatchRequest req, final String contentId); + void batch(final ODataBatchRequest req, final String contentId); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/batch/BatchRequestFactory.java ---------------------------------------------------------------------- diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/batch/BatchRequestFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/batch/BatchRequestFactory.java index 48a08fc..5d8b230 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/batch/BatchRequestFactory.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/batch/BatchRequestFactory.java @@ -19,11 +19,13 @@ package org.apache.olingo.client.api.communication.request.batch; -public interface BatchRequestFactory extends CommonBatchRequestFactory { +public interface BatchRequestFactory { /** - * {@inheritDoc } + * Gets a batch request object instance. + * + * @param serviceRoot service root. + * @return new ODataBatchRequest instance. */ - @Override ODataBatchRequest getBatchRequest(String serviceRoot); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/batch/CommonBatchRequestFactory.java ---------------------------------------------------------------------- diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/batch/CommonBatchRequestFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/batch/CommonBatchRequestFactory.java deleted file mode 100644 index 27b723a..0000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/batch/CommonBatchRequestFactory.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.communication.request.batch; - -/** - * OData batch request factory class. - */ -public interface CommonBatchRequestFactory { - - /** - * Gets a batch request object instance. - * - * @param serviceRoot service root. - * @return new ODataBatchRequest instance. - */ - CommonODataBatchRequest getBatchRequest(String serviceRoot); -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/batch/CommonODataBatchRequest.java ---------------------------------------------------------------------- diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/batch/CommonODataBatchRequest.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/batch/CommonODataBatchRequest.java deleted file mode 100644 index 466b269..0000000 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/batch/CommonODataBatchRequest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.api.communication.request.batch; - -import java.io.IOException; -import java.io.PipedOutputStream; - -/** - * This class implements a batch request. - */ -public interface CommonODataBatchRequest { - - /** - * Gets piped stream to be used to stream batch items. - * - * @return piped stream for the payload. - */ - PipedOutputStream getOutputStream(); - - /** - * Appends the given byte array to the payload. - * - * @param toBeStreamed byte array to be appended. - * @return the current batch request. - * @throws IOException in case of write errors. - */ - CommonODataBatchRequest rawAppend(final byte[] toBeStreamed) throws IOException; - - /** - * Appends the given byte array to the payload. - * - * @param toBeStreamed byte array to be appended. - * @param off byte array offset. - * @param len number of byte to be streamed. - * @return the current batch request. - * @throws IOException in case of write errors. - */ - CommonODataBatchRequest rawAppend(final byte[] toBeStreamed, int off, int len) throws IOException; -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/batch/ODataBatchRequest.java ---------------------------------------------------------------------- diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/batch/ODataBatchRequest.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/batch/ODataBatchRequest.java index 3a07e25..714d4ad 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/batch/ODataBatchRequest.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/batch/ODataBatchRequest.java @@ -1,27 +1,56 @@ /* * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * 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 - * + * 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 + * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.olingo.client.api.communication.request.batch; +import java.io.IOException; +import java.io.PipedOutputStream; + import org.apache.olingo.client.api.communication.request.ODataStreamedRequest; import org.apache.olingo.client.api.communication.response.ODataBatchResponse; -public interface ODataBatchRequest - extends CommonODataBatchRequest, ODataStreamedRequest<ODataBatchResponse, BatchManager> { +public interface ODataBatchRequest extends ODataStreamedRequest<ODataBatchResponse, BatchManager> { + + /** + * Gets piped stream to be used to stream batch items. + * + * @return piped stream for the payload. + */ + PipedOutputStream getOutputStream(); + + /** + * Appends the given byte array to the payload. + * + * @param toBeStreamed byte array to be appended. + * @return the current batch request. + * @throws IOException in case of write errors. + */ + ODataBatchRequest rawAppend(final byte[] toBeStreamed) throws IOException; + + /** + * Appends the given byte array to the payload. + * + * @param toBeStreamed byte array to be appended. + * @param off byte array offset. + * @param len number of byte to be streamed. + * @return the current batch request. + * @throws IOException in case of write errors. + */ + ODataBatchRequest rawAppend(final byte[] toBeStreamed, int off, int len) throws IOException; } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/f38d54dc/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/cud/CUDRequestFactory.java ---------------------------------------------------------------------- diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/cud/CUDRequestFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/cud/CUDRequestFactory.java index 53c67ff..9cc35c5 100644 --- a/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/cud/CUDRequestFactory.java +++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/cud/CUDRequestFactory.java @@ -18,11 +18,145 @@ */ package org.apache.olingo.client.api.communication.request.cud; +import java.io.InputStream; import java.net.URI; +import org.apache.olingo.client.api.communication.request.streamed.ODataMediaEntityCreateRequest; +import org.apache.olingo.client.api.communication.request.streamed.ODataMediaEntityUpdateRequest; +import org.apache.olingo.client.api.communication.request.streamed.ODataStreamUpdateRequest; +import org.apache.olingo.commons.api.domain.ODataEntity; +import org.apache.olingo.commons.api.domain.ODataPrimitiveValue; +import org.apache.olingo.commons.api.domain.ODataProperty; import org.apache.olingo.commons.api.domain.ODataSingleton; -public interface CUDRequestFactory extends CommonCUDRequestFactory<UpdateType> { +public interface CUDRequestFactory { + + /** + * Gets a create request object instance. + * <br/> + * Use this kind of request to create a new entity. + * + * @param <E> concrete ODataEntity implementation + * @param targetURI entity set URI. + * @param entity entity to be created. + * @return new ODataEntityCreateRequest instance. + */ + <E extends ODataEntity> ODataEntityCreateRequest<E> getEntityCreateRequest(URI targetURI, E entity); + + /** + * Gets an update request object instance. + * + * @param <E> concrete ODataEntity implementation + * @param targetURI edit link of the object to be updated. + * @param type type of update to be performed. + * @param changes changes to be applied. + * @return new ODataEntityUpdateRequest instance. + */ + <E extends ODataEntity> ODataEntityUpdateRequest<E> getEntityUpdateRequest(URI targetURI, UpdateType type, E changes); + + /** + * Gets an update request object instance; uses entity's edit link as endpoint. + * + * @param <E> concrete ODataEntity implementation + * @param type type of update to be performed. + * @param entity changes to be applied. + * @return new ODataEntityUpdateRequest instance. + */ + <E extends ODataEntity> ODataEntityUpdateRequest<E> getEntityUpdateRequest(UpdateType type, E entity); + + /** + * Gets a create request object instance. + * <br/> + * Use this kind of request to create a new value (e.g. http://Northwind.svc/Customer(1)/Picture/$value). + * + * @param targetURI entity set or entity or entity property URI. + * @param type type of update to be performed. + * @param value value to be created. + * @return new ODataValueUpdateRequest instance. + */ + ODataValueUpdateRequest getValueUpdateRequest(URI targetURI, UpdateType type, ODataPrimitiveValue value); + + /** + * Gets an update request object instance. + * <br/> + * Use this kind of request to update a primitive property value. + * + * @param targetURI entity set or entity or entity property URI. + * @param property value to be update. + * @return new ODataPropertyUpdateRequest instance. + */ + ODataPropertyUpdateRequest getPropertyPrimitiveValueUpdateRequest(URI targetURI, ODataProperty property); + + /** + * Gets an update request object instance. + * <br/> + * Use this kind of request to update a complex property value. + * + * @param targetURI entity set or entity or entity property URI. + * @param type type of update to be performed. + * @param property value to be update. + * @return new ODataPropertyUpdateRequest instance. + */ + ODataPropertyUpdateRequest + getPropertyComplexValueUpdateRequest(URI targetURI, UpdateType type, ODataProperty property); + + /** + * Gets an update request object instance. + * <br/> + * Use this kind of request to update a collection property value. + * + * @param targetURI entity set or entity or entity property URI. + * @param property value to be update. + * @return new ODataPropertyUpdateRequest instance. + */ + ODataPropertyUpdateRequest getPropertyCollectionValueUpdateRequest(URI targetURI, ODataProperty property); + + /** + * Gets a delete request object instance. + * <br/> + * Use this kind of request to delete an entity and media entity as well. + * + * @param targetURI edit link of the object to be removed. + * @return new ODataDeleteRequest instance. + */ + ODataDeleteRequest getDeleteRequest(URI targetURI); + + /** + * Gets a media entity create request object instance. + * <br/> + * Use this kind of request to create a new media entity. + * + * @param <E> concrete ODataEntity implementation + * @param targetURI entity set URI. + * @param media entity blob to be created. + * @return new ODataMediaEntityCreateRequest instance. + */ + <E extends ODataEntity> ODataMediaEntityCreateRequest<E> getMediaEntityCreateRequest( + URI targetURI, InputStream media); + + /** + * Gets a stream update request object instance. + * <br/> + * Use this kind of request to update a named stream property. + * + * @param targetURI target URI. + * @param stream stream to be updated. + * @return new ODataStreamUpdateRequest instance. + */ + ODataStreamUpdateRequest getStreamUpdateRequest(URI targetURI, InputStream stream); + + /** + * Gets a media entity update request object instance. + * <br/> + * Use this kind of request to update a media entity. + * + * @param <E> concrete ODataEntity implementation + * @param editURI media entity edit link URI. + * @param media entity blob to be updated. + * @return new ODataMediaEntityUpdateRequest instance. + */ + <E extends ODataEntity> ODataMediaEntityUpdateRequest<E> getMediaEntityUpdateRequest( + URI editURI, InputStream media); ODataEntityUpdateRequest<ODataSingleton> getSingletonUpdateRequest( URI targetURI, UpdateType type, ODataSingleton changes);
