You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by sk...@apache.org on 2014/05/23 12:58:43 UTC
[48/59] [abbrv] [partial] Removing /ODataJClient: merge complete
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataBatchResponseManager.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataBatchResponseManager.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataBatchResponseManager.java
deleted file mode 100644
index bba10a3..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataBatchResponseManager.java
+++ /dev/null
@@ -1,147 +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 com.msopentech.odatajclient.engine.communication.request.batch;
-
-import com.msopentech.odatajclient.engine.communication.header.ODataHeaders;
-import com.msopentech.odatajclient.engine.communication.response.ODataBatchResponse;
-import com.msopentech.odatajclient.engine.utils.ODataConstants;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import org.apache.commons.io.IOUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Batch response manager class.
- */
-public class ODataBatchResponseManager implements Iterator<ODataBatchResponseItem> {
-
- /**
- * Logger.
- */
- private static final Logger LOG = LoggerFactory.getLogger(ODataBatchResponseManager.class);
-
- /**
- * Batch response line iterator.
- */
- private final ODataBatchLineIterator batchLineIterator;
-
- /**
- * Batch boundary.
- */
- private final String batchBoundary;
-
- /**
- * Expected batch response items iterator.
- */
- private final Iterator<ODataBatchResponseItem> expectedItemsIterator;
-
- /**
- * Last retrieved batch response item.
- */
- private ODataBatchResponseItem current = null;
-
- /**
- * Constructor.
- *
- * @param res OData batch response.
- * @param expectedItems expected batch response items.
- */
- public ODataBatchResponseManager(final ODataBatchResponse res, final List<ODataBatchResponseItem> expectedItems) {
- try {
- this.expectedItemsIterator = expectedItems.iterator();
- this.batchLineIterator = new ODataBatchLineIterator(
- IOUtils.lineIterator(res.getRawResponse(), ODataConstants.UTF8));
-
- // search for boundary
- batchBoundary = ODataBatchUtilities.getBoundaryFromHeader(
- res.getHeader(ODataHeaders.HeaderName.contentType));
- LOG.debug("Retrieved batch response bondary '{}'", batchBoundary);
- } catch (IOException e) {
- LOG.error("Error parsing batch response", e);
- throw new IllegalStateException(e);
- }
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public boolean hasNext() {
- return expectedItemsIterator.hasNext();
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public ODataBatchResponseItem next() {
- if (current != null) {
- current.close();
- }
-
- if (!hasNext()) {
- throw new NoSuchElementException("No item found");
- }
-
- current = expectedItemsIterator.next();
-
- final Map<String, Collection<String>> nextItemHeaders =
- ODataBatchUtilities.nextItemHeaders(batchLineIterator, batchBoundary);
-
- switch (ODataBatchUtilities.getItemType(nextItemHeaders)) {
- case CHANGESET:
- if (!current.isChangeset()) {
- throw new IllegalStateException("Unexpected batch item");
- }
-
- current.initFromBatch(
- batchLineIterator,
- ODataBatchUtilities.getBoundaryFromHeader(
- nextItemHeaders.get(ODataHeaders.HeaderName.contentType.toString())));
- break;
-
- case RETRIEVE:
- if (current.isChangeset()) {
- throw new IllegalStateException("Unexpected batch item");
- }
-
- current.initFromBatch(
- batchLineIterator,
- batchBoundary);
- break;
- default:
- throw new IllegalStateException("Expected item not found");
- }
-
- return current;
- }
-
- /**
- * Unsupported operation.
- */
- @Override
- public void remove() {
- throw new UnsupportedOperationException("Remove operation is not supported");
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataBatchUtilities.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataBatchUtilities.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataBatchUtilities.java
deleted file mode 100644
index 99ebb4d..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataBatchUtilities.java
+++ /dev/null
@@ -1,330 +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 com.msopentech.odatajclient.engine.communication.request.batch;
-
-import com.msopentech.odatajclient.engine.communication.header.ODataHeaders;
-import com.msopentech.odatajclient.engine.communication.request.ODataStreamer;
-import com.msopentech.odatajclient.engine.utils.ODataBatchConstants;
-import com.msopentech.odatajclient.engine.utils.ODataConstants;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.AbstractMap;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.io.LineIterator;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Utility class for batch requests and responses.
- */
-public class ODataBatchUtilities {
-
- public static enum BatchItemType {
-
- NONE,
- CHANGESET,
- RETRIEVE
-
- }
-
- /**
- * Logger.
- */
- private static final Logger LOG = LoggerFactory.getLogger(ODataBatchUtilities.class);
-
- /**
- * Response line syntax.
- */
- private static final Pattern RESPONSE_PATTERN =
- Pattern.compile("HTTP/\\d\\.\\d (\\d+) (.*)", Pattern.CASE_INSENSITIVE);
-
- /**
- * Reads batch part taking source and delimiter (boundary) from given batch controller.
- * <p>
- * Usually used to consume/discard useless lines.
- *
- * @param batchController batch controller.
- * @param checkCurrent if 'TRUE' the current line will be included into the delimiter verification.
- * @return latest read line.
- */
- public static String readBatchPart(final ODataBatchController batchController, final boolean checkCurrent) {
- return readBatchPart(batchController, null, -1, checkCurrent);
- }
-
- /**
- * Reads the given number of line from the given batch wrapped into the batch controller.
- * <p>
- * Usually used to consume/discard useless lines.
- *
- * @param batchController batch controller.
- * @param count number of batch line to be read.
- * @return latest read line.
- */
- public static String readBatchPart(final ODataBatchController batchController, final int count) {
- return readBatchPart(batchController, null, count, true);
- }
-
- /**
- * Reads batch part taking source and delimiter (boundary) from given batch controller.
- * <p>
- * Usually used to read an entire batch part.
- *
- * @param batchController batch controller.
- * @param os destination stream of batch part (null to discard).
- * @param checkCurrent if 'TRUE' the current line will be included into the delimiter verification.
- * @return latest read line.
- */
- public static String readBatchPart(
- final ODataBatchController controller, final OutputStream os, final boolean checkCurrent) {
-
- return readBatchPart(controller, os, -1, checkCurrent);
- }
-
- /**
- * Reads batch part taking source and delimiter (boundary) from given batch controller.
- * <p>
- * Usually used to read an entire batch part.
- *
- * @param batchController batch controller.
- * @param os destination stream of batch part (null to discard).
- * @param count number of batch line to be read.
- * @param checkCurrent if 'TRUE' the current line will be included into the delimiter verification.
- * @return latest read line.
- */
- public static String readBatchPart(
- final ODataBatchController controller, final OutputStream os, final int count, final boolean checkCurrent) {
-
- String currentLine;
-
- synchronized (controller.getBatchLineIterator()) {
- currentLine = checkCurrent ? controller.getBatchLineIterator().getCurrent() : null;
-
- if (count < 0) {
- try {
-
- boolean notEndLine = isNotEndLine(controller, currentLine);
-
- while (controller.isValidBatch() && notEndLine && controller.getBatchLineIterator().hasNext()) {
-
- currentLine = controller.getBatchLineIterator().nextLine();
- LOG.debug("Read line '{}' (end-line '{}')", currentLine, controller.getBoundary());
-
- notEndLine = isNotEndLine(controller, currentLine);
-
- if (notEndLine && os != null) {
- os.write(currentLine.getBytes(ODataConstants.UTF8));
- os.write(ODataStreamer.CRLF);
- }
- }
-
- } catch (IOException e) {
- LOG.error("Error reading batch part", e);
- throw new IllegalStateException(e);
- }
-
- } else {
- for (int i = 0;
- controller.isValidBatch() && controller.getBatchLineIterator().hasNext() && i < count; i++) {
- currentLine = controller.getBatchLineIterator().nextLine();
- }
- }
- }
-
- return currentLine;
- }
-
- /**
- * Reads headers from the batch starting from the given position.
- *
- * @param iterator batch iterator.
- * @return Map of header name in header values.
- */
- public static Map<String, Collection<String>> readHeaders(final ODataBatchLineIterator iterator) {
- final Map<String, Collection<String>> target =
- new TreeMap<String, Collection<String>>(String.CASE_INSENSITIVE_ORDER);
-
- readHeaders(iterator, target);
- return target;
- }
-
- /**
- * Reads headers from the batch starting from the given position.
- * <p>
- * Retrieved headers will be added to the map given by target parameter.
- *
- * @param iterator batch iterator.
- * @param target destination of the retrieved headers.
- */
- public static void readHeaders(
- final ODataBatchLineIterator iterator, final Map<String, Collection<String>> target) {
-
- try {
- final ByteArrayOutputStream baos = new ByteArrayOutputStream();
- readBatchPart(new ODataBatchController(iterator, null), baos, true);
-
- final LineIterator headers = IOUtils.lineIterator(new ByteArrayInputStream(baos.toByteArray()),
- ODataConstants.UTF8);
- while (headers.hasNext()) {
- final String line = headers.nextLine().trim();
- if (StringUtils.isNotBlank(line)) {
- addHeaderLine(line, target);
- }
- }
- } catch (Exception e) {
- LOG.error("Error retrieving headers", e);
- throw new IllegalStateException(e);
- }
- }
-
- /**
- * Parses and adds the given header line to the given target map.
- *
- * @param headerLine header line to be added.
- * @param targetMap target map.
- */
- public static void addHeaderLine(final String headerLine, final Map<String, Collection<String>> targetMap) {
- final int sep = headerLine.indexOf(':');
- if (sep > 0 && sep < headerLine.length() - 1) {
- final String key = headerLine.substring(0, sep).trim();
- final Collection<String> value;
- if (targetMap.containsKey(key)) {
- value = targetMap.get(key);
- } else {
- value = new HashSet<String>();
- targetMap.put(key, value);
- }
- value.add(headerLine.substring(sep + 1, headerLine.length()).trim());
- }
- }
-
- /**
- * Retrieved batch boundary from the given content-type header values.
- *
- * @param contentType content-types.
- * @return batch boundary.
- */
- public static String getBoundaryFromHeader(final Collection<String> contentType) {
- final String boundaryKey = ODataBatchConstants.BOUNDARY + "=";
-
- if (contentType == null || contentType.isEmpty() || !contentType.toString().contains(boundaryKey)) {
- throw new IllegalArgumentException("Invalid content type");
- }
-
- final String headerValue = contentType.toString();
-
- final int start = headerValue.indexOf(boundaryKey) + boundaryKey.length();
- int end = headerValue.indexOf(';', start);
-
- if (end < 0) {
- end = headerValue.indexOf(']', start);
- }
-
- final String res = headerValue.substring(start, end);
- return res.startsWith("--") ? res : "--" + res;
- }
-
- /**
- * Retrieves response line from the given position.
- *
- * @param iterator batch iterator.
- * @return retrieved response line.
- */
- public static Map.Entry<Integer, String> readResponseLine(final ODataBatchLineIterator iterator) {
- final String line = readBatchPart(new ODataBatchController(iterator, null), 1);
- LOG.debug("Response line '{}'", line);
-
- final Matcher matcher = RESPONSE_PATTERN.matcher(line.trim());
-
- if (matcher.matches()) {
- return new AbstractMap.SimpleEntry<Integer, String>(Integer.valueOf(matcher.group(1)), matcher.group(2));
- }
-
- throw new IllegalArgumentException("Invalid response line '" + line + "'");
- }
-
- /**
- * Retrieves headers of the next batch item.
- *
- * @param iterator batch line iterator.
- * @param boundary batch boundary.
- * @return batch item headers.
- */
- public static Map<String, Collection<String>> nextItemHeaders(
- final ODataBatchLineIterator iterator, final String boundary) {
-
- final Map<String, Collection<String>> headers =
- new TreeMap<String, Collection<String>>(String.CASE_INSENSITIVE_ORDER);
-
- final String line = ODataBatchUtilities.readBatchPart(new ODataBatchController(iterator, boundary), true);
-
- if (line != null && line.trim().equals(boundary)) {
- ODataBatchUtilities.readHeaders(iterator, headers);
- }
-
- LOG.debug("Retrieved batch item headers {}", headers);
- return headers;
- }
-
- /**
- * Retrieves item type from item headers.
- *
- * @param headers batch item headers.
- * @return batch item type.
- */
- public static BatchItemType getItemType(final Map<String, Collection<String>> headers) {
-
- final BatchItemType nextItemType;
-
- final String contentType = headers.containsKey(ODataHeaders.HeaderName.contentType.toString())
- ? headers.get(ODataHeaders.HeaderName.contentType.toString()).toString() : StringUtils.EMPTY;
-
- if (contentType.contains(ODataBatchConstants.MULTIPART_CONTENT_TYPE)) {
- nextItemType = BatchItemType.CHANGESET;
- } else if (contentType.contains(ODataBatchConstants.ITEM_CONTENT_TYPE)) {
- nextItemType = BatchItemType.RETRIEVE;
- } else {
- nextItemType = BatchItemType.NONE;
- }
-
- LOG.debug("Retrieved next item type {}", nextItemType);
- return nextItemType;
- }
-
- /**
- * Checks if the given line is the expected end-line.
- *
- * @param controller batch controller.
- * @param line line to be checked.
- * @return 'TRUE' if the line is not the end-line; 'FALSE' otherwise.
- */
- private static boolean isNotEndLine(final ODataBatchController controller, final String line) {
- return line == null
- || (StringUtils.isBlank(controller.getBoundary()) && StringUtils.isNotBlank(line))
- || (StringUtils.isNotBlank(controller.getBoundary()) && !line.startsWith(controller.getBoundary()));
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataBatchableRequest.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataBatchableRequest.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataBatchableRequest.java
deleted file mode 100644
index d906cc5..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataBatchableRequest.java
+++ /dev/null
@@ -1,47 +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 com.msopentech.odatajclient.engine.communication.request.batch;
-
-import com.msopentech.odatajclient.engine.communication.request.ODataRequest;
-
-/**
- * Object request that can be sent embedded into a batch request.
- */
-public interface ODataBatchableRequest extends ODataRequest {
-
- /**
- * Writes (and consume) the request onto the given batch stream.
- * <p>
- * Please note that this method will consume the request (execution won't be possible anymore).
- *
- * @param req destination batch request.
- */
- void batch(final ODataBatchRequest req);
-
- /**
- * Writes (and consume) the request onto the given batch stream.
- * <p>
- * Please note that this method will consume the request (execution won't be possible anymore).
- *
- * @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 ODataBatchRequest req, final String contentId);
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataChangeset.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataChangeset.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataChangeset.java
deleted file mode 100644
index 63c6f82..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataChangeset.java
+++ /dev/null
@@ -1,124 +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 com.msopentech.odatajclient.engine.communication.request.batch;
-
-import com.msopentech.odatajclient.engine.client.http.HttpMethod;
-import com.msopentech.odatajclient.engine.communication.header.ODataHeaders;
-import com.msopentech.odatajclient.engine.communication.request.ODataRequestImpl;
-import com.msopentech.odatajclient.engine.utils.ODataBatchConstants;
-import java.util.UUID;
-
-/**
- * Changeset wrapper for the corresponding batch item.
- */
-public class ODataChangeset extends ODataBatchRequestItem {
-
- /**
- * ContentId.
- */
- private int contentId = 0;
-
- /**
- * Changeset boundary.
- */
- private final String boundary;
-
- /**
- * Expected changeset response items.
- */
- private final ODataChangesetResponseItem expectedResItem;
-
- /**
- * Constructor.
- *
- * @param req batch request.
- * @param expectedResItem expected OData response items.
- */
- ODataChangeset(final ODataBatchRequest req, final ODataChangesetResponseItem expectedResItem) {
- super(req);
- this.expectedResItem = expectedResItem;
-
- // create a random UUID value for boundary
- boundary = "changeset_" + UUID.randomUUID().toString();
- }
-
- public int getLastContentId() {
- return contentId;
- }
-
- /**
- * Close changeset item an send changeset request footer.
- */
- @Override
- protected void closeItem() {
- // stream close-delimiter
- if (hasStreamedSomething) {
- newLine();
- stream(("--" + boundary + "--").getBytes());
- newLine();
- newLine();
- }
- }
-
- /**
- * Serialize and send the given request.
- * <p>
- * An IllegalArgumentException is thrown in case of GET request.
- *
- * @param request request to be serialized.
- * @return current item instance.
- */
- public ODataChangeset addRequest(final ODataBatchableRequest request) {
- if (!isOpen()) {
- throw new IllegalStateException("Current batch item is closed");
- }
-
- if (request.getMethod() == HttpMethod.GET) {
- throw new IllegalArgumentException("Invalid request. GET method not allowed in changeset");
- }
-
- if (!hasStreamedSomething) {
- stream((ODataHeaders.HeaderName.contentType.toString() + ": "
- + ODataBatchConstants.MULTIPART_CONTENT_TYPE + ";boundary=" + boundary).getBytes());
-
- newLine();
- newLine();
-
- hasStreamedSomething = true;
- }
-
- contentId++;
-
- // preamble
- newLine();
-
- // stream batch-boundary
- stream(("--" + boundary).getBytes());
- newLine();
-
- // stream the request
- streamRequestHeader(request, contentId);
-
- request.batch(req, String.valueOf(contentId));
-
- // add request to the list
- expectedResItem.addResponse(String.valueOf(contentId), ((ODataRequestImpl) request).getResponseTemplate());
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataChangesetResponseItem.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataChangesetResponseItem.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataChangesetResponseItem.java
deleted file mode 100644
index b5067f9..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataChangesetResponseItem.java
+++ /dev/null
@@ -1,131 +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 com.msopentech.odatajclient.engine.communication.request.batch;
-
-import static com.msopentech.odatajclient.engine.communication.request.batch.ODataBatchResponseItem.LOG;
-
-import com.msopentech.odatajclient.engine.communication.response.ODataResponse;
-import com.msopentech.odatajclient.engine.utils.ODataBatchConstants;
-import java.util.Collection;
-import java.util.Map;
-import java.util.NoSuchElementException;
-
-/**
- * Changeset wrapper for the corresponding batch item.
- */
-public class ODataChangesetResponseItem extends ODataBatchResponseItem {
-
- /**
- * Last cached OData response.
- */
- private ODataResponse current = null;
-
- /**
- * Constructor.
- */
- public ODataChangesetResponseItem() {
- super(true);
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public boolean hasNext() {
- if (closed) {
- throw new IllegalStateException("Invalid request - the item has been closed");
- }
-
- if (expectedItemsIterator == null) {
- expectedItemsIterator = responses.values().iterator();
- }
-
- return expectedItemsIterator.hasNext();
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public ODataResponse next() {
-
- if (current != null) {
- current.close();
- }
-
- if (closed) {
- throw new IllegalStateException("Invalid request - the item has been closed");
- }
-
- if (hasNext()) {
- // consume item for condition above (like a counter ...)
- expectedItemsIterator.next();
- } else {
- throw new NoSuchElementException("No item found");
- }
-
- final Map<String, Collection<String>> nextItemHeaders =
- ODataBatchUtilities.nextItemHeaders(batchLineIterator, boundary);
-
- if (nextItemHeaders.isEmpty()) {
- throw new IllegalStateException("Expected item not found");
- }
-
- final Map.Entry<Integer, String> responseLine = ODataBatchUtilities.readResponseLine(batchLineIterator);
- LOG.debug("Retrieved item response {}", responseLine);
-
- final Map<String, Collection<String>> headers = ODataBatchUtilities.readHeaders(batchLineIterator);
- LOG.debug("Retrieved item headers {}", headers);
-
- Collection<String> contentId = nextItemHeaders.get(ODataBatchConstants.CHANGESET_CONTENT_ID_NAME);
-
- if (contentId == null || contentId.isEmpty()) {
- contentId = headers.get(ODataBatchConstants.CHANGESET_CONTENT_ID_NAME);
-
- if (contentId == null || contentId.isEmpty()) {
- throw new IllegalStateException("Content-ID is missing");
- }
- }
-
- current = getResponse(contentId.iterator().next());
-
- if (current == null) {
- throw new IllegalStateException("Unexpected '" + contentId + "' item found");
- }
-
- current.initFromBatch(responseLine, headers, batchLineIterator, boundary);
-
- if (current.getStatusCode() >= 400) {
- // found error .... consume expeted items
- while (expectedItemsIterator.hasNext()) {
- expectedItemsIterator.next();
- }
- }
-
- return current;
- }
-
- /**
- * Unsupported operation.
- */
- @Override
- public void remove() {
- throw new UnsupportedOperationException("Not supported operation.");
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataRetrieve.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataRetrieve.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataRetrieve.java
deleted file mode 100644
index bad847b..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataRetrieve.java
+++ /dev/null
@@ -1,81 +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 com.msopentech.odatajclient.engine.communication.request.batch;
-
-import com.msopentech.odatajclient.engine.client.http.HttpMethod;
-import com.msopentech.odatajclient.engine.communication.request.ODataRequestImpl;
-
-/**
- * Retrieve request wrapper for the corresponding batch item.
- */
-public class ODataRetrieve extends ODataBatchRequestItem {
-
- private final ODataRetrieveResponseItem expectedResItem;
-
- /**
- * Constructor.
- *
- * @param req batch request.
- * @param expectedResItem expected batch response item.
- */
- ODataRetrieve(final ODataBatchRequest req, final ODataRetrieveResponseItem expectedResItem) {
- super(req);
- this.expectedResItem = expectedResItem;
- }
-
- /**
- * Close item.
- */
- @Override
- protected void closeItem() {
- // nop
- }
-
- /**
- * Serialize and send the given request.
- * <p>
- * An IllegalArgumentException is thrown in case of no GET request.
- *
- * @param request request to be serialized.
- * @return current item instance.
- */
- public ODataRetrieve setRequest(final ODataBatchableRequest request) {
- if (!isOpen()) {
- throw new IllegalStateException("Current batch item is closed");
- }
-
- if (((ODataRequestImpl) request).getMethod() != HttpMethod.GET) {
- throw new IllegalArgumentException("Invalid request. Only GET method is allowed");
- }
-
- hasStreamedSomething = true;
-
- // stream the request
- streamRequestHeader(request);
-
- // close before in order to avoid any further setRequest calls.
- close();
-
- // add request to the list
- expectedResItem.addResponse(
- ODataRetrieveResponseItem.RETRIEVE_CONTENT_ID, ((ODataRequestImpl) request).getResponseTemplate());
-
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataRetrieveResponseItem.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataRetrieveResponseItem.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataRetrieveResponseItem.java
deleted file mode 100644
index 90523b9..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/ODataRetrieveResponseItem.java
+++ /dev/null
@@ -1,86 +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 com.msopentech.odatajclient.engine.communication.request.batch;
-
-import static com.msopentech.odatajclient.engine.communication.request.batch.ODataBatchResponseItem.LOG;
-import com.msopentech.odatajclient.engine.communication.response.ODataResponse;
-import java.util.Collection;
-import java.util.Map;
-import java.util.NoSuchElementException;
-
-/**
- * Retrieve response wrapper for the corresponding batch item.
- */
-public class ODataRetrieveResponseItem extends ODataBatchResponseItem {
-
- public static final String RETRIEVE_CONTENT_ID = "__RETRIEVE__";
-
- /**
- * Constructor.
- */
- public ODataRetrieveResponseItem() {
- super(false);
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public boolean hasNext() {
- if (closed) {
- throw new IllegalStateException("Invalid request - the item has been closed");
- }
-
- if (expectedItemsIterator == null) {
- expectedItemsIterator = responses.values().iterator();
- }
-
- return expectedItemsIterator.hasNext();
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public ODataResponse next() {
- if (closed) {
- throw new IllegalStateException("Invalid request - the item has been closed");
- }
-
- if (!hasNext()) {
- throw new NoSuchElementException("No item found");
- }
-
- final Map.Entry<Integer, String> responseLine = ODataBatchUtilities.readResponseLine(batchLineIterator);
- LOG.debug("Retrieved item response {}", responseLine);
-
- final Map<String, Collection<String>> headers = ODataBatchUtilities.readHeaders(batchLineIterator);
- LOG.debug("Retrieved item headers {}", headers);
-
- return expectedItemsIterator.next().initFromBatch(responseLine, headers, batchLineIterator, boundary);
- }
-
- /**
- * Unsupported operation.
- */
- @Override
- public void remove() {
- throw new UnsupportedOperationException("Operation not supported.");
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/V3BatchRequestFactory.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/V3BatchRequestFactory.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/V3BatchRequestFactory.java
deleted file mode 100644
index 119af93..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/V3BatchRequestFactory.java
+++ /dev/null
@@ -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 com.msopentech.odatajclient.engine.communication.request.batch;
-
-import com.msopentech.odatajclient.engine.client.ODataV3Client;
-
-public class V3BatchRequestFactory extends AbstractBatchRequestFactory {
-
- private static final long serialVersionUID = -6271567229804128570L;
-
- public V3BatchRequestFactory(final ODataV3Client client) {
- super(client);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/V4BatchRequestFactory.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/V4BatchRequestFactory.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/V4BatchRequestFactory.java
deleted file mode 100644
index 04c161d..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/batch/V4BatchRequestFactory.java
+++ /dev/null
@@ -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 com.msopentech.odatajclient.engine.communication.request.batch;
-
-import com.msopentech.odatajclient.engine.client.ODataV4Client;
-
-public class V4BatchRequestFactory extends AbstractBatchRequestFactory {
-
- private static final long serialVersionUID = 788349446729208639L;
-
- public V4BatchRequestFactory(final ODataV4Client client) {
- super(client);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/AbstractCUDRequestFactory.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/AbstractCUDRequestFactory.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/AbstractCUDRequestFactory.java
deleted file mode 100644
index c4e2eb0..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/AbstractCUDRequestFactory.java
+++ /dev/null
@@ -1,189 +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 com.msopentech.odatajclient.engine.communication.request.cud;
-
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import com.msopentech.odatajclient.engine.client.http.HttpMethod;
-import com.msopentech.odatajclient.engine.communication.request.UpdateType;
-import com.msopentech.odatajclient.engine.data.ODataEntity;
-import com.msopentech.odatajclient.engine.data.ODataLink;
-import com.msopentech.odatajclient.engine.data.ODataPrimitiveValue;
-import com.msopentech.odatajclient.engine.data.ODataProperty;
-import java.net.URI;
-
-public abstract class AbstractCUDRequestFactory implements CUDRequestFactory {
-
- private static final long serialVersionUID = -2723641791198745990L;
-
- protected final ODataClient client;
-
- protected AbstractCUDRequestFactory(final ODataClient client) {
- this.client = client;
- }
-
- @Override
- public ODataEntityCreateRequest getEntityCreateRequest(final URI targetURI, final ODataEntity entity) {
- return new ODataEntityCreateRequest(client, targetURI, entity);
- }
-
- @Override
- public ODataEntityUpdateRequest getEntityUpdateRequest(
- final URI targetURI, final UpdateType type, final ODataEntity changes) {
-
- final ODataEntityUpdateRequest req;
-
- if (client.getConfiguration().isUseXHTTPMethod()) {
- req = new ODataEntityUpdateRequest(client, HttpMethod.POST, targetURI, changes);
- req.setXHTTPMethod(type.getMethod().name());
- } else {
- req = new ODataEntityUpdateRequest(client, type.getMethod(), targetURI, changes);
- }
-
- return req;
- }
-
- @Override
- public ODataEntityUpdateRequest getEntityUpdateRequest(final UpdateType type, final ODataEntity entity) {
- if (entity.getEditLink() == null) {
- throw new IllegalArgumentException("No edit link found");
- }
-
- final ODataEntityUpdateRequest req;
-
- if (client.getConfiguration().isUseXHTTPMethod()) {
- req = new ODataEntityUpdateRequest(client, HttpMethod.POST, entity.getEditLink(), entity);
- req.setXHTTPMethod(type.getMethod().name());
- } else {
- req = new ODataEntityUpdateRequest(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 ODataValueUpdateRequest(client, HttpMethod.POST, targetURI, value);
- req.setXHTTPMethod(type.getMethod().name());
- } else {
- req = new ODataValueUpdateRequest(client, type.getMethod(), 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 ODataPropertyUpdateRequest(client, HttpMethod.POST, targetURI, property);
- req.setXHTTPMethod(HttpMethod.PUT.name());
- } else {
- req = new ODataPropertyUpdateRequest(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 ODataPropertyUpdateRequest(client, HttpMethod.POST, targetURI, property);
- req.setXHTTPMethod(type.getMethod().name());
- } else {
- req = new ODataPropertyUpdateRequest(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 ODataPropertyUpdateRequest(client, HttpMethod.POST, targetURI, property);
- req.setXHTTPMethod(HttpMethod.PUT.name());
- } else {
- req = new ODataPropertyUpdateRequest(client, HttpMethod.PUT, targetURI, property);
- }
-
- return req;
- }
-
- @Override
- public ODataLinkCreateRequest getLinkCreateRequest(final URI targetURI, final ODataLink link) {
- return new ODataLinkCreateRequest(client, targetURI, link);
- }
-
- @Override
- public ODataLinkUpdateRequest getLinkUpdateRequest(
- final URI targetURI, final UpdateType type, final ODataLink link) {
-
- final ODataLinkUpdateRequest req;
-
- if (client.getConfiguration().isUseXHTTPMethod()) {
- req = new ODataLinkUpdateRequest(client, HttpMethod.POST, targetURI, link);
- req.setXHTTPMethod(type.getMethod().name());
- } else {
- req = new ODataLinkUpdateRequest(client, type.getMethod(), targetURI, link);
- }
-
- return req;
- }
-
- @Override
- public ODataDeleteRequest getDeleteRequest(final URI targetURI) {
- final ODataDeleteRequest req;
-
- if (client.getConfiguration().isUseXHTTPMethod()) {
- req = new ODataDeleteRequest(client, HttpMethod.POST, targetURI);
- req.setXHTTPMethod(HttpMethod.DELETE.name());
- } else {
- req = new ODataDeleteRequest(client, HttpMethod.DELETE, targetURI);
- }
-
- return req;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/CUDRequestFactory.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/CUDRequestFactory.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/CUDRequestFactory.java
deleted file mode 100644
index 99af458..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/CUDRequestFactory.java
+++ /dev/null
@@ -1,145 +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 com.msopentech.odatajclient.engine.communication.request.cud;
-
-import com.msopentech.odatajclient.engine.communication.request.UpdateType;
-import com.msopentech.odatajclient.engine.data.ODataEntity;
-import com.msopentech.odatajclient.engine.data.ODataLink;
-import com.msopentech.odatajclient.engine.data.ODataPrimitiveValue;
-import com.msopentech.odatajclient.engine.data.ODataProperty;
-import java.io.Serializable;
-import java.net.URI;
-
-/**
- * OData request factory class.
- */
-public interface CUDRequestFactory extends Serializable {
-
- /**
- * Gets a create request object instance.
- * <br/>
- * Use this kind of request to create a new entity.
- *
- * @param targetURI entity set URI.
- * @param entity entity to be created.
- * @return new ODataEntityCreateRequest instance.
- */
- ODataEntityCreateRequest getEntityCreateRequest(URI targetURI, ODataEntity entity);
-
- /**
- * Gets an update request object instance.
- *
- * @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.
- */
- ODataEntityUpdateRequest getEntityUpdateRequest(URI targetURI, UpdateType type, ODataEntity changes);
-
- /**
- * Gets an update request object instance; uses entity's edit link as endpoint.
- *
- * @param type type of update to be performed.
- * @param entity changes to be applied.
- * @return new ODataEntityUpdateRequest instance.
- */
- ODataEntityUpdateRequest getEntityUpdateRequest(UpdateType type, ODataEntity 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 an add link request object instance.
- * <br/>
- * Use this kind of request to create a navigation link between existing entities.
- *
- * @param targetURI navigation property's link collection.
- * @param link navigation link to be added.
- * @return new ODataLinkCreateRequest instance.
- */
- ODataLinkCreateRequest getLinkCreateRequest(URI targetURI, ODataLink link);
-
- /**
- * Gets a link update request object instance.
- * <br/>
- * Use this kind of request to update a navigation link between existing entities.
- * <br/>
- * In case of the old navigation link doesn't exist the new one will be added as well.
- *
- * @param targetURI navigation property's link collection.
- * @param type type of update to be performed.
- * @param link URL that identifies the entity to be linked.
- * @return new ODataLinkUpdateRequest instance.
- */
- ODataLinkUpdateRequest getLinkUpdateRequest(URI targetURI, UpdateType type, ODataLink link);
-
- /**
- * 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);
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataDeleteRequest.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataDeleteRequest.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataDeleteRequest.java
deleted file mode 100644
index 5631e0d..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataDeleteRequest.java
+++ /dev/null
@@ -1,92 +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 com.msopentech.odatajclient.engine.communication.request.cud;
-
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import com.msopentech.odatajclient.engine.client.http.HttpMethod;
-import com.msopentech.odatajclient.engine.communication.response.ODataResponseImpl;
-import com.msopentech.odatajclient.engine.communication.request.AbstractODataBasicRequestImpl;
-import com.msopentech.odatajclient.engine.communication.request.batch.ODataBatchableRequest;
-import com.msopentech.odatajclient.engine.communication.response.ODataDeleteResponse;
-import com.msopentech.odatajclient.engine.format.ODataPubFormat;
-import java.io.InputStream;
-import java.net.URI;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-
-/**
- * This class implements an OData delete request.
- */
-public class ODataDeleteRequest extends AbstractODataBasicRequestImpl<ODataDeleteResponse, ODataPubFormat>
- implements ODataBatchableRequest {
-
- /**
- * Constructor.
- *
- * @param odataClient client instance getting this request
- * @param method HTTP method to be used
- * @param uri URI of the entity to be deleted.
- */
- ODataDeleteRequest(final ODataClient odataClient, final HttpMethod method, final URI uri) {
- super(odataClient, ODataPubFormat.class, method, uri);
- }
-
- /**
- * {@inheritDoc }
- * <p>
- * No payload: null will be returned.
- */
- @Override
- protected InputStream getPayload() {
- return null;
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public ODataDeleteResponse execute() {
- return new ODataDeleteResponseImpl(httpClient, doExecute());
- }
-
- /**
- * Response class about an ODataDeleteRequest.
- */
- private class ODataDeleteResponseImpl extends ODataResponseImpl implements ODataDeleteResponse {
-
- /**
- * Constructor.
- * <p>
- * Just to create response templates to be initialized from batch.
- */
- private ODataDeleteResponseImpl() {
- }
-
- /**
- * Constructor.
- *
- * @param client HTTP client.
- * @param res HTTP response.
- */
- private ODataDeleteResponseImpl(final HttpClient client, final HttpResponse res) {
- super(client, res);
- this.close();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataEntityCreateRequest.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataEntityCreateRequest.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataEntityCreateRequest.java
deleted file mode 100644
index 7d01833..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataEntityCreateRequest.java
+++ /dev/null
@@ -1,124 +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 com.msopentech.odatajclient.engine.communication.request.cud;
-
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import com.msopentech.odatajclient.engine.client.http.HttpMethod;
-import com.msopentech.odatajclient.engine.communication.request.AbstractODataBasicRequestImpl;
-import com.msopentech.odatajclient.engine.communication.request.batch.ODataBatchableRequest;
-import com.msopentech.odatajclient.engine.communication.response.ODataEntityCreateResponse;
-import com.msopentech.odatajclient.engine.communication.response.ODataResponseImpl;
-import com.msopentech.odatajclient.engine.data.ODataEntity;
-import com.msopentech.odatajclient.engine.format.ODataPubFormat;
-import com.msopentech.odatajclient.engine.utils.URIUtils;
-import java.io.InputStream;
-import java.net.URI;
-import org.apache.commons.io.IOUtils;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpPost;
-
-/**
- * This class implements an OData create request.
- */
-public class ODataEntityCreateRequest extends AbstractODataBasicRequestImpl<ODataEntityCreateResponse, ODataPubFormat>
- implements ODataBatchableRequest {
-
- /**
- * Entity to be created.
- */
- private final ODataEntity entity;
-
- /**
- * Constructor.
- *
- * @param odataClient client instance getting this request
- * @param targetURI entity set URI.
- * @param entity entity to be created.
- */
- ODataEntityCreateRequest(final ODataClient odataClient, final URI targetURI, final ODataEntity entity) {
- super(odataClient, ODataPubFormat.class, HttpMethod.POST, targetURI);
- this.entity = entity;
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- protected InputStream getPayload() {
- return odataClient.getWriter().writeEntity(entity, ODataPubFormat.fromString(getContentType()));
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public ODataEntityCreateResponse execute() {
- final InputStream input = getPayload();
- ((HttpPost) request).setEntity(URIUtils.buildInputStreamEntity(odataClient, input));
-
- try {
- return new ODataEntityCreateResponseImpl(httpClient, doExecute());
- } finally {
- IOUtils.closeQuietly(input);
- }
- }
-
- /**
- * Response class about an ODataEntityCreateRequest.
- */
- private class ODataEntityCreateResponseImpl extends ODataResponseImpl implements ODataEntityCreateResponse {
-
- private ODataEntity entity = null;
-
- /**
- * Constructor.
- * <p>
- * Just to create response templates to be initialized from batch.
- */
- private ODataEntityCreateResponseImpl() {
- }
-
- /**
- * Constructor.
- *
- * @param client HTTP client.
- * @param res HTTP response.
- */
- private ODataEntityCreateResponseImpl(final HttpClient client, final HttpResponse res) {
- super(client, res);
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public ODataEntity getBody() {
- if (entity == null) {
- try {
- entity = odataClient.getReader().
- readEntity(getRawResponse(), ODataPubFormat.fromString(getAccept()));
- } finally {
- this.close();
- }
- }
- return entity;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataEntityUpdateRequest.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataEntityUpdateRequest.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataEntityUpdateRequest.java
deleted file mode 100644
index f5b1de2..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataEntityUpdateRequest.java
+++ /dev/null
@@ -1,130 +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 com.msopentech.odatajclient.engine.communication.request.cud;
-
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import com.msopentech.odatajclient.engine.client.http.HttpMethod;
-import com.msopentech.odatajclient.engine.communication.request.AbstractODataBasicRequestImpl;
-import com.msopentech.odatajclient.engine.communication.request.batch.ODataBatchableRequest;
-import com.msopentech.odatajclient.engine.communication.response.ODataEntityUpdateResponse;
-import com.msopentech.odatajclient.engine.communication.response.ODataResponseImpl;
-import com.msopentech.odatajclient.engine.data.ODataEntity;
-import com.msopentech.odatajclient.engine.format.ODataPubFormat;
-import com.msopentech.odatajclient.engine.utils.URIUtils;
-import java.io.InputStream;
-import java.net.URI;
-import org.apache.commons.io.IOUtils;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
-
-/**
- * This class implements an OData update request.
- */
-public class ODataEntityUpdateRequest extends AbstractODataBasicRequestImpl<ODataEntityUpdateResponse, ODataPubFormat>
- implements ODataBatchableRequest {
-
- /**
- * Changes to be applied.
- */
- private final ODataEntity changes;
-
- /**
- * Constructor.
- *
- * @param odataClient client instance getting this request
- * @param method request method.
- * @param uri URI of the entity to be updated.
- * @param changes changes to be applied.
- */
- ODataEntityUpdateRequest(final ODataClient odataClient,
- final HttpMethod method, final URI uri, final ODataEntity changes) {
-
- super(odataClient, ODataPubFormat.class, method, uri);
- this.changes = changes;
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public ODataEntityUpdateResponse execute() {
- final InputStream input = getPayload();
- ((HttpEntityEnclosingRequestBase) request).setEntity(URIUtils.buildInputStreamEntity(odataClient, input));
-
- try {
- return new ODataEntityUpdateResponseImpl(httpClient, doExecute());
- } finally {
- IOUtils.closeQuietly(input);
- }
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- protected InputStream getPayload() {
- return odataClient.getWriter().writeEntity(changes, ODataPubFormat.fromString(getContentType()));
- }
-
- /**
- * Response class about an ODataEntityUpdateRequest.
- */
- private class ODataEntityUpdateResponseImpl extends ODataResponseImpl implements ODataEntityUpdateResponse {
-
- /**
- * Changes.
- */
- private ODataEntity entity = null;
-
- /**
- * Constructor.
- * <p>
- * Just to create response templates to be initialized from batch.
- */
- private ODataEntityUpdateResponseImpl() {
- }
-
- /**
- * Constructor.
- *
- * @param client HTTP client.
- * @param res HTTP response.
- */
- private ODataEntityUpdateResponseImpl(final HttpClient client, final HttpResponse res) {
- super(client, res);
- }
-
- /**
- * {@inheritDoc ]
- */
- @Override
- public ODataEntity getBody() {
- if (entity == null) {
- try {
- entity = odataClient.getReader().
- readEntity(getRawResponse(), ODataPubFormat.fromString(getAccept()));
- } finally {
- this.close();
- }
- }
- return entity;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataLinkCreateRequest.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataLinkCreateRequest.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataLinkCreateRequest.java
deleted file mode 100644
index 89d450e..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataLinkCreateRequest.java
+++ /dev/null
@@ -1,107 +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 com.msopentech.odatajclient.engine.communication.request.cud;
-
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import com.msopentech.odatajclient.engine.client.http.HttpMethod;
-import com.msopentech.odatajclient.engine.communication.request.AbstractODataBasicRequestImpl;
-import com.msopentech.odatajclient.engine.communication.request.batch.ODataBatchableRequest;
-import com.msopentech.odatajclient.engine.communication.response.ODataLinkOperationResponse;
-import com.msopentech.odatajclient.engine.communication.response.ODataResponseImpl;
-import com.msopentech.odatajclient.engine.data.ODataLink;
-import com.msopentech.odatajclient.engine.format.ODataFormat;
-import com.msopentech.odatajclient.engine.utils.URIUtils;
-import java.io.InputStream;
-import java.net.URI;
-import org.apache.commons.io.IOUtils;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpPost;
-
-/**
- * This class implements an insert link OData request.
- */
-public class ODataLinkCreateRequest extends AbstractODataBasicRequestImpl<ODataLinkOperationResponse, ODataFormat>
- implements ODataBatchableRequest {
-
- /**
- * OData entity to be linked.
- */
- private final ODataLink link;
-
- /**
- * Constructor.
- *
- * @param odataClient client instance getting this request
- * @param targetURI entity set URI.
- * @param link entity to be linked.
- */
- ODataLinkCreateRequest(final ODataClient odataClient, final URI targetURI, final ODataLink link) {
- super(odataClient, ODataFormat.class, HttpMethod.POST, targetURI);
- // set request body
- this.link = link;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public ODataLinkOperationResponse execute() {
- final InputStream input = getPayload();
- ((HttpPost) request).setEntity(URIUtils.buildInputStreamEntity(odataClient, input));
-
- try {
- return new ODataLinkCreateResponseImpl(httpClient, doExecute());
- } finally {
- IOUtils.closeQuietly(input);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected InputStream getPayload() {
- return odataClient.getWriter().writeLink(link, ODataFormat.fromString(getContentType()));
- }
-
- /**
- * This class implements the response to an OData link operation request.
- */
- private class ODataLinkCreateResponseImpl extends ODataResponseImpl implements ODataLinkOperationResponse {
-
- /**
- * Constructor.
- * <p>
- * Just to create response templates to be initialized from batch.
- */
- private ODataLinkCreateResponseImpl() {
- }
-
- /**
- * Constructor.
- *
- * @param client HTTP client.
- * @param res HTTP response.
- */
- private ODataLinkCreateResponseImpl(final HttpClient client, final HttpResponse res) {
- super(client, res);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataLinkUpdateRequest.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataLinkUpdateRequest.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataLinkUpdateRequest.java
deleted file mode 100644
index 23da27c..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataLinkUpdateRequest.java
+++ /dev/null
@@ -1,110 +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 com.msopentech.odatajclient.engine.communication.request.cud;
-
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import com.msopentech.odatajclient.engine.client.http.HttpMethod;
-import com.msopentech.odatajclient.engine.communication.request.AbstractODataBasicRequestImpl;
-import com.msopentech.odatajclient.engine.communication.request.batch.ODataBatchableRequest;
-import com.msopentech.odatajclient.engine.communication.response.ODataLinkOperationResponse;
-import com.msopentech.odatajclient.engine.communication.response.ODataResponseImpl;
-import com.msopentech.odatajclient.engine.data.ODataLink;
-import com.msopentech.odatajclient.engine.format.ODataFormat;
-import com.msopentech.odatajclient.engine.utils.URIUtils;
-import java.io.InputStream;
-import java.net.URI;
-import org.apache.commons.io.IOUtils;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
-
-/**
- * This class implements an update link OData request.
- */
-public class ODataLinkUpdateRequest extends AbstractODataBasicRequestImpl<ODataLinkOperationResponse, ODataFormat>
- implements ODataBatchableRequest {
-
- /**
- * Entity to be linked.
- */
- private final ODataLink link;
-
- /**
- * Constructor.
- *
- * @param odataClient client instance getting this request
- * @param method request method.
- * @param targetURI entity URI.
- * @param link entity to be linked.
- */
- ODataLinkUpdateRequest(final ODataClient odataClient,
- final HttpMethod method, final URI targetURI, final ODataLink link) {
-
- super(odataClient, ODataFormat.class, method, targetURI);
- // set request body
- this.link = link;
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public ODataLinkOperationResponse execute() {
- final InputStream input = getPayload();
- ((HttpEntityEnclosingRequestBase) request).setEntity(URIUtils.buildInputStreamEntity(odataClient, input));
-
- try {
- return new ODataLinkUpdateResponseImpl(httpClient, doExecute());
- } finally {
- IOUtils.closeQuietly(input);
- }
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- protected InputStream getPayload() {
- return odataClient.getWriter().writeLink(link, ODataFormat.fromString(getContentType()));
- }
-
- /**
- * This class implements the response to an OData link operation request.
- */
- public class ODataLinkUpdateResponseImpl extends ODataResponseImpl implements ODataLinkOperationResponse {
-
- /**
- * Constructor.
- * <p>
- * Just to create response templates to be initialized from batch.
- */
- private ODataLinkUpdateResponseImpl() {
- }
-
- /**
- * Constructor.
- *
- * @param client HTTP client.
- * @param res HTTP response.
- */
- public ODataLinkUpdateResponseImpl(final HttpClient client, final HttpResponse res) {
- super(client, res);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataPropertyUpdateRequest.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataPropertyUpdateRequest.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataPropertyUpdateRequest.java
deleted file mode 100644
index 490904f..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/communication/request/cud/ODataPropertyUpdateRequest.java
+++ /dev/null
@@ -1,129 +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 com.msopentech.odatajclient.engine.communication.request.cud;
-
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import com.msopentech.odatajclient.engine.client.http.HttpMethod;
-import com.msopentech.odatajclient.engine.communication.request.AbstractODataBasicRequestImpl;
-import com.msopentech.odatajclient.engine.communication.request.batch.ODataBatchableRequest;
-import com.msopentech.odatajclient.engine.communication.response.ODataPropertyUpdateResponse;
-import com.msopentech.odatajclient.engine.communication.response.ODataResponseImpl;
-import com.msopentech.odatajclient.engine.data.ODataProperty;
-import com.msopentech.odatajclient.engine.format.ODataFormat;
-import com.msopentech.odatajclient.engine.utils.URIUtils;
-import java.io.InputStream;
-import java.net.URI;
-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.http.entity.InputStreamEntity;
-
-/**
- * This class implements an OData update entity property request.
- */
-public class ODataPropertyUpdateRequest extends AbstractODataBasicRequestImpl<ODataPropertyUpdateResponse, ODataFormat>
- implements ODataBatchableRequest {
-
- /**
- * Value to be created.
- */
- private final ODataProperty property;
-
- /**
- * Constructor.
- *
- * @param odataClient client instance getting this request
- * @param method request method.
- * @param targetURI entity set or entity or entity property URI.
- * @param property value to be created.
- */
- ODataPropertyUpdateRequest(final ODataClient odataClient,
- final HttpMethod method, final URI targetURI, final ODataProperty property) {
-
- super(odataClient, ODataFormat.class, method, targetURI);
- // set request body
- this.property = property;
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public ODataPropertyUpdateResponse execute() {
- final InputStream input = getPayload();
- ((HttpEntityEnclosingRequestBase) request).setEntity(URIUtils.buildInputStreamEntity(odataClient, input));
-
- try {
- return new ODataPropertyUpdateResponseImpl(httpClient, doExecute());
- } finally {
- IOUtils.closeQuietly(input);
- }
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- protected InputStream getPayload() {
- return odataClient.getWriter().writeProperty(property, ODataFormat.fromString(getContentType()));
- }
-
- /**
- * Response class about an ODataPropertyUpdateRequest.
- */
- private class ODataPropertyUpdateResponseImpl extends ODataResponseImpl implements ODataPropertyUpdateResponse {
-
- private ODataProperty property = null;
-
- /**
- * Constructor.
- * <p>
- * Just to create response templates to be initialized from batch.
- */
- private ODataPropertyUpdateResponseImpl() {
- }
-
- /**
- * Constructor.
- *
- * @param client HTTP client.
- * @param res HTTP response.
- */
- private ODataPropertyUpdateResponseImpl(final HttpClient client, final HttpResponse res) {
- super(client, res);
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public ODataProperty getBody() {
- if (property == null) {
- try {
- property = odataClient.getReader().
- readProperty(getRawResponse(), ODataFormat.fromString(getAccept()));
- } finally {
- this.close();
- }
- }
- return property;
- }
- }
-}