[OLINGO-575] Delete abstract client class

This commit is contained in:
Christian Amend 2015-03-02 14:58:56 +01:00
parent 55c7d10737
commit f38d54dcf3
85 changed files with 702 additions and 1019 deletions

View File

@ -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;

View File

@ -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();
}

View File

@ -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());

View File

@ -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 =

View File

@ -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)) {

View File

@ -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)) {

View File

@ -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()

View File

@ -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.");
}
}

View File

@ -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.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> {
import org.apache.olingo.client.api.EdmEnabledODataClient;
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
import org.apache.olingo.ext.proxy.AbstractService;
import org.apache.olingo.ext.proxy.api.AbstractTerm;
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/7dYHAFQBj4wJxg9aJyoCkaDT2Fk07q1hsuSK+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+CXzMNlRlYzdBFnNBUgxBmDwgYlM29jwLzcNawOWoWNg5aADBMQbYX5kT3jWrE5NJDkKnVdB1IQNxb3c8X9ccxZNymLRDO0BZoZ14ieBTVbXYumIB3IoskrsIpfGouYOM6vID09WTk0AyK3rCyyJMURuLOkLgH9NdLckbH93pHJS9B2URm4aMBtSHvwv0OyKkCzCMoviFR+NW4ua0Qy4mg+e5FS/fJcbnl5OauxBinLwgyIvyhSfJ7C4Zmvs8sjRImjZD0jMJGri0BfOLKwwVgCFbk4KjzEPS1/tkcqK2hivcYyuuVR5jRciibZDGtqDi8cMXBM0CI92RbNOiIvCWJzCmKq2Iyppnc0tyu3a+fIbpB8YaTksmDQSU1i2TEWoSON/3CkilINSioGf6MRLttfVcSvosbdLpcl131fufTA5hsfepvXnsOCPTdxGlUoSDUd81I1tJfonYc6ccYuNqEyUYUlucofgRiosxPr9Lb9uv9O8hrNY/y6Z2979MY3P3SxOfJyGgUzq0Lxn5cklg8Riij0QwHt4jfYSC/mOIy1XqZTTYbmgaEn9n91wx0PRdakMTs6p4eyZP+18s6FI3c/9uUU6vN0CHOop67KoiZhNtjCC0JdobNO+RLSPyTop9r0Eh0dulU0YEzdtsIsIsKx/Zq5Jj0OrEq0oqsCAOJES3rmZH0cMEm2aJy1e2Rl4xqszI0/KWgZAjGOXLP11cFN7527PoW6ymiNYM9CNELbDKf6nZmIMwqyB0X+tf0GmKNg6uHcRxPOTP0mv3Xn1j1vjTx/JIXSc2ijxbKWZyByKMKtzbImSCC+qDJyShAbPoEbFKuSPVZqPaWIdZAD7dul+FPUvAcNhvO2K5459dSJ6iu8Yeo2cba576AZblmwt6Fok1uXtbbHYS1zm6jdw2/0JJrvFG2DmWcn33jwvutLzw+CZ3PoA7IqKnUJl1QLRDuBh/JoUyA8Nw/KqmQzvTv5mMexbHnzD46fLL1wiLdp/e6oM2Lzw9oByL92Yd8RjZ87OzgUG79rotxmeD4wdM8N5xe++I7ZYOru0DHY6bNK0LH6EBZonWDJ7hacCpXBT9Fa37VZfz4J0WUcIlpVYyTxXdjf99olL0V9/qofvlxj6SpgOHkK6PBdW6x7nKJzAthGrGiDs7ffAdU9wU1y1A276iyHmj7f4mtxZK+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/Pp7f4O6dM6ytaF3WKkHdFSJoC82pzRZbZ96BqC0EuuE/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)) {

View File

@ -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.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> {
import org.apache.olingo.client.api.EdmEnabledODataClient;
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
import org.apache.olingo.ext.proxy.AbstractService;
import org.apache.olingo.ext.proxy.api.AbstractTerm;
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);

View File

@ -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.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> {
import org.apache.olingo.client.api.EdmEnabledODataClient;
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
import org.apache.olingo.ext.proxy.AbstractService;
import org.apache.olingo.ext.proxy.api.AbstractTerm;
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);

View File

@ -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;
}

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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())

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);

View File

@ -1,163 +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.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.ODataProperty;
import org.apache.olingo.commons.api.domain.ODataPrimitiveValue;
/**
* OData request factory class.
*
* @param <UT> concrete UpdateType.
*/
public interface CommonCUDRequestFactory<UT extends CommonUpdateType> {
/**
* 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, UT 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(UT 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, UT 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, UT 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);
}

View File

@ -1,31 +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.cud;
import org.apache.olingo.commons.api.http.HttpMethod;
public interface CommonUpdateType {
/**
* Gets HTTP request method.
*
* @return HTTP request method.
*/
HttpMethod getMethod();
}

View File

@ -23,7 +23,7 @@ import org.apache.olingo.commons.api.http.HttpMethod;
/**
* Update type.
*/
public enum UpdateType implements CommonUpdateType {
public enum UpdateType {
/**
* Replace all and remove missing attributes.
@ -39,13 +39,12 @@ public enum UpdateType implements CommonUpdateType {
private UpdateType(final HttpMethod method) {
this.method = method;
}
/**
* Gets HTTP request method.
*
* @return HTTP request method.
*/
@Override
public HttpMethod getMethod() {
return method;
}

View File

@ -29,7 +29,7 @@ import java.util.NoSuchElementException;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.commons.api.Constants;
import org.apache.olingo.commons.api.data.Entity;
import org.apache.olingo.commons.api.data.ResWrap;
@ -56,7 +56,7 @@ public class ODataEntitySetIterator<ES extends ODataEntitySet, E extends ODataEn
*/
private static final Logger LOG = LoggerFactory.getLogger(ODataEntitySetIterator.class);
protected final CommonODataClient<?> odataClient;
protected final ODataClient odataClient;
protected ResWrap<Entity> cached;
@ -79,7 +79,7 @@ public class ODataEntitySetIterator<ES extends ODataEntitySet, E extends ODataEn
* @param stream source stream.
* @param format OData format.
*/
public ODataEntitySetIterator(final CommonODataClient<?> odataClient, final InputStream stream,
public ODataEntitySetIterator(final ODataClient odataClient, final InputStream stream,
final ODataFormat format) {
this.odataClient = odataClient;

View File

@ -1,49 +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.core;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.Configuration;
import org.apache.olingo.client.api.communication.header.ODataPreferences;
import org.apache.olingo.client.api.communication.request.cud.CommonUpdateType;
import org.apache.olingo.client.api.serialization.ODataWriter;
import org.apache.olingo.client.core.serialization.ODataWriterImpl;
public abstract class AbstractODataClient<UT extends CommonUpdateType> implements CommonODataClient<UT> {
protected final Configuration configuration = new ConfigurationImpl();
private final ODataWriter writer = new ODataWriterImpl(this);
@Override
public Configuration getConfiguration() {
return configuration;
}
@Override
public ODataPreferences newPreferences() {
return new ODataPreferences(getServiceVersion());
}
@Override
public ODataWriter getWriter() {
return writer;
}
}

View File

@ -26,7 +26,7 @@ import org.apache.olingo.commons.api.format.ODataFormat;
public final class ODataClientFactory {
public static ODataClient getV4() {
return new org.apache.olingo.client.core.ODataClientImpl();
return new ODataClientImpl();
}
public static EdmEnabledODataClient getEdmEnabledV4(final String serviceRoot) {

View File

@ -18,18 +18,20 @@
*/
package org.apache.olingo.client.core;
import org.apache.olingo.client.api.Configuration;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.header.HeaderName;
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;
@ -42,6 +44,7 @@ import org.apache.olingo.client.core.communication.request.retrieve.RetrieveRequ
import org.apache.olingo.client.core.serialization.ClientODataDeserializerImpl;
import org.apache.olingo.client.core.serialization.ODataBinderImpl;
import org.apache.olingo.client.core.serialization.ODataReaderImpl;
import org.apache.olingo.client.core.serialization.ODataWriterImpl;
import org.apache.olingo.client.core.uri.FilterFactoryImpl;
import org.apache.olingo.client.core.uri.URIBuilderImpl;
import org.apache.olingo.commons.api.domain.ODataObjectFactory;
@ -52,7 +55,7 @@ import org.apache.olingo.commons.core.domain.ODataObjectFactoryImpl;
import org.apache.olingo.commons.core.serialization.AtomSerializer;
import org.apache.olingo.commons.core.serialization.JsonSerializer;
public class ODataClientImpl extends AbstractODataClient<UpdateType> implements ODataClient {
public class ODataClientImpl implements ODataClient {
private final FilterFactory filterFactory = new FilterFactoryImpl(getServiceVersion());
@ -74,6 +77,25 @@ public class ODataClientImpl extends AbstractODataClient<UpdateType> implements
private final BatchRequestFactory batchReqFact = new BatchRequestFactoryImpl(this);
protected final Configuration configuration = new ConfigurationImpl();
private final ODataWriter writer = new ODataWriterImpl(this);
@Override
public Configuration getConfiguration() {
return configuration;
}
@Override
public ODataPreferences newPreferences() {
return new ODataPreferences(getServiceVersion());
}
@Override
public ODataWriter getWriter() {
return writer;
}
@Override
public ODataServiceVersion getServiceVersion() {
return ODataServiceVersion.V40;

View File

@ -21,7 +21,7 @@ package org.apache.olingo.client.core.communication.header;
import java.io.InputStream;
import org.apache.http.StatusLine;
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.ODataServerErrorException;
import org.apache.olingo.commons.api.ODataRuntimeException;
@ -43,7 +43,7 @@ public final class ODataErrorResponseChecker {
}
public static ODataRuntimeException checkResponse(
final CommonODataClient<?> odataClient, final StatusLine statusLine, final InputStream entity,
final ODataClient odataClient, final StatusLine statusLine, final InputStream entity,
final String accept) {
ODataRuntimeException result = null;

View File

@ -26,11 +26,11 @@ import java.util.concurrent.Future;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataBatchConstants;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.ODataBasicRequest;
import org.apache.olingo.client.api.communication.request.ODataStreamer;
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.response.ODataResponse;
import org.apache.olingo.commons.api.format.ODataFormat;
import org.apache.olingo.commons.api.http.HttpMethod;
@ -50,7 +50,7 @@ public abstract class AbstractODataBasicRequest<T extends ODataResponse>
* @param method request method.
* @param uri OData request URI.
*/
public AbstractODataBasicRequest(final CommonODataClient<?> odataClient, final HttpMethod method, final URI uri) {
public AbstractODataBasicRequest(final ODataClient odataClient, final HttpMethod method, final URI uri) {
super(odataClient, method, uri);
}
@ -85,7 +85,7 @@ public abstract class AbstractODataBasicRequest<T extends ODataResponse>
*
* @param req destination batch request.
*/
public void batch(final CommonODataBatchRequest req) {
public void batch(final ODataBatchRequest req) {
batch(req, null);
}
@ -97,7 +97,7 @@ public abstract class AbstractODataBasicRequest<T extends ODataResponse>
* @param req destination batch request.
* @param contentId contentId of the changeset item.
*/
public void batch(final CommonODataBatchRequest req, final String contentId) {
public void batch(final ODataBatchRequest req, final String contentId) {
try {
req.rawAppend(toByteArray());
if (StringUtils.isNotBlank(contentId)) {

View File

@ -33,7 +33,7 @@ import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.impl.client.DecompressingHttpClient;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.header.HeaderName;
import org.apache.olingo.client.api.communication.header.ODataHeaders;
import org.apache.olingo.client.api.communication.request.ODataRequest;
@ -55,7 +55,7 @@ import org.apache.olingo.commons.api.http.HttpMethod;
*/
public abstract class AbstractODataRequest extends AbstractRequest implements ODataRequest {
protected final CommonODataClient<?> odataClient;
protected final ODataClient odataClient;
/**
* OData request method.
@ -89,7 +89,7 @@ public abstract class AbstractODataRequest extends AbstractRequest implements OD
* @param method HTTP request method. If configured X-HTTP-METHOD header will be used.
* @param uri OData request URI.
*/
protected AbstractODataRequest(final CommonODataClient<?> odataClient, final HttpMethod method, final URI uri) {
protected AbstractODataRequest(final ODataClient odataClient, final HttpMethod method, final URI uri) {
super();
this.odataClient = odataClient;
@ -344,7 +344,7 @@ public abstract class AbstractODataRequest extends AbstractRequest implements OD
if (ODataResponse.class.isAssignableFrom(clazz)) {
try {
final Constructor<?> constructor = clazz.getDeclaredConstructor(
this.getClass(), CommonODataClient.class, HttpClient.class, HttpResponse.class);
this.getClass(), ODataClient.class, HttpClient.class, HttpResponse.class);
constructor.setAccessible(true);
return (V) constructor.newInstance(this, odataClient, httpClient, null);
} catch (Exception e) {

View File

@ -19,8 +19,8 @@ import java.io.IOException;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.olingo.client.api.CommonEdmEnabledODataClient;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.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.slf4j.Logger;
@ -33,21 +33,21 @@ public abstract class AbstractRequest {
*/
protected static final Logger LOG = LoggerFactory.getLogger(AbstractRequest.class);
protected void checkRequest(final CommonODataClient<?> odataClient, final HttpUriRequest request) {
protected void checkRequest(final ODataClient odataClient, final HttpUriRequest request) {
// If using and Edm enabled client, checks that the cached service root matches the request URI
if (odataClient instanceof CommonEdmEnabledODataClient
if (odataClient instanceof EdmEnabledODataClient
&& !request.getURI().toASCIIString().startsWith(
((CommonEdmEnabledODataClient<?>) odataClient).getServiceRoot())) {
((EdmEnabledODataClient) odataClient).getServiceRoot())) {
throw new IllegalArgumentException(
String.format("The current request URI %s does not match the configured service root %s",
request.getURI().toASCIIString(),
((CommonEdmEnabledODataClient<?>) odataClient).getServiceRoot()));
((EdmEnabledODataClient) odataClient).getServiceRoot()));
}
}
protected void checkResponse(
final CommonODataClient<?> odataClient, final HttpResponse response, final String accept) {
final ODataClient odataClient, final HttpResponse response, final String accept) {
if (response.getStatusLine().getStatusCode() >= 400) {
try {

View File

@ -23,7 +23,7 @@ import java.util.concurrent.TimeUnit;
import org.apache.http.HttpResponse;
import org.apache.olingo.client.api.communication.request.ODataBatchableRequest;
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.ODataBatchRequestItem;
import org.apache.olingo.client.api.communication.request.batch.ODataChangeset;
import org.apache.olingo.client.api.communication.request.batch.ODataSingleRequest;
@ -46,9 +46,9 @@ public abstract class AbstractBatchManager extends AbstractODataStreamManager<OD
/**
* batch request reference.
*/
protected final CommonODataBatchRequest req;
protected final ODataBatchRequest req;
protected AbstractBatchManager(final CommonODataBatchRequest req,
protected AbstractBatchManager(final ODataBatchRequest req,
final Wrapper<Future<HttpResponse>> futureWrap, final boolean continueOnError) {
super(futureWrap);

View File

@ -1,28 +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.core.communication.request.batch;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.communication.request.batch.CommonBatchRequestFactory;
/**
* OData batch request factory class.
*/
public abstract class AbstractBatchRequestFactory implements CommonBatchRequestFactory {
protected final CommonODataClient<?> client;
protected AbstractBatchRequestFactory(final CommonODataClient<?> client) {
this.client = client;
}
}

View File

@ -24,10 +24,10 @@ import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataBatchConstants;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.ODataPayloadManager;
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.response.ODataResponse;
import org.apache.olingo.client.core.communication.request.streamed.AbstractODataStreamedRequest;
@ -56,7 +56,7 @@ public abstract class AbstractODataBatchRequest<V extends ODataResponse, T exten
* @param odataClient client instance getting this request
* @param uri batch request URI (http://serviceRoot/$batch)
*/
protected AbstractODataBatchRequest(final CommonODataClient<?> odataClient, final URI uri) {
protected AbstractODataBatchRequest(final ODataClient odataClient, final URI uri) {
super(odataClient, HttpMethod.POST, uri);
// create a random UUID value for boundary
@ -80,7 +80,7 @@ public abstract class AbstractODataBatchRequest<V extends ODataResponse, T exten
* This operation is unsupported by a batch request.
*/
@Override
public void batch(final CommonODataBatchRequest req) {
public void batch(final ODataBatchRequest req) {
throw new UnsupportedOperationException("A batch request is not batchable");
}
}

View File

@ -20,7 +20,7 @@ package org.apache.olingo.client.core.communication.request.batch;
import org.apache.olingo.client.api.ODataBatchConstants;
import org.apache.olingo.client.api.communication.request.ODataBatchableRequest;
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.ODataBatchRequestItem;
import org.apache.olingo.client.core.communication.request.AbstractODataStreamer;
@ -43,14 +43,14 @@ public abstract class AbstractODataBatchRequestItem extends AbstractODataStreame
/**
* OData batch request.
*/
protected CommonODataBatchRequest req;
protected ODataBatchRequest req;
/**
* Constructor.
*
* @param req OData batch request.
*/
public AbstractODataBatchRequestItem(final CommonODataBatchRequest req) {
public AbstractODataBatchRequestItem(final ODataBatchRequest req) {
super(req.getOutputStream());
this.open = true;
this.req = req;

View File

@ -1,18 +1,18 @@
/*
* 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.
*/
@ -22,16 +22,17 @@ import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.batch.BatchRequestFactory;
import org.apache.olingo.client.api.communication.request.batch.ODataBatchRequest;
public class BatchRequestFactoryImpl extends AbstractBatchRequestFactory
implements BatchRequestFactory {
public class BatchRequestFactoryImpl implements BatchRequestFactory {
protected final ODataClient client;
public BatchRequestFactoryImpl(final ODataClient client) {
super(client);
this.client = client;
}
@Override
public ODataBatchRequest getBatchRequest(final String serviceRoot) {
return new ODataBatchRequestImpl(
(ODataClient) client, client.newURIBuilder(serviceRoot).appendBatchSegment().build());
(ODataClient) client, client.newURIBuilder(serviceRoot).appendBatchSegment().build());
}
}

View File

@ -25,7 +25,6 @@ import java.util.concurrent.TimeUnit;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.header.HeaderName;
import org.apache.olingo.client.api.communication.header.ODataPreferences;
@ -98,7 +97,7 @@ public class ODataBatchRequestImpl
protected class ODataBatchResponseImpl extends AbstractODataResponse implements ODataBatchResponse {
protected ODataBatchResponseImpl(
final CommonODataClient<?> odataClient, final HttpClient httpClient, final HttpResponse res) {
final ODataClient odataClient, final HttpClient httpClient, final HttpResponse res) {
super(odataClient, httpClient, res);
}

View File

@ -22,7 +22,7 @@ import java.util.UUID;
import org.apache.olingo.client.api.communication.header.HeaderName;
import org.apache.olingo.client.api.communication.request.ODataBatchableRequest;
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.ODataChangeset;
import org.apache.olingo.client.core.communication.request.AbstractODataRequest;
import org.apache.olingo.commons.api.format.ContentType;
@ -55,7 +55,7 @@ public class ODataChangesetImpl extends AbstractODataBatchRequestItem
* @param req batch request.
* @param expectedResItem expected OData response items.
*/
ODataChangesetImpl(final CommonODataBatchRequest req, final ODataChangesetResponseItem expectedResItem) {
ODataChangesetImpl(final ODataBatchRequest req, final ODataChangesetResponseItem expectedResItem) {
super(req);
this.expectedResItem = expectedResItem;

View File

@ -19,7 +19,7 @@
package org.apache.olingo.client.core.communication.request.batch;
import org.apache.olingo.client.api.communication.request.ODataBatchableRequest;
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.ODataSingleRequest;
import org.apache.olingo.client.core.communication.request.AbstractODataRequest;
import org.apache.olingo.commons.api.http.HttpMethod;
@ -37,7 +37,7 @@ public class ODataSingleRequestImpl extends AbstractODataBatchRequestItem implem
* @param req batch request.
* @param expectedResItem expected batch response item.
*/
ODataSingleRequestImpl(final CommonODataBatchRequest req, final ODataSingleResponseItem expectedResItem) {
ODataSingleRequestImpl(final ODataBatchRequest req, final ODataSingleResponseItem expectedResItem) {
super(req);
this.expectedResItem = expectedResItem;
}

View File

@ -1,221 +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.core.communication.request.cud;
import java.io.InputStream;
import java.net.URI;
import org.apache.olingo.client.api.CommonODataClient;
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.cud.ODataDeleteRequest;
import org.apache.olingo.client.api.communication.request.cud.ODataEntityCreateRequest;
import org.apache.olingo.client.api.communication.request.cud.ODataEntityUpdateRequest;
import org.apache.olingo.client.api.communication.request.cud.ODataPropertyUpdateRequest;
import org.apache.olingo.client.api.communication.request.cud.ODataValueUpdateRequest;
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.client.core.communication.request.streamed.ODataMediaEntityCreateRequestImpl;
import org.apache.olingo.client.core.communication.request.streamed.ODataMediaEntityUpdateRequestImpl;
import org.apache.olingo.client.core.communication.request.streamed.ODataStreamUpdateRequestImpl;
import org.apache.olingo.client.core.uri.URIUtils;
import org.apache.olingo.commons.api.domain.ODataEntity;
import org.apache.olingo.commons.api.domain.ODataProperty;
import org.apache.olingo.commons.api.domain.ODataPrimitiveValue;
import org.apache.olingo.commons.api.http.HttpMethod;
public abstract class AbstractCUDRequestFactory<UT extends CommonUpdateType> implements CommonCUDRequestFactory<UT> {
protected final CommonODataClient<?> client;
protected AbstractCUDRequestFactory(final CommonODataClient<?> client) {
this.client = client;
}
@Override
public <E extends ODataEntity> ODataEntityCreateRequest<E> getEntityCreateRequest(
final URI targetURI, final E entity) {
return new ODataEntityCreateRequestImpl<E>(client, targetURI, entity);
}
@Override
public <E extends ODataEntity> ODataEntityUpdateRequest<E> getEntityUpdateRequest(
final URI targetURI, final UT type, final E changes) {
final ODataEntityUpdateRequest<E> req;
if (client.getConfiguration().isUseXHTTPMethod()) {
req = new ODataEntityUpdateRequestImpl<E>(client, HttpMethod.POST, targetURI, changes);
req.setXHTTPMethod(type.getMethod().name());
} else {
req = new ODataEntityUpdateRequestImpl<E>(client, type.getMethod(), targetURI, changes);
}
return req;
}
@Override
public <E extends ODataEntity> ODataEntityUpdateRequest<E> getEntityUpdateRequest(
final UT type, final E entity) {
if (entity.getEditLink() == null) {
throw new IllegalArgumentException("No edit link found");
}
final ODataEntityUpdateRequest<E> req;
if (client.getConfiguration().isUseXHTTPMethod()) {
req = new ODataEntityUpdateRequestImpl<E>(client, HttpMethod.POST, entity.getEditLink(), entity);
req.setXHTTPMethod(type.getMethod().name());
} else {
req = new ODataEntityUpdateRequestImpl<E>(client, type.getMethod(), entity.getEditLink(), entity);
}
return req;
}
@Override
public ODataValueUpdateRequest getValueUpdateRequest(
final URI targetURI, final UT type, final ODataPrimitiveValue value) {
final ODataValueUpdateRequest req;
if (client.getConfiguration().isUseXHTTPMethod()) {
req = new ODataValueUpdateRequestImpl(client, HttpMethod.POST, URIUtils.addValueSegment(targetURI), value);
req.setXHTTPMethod(type.getMethod().name());
} else {
req = new ODataValueUpdateRequestImpl(client, type.getMethod(), URIUtils.addValueSegment(targetURI), value);
}
return req;
}
@Override
public ODataPropertyUpdateRequest getPropertyPrimitiveValueUpdateRequest(
final URI targetURI, final ODataProperty property) {
if (!property.hasPrimitiveValue()) {
throw new IllegalArgumentException("A primitive value is required");
}
final ODataPropertyUpdateRequest req;
if (client.getConfiguration().isUseXHTTPMethod()) {
req = new ODataPropertyUpdateRequestImpl(client, HttpMethod.POST, targetURI, property);
req.setXHTTPMethod(HttpMethod.PUT.name());
} else {
req = new ODataPropertyUpdateRequestImpl(client, HttpMethod.PUT, targetURI, property);
}
return req;
}
@Override
public ODataPropertyUpdateRequest getPropertyComplexValueUpdateRequest(
final URI targetURI, final UT type, final ODataProperty property) {
if (!property.hasComplexValue()) {
throw new IllegalArgumentException("A complex value is required");
}
final ODataPropertyUpdateRequest req;
if (client.getConfiguration().isUseXHTTPMethod()) {
req = new ODataPropertyUpdateRequestImpl(client, HttpMethod.POST, targetURI, property);
req.setXHTTPMethod(type.getMethod().name());
} else {
req = new ODataPropertyUpdateRequestImpl(client, type.getMethod(), targetURI, property);
}
return req;
}
@Override
public ODataPropertyUpdateRequest getPropertyCollectionValueUpdateRequest(
final URI targetURI, final ODataProperty property) {
if (!property.hasCollectionValue()) {
throw new IllegalArgumentException("A collection value is required");
}
final ODataPropertyUpdateRequest req;
if (client.getConfiguration().isUseXHTTPMethod()) {
req = new ODataPropertyUpdateRequestImpl(client, HttpMethod.POST, targetURI, property);
req.setXHTTPMethod(HttpMethod.PUT.name());
} else {
req = new ODataPropertyUpdateRequestImpl(client, HttpMethod.PUT, targetURI, property);
}
return req;
}
@Override
public ODataDeleteRequest getDeleteRequest(final URI targetURI) {
final ODataDeleteRequest req;
if (client.getConfiguration().isUseXHTTPMethod()) {
req = new ODataDeleteRequestImpl(client, HttpMethod.POST, targetURI);
req.setXHTTPMethod(HttpMethod.DELETE.name());
} else {
req = new ODataDeleteRequestImpl(client, HttpMethod.DELETE, targetURI);
}
return req;
}
@Override
public <E extends ODataEntity> ODataMediaEntityCreateRequest<E> getMediaEntityCreateRequest(
final URI targetURI, final InputStream media) {
return new ODataMediaEntityCreateRequestImpl<E>(client, targetURI, media);
}
@Override
public ODataStreamUpdateRequest getStreamUpdateRequest(final URI targetURI, final InputStream stream) {
final ODataStreamUpdateRequest req;
if (client.getConfiguration().isUseXHTTPMethod()) {
req = new ODataStreamUpdateRequestImpl(client, HttpMethod.POST, targetURI, stream);
req.setXHTTPMethod(HttpMethod.PUT.name());
} else {
req = new ODataStreamUpdateRequestImpl(client, HttpMethod.PUT, targetURI, stream);
}
return req;
}
@Override
public <E extends ODataEntity> ODataMediaEntityUpdateRequest<E> getMediaEntityUpdateRequest(
final URI editURI, final InputStream media) {
final ODataMediaEntityUpdateRequest<E> req;
if (client.getConfiguration().isUseXHTTPMethod()) {
req = new ODataMediaEntityUpdateRequestImpl<E>(client, HttpMethod.POST, URIUtils.addValueSegment(editURI), media);
req.setXHTTPMethod(HttpMethod.PUT.name());
} else {
req = new ODataMediaEntityUpdateRequestImpl<E>(client, HttpMethod.PUT, URIUtils.addValueSegment(editURI), media);
}
return req;
}
}

View File

@ -18,35 +18,222 @@
*/
package org.apache.olingo.client.core.communication.request.cud;
import java.io.InputStream;
import java.net.URI;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.cud.CUDRequestFactory;
import org.apache.olingo.client.api.communication.request.cud.ODataDeleteRequest;
import org.apache.olingo.client.api.communication.request.cud.ODataEntityCreateRequest;
import org.apache.olingo.client.api.communication.request.cud.ODataEntityUpdateRequest;
import org.apache.olingo.client.api.communication.request.cud.ODataPropertyUpdateRequest;
import org.apache.olingo.client.api.communication.request.cud.ODataReferenceAddingRequest;
import org.apache.olingo.client.api.communication.request.cud.ODataValueUpdateRequest;
import org.apache.olingo.client.api.communication.request.cud.UpdateType;
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.client.core.communication.request.streamed.ODataMediaEntityCreateRequestImpl;
import org.apache.olingo.client.core.communication.request.streamed.ODataMediaEntityUpdateRequestImpl;
import org.apache.olingo.client.core.communication.request.streamed.ODataStreamUpdateRequestImpl;
import org.apache.olingo.client.core.uri.URIUtils;
import org.apache.olingo.commons.api.data.ResWrap;
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;
import org.apache.olingo.commons.api.http.HttpMethod;
public class CUDRequestFactoryImpl extends AbstractCUDRequestFactory<UpdateType> implements CUDRequestFactory {
public class CUDRequestFactoryImpl implements CUDRequestFactory {
protected final ODataClient client;
public CUDRequestFactoryImpl(final ODataClient client) {
super(client);
this.client = client;
}
@Override
public <E extends ODataEntity> ODataEntityCreateRequest<E> getEntityCreateRequest(
final URI targetURI, final E entity) {
return new ODataEntityCreateRequestImpl<E>(client, targetURI, entity);
}
@Override
public <E extends ODataEntity> ODataEntityUpdateRequest<E> getEntityUpdateRequest(
final URI targetURI, final UpdateType type, final E changes) {
final ODataEntityUpdateRequest<E> req;
if (client.getConfiguration().isUseXHTTPMethod()) {
req = new ODataEntityUpdateRequestImpl<E>(client, HttpMethod.POST, targetURI, changes);
req.setXHTTPMethod(type.getMethod().name());
} else {
req = new ODataEntityUpdateRequestImpl<E>(client, type.getMethod(), targetURI, changes);
}
return req;
}
@Override
public <E extends ODataEntity> ODataEntityUpdateRequest<E> getEntityUpdateRequest(
final UpdateType type, final E entity) {
if (entity.getEditLink() == null) {
throw new IllegalArgumentException("No edit link found");
}
final ODataEntityUpdateRequest<E> req;
if (client.getConfiguration().isUseXHTTPMethod()) {
req = new ODataEntityUpdateRequestImpl<E>(client, HttpMethod.POST, entity.getEditLink(), entity);
req.setXHTTPMethod(type.getMethod().name());
} else {
req = new ODataEntityUpdateRequestImpl<E>(client, type.getMethod(), entity.getEditLink(), entity);
}
return req;
}
@Override
public ODataValueUpdateRequest getValueUpdateRequest(
final URI targetURI, final UpdateType type, final ODataPrimitiveValue value) {
final ODataValueUpdateRequest req;
if (client.getConfiguration().isUseXHTTPMethod()) {
req = new ODataValueUpdateRequestImpl(client, HttpMethod.POST, URIUtils.addValueSegment(targetURI), value);
req.setXHTTPMethod(type.getMethod().name());
} else {
req = new ODataValueUpdateRequestImpl(client, type.getMethod(), URIUtils.addValueSegment(targetURI), value);
}
return req;
}
@Override
public ODataPropertyUpdateRequest getPropertyPrimitiveValueUpdateRequest(
final URI targetURI, final ODataProperty property) {
if (!property.hasPrimitiveValue()) {
throw new IllegalArgumentException("A primitive value is required");
}
final ODataPropertyUpdateRequest req;
if (client.getConfiguration().isUseXHTTPMethod()) {
req = new ODataPropertyUpdateRequestImpl(client, HttpMethod.POST, targetURI, property);
req.setXHTTPMethod(HttpMethod.PUT.name());
} else {
req = new ODataPropertyUpdateRequestImpl(client, HttpMethod.PUT, targetURI, property);
}
return req;
}
@Override
public ODataPropertyUpdateRequest getPropertyComplexValueUpdateRequest(
final URI targetURI, final UpdateType type, final ODataProperty property) {
if (!property.hasComplexValue()) {
throw new IllegalArgumentException("A complex value is required");
}
final ODataPropertyUpdateRequest req;
if (client.getConfiguration().isUseXHTTPMethod()) {
req = new ODataPropertyUpdateRequestImpl(client, HttpMethod.POST, targetURI, property);
req.setXHTTPMethod(type.getMethod().name());
} else {
req = new ODataPropertyUpdateRequestImpl(client, type.getMethod(), targetURI, property);
}
return req;
}
@Override
public ODataPropertyUpdateRequest getPropertyCollectionValueUpdateRequest(
final URI targetURI, final ODataProperty property) {
if (!property.hasCollectionValue()) {
throw new IllegalArgumentException("A collection value is required");
}
final ODataPropertyUpdateRequest req;
if (client.getConfiguration().isUseXHTTPMethod()) {
req = new ODataPropertyUpdateRequestImpl(client, HttpMethod.POST, targetURI, property);
req.setXHTTPMethod(HttpMethod.PUT.name());
} else {
req = new ODataPropertyUpdateRequestImpl(client, HttpMethod.PUT, targetURI, property);
}
return req;
}
@Override
public ODataDeleteRequest getDeleteRequest(final URI targetURI) {
final ODataDeleteRequest req;
if (client.getConfiguration().isUseXHTTPMethod()) {
req = new ODataDeleteRequestImpl(client, HttpMethod.POST, targetURI);
req.setXHTTPMethod(HttpMethod.DELETE.name());
} else {
req = new ODataDeleteRequestImpl(client, HttpMethod.DELETE, targetURI);
}
return req;
}
@Override
public <E extends ODataEntity> ODataMediaEntityCreateRequest<E> getMediaEntityCreateRequest(
final URI targetURI, final InputStream media) {
return new ODataMediaEntityCreateRequestImpl<E>(client, targetURI, media);
}
@Override
public ODataStreamUpdateRequest getStreamUpdateRequest(final URI targetURI, final InputStream stream) {
final ODataStreamUpdateRequest req;
if (client.getConfiguration().isUseXHTTPMethod()) {
req = new ODataStreamUpdateRequestImpl(client, HttpMethod.POST, targetURI, stream);
req.setXHTTPMethod(HttpMethod.PUT.name());
} else {
req = new ODataStreamUpdateRequestImpl(client, HttpMethod.PUT, targetURI, stream);
}
return req;
}
@Override
public <E extends ODataEntity> ODataMediaEntityUpdateRequest<E> getMediaEntityUpdateRequest(
final URI editURI, final InputStream media) {
final ODataMediaEntityUpdateRequest<E> req;
if (client.getConfiguration().isUseXHTTPMethod()) {
req = new ODataMediaEntityUpdateRequestImpl<E>(client, HttpMethod.POST, URIUtils.addValueSegment(editURI), media);
req.setXHTTPMethod(HttpMethod.PUT.name());
} else {
req = new ODataMediaEntityUpdateRequestImpl<E>(client, HttpMethod.PUT, URIUtils.addValueSegment(editURI), media);
}
return req;
}
@Override
public ODataEntityUpdateRequest<ODataSingleton> getSingletonUpdateRequest(
final UpdateType type, final ODataSingleton entity) {
final UpdateType type, final ODataSingleton entity) {
return super.getEntityUpdateRequest(type, entity);
return getEntityUpdateRequest(type, entity);
}
@Override
public ODataEntityUpdateRequest<ODataSingleton> getSingletonUpdateRequest(
final URI targetURI, final UpdateType type, final ODataSingleton changes) {
final URI targetURI, final UpdateType type, final ODataSingleton changes) {
return super.getEntityUpdateRequest(targetURI, type, changes);
return getEntityUpdateRequest(targetURI, type, changes);
}
@Override
@ -56,14 +243,14 @@ public class CUDRequestFactoryImpl extends AbstractCUDRequestFactory<UpdateType>
ResWrap<URI> wrappedPayload = new ResWrap<URI>(contextURI, null, reference);
return new ODataReferenceAddingRequestImpl(client, HttpMethod.POST, targetURI, wrappedPayload);
}
public ODataReferenceAddingRequest getReferenceSingleChangeRequest(final URI serviceRoot, final URI targetURI,
}
public ODataReferenceAddingRequest getReferenceSingleChangeRequest(final URI serviceRoot, final URI targetURI,
final URI reference) {
// See OData Protocol 11.4.6.3
// See OData Protocol 11.4.6.3
final URI contextURI = client.newURIBuilder(serviceRoot.toASCIIString()).appendMetadataSegment().build();
ResWrap<URI> wrappedPayload = new ResWrap<URI>(contextURI, null, reference);
return new ODataReferenceAddingRequestImpl(client, HttpMethod.PUT, targetURI, wrappedPayload);
}
}
}

View File

@ -23,7 +23,7 @@ import java.net.URI;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.cud.ODataDeleteRequest;
import org.apache.olingo.client.api.communication.response.ODataDeleteResponse;
import org.apache.olingo.client.core.communication.request.AbstractODataBasicRequest;
@ -37,7 +37,7 @@ import org.apache.olingo.commons.api.http.HttpMethod;
public class ODataDeleteRequestImpl extends AbstractODataBasicRequest<ODataDeleteResponse>
implements ODataDeleteRequest {
ODataDeleteRequestImpl(final CommonODataClient<?> odataClient, final HttpMethod method, final URI uri) {
ODataDeleteRequestImpl(final ODataClient odataClient, final HttpMethod method, final URI uri) {
super(odataClient, method, uri);
}
@ -64,7 +64,7 @@ public class ODataDeleteRequestImpl extends AbstractODataBasicRequest<ODataDelet
*/
private class ODataDeleteResponseImpl extends AbstractODataResponse implements ODataDeleteResponse {
private ODataDeleteResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private ODataDeleteResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -25,7 +25,7 @@ import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.cud.ODataEntityCreateRequest;
import org.apache.olingo.client.api.communication.response.ODataEntityCreateResponse;
import org.apache.olingo.client.core.communication.request.AbstractODataBasicRequest;
@ -60,7 +60,7 @@ public class ODataEntityCreateRequestImpl<E extends ODataEntity>
* @param targetURI entity set URI.
* @param entity entity to be created.
*/
ODataEntityCreateRequestImpl(final CommonODataClient<?> odataClient, final URI targetURI, final E entity) {
ODataEntityCreateRequestImpl(final ODataClient odataClient, final URI targetURI, final E entity) {
super(odataClient, HttpMethod.POST, targetURI);
this.entity = entity;
}
@ -98,7 +98,7 @@ public class ODataEntityCreateRequestImpl<E extends ODataEntity>
private E entity = null;
private ODataEntityCreateResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private ODataEntityCreateResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -26,7 +26,7 @@ import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.cud.ODataEntityUpdateRequest;
import org.apache.olingo.client.api.communication.response.ODataEntityUpdateResponse;
import org.apache.olingo.client.core.communication.request.AbstractODataBasicRequest;
@ -62,7 +62,7 @@ public class ODataEntityUpdateRequestImpl<E extends ODataEntity>
* @param uri URI of the entity to be updated.
* @param changes changes to be applied.
*/
public ODataEntityUpdateRequestImpl(final CommonODataClient<?> odataClient,
public ODataEntityUpdateRequestImpl(final ODataClient odataClient,
final HttpMethod method, final URI uri, final E changes) {
super(odataClient, method, uri);
@ -111,7 +111,7 @@ public class ODataEntityUpdateRequestImpl<E extends ODataEntity>
*/
private E entity = null;
private ODataEntityUpdateResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private ODataEntityUpdateResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -25,7 +25,7 @@ import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.cud.ODataPropertyUpdateRequest;
import org.apache.olingo.client.api.communication.response.ODataPropertyUpdateResponse;
import org.apache.olingo.client.core.communication.request.AbstractODataBasicRequest;
@ -58,7 +58,7 @@ public class ODataPropertyUpdateRequestImpl extends AbstractODataBasicRequest<OD
* @param targetURI entity set or entity or entity property URI.
* @param property value to be created.
*/
ODataPropertyUpdateRequestImpl(final CommonODataClient<?> odataClient,
ODataPropertyUpdateRequestImpl(final ODataClient odataClient,
final HttpMethod method, final URI targetURI, final ODataProperty property) {
super(odataClient, method, targetURI);
@ -99,7 +99,7 @@ public class ODataPropertyUpdateRequestImpl extends AbstractODataBasicRequest<OD
private ODataProperty property = null;
private ODataPropertyUpdateResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private ODataPropertyUpdateResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -25,7 +25,7 @@ import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.cud.ODataReferenceAddingRequest;
import org.apache.olingo.client.api.communication.response.ODataReferenceAddingResponse;
import org.apache.olingo.client.api.serialization.ODataWriter;
@ -48,7 +48,7 @@ public class ODataReferenceAddingRequestImpl extends AbstractODataBasicRequest<O
final ResWrap<URI> reference;
ODataReferenceAddingRequestImpl(
final CommonODataClient<?> odataClient, final HttpMethod method, final URI uri, final ResWrap<URI> reference) {
final ODataClient odataClient, final HttpMethod method, final URI uri, final ResWrap<URI> reference) {
super(odataClient, method, uri);
this.reference = reference;
}
@ -94,7 +94,7 @@ public class ODataReferenceAddingRequestImpl extends AbstractODataBasicRequest<O
private class ODataReferenceAddingResponseImpl extends AbstractODataResponse implements ODataReferenceAddingResponse {
private ODataReferenceAddingResponseImpl(
final CommonODataClient<?> odataClient, final HttpClient httpClient, final HttpResponse res) {
final ODataClient odataClient, final HttpClient httpClient, final HttpResponse res) {
super(odataClient, httpClient, res);
this.close();

View File

@ -25,7 +25,7 @@ import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.cud.ODataValueUpdateRequest;
import org.apache.olingo.client.api.communication.response.ODataValueUpdateResponse;
import org.apache.olingo.client.api.http.HttpClientException;
@ -56,7 +56,7 @@ public class ODataValueUpdateRequestImpl extends AbstractODataBasicRequest<OData
* @param targetURI entity set or entity or entity property URI.
* @param value value to be created.
*/
ODataValueUpdateRequestImpl(final CommonODataClient<?> odataClient,
ODataValueUpdateRequestImpl(final ODataClient odataClient,
final HttpMethod method, final URI targetURI, final ODataPrimitiveValue value) {
super(odataClient, method, targetURI);
@ -96,7 +96,7 @@ public class ODataValueUpdateRequestImpl extends AbstractODataBasicRequest<OData
private ODataPrimitiveValue value = null;
private ODataValueUpdateResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private ODataValueUpdateResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -22,7 +22,7 @@ import java.net.URI;
import java.util.ArrayList;
import java.util.Map;
import org.apache.olingo.client.api.CommonEdmEnabledODataClient;
import org.apache.olingo.client.api.EdmEnabledODataClient;
import org.apache.olingo.client.api.communication.request.invoke.EdmEnabledInvokeRequestFactory;
import org.apache.olingo.client.api.communication.request.invoke.ODataInvokeRequest;
import org.apache.olingo.commons.api.domain.ODataInvokeResult;
@ -39,9 +39,9 @@ import org.apache.olingo.commons.api.http.HttpMethod;
public abstract class AbstractEdmEnabledInvokeRequestFactory extends AbstractInvokeRequestFactory
implements EdmEnabledInvokeRequestFactory {
private final CommonEdmEnabledODataClient<?> edmClient;
private final EdmEnabledODataClient edmClient;
public AbstractEdmEnabledInvokeRequestFactory(final CommonEdmEnabledODataClient<?> edmClient) {
public AbstractEdmEnabledInvokeRequestFactory(final EdmEnabledODataClient edmClient) {
this.edmClient = edmClient;
}

View File

@ -29,7 +29,6 @@ import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.ODataBatchableRequest;
import org.apache.olingo.client.api.communication.request.invoke.ODataInvokeRequest;
@ -41,8 +40,8 @@ import org.apache.olingo.client.core.communication.response.AbstractODataRespons
import org.apache.olingo.client.core.uri.URIUtils;
import org.apache.olingo.commons.api.domain.ODataEntity;
import org.apache.olingo.commons.api.domain.ODataEntitySet;
import org.apache.olingo.commons.api.domain.ODataProperty;
import org.apache.olingo.commons.api.domain.ODataInvokeResult;
import org.apache.olingo.commons.api.domain.ODataProperty;
import org.apache.olingo.commons.api.domain.ODataValue;
import org.apache.olingo.commons.api.format.ODataFormat;
import org.apache.olingo.commons.api.http.HttpMethod;
@ -72,7 +71,7 @@ public abstract class AbstractODataInvokeRequest<T extends ODataInvokeResult>
* @param uri URI that identifies the operation.
*/
public AbstractODataInvokeRequest(
final CommonODataClient<?> odataClient,
final ODataClient odataClient,
final Class<T> reference,
final HttpMethod method,
final URI uri) {
@ -183,7 +182,7 @@ public abstract class AbstractODataInvokeRequest<T extends ODataInvokeResult>
private T invokeResult = null;
private ODataInvokeResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private ODataInvokeResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -20,7 +20,7 @@ package org.apache.olingo.client.core.communication.request.invoke;
import java.net.URI;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.commons.api.domain.ODataInvokeResult;
import org.apache.olingo.commons.api.format.ODataFormat;
import org.apache.olingo.commons.api.http.HttpMethod;
@ -29,7 +29,7 @@ public class ODataInvokeRequestImpl<T extends ODataInvokeResult> extends Abstrac
private ODataFormat format;
public ODataInvokeRequestImpl(final CommonODataClient<?> odataClient, final Class<T> reference,
public ODataInvokeRequestImpl(final ODataClient odataClient, final Class<T> reference,
final HttpMethod method, final URI uri) {
super(odataClient, reference, method, uri);

View File

@ -20,14 +20,14 @@ package org.apache.olingo.client.core.communication.request.retrieve;
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.request.ODataRequest;
import org.apache.olingo.commons.api.format.ContentType;
import org.apache.olingo.commons.api.format.ODataFormat;
public abstract class AbstractMetadataRequestImpl<V> extends AbstractODataRetrieveRequest<V> {
public AbstractMetadataRequestImpl(final CommonODataClient<?> odataClient, final URI query) {
public AbstractMetadataRequestImpl(final ODataClient odataClient, final URI query) {
super(odataClient, query);
super.setAccept(ContentType.APPLICATION_XML.toContentTypeString());
super.setContentType(ContentType.APPLICATION_XML.toContentTypeString());

View File

@ -23,7 +23,7 @@ import java.net.URI;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.retrieve.ODataRetrieveRequest;
import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
import org.apache.olingo.client.core.communication.request.AbstractODataBasicRequest;
@ -43,7 +43,7 @@ public abstract class AbstractODataRetrieveRequest<T>
* @param odataClient client instance getting this request
* @param query query to be executed.
*/
public AbstractODataRetrieveRequest(final CommonODataClient<?> odataClient, final URI query) {
public AbstractODataRetrieveRequest(final ODataClient odataClient, final URI query) {
super(odataClient, HttpMethod.GET, query);
}
@ -64,7 +64,7 @@ public abstract class AbstractODataRetrieveRequest<T>
protected abstract class AbstractODataRetrieveResponse
extends AbstractODataResponse implements ODataRetrieveResponse<T> {
protected AbstractODataRetrieveResponse(final CommonODataClient<?> odataClient, final HttpClient httpClient,
protected AbstractODataRetrieveResponse(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -21,7 +21,7 @@ package org.apache.olingo.client.core.communication.request.retrieve;
import java.net.URI;
import org.apache.http.client.HttpClient;
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;
@ -36,7 +36,7 @@ class EdmMetadataRequestImpl extends AbstractMetadataRequestImpl<Edm> implements
private EdmMetadataResponseImpl privateResponse;
EdmMetadataRequestImpl(final CommonODataClient<?> odataClient, final String serviceRoot, final URI uri) {
EdmMetadataRequestImpl(final ODataClient odataClient, final String serviceRoot, final URI uri) {
super(odataClient, uri);
this.serviceRoot = serviceRoot;
}
@ -67,7 +67,7 @@ class EdmMetadataRequestImpl extends AbstractMetadataRequestImpl<Edm> implements
private XMLMetadata metadata = null;
private EdmMetadataResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private EdmMetadataResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final ODataRetrieveResponse<XMLMetadata> xmlMetadataResponse) {
super(odataClient, httpClient, null);

View File

@ -23,7 +23,6 @@ import java.net.URI;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.retrieve.ODataDeltaRequest;
import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
@ -37,7 +36,7 @@ import org.apache.olingo.commons.api.serialization.ODataDeserializerException;
public class ODataDeltaRequestImpl extends AbstractODataRetrieveRequest<ODataDelta>
implements ODataDeltaRequest {
public ODataDeltaRequestImpl(final CommonODataClient<?> odataClient, final URI query) {
public ODataDeltaRequestImpl(final ODataClient odataClient, final URI query) {
super(odataClient, query);
}
@ -56,7 +55,7 @@ public class ODataDeltaRequestImpl extends AbstractODataRetrieveRequest<ODataDel
private ODataDelta delta = null;
private ODataDeltaResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private ODataDeltaResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -22,7 +22,7 @@ import java.net.URI;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
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.commons.api.data.Entity;
@ -43,7 +43,7 @@ public class ODataEntityRequestImpl<E extends ODataEntity>
* @param odataClient client instance getting this request
* @param query query to be executed.
*/
public ODataEntityRequestImpl(final CommonODataClient<?> odataClient, final URI query) {
public ODataEntityRequestImpl(final ODataClient odataClient, final URI query) {
super(odataClient, query);
}
@ -64,7 +64,7 @@ public class ODataEntityRequestImpl<E extends ODataEntity>
private E entity = null;
private ODataEntityResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private ODataEntityResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -22,7 +22,7 @@ import java.net.URI;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.retrieve.ODataEntitySetIteratorRequest;
import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
import org.apache.olingo.client.api.domain.ODataEntitySetIterator;
@ -45,7 +45,7 @@ public class ODataEntitySetIteratorRequestImpl<ES extends ODataEntitySet, E exte
* @param odataClient client instance getting this request
* @param query query to be executed.
*/
public ODataEntitySetIteratorRequestImpl(final CommonODataClient<?> odataClient, final URI query) {
public ODataEntitySetIteratorRequestImpl(final ODataClient odataClient, final URI query) {
super(odataClient, query);
}
@ -65,7 +65,7 @@ public class ODataEntitySetIteratorRequestImpl<ES extends ODataEntitySet, E exte
*/
protected class ODataEntitySetIteratorResponseImpl extends AbstractODataRetrieveResponse {
private ODataEntitySetIteratorResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private ODataEntitySetIteratorResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -22,7 +22,7 @@ import java.net.URI;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.retrieve.ODataEntitySetRequest;
import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
import org.apache.olingo.commons.api.data.EntitySet;
@ -47,7 +47,7 @@ public class ODataEntitySetRequestImpl<ES extends ODataEntitySet>
* @param odataClient client instance getting this request
* @param query query to be executed.
*/
public ODataEntitySetRequestImpl(final CommonODataClient<?> odataClient, final URI query) {
public ODataEntitySetRequestImpl(final ODataClient odataClient, final URI query) {
super(odataClient, query);
}
@ -67,7 +67,7 @@ public class ODataEntitySetRequestImpl<ES extends ODataEntitySet>
*/
protected class ODataEntitySetResponseImpl extends AbstractODataRetrieveResponse {
private ODataEntitySetResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private ODataEntitySetResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -24,7 +24,7 @@ import java.net.URI;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.header.HeaderName;
import org.apache.olingo.client.api.communication.request.retrieve.ODataMediaRequest;
import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
@ -42,7 +42,7 @@ public class ODataMediaRequestImpl extends AbstractODataRetrieveRequest<InputStr
* @param odataClient client instance getting this request
* @param query query to be executed.
*/
ODataMediaRequestImpl(final CommonODataClient<?> odataClient, final URI query) {
ODataMediaRequestImpl(final ODataClient odataClient, final URI query) {
super(odataClient, query);
setAccept(ODataFormat.APPLICATION_OCTET_STREAM.toString());
@ -71,7 +71,7 @@ public class ODataMediaRequestImpl extends AbstractODataRetrieveRequest<InputStr
private InputStream input = null;
private ODataMediaResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private ODataMediaResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -23,7 +23,7 @@ import java.net.URI;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.retrieve.ODataPropertyRequest;
import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
import org.apache.olingo.client.api.http.HttpClientException;
@ -45,7 +45,7 @@ public class ODataPropertyRequestImpl<T extends ODataProperty>
* @param odataClient client instance getting this request
* @param query query to be executed.
*/
public ODataPropertyRequestImpl(final CommonODataClient<?> odataClient, final URI query) {
public ODataPropertyRequestImpl(final ODataClient odataClient, final URI query) {
super(odataClient, query);
}
@ -64,7 +64,7 @@ public class ODataPropertyRequestImpl<T extends ODataProperty>
private T property = null;
private ODataPropertyResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private ODataPropertyResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -25,7 +25,7 @@ import java.net.URI;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.retrieve.ODataRawRequest;
import org.apache.olingo.client.api.communication.response.ODataRawResponse;
import org.apache.olingo.client.core.communication.request.AbstractODataRequest;
@ -46,7 +46,7 @@ public class ODataRawRequestImpl extends AbstractODataRequest implements ODataRa
* @param odataClient client instance getting this request
* @param uri request URI.
*/
ODataRawRequestImpl(final CommonODataClient<?> odataClient, final URI uri) {
ODataRawRequestImpl(final ODataClient odataClient, final URI uri) {
super(odataClient, HttpMethod.GET, uri);
}
@ -70,7 +70,7 @@ public class ODataRawRequestImpl extends AbstractODataRequest implements ODataRa
private byte[] obj = null;
private ODataRawResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private ODataRawResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -22,7 +22,7 @@ import java.net.URI;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.retrieve.ODataServiceDocumentRequest;
import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
import org.apache.olingo.client.api.data.ServiceDocument;
@ -43,7 +43,7 @@ public class ODataServiceDocumentRequestImpl extends AbstractODataRetrieveReques
* @param odataClient client instance getting this request
* @param uri request URI.
*/
ODataServiceDocumentRequestImpl(final CommonODataClient<?> odataClient, final URI uri) {
ODataServiceDocumentRequestImpl(final ODataClient odataClient, final URI uri) {
super(odataClient, uri);
}
@ -65,7 +65,7 @@ public class ODataServiceDocumentRequestImpl extends AbstractODataRetrieveReques
private ODataServiceDocument serviceDocument = null;
private ODataServiceResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private ODataServiceResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -23,7 +23,7 @@ import java.net.URI;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.retrieve.ODataValueRequest;
import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
import org.apache.olingo.client.api.http.HttpClientException;
@ -43,7 +43,7 @@ public class ODataValueRequestImpl extends AbstractODataRetrieveRequest<ODataPri
* @param odataClient client instance getting this request
* @param query query to be executed.
*/
ODataValueRequestImpl(final CommonODataClient<?> odataClient, final URI query) {
ODataValueRequestImpl(final ODataClient odataClient, final URI query) {
super(odataClient, query);
}
@ -65,7 +65,7 @@ public class ODataValueRequestImpl extends AbstractODataRetrieveRequest<ODataPri
private ODataPrimitiveValue value = null;
private ODataValueResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private ODataValueResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -24,7 +24,6 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.retrieve.XMLMetadataRequest;
import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
@ -133,7 +132,7 @@ public class XMLMetadataRequestImpl
* main metadata document's URI but don't have to start with the service root
* as all other OData request URIs. */
@Override
protected void checkRequest(final CommonODataClient<?> odataClient, final HttpUriRequest request) {
protected void checkRequest(final ODataClient odataClient, final HttpUriRequest request) {
if (parentURI == null) {
super.checkRequest(odataClient, request);
} else {
@ -173,7 +172,7 @@ public class XMLMetadataRequestImpl
private final XMLMetadata metadata;
private XMLMetadataResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private XMLMetadataResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res, final XMLMetadata metadata) {
super(odataClient, httpClient, null);

View File

@ -20,7 +20,7 @@ package org.apache.olingo.client.core.communication.request.streamed;
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.request.ODataPayloadManager;
import org.apache.olingo.client.api.communication.request.streamed.ODataStreamedEntityRequest;
import org.apache.olingo.client.api.communication.response.ODataResponse;
@ -46,7 +46,7 @@ public abstract class AbstractODataStreamedEntityRequest<V extends ODataResponse
* @param method HTTP request method.
* @param uri request URI.
*/
public AbstractODataStreamedEntityRequest(final CommonODataClient<?> odataClient, final HttpMethod method,
public AbstractODataStreamedEntityRequest(final ODataClient odataClient, final HttpMethod method,
final URI uri) {
super(odataClient, method, uri);

View File

@ -28,12 +28,12 @@ import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataBatchConstants;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.ODataPayloadManager;
import org.apache.olingo.client.api.communication.request.ODataStreamedRequest;
import org.apache.olingo.client.api.communication.request.ODataStreamer;
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.response.ODataResponse;
import org.apache.olingo.client.core.communication.request.AbstractODataRequest;
import org.apache.olingo.client.core.communication.request.Wrapper;
@ -69,7 +69,7 @@ public abstract class AbstractODataStreamedRequest<V extends ODataResponse, T ex
* @param method OData request HTTP method.
* @param uri OData request URI.
*/
public AbstractODataStreamedRequest(final CommonODataClient<?> odataClient,
public AbstractODataStreamedRequest(final ODataClient odataClient,
final HttpMethod method, final URI uri) {
super(odataClient, method, uri);
@ -130,7 +130,7 @@ public abstract class AbstractODataStreamedRequest<V extends ODataResponse, T ex
*
* @param req destination batch request.
*/
public void batch(final CommonODataBatchRequest req) {
public void batch(final ODataBatchRequest req) {
batch(req, null);
}
@ -142,7 +142,7 @@ public abstract class AbstractODataStreamedRequest<V extends ODataResponse, T ex
* @param req destination batch request.
* @param contentId ContentId header value to be added to the serialization. Use this in case of changeset items.
*/
public void batch(final CommonODataBatchRequest req, final String contentId) {
public void batch(final ODataBatchRequest req, final String contentId) {
final InputStream input = getPayloadManager().getBody();
try {

View File

@ -24,7 +24,7 @@ import java.util.concurrent.TimeUnit;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.streamed.MediaEntityCreateStreamManager;
import org.apache.olingo.client.api.communication.request.streamed.ODataMediaEntityCreateRequest;
import org.apache.olingo.client.api.communication.response.ODataMediaEntityCreateResponse;
@ -54,7 +54,7 @@ public class ODataMediaEntityCreateRequestImpl<E extends ODataEntity>
* @param targetURI target entity set.
* @param media media entity blob to be created.
*/
public ODataMediaEntityCreateRequestImpl(final CommonODataClient<?> odataClient, final URI targetURI,
public ODataMediaEntityCreateRequestImpl(final ODataClient odataClient, final URI targetURI,
final InputStream media) {
super(odataClient, HttpMethod.POST, targetURI);
@ -99,7 +99,7 @@ public class ODataMediaEntityCreateRequestImpl<E extends ODataEntity>
private E entity = null;
private ODataMediaEntityCreateResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private ODataMediaEntityCreateResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -24,7 +24,7 @@ import java.util.concurrent.TimeUnit;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.streamed.MediaEntityUpdateStreamManager;
import org.apache.olingo.client.api.communication.request.streamed.ODataMediaEntityUpdateRequest;
import org.apache.olingo.client.api.communication.response.ODataMediaEntityUpdateResponse;
@ -55,7 +55,7 @@ public class ODataMediaEntityUpdateRequestImpl<E extends ODataEntity>
* @param editURI edit URI of the entity to be updated.
* @param media media entity blob to be created.
*/
public ODataMediaEntityUpdateRequestImpl(final CommonODataClient<?> odataClient,
public ODataMediaEntityUpdateRequestImpl(final ODataClient odataClient,
final HttpMethod method, final URI editURI, final InputStream media) {
super(odataClient, method, editURI);
@ -100,7 +100,7 @@ public class ODataMediaEntityUpdateRequestImpl<E extends ODataEntity>
private E entity = null;
private ODataMediaEntityUpdateResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private ODataMediaEntityUpdateResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -24,7 +24,7 @@ import java.util.concurrent.TimeUnit;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.streamed.ODataStreamUpdateRequest;
import org.apache.olingo.client.api.communication.request.streamed.StreamUpdateStreamManager;
import org.apache.olingo.client.api.communication.response.ODataStreamUpdateResponse;
@ -49,7 +49,7 @@ public class ODataStreamUpdateRequestImpl
* @param targetURI target URI.
* @param stream stream to be updated.
*/
public ODataStreamUpdateRequestImpl(final CommonODataClient<?> odataClient,
public ODataStreamUpdateRequestImpl(final ODataClient odataClient,
final HttpMethod method, final URI targetURI, final InputStream stream) {
super(odataClient, method, targetURI);
@ -97,7 +97,7 @@ public class ODataStreamUpdateRequestImpl
private InputStream input = null;
private ODataStreamUpdateResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
private ODataStreamUpdateResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -34,7 +34,7 @@ import org.apache.http.Header;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.header.HeaderName;
import org.apache.olingo.client.api.communication.request.ODataStreamer;
import org.apache.olingo.client.api.communication.request.batch.ODataBatchLineIterator;
@ -58,7 +58,7 @@ public abstract class AbstractODataResponse implements ODataResponse {
*/
protected static final Logger LOG = LoggerFactory.getLogger(ODataResponse.class);
protected final CommonODataClient<?> odataClient;
protected final ODataClient odataClient;
/**
* HTTP client.
@ -102,7 +102,7 @@ public abstract class AbstractODataResponse implements ODataResponse {
protected ODataBatchController batchInfo = null;
public AbstractODataResponse(
final CommonODataClient<?> odataClient, final HttpClient httpclient, final HttpResponse res) {
final ODataClient odataClient, final HttpClient httpclient, final HttpResponse res) {
this.odataClient = odataClient;
this.httpClient = httpclient;

View File

@ -23,7 +23,7 @@ import java.util.Map;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.communication.request.batch.ODataBatchLineIterator;
import org.apache.olingo.client.api.communication.response.AsyncResponse;
import org.apache.olingo.client.core.communication.request.batch.ODataBatchController;
@ -33,7 +33,7 @@ import org.apache.olingo.client.core.communication.request.batch.ODataBatchContr
*/
public class AsyncResponseImpl extends AbstractODataResponse implements AsyncResponse {
public AsyncResponseImpl(final CommonODataClient<?> odataClient, final HttpClient httpClient,
public AsyncResponseImpl(final ODataClient odataClient, final HttpClient httpClient,
final HttpResponse res) {
super(odataClient, httpClient, res);

View File

@ -23,7 +23,6 @@ import java.net.URI;
import java.util.Map;
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.data.ServiceDocument;
import org.apache.olingo.client.api.domain.ODataEntitySetIterator;
@ -55,9 +54,9 @@ public class ODataReaderImpl implements ODataReader {
*/
protected static final Logger LOG = LoggerFactory.getLogger(ODataReaderImpl.class);
protected final CommonODataClient<?> client;
protected final ODataClient client;
public ODataReaderImpl(final CommonODataClient<?> client) {
public ODataReaderImpl(final ODataClient client) {
this.client = client;
}

View File

@ -28,21 +28,21 @@ import java.util.Collection;
import java.util.Collections;
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.serialization.ODataWriter;
import org.apache.olingo.commons.api.Constants;
import org.apache.olingo.commons.api.data.ResWrap;
import org.apache.olingo.commons.api.domain.ODataEntity;
import org.apache.olingo.commons.api.domain.ODataProperty;
import org.apache.olingo.commons.api.domain.ODataLink;
import org.apache.olingo.commons.api.domain.ODataProperty;
import org.apache.olingo.commons.api.format.ODataFormat;
import org.apache.olingo.commons.api.serialization.ODataSerializerException;
public class ODataWriterImpl implements ODataWriter {
protected final CommonODataClient<?> client;
protected final ODataClient client;
public ODataWriterImpl(final CommonODataClient<?> client) {
public ODataWriterImpl(final ODataClient client) {
this.client = client;
}

View File

@ -44,7 +44,7 @@ import org.apache.http.client.utils.URIBuilder;
import org.apache.http.entity.AbstractHttpEntity;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.InputStreamEntity;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.client.api.http.HttpClientFactory;
import org.apache.olingo.client.api.http.WrappingHttpClientFactory;
import org.apache.olingo.client.api.uri.SegmentType;
@ -351,7 +351,7 @@ public final class URIUtils {
return value;
}
public static boolean shouldUseRepeatableHttpBodyEntry(final CommonODataClient<?> client) {
public static boolean shouldUseRepeatableHttpBodyEntry(final ODataClient client) {
// returns true for authentication request in case of http401 which needs retry so requires being repeatable.
HttpClientFactory httpclientFactory = client.getConfiguration().getHttpClientFactory();
if (httpclientFactory instanceof BasicAuthHttpClientFactory) {
@ -366,7 +366,7 @@ public final class URIUtils {
return false;
}
public static HttpEntity buildInputStreamEntity(final CommonODataClient<?> client, final InputStream input) {
public static HttpEntity buildInputStreamEntity(final ODataClient client, final InputStream input) {
AbstractHttpEntity entity;
boolean useChunked = client.getConfiguration().isUseChuncked();

View File

@ -18,16 +18,16 @@
*/
package org.apache.olingo.client.core;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.commons.api.format.ODataFormat;
import org.custommonkey.xmlunit.XMLUnit;
import org.junit.BeforeClass;
public abstract class AbstractTest {
protected static org.apache.olingo.client.api.ODataClient v4Client;
protected static ODataClient v4Client;
protected abstract CommonODataClient<?> getClient();
protected abstract ODataClient getClient();
@BeforeClass
public static void setUp() {

View File

@ -18,18 +18,18 @@
*/
package org.apache.olingo.client.core;
import org.apache.olingo.client.api.CommonODataClient;
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.apache.olingo.client.api.ODataClient;
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
import org.junit.Test;
public class ODataClientTest {
@Test
public void before() {
CommonODataClient<?> client = ODataClientFactory.getV4();
ODataClient client = ODataClientFactory.getV4();
assertNotNull(client);
assertEquals(ODataServiceVersion.V40, client.getServiceVersion());
}