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/03/10 10:03:03 UTC
[47/51] [abbrv] [partial] [OLINGO-192] rename java packages
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Term.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Term.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Term.java
new file mode 100644
index 0000000..59cdd29
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Term.java
@@ -0,0 +1,44 @@
+/*
+ * 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.edm.xml.v4;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Named;
+
+public interface Term extends Named {
+
+ List<CSDLElement> getAppliesTo();
+
+ String getBaseTerm();
+
+ String getDefaultValue();
+
+ Integer getMaxLength();
+
+ Integer getPrecision();
+
+ Integer getScale();
+
+ String getSrid();
+
+ String getType();
+
+ boolean isNullable();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/TypeDefinition.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/TypeDefinition.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/TypeDefinition.java
new file mode 100644
index 0000000..568c737
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/TypeDefinition.java
@@ -0,0 +1,40 @@
+/*
+ * 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.edm.xml.v4;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Named;
+
+public interface TypeDefinition extends Named {
+
+ List<Annotation> getAnnotations();
+
+ Integer getMaxLength();
+
+ Integer getPrecision();
+
+ Integer getScale();
+
+ String getSrid();
+
+ String getUnderlyingType();
+
+ boolean isUnicode();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/XMLMetadata.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/XMLMetadata.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/XMLMetadata.java
new file mode 100644
index 0000000..f3b619e
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/XMLMetadata.java
@@ -0,0 +1,36 @@
+/*
+ * 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.edm.xml.v4;
+
+import java.util.List;
+
+public interface XMLMetadata extends org.apache.olingo.client.api.edm.xml.XMLMetadata {
+
+ @Override
+ List<Schema> getSchemas();
+
+ @Override
+ Schema getSchema(int index);
+
+ @Override
+ Schema getSchema(String key);
+
+ List<Reference> getReferences();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/ConstExprConstruct.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/ConstExprConstruct.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/ConstExprConstruct.java
new file mode 100644
index 0000000..e51b9e3
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/ConstExprConstruct.java
@@ -0,0 +1,56 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+public interface ConstExprConstruct extends ExprConstruct {
+
+ public enum Type {
+
+ Binary,
+ Bool,
+ Date,
+ DateTimeOffset,
+ Decimal,
+ Duration,
+ EnumMember,
+ Float,
+ Guid,
+ Int,
+ String,
+ TimeOfDay;
+
+ public static Type fromString(final String value) {
+ Type result = null;
+ try {
+ result = valueOf(value);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ return result;
+ }
+ }
+
+ Type getType();
+
+ void setType(Type type);
+
+ String getValue();
+
+ void setValue(String value);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/DynExprConstruct.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/DynExprConstruct.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/DynExprConstruct.java
new file mode 100644
index 0000000..5baffa6
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/DynExprConstruct.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.api.edm.xml.v4.annotation;
+
+public interface DynExprConstruct extends ExprConstruct {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/ExprConstruct.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/ExprConstruct.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/ExprConstruct.java
new file mode 100644
index 0000000..4de83a7
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/ExprConstruct.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.api.edm.xml.v4.annotation;
+
+public interface ExprConstruct {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataFormat.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataFormat.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataFormat.java
new file mode 100644
index 0000000..b7928e9
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataFormat.java
@@ -0,0 +1,97 @@
+/*
+ * 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.format;
+
+import org.apache.http.entity.ContentType;
+
+/**
+ * Available formats to be used in various contexts.
+ */
+public enum ODataFormat {
+
+ /**
+ * JSON format with no metadata.
+ */
+ JSON_NO_METADATA(ContentType.APPLICATION_JSON.getMimeType() + ";odata=nometadata"),
+ /**
+ * JSON format with minimal metadata (default).
+ */
+ JSON(ContentType.APPLICATION_JSON.getMimeType() + ";odata=minimalmetadata"),
+ /**
+ * JSON format with no metadata.
+ */
+ JSON_FULL_METADATA(ContentType.APPLICATION_JSON.getMimeType() + ";odata=fullmetadata"),
+ /**
+ * XML format.
+ */
+ XML(ContentType.APPLICATION_XML.getMimeType());
+
+ private final String format;
+
+ ODataFormat(final String format) {
+ this.format = format;
+ }
+
+ /**
+ * Gets format as a string.
+ *
+ * @return format as a string.
+ */
+ @Override
+ public String toString() {
+ return format;
+ }
+
+ /**
+ * Gets OData format from its string representation.
+ *
+ * @param format string representation of the format.
+ * @return OData format.
+ */
+ public static ODataFormat fromString(final String format) {
+ ODataFormat result = null;
+
+ final StringBuffer _format = new StringBuffer();
+
+ final String[] parts = format.split(";");
+ _format.append(parts[0]);
+ if (ContentType.APPLICATION_JSON.getMimeType().equals(parts[0])) {
+ if (parts.length > 1) {
+ _format.append(';').append(parts[1]);
+ } else {
+ result = ODataFormat.JSON;
+ }
+ }
+
+ if (result == null) {
+ final String candidate = _format.toString();
+ for (ODataFormat value : values()) {
+ if (candidate.equals(value.toString())) {
+ result = value;
+ }
+ }
+ }
+
+ if (result == null) {
+ throw new IllegalArgumentException("Unsupported format: " + format);
+ }
+
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataMediaFormat.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataMediaFormat.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataMediaFormat.java
new file mode 100644
index 0000000..353edc4
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataMediaFormat.java
@@ -0,0 +1,71 @@
+/*
+ * 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.format;
+
+import org.apache.http.entity.ContentType;
+
+/**
+ * Available formats for media.
+ */
+public enum ODataMediaFormat {
+
+ CHARSET_PARAMETER("charset"),
+ MEDIA_TYPE_WILDCARD("*"),
+ WILDCARD("*/*"),
+ APPLICATION_XML(ContentType.APPLICATION_XML.getMimeType()),
+ APPLICATION_ATOM_XML(ContentType.APPLICATION_ATOM_XML.getMimeType()),
+ APPLICATION_XHTML_XML(ContentType.APPLICATION_XHTML_XML.getMimeType()),
+ APPLICATION_SVG_XML(ContentType.APPLICATION_SVG_XML.getMimeType()),
+ APPLICATION_JSON(ContentType.APPLICATION_JSON.getMimeType()),
+ APPLICATION_FORM_URLENCODED(ContentType.APPLICATION_FORM_URLENCODED.getMimeType()),
+ MULTIPART_FORM_DATA(ContentType.MULTIPART_FORM_DATA.getMimeType()),
+ APPLICATION_OCTET_STREAM(ContentType.APPLICATION_OCTET_STREAM.getMimeType()),
+ TEXT_PLAIN(ContentType.TEXT_PLAIN.getMimeType()),
+ TEXT_XML(ContentType.TEXT_XML.getMimeType()),
+ TEXT_HTML(ContentType.TEXT_HTML.getMimeType());
+
+ private final String format;
+
+ private ODataMediaFormat(final String format) {
+ this.format = format;
+ }
+
+ @Override
+ public String toString() {
+ return format;
+ }
+
+ public static ODataMediaFormat fromFormat(final String format) {
+ final String _format = format.split(";")[0];
+
+ ODataMediaFormat result = null;
+
+ for (ODataMediaFormat value : values()) {
+ if (_format.equals(value.toString())) {
+ result = value;
+ }
+ }
+
+ if (result == null) {
+ throw new IllegalArgumentException("Unsupported format: " + format);
+ }
+
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataPubFormat.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataPubFormat.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataPubFormat.java
new file mode 100644
index 0000000..2a89fd7
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataPubFormat.java
@@ -0,0 +1,97 @@
+/*
+ * 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.format;
+
+import org.apache.http.entity.ContentType;
+
+/**
+ * Available formats for AtomPub exchange.
+ */
+public enum ODataPubFormat {
+
+ /**
+ * JSON format with no metadata.
+ */
+ JSON_NO_METADATA(ContentType.APPLICATION_JSON.getMimeType() + ";odata=nometadata"),
+ /**
+ * JSON format with minimal metadata (default).
+ */
+ JSON(ContentType.APPLICATION_JSON.getMimeType() + ";odata=minimalmetadata"),
+ /**
+ * JSON format with no metadata.
+ */
+ JSON_FULL_METADATA(ContentType.APPLICATION_JSON.getMimeType() + ";odata=fullmetadata"),
+ /**
+ * Atom format.
+ */
+ ATOM(ContentType.APPLICATION_ATOM_XML.getMimeType());
+
+ private final String format;
+
+ ODataPubFormat(final String format) {
+ this.format = format;
+ }
+
+ /**
+ * Gets format as a string.
+ *
+ * @return format as a string.
+ */
+ @Override
+ public String toString() {
+ return format;
+ }
+
+ /**
+ * Gets OData format from its string representation.
+ *
+ * @param format string representation of the format.
+ * @return OData format.
+ */
+ public static ODataPubFormat fromString(final String format) {
+ ODataPubFormat result = null;
+
+ final StringBuffer _format = new StringBuffer();
+
+ final String[] parts = format.split(";");
+ _format.append(parts[0]);
+ if (ContentType.APPLICATION_JSON.getMimeType().equals(parts[0])) {
+ if (parts.length > 1 && parts[1].startsWith("odata=")) {
+ _format.append(';').append(parts[1]);
+ } else {
+ result = ODataPubFormat.JSON;
+ }
+ }
+
+ if (result == null) {
+ final String candidate = _format.toString();
+ for (ODataPubFormat value : values()) {
+ if (candidate.equals(value.toString())) {
+ result = value;
+ }
+ }
+ }
+
+ if (result == null) {
+ throw new IllegalArgumentException("Unsupported format: " + format);
+ }
+
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataValueFormat.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataValueFormat.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataValueFormat.java
new file mode 100644
index 0000000..b04ce7d
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataValueFormat.java
@@ -0,0 +1,76 @@
+/*
+ * 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.format;
+
+import org.apache.http.entity.ContentType;
+
+/**
+ * Available formats for property values.
+ */
+public enum ODataValueFormat {
+
+ /**
+ * Application octet stream.
+ */
+ STREAM(ContentType.APPLICATION_OCTET_STREAM.getMimeType()),
+ /**
+ * Plain text format.
+ */
+ TEXT(ContentType.TEXT_PLAIN.getMimeType());
+
+ private final String format;
+
+ ODataValueFormat(final String format) {
+ this.format = format;
+ }
+
+ /**
+ * Gets format as a string.
+ *
+ * @return format as a string.
+ */
+ @Override
+ public String toString() {
+ return format;
+ }
+
+ /**
+ * Gets format from its string representation.
+ *
+ * @param format string representation of the format.
+ * @return OData format.
+ */
+ public static ODataValueFormat fromString(final String format) {
+ final String _format = format.split(";")[0];
+
+ ODataValueFormat result = null;
+
+ for (ODataValueFormat value : values()) {
+ if (_format.equals(value.toString())) {
+ result = value;
+ }
+ }
+
+ if (result == null) {
+ throw new IllegalArgumentException("Unsupported format: " + format);
+ }
+
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientException.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientException.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientException.java
new file mode 100644
index 0000000..12e432b
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientException.java
@@ -0,0 +1,68 @@
+/*
+ * 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.http;
+
+/**
+ * A client-side processing runtime exception.
+ *
+ * The exception is thrown during HTTP request invocation processing, to signal a failure to process the HTTP request or
+ * response. The exception message or nested {@link Throwable} cause SHOULD contain additional information about the
+ * reason of the processing failure.
+ */
+public class HttpClientException extends RuntimeException {
+
+ private static final long serialVersionUID = -4232431597816056514L;
+
+ /**
+ * Constructs a new client-side runtime exception with the specified cause and a detail message of
+ * {@code (cause==null ? null : cause.toString())} (which typically contains the class and detail message of
+ * {@code cause}). This constructor is useful for runtime exceptions that are little more than wrappers for other
+ * throwables.
+ *
+ * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null}
+ * value is permitted, and indicates that the cause is nonexistent or unknown.)
+ */
+ public HttpClientException(final Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Constructs a new client-side runtime exception with the specified detail message and cause.
+ * <br/>
+ * Note that the detail message associated with {@code cause} is <i>not</i>
+ * automatically incorporated in this runtime exception's detail message.
+ *
+ * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method).
+ * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null}
+ * value is permitted, and indicates that the cause is nonexistent or unknown.)
+ */
+ public HttpClientException(final String message, final Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs a new client-side runtime exception with the specified detail message. The cause is not initialized, and
+ * may subsequently be initialized by a call to {@link #initCause}.
+ *
+ * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method).
+ */
+ public HttpClientException(final String message) {
+ super(message);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientFactory.java
new file mode 100644
index 0000000..367ef01
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientFactory.java
@@ -0,0 +1,30 @@
+/*
+ * 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.http;
+
+import java.net.URI;
+import org.apache.http.client.HttpClient;
+
+/**
+ * Interface used by ODataRequest implementations to instantiate HttpClient.
+ */
+public interface HttpClientFactory {
+
+ HttpClient createHttpClient(HttpMethod method, URI uri);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpMethod.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpMethod.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpMethod.java
new file mode 100644
index 0000000..df3f06a
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpMethod.java
@@ -0,0 +1,33 @@
+/*
+ * 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.http;
+
+/**
+ * Supported HTTP methods.
+ */
+public enum HttpMethod {
+
+ GET,
+ POST,
+ PUT,
+ PATCH,
+ MERGE,
+ DELETE;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpUriRequestFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpUriRequestFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpUriRequestFactory.java
new file mode 100644
index 0000000..1687045
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpUriRequestFactory.java
@@ -0,0 +1,30 @@
+/*
+ * 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.http;
+
+import java.net.URI;
+import org.apache.http.client.methods.HttpUriRequest;
+
+/**
+ * Interface used by ODataRequest implementations to create the HttpUriRequest.
+ */
+public interface HttpUriRequestFactory {
+
+ HttpUriRequest createHttpUriRequest(HttpMethod method, URI uri);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/http/NoContentException.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/http/NoContentException.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/NoContentException.java
new file mode 100644
index 0000000..4daf92d
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/NoContentException.java
@@ -0,0 +1,36 @@
+/*
+ * 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.http;
+
+import org.apache.http.HttpStatus;
+
+/**
+ * Exception to be thrown when trying to read content with HTTP status 204.
+ */
+public class NoContentException extends HttpClientException {
+
+ private static final long serialVersionUID = 7947066635285809192L;
+
+ /**
+ * Constructs a new client-side runtime exception, with fixed message.
+ */
+ public NoContentException() {
+ super("No content found when HTTP status is " + HttpStatus.SC_NO_CONTENT);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataBinder.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataBinder.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataBinder.java
new file mode 100644
index 0000000..94044f9
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataBinder.java
@@ -0,0 +1,122 @@
+/*
+ * 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.op;
+
+import java.io.Serializable;
+
+import org.apache.olingo.client.api.data.ServiceDocument;
+import org.apache.olingo.client.api.domain.ODataServiceDocument;
+
+public interface ODataBinder extends Serializable {
+
+ /**
+ * Gets <tt>ODataServiceDocument</tt> from the given service document resource.
+ *
+ * @param resource service document resource.
+ * @return <tt>ODataServiceDocument</tt> object.
+ */
+ ODataServiceDocument getODataServiceDocument(ServiceDocument resource);
+
+ /**
+ * Gets a <tt>FeedResource</tt> from the given OData entity set.
+ *
+ * @param <T> feed resource type.
+ * @param feed OData entity set.
+ * @param reference reference class.
+ * @return <tt>FeedResource</tt> object.
+ */
+// <T extends Feed> T getFeed(ODataEntitySet feed, Class<T> reference);
+ /**
+ * Gets an <tt>EntryResource</tt> from the given OData entity.
+ *
+ * @param <T> entry resource type.
+ * @param entity OData entity.
+ * @param reference reference class.
+ * @return <tt>EntryResource</tt> object.
+ */
+// <T extends Entry> T getEntry(ODataEntity entity, Class<T> reference);
+ /**
+ * Gets an <tt>EntryResource</tt> from the given OData entity.
+ *
+ * @param <T> entry resource type.
+ * @param entity OData entity.
+ * @param reference reference class.
+ * @param setType whether to explicitly output type information.
+ * @return <tt>EntryResource</tt> object.
+ */
+// <T extends Entry> T getEntry(ODataEntity entity, Class<T> reference, boolean setType);
+ /**
+ * Gets the given OData property as DOM element.
+ *
+ * @param prop OData property.
+ * @return <tt>Element</tt> object.
+ */
+// Element toDOMElement(ODataProperty prop);
+// ODataLinkCollection getLinkCollection(LinkCollection linkCollection);
+ /**
+ * Gets <tt>ODataEntitySet</tt> from the given feed resource.
+ *
+ * @param resource feed resource.
+ * @return <tt>ODataEntitySet</tt> object.
+ */
+// ODataEntitySet getODataEntitySet(Feed resource);
+ /**
+ * Gets <tt>ODataEntitySet</tt> from the given feed resource.
+ *
+ * @param resource feed resource.
+ * @param defaultBaseURI default base URI.
+ * @return <tt>ODataEntitySet</tt> object.
+ */
+// ODataEntitySet getODataEntitySet(Feed resource, URI defaultBaseURI);
+ /**
+ * Gets <tt>ODataEntity</tt> from the given entry resource.
+ *
+ * @param resource entry resource.
+ * @return <tt>ODataEntity</tt> object.
+ */
+// ODataEntity getODataEntity(Entry resource);
+ /**
+ * Gets <tt>ODataEntity</tt> from the given entry resource.
+ *
+ * @param resource entry resource.
+ * @param defaultBaseURI default base URI.
+ * @return <tt>ODataEntity</tt> object.
+ */
+// ODataEntity getODataEntity(Entry resource, URI defaultBaseURI);
+ /**
+ * Gets a <tt>LinkResource</tt> from the given OData link.
+ *
+ * @param <T> link resource type.
+ * @param link OData link.
+ * @param reference reference class.
+ * @return <tt>LinkResource</tt> object.
+ */
+// @SuppressWarnings("unchecked")
+// <T extends Link> T getLinkResource(ODataLink link, Class<T> reference);
+
+ /**
+ * Gets an <tt>ODataProperty</tt> from the given DOM element.
+ *
+ * @param property content.
+ * @return <tt>ODataProperty</tt> object.
+ */
+// ODataProperty getProperty(Element property);
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataDeserializer.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataDeserializer.java
new file mode 100644
index 0000000..81e2b6b
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataDeserializer.java
@@ -0,0 +1,94 @@
+/*
+ * 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.op;
+
+import java.io.InputStream;
+import java.io.Serializable;
+
+import org.apache.olingo.client.api.data.ServiceDocument;
+import org.apache.olingo.client.api.edm.xml.XMLMetadata;
+import org.apache.olingo.client.api.format.ODataFormat;
+import org.w3c.dom.Element;
+
+/**
+ * Utility class for serialization.
+ */
+public interface ODataDeserializer extends Serializable {
+
+ XMLMetadata toMetadata(InputStream input);
+
+ /**
+ * Gets the ServiceDocumentResource object represented by the given InputStream.
+ *
+ * @param input stream to be de-serialized.
+ * @param format OData service document format.
+ * @return ServiceDocumentResource object.
+ */
+ ServiceDocument toServiceDocument(InputStream input, ODataFormat format);
+
+ /**
+ * Gets a feed object from the given InputStream.
+ *
+ * @param <T> reference class type
+ * @param input stream to be de-serialized.
+ * @param reference reference class (AtomFeed.class, JSONFeed.class).
+ * @return FeedResource instance.
+ */
+// <T extends Feed> T toFeed(InputStream input, Class<T> reference);
+ /**
+ * Gets an entry object from the given InputStream.
+ *
+ * @param <T> reference class type
+ * @param input stream to be de-serialized.
+ * @param reference reference class (AtomEntry.class, JSONV3Entry.class).
+ * @return EntryResource instance.
+ */
+// <T extends Entry> T toEntry(InputStream input, Class<T> reference);
+ /**
+ * Gets a DOM representation of the given InputStream.
+ *
+ * @param input stream to be de-serialized.
+ * @param format OData format.
+ * @return DOM.
+ */
+// Element toPropertyDOM(InputStream input, ODataFormat format);
+ /**
+ * Gets a list of links from the given InputStream.
+ *
+ * @param input stream to be de-serialized.
+ * @param format OData format.
+ * @return de-serialized links.
+ */
+// LinkCollection toLinkCollection(InputStream input, ODataFormat format);
+ /**
+ * Gets the ODataError object represented by the given InputStream.
+ *
+ * @param input stream to be parsed and de-serialized.
+ * @param isXML 'TRUE' if the error is represented by XML; 'FALSE' otherwise.
+ * @return
+ */
+// ODataError toODataError(InputStream input, boolean isXML);
+ /**
+ * Parses the given input into a DOM tree.
+ *
+ * @param input stream to be parsed and de-serialized.
+ * @return DOM tree
+ */
+ Element toDOM(InputStream input);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataReader.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataReader.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataReader.java
new file mode 100644
index 0000000..d8ef18d
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataReader.java
@@ -0,0 +1,104 @@
+/*
+ * 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.op;
+
+import java.io.InputStream;
+import java.io.Serializable;
+
+import org.apache.olingo.client.api.domain.ODataServiceDocument;
+import org.apache.olingo.client.api.format.ODataFormat;
+import org.apache.olingo.commons.api.edm.Edm;
+
+/**
+ * OData reader.
+ * <br/>
+ * Use this class to de-serialize an OData response body.
+ * <br/>
+ * This class provides method helpers to de-serialize an entire feed, a set of entities and a single entity as well.
+ */
+public interface ODataReader extends Serializable {
+
+ /**
+ * Parses a stream into metadata representation.
+ *
+ * @param input stream to de-serialize.
+ * @return metadata representation.
+ */
+ Edm readMetadata(InputStream input);
+
+ /**
+ * Parses an OData service document.
+ *
+ * @param input stream to de-serialize.
+ * @param format de-serialize as XML or JSON
+ * @return List of URIs.
+ */
+ ODataServiceDocument readServiceDocument(InputStream input, ODataFormat format);
+
+ /**
+ * De-Serializes a stream into an OData entity set.
+ *
+ * @param input stream to de-serialize.
+ * @param format de-serialize as AtomFeed or JSONFeed
+ * @return de-serialized entity set.
+ */
+ //ODataEntitySet readEntitySet(InputStream input, ODataPubFormat format);
+ /**
+ * Parses a stream taking care to de-serializes the first OData entity found.
+ *
+ * @param input stream to de-serialize.
+ * @param format de-serialize as AtomEntry or JSONEntry
+ * @return entity de-serialized.
+ */
+ //ODataEntity readEntity(InputStream input, ODataPubFormat format);
+ /**
+ * Parses a stream taking care to de-serialize the first OData entity property found.
+ *
+ * @param input stream to de-serialize.
+ * @param format de-serialize as XML or JSON
+ * @return OData entity property de-serialized.
+ */
+ //ODataProperty readProperty(InputStream input, ODataFormat format);
+ /**
+ * Parses a $links request response.
+ *
+ * @param input stream to de-serialize.
+ * @param format de-serialize as XML or JSON
+ * @return List of URIs.
+ */
+ //ODataLinkCollection readLinks(InputStream input, ODataFormat format);
+ /**
+ * Parses a stream into an OData error.
+ *
+ * @param inputStream stream to de-serialize.
+ * @param isXML 'TRUE' if the error is in XML format.
+ * @return OData error.
+ */
+// ODataError readError(InputStream inputStream, boolean isXML);
+ /**
+ * Parses a stream into the object type specified by the given reference.
+ *
+ * @param <T> expected object type.
+ * @param src input stream.
+ * @param format format
+ * @param reference reference.
+ * @return read object.
+ */
+ //<T> T read(InputStream src, String format, Class<T> reference);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataSerializer.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataSerializer.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataSerializer.java
new file mode 100644
index 0000000..94c168f
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataSerializer.java
@@ -0,0 +1,118 @@
+/**
+ * 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.op;
+
+import java.io.OutputStream;
+import java.io.Serializable;
+import java.io.Writer;
+import org.w3c.dom.Node;
+
+/**
+ * Utility class for serialization.
+ */
+public interface ODataSerializer extends Serializable {
+
+ /**
+ * Writes <tt>FeedResource</tt> object onto the given stream.
+ *
+ * @param <T> feed resource type.
+ * @param obj object to be streamed.
+ * @param out output stream.
+ */
+// <T extends Feed> void feed(T obj, OutputStream out);
+
+ /**
+ * Writes <tt>FeedResource</tt> object by the given writer.
+ *
+ * @param <T> feed resource type.
+ * @param obj object to be streamed.
+ * @param writer writer.
+ */
+// <T extends Feed> void feed(T obj, Writer writer);
+
+ /**
+ * Writes <tt>EntryResource</tt> object onto the given stream.
+ *
+ * @param <T> entry resource type.
+ * @param obj object to be streamed.
+ * @param out output stream.
+ */
+// <T extends Entry> void entry(T obj, OutputStream out);
+
+ /**
+ * Writes <tt>EntryResource</tt> object by the given writer.
+ *
+ * @param <T> entry resource type.
+ * @param obj object to be streamed.
+ * @param writer writer.
+ */
+// <T extends Entry> void entry(T obj, Writer writer);
+
+ /**
+ * Writes entry content onto the given stream.
+ *
+ * @param element element to be streamed.
+ * @param format streaming format.
+ * @param out output stream.
+ */
+// void property(Element element, ODataFormat format, OutputStream out);
+
+ /**
+ * Writes entry content by the given writer.
+ *
+ * @param element element to be streamed.
+ * @param format streaming format.
+ * @param writer writer.
+ */
+// void property(Element element, ODataFormat format, Writer writer);
+
+ /**
+ * Writes OData link onto the given stream.
+ *
+ * @param link OData link to be streamed.
+ * @param format streaming format.
+ * @param out output stream.
+ */
+// void link(ODataLink link, ODataFormat format, OutputStream out);
+
+ /**
+ * Writes OData link by the given writer.
+ *
+ * @param link OData link to be streamed.
+ * @param format streaming format.
+ * @param writer writer.
+ */
+// void link(ODataLink link, ODataFormat format, Writer writer);
+
+ /**
+ * Writes DOM object onto the given stream.
+ *
+ * @param content DOM to be streamed.
+ * @param out output stream.
+ */
+ void dom(Node content, OutputStream out);
+
+ /**
+ * Writes DOM object by the given writer.
+ *
+ * @param content DOM to be streamed.
+ * @param writer writer.
+ */
+ void dom(Node content, Writer writer);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataV3Deserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataV3Deserializer.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataV3Deserializer.java
new file mode 100644
index 0000000..aeb84a1
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataV3Deserializer.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.api.op;
+
+public interface ODataV3Deserializer extends ODataDeserializer {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataV4Deserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataV4Deserializer.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataV4Deserializer.java
new file mode 100644
index 0000000..c782cd5
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataV4Deserializer.java
@@ -0,0 +1,30 @@
+/*
+ * 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.op;
+
+import java.io.InputStream;
+
+import org.apache.olingo.client.api.edm.xml.v4.XMLMetadata;
+
+public interface ODataV4Deserializer extends ODataDeserializer {
+
+ @Override
+ XMLMetadata toMetadata(InputStream input);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/QueryOption.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/QueryOption.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/QueryOption.java
new file mode 100644
index 0000000..c871f9b
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/QueryOption.java
@@ -0,0 +1,95 @@
+/*
+ * 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.uri;
+
+/**
+ * Query options.
+ */
+public enum QueryOption {
+
+ /**
+ * The entity-id specified by $id may be expressed absolute or relative to the request URL.
+ */
+ ID,
+ /**
+ * The $count system query option allows clients to request a count of the matching resources included with the
+ * resources in the response. The $count query option has a Boolean value of true or false.
+ */
+ COUNT,
+ /**
+ * This option indicates entities associated with the EntityType instance or EntitySet, identified by the resource
+ * path section of the URI, and MUST be represented inline in the data service's response.
+ */
+ EXPAND,
+ /**
+ * This option specifies the media type acceptable in a response. If present, this value SHOULD take precedence over
+ * value(s) specified in an Accept request header.
+ */
+ FORMAT,
+ /**
+ * This option is used to specify that a subset of the properties of the entities identified by the path of the
+ * request URI and $expand query option SHOULD be returned in the response from the data service.
+ */
+ SELECT,
+ /**
+ * This option specifies the sort properties and sort direction (ascending or descending) that the data service MUST
+ * use to order the entities in the EntitySet, identified by the resource path section of the URI.
+ */
+ ORDERBY,
+ /**
+ * This option specifies a positive integer N that is the maximum number of entities in the EntitySet, identified by
+ * the resource path section of the URI, that the data service MUST return.
+ */
+ TOP,
+ /**
+ * This option specifies a positive integer N that represents the number of entities, counted from the first entity in
+ * the EntitySet and ordered as specified by the $orderby option, that the data service should skip when returning the
+ * entities in the EntitySet, which is identified by the resource path section of the URI. The data service SHOULD
+ * return all subsequent entities, starting from the one in position N+1.
+ */
+ SKIP,
+ /**
+ * This query option applies only to the OData 2.0 protocol to the AtomPub protocol. The value of a $skiptoken query
+ * option is an opaque token which identifies an index into the collection of entities identified by the URI
+ * containing the $skiptoken parameter.
+ */
+ SKIPTOKEN,
+ /**
+ * This option specifies a predicate used to filter the elements from the EntitySet identified by the resource path
+ * section of the URI.
+ */
+ FILTER,
+ /**
+ * For a value of "allpages", this option indicates that the response to the request MUST include the count of the
+ * number of entities in the EntitySet, identified by the resource path section of the URI after all $filter system
+ * query options have been applied. For a value of "none", this option indicates that the response to the request MUST
+ * NOT include the count value.
+ */
+ INLINECOUNT,
+ /**
+ * Search expressions are used within the $search system query option to request entities matching the specified
+ * expression.
+ */
+ SEARCH;
+
+ @Override
+ public String toString() {
+ return name().toLowerCase();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/SegmentType.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/SegmentType.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/SegmentType.java
new file mode 100644
index 0000000..a3e5a15
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/SegmentType.java
@@ -0,0 +1,66 @@
+/*
+ * 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.uri;
+
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * URI Segment types.
+ */
+public enum SegmentType {
+
+ ENTITY("$entity"),
+ ENTITYSET,
+ SINGLETON,
+ KEY,
+ KEY_AS_SEGMENT,
+ PROPERTY,
+ NAVIGATION,
+ DERIVED_ENTITY_TYPE,
+ VALUE("$value"),
+ BOUND_OPERATION,
+ UNBOUND_OPERATION,
+ METADATA("$metadata"),
+ BATCH("$batch"),
+ LINKS("$links"),
+ REF("$ref"),
+ CROSS_JOIN("$crossjoin"),
+ ALL("$all"),
+ /**
+ * For query options like as $count that needs to stay in their own segment, right after service root.
+ *
+ * @see QueryOption#COUNT
+ */
+ ROOT_QUERY_OPTION,
+ SERVICEROOT;
+
+ private final String value;
+
+ private SegmentType() {
+ this.value = StringUtils.EMPTY;
+ }
+
+ private SegmentType(final String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/URIBuilder.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/URIBuilder.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/URIBuilder.java
new file mode 100644
index 0000000..cfb041b
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/URIBuilder.java
@@ -0,0 +1,225 @@
+/*
+ * 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.uri;
+
+import org.apache.olingo.client.api.uri.filter.URIFilter;
+
+import java.net.URI;
+import java.util.Map;
+
+/**
+ * OData URI builder.
+ */
+public interface URIBuilder<UB extends URIBuilder<?>> {
+
+ /**
+ * Adds the specified query option to the URI.
+ *
+ * @param option query option.
+ * @param value query option value.
+ * @return current URIBuilder instance
+ */
+ UB addQueryOption(QueryOption option, String value);
+
+ /**
+ * Adds the specified (custom) query option to the URI.
+ *
+ * @param option query option.
+ * @param value query option value.
+ * @return current URIBuilder instance
+ */
+ UB addQueryOption(String option, String value);
+
+ /**
+ * Appends EntitySet segment to the URI.
+ *
+ * @param segmentValue segment value.
+ * @return current URIBuilder instance
+ */
+ UB appendEntitySetSegment(String segmentValue);
+
+ /**
+ * Appends key segment to the URI.
+ *
+ * @param val segment value.
+ * @return current URIBuilder instance
+ */
+ UB appendKeySegment(Object val);
+
+ /**
+ * Appends key segment to the URI, for multiple keys.
+ *
+ * @param segmentValues segment values.
+ * @return current URIBuilder instance
+ */
+ UB appendKeySegment(Map<String, Object> segmentValues);
+
+ /**
+ * Appends property segment to the URI.
+ *
+ * @param segmentValue segment value.
+ * @return current URIBuilder instance
+ */
+ UB appendPropertySegment(String segmentValue);
+
+ /**
+ * Appends navigation segment to the URI.
+ *
+ * @param segmentValue segment value.
+ * @return current URIBuilder instance
+ */
+ UB appendNavigationSegment(String segmentValue);
+
+ /**
+ * Appends derived entity type segment to the URI.
+ *
+ * @param segmentValue segment value.
+ * @return current URIBuilder instance
+ */
+ UB appendDerivedEntityTypeSegment(String segmentValue);
+
+ /**
+ * Appends value segment to the URI.
+ *
+ * @return current URIBuilder instance
+ */
+ UB appendValueSegment();
+
+ /**
+ * Appends operation (action or function) segment to the URI.
+ *
+ * @param operation Operation (action or function) name
+ * @param arguments Operation arguments
+ * @return current URIBuilder instance
+ */
+ UB appendOperationCallSegment(String operation, Map<String, Object> arguments);
+
+ /**
+ * Appends metadata segment to the URI.
+ *
+ * @return current URIBuilder instance
+ */
+ UB appendMetadataSegment();
+
+ /**
+ * Appends batch segment to the URI.
+ *
+ * @return current URIBuilder instance
+ */
+ UB appendBatchSegment();
+
+ /**
+ * Adds count query option.
+ *
+ * @return current URIBuilder instance
+ */
+ UB count();
+
+ /**
+ * Adds expand query option.
+ *
+ * @param expandItems items to be expanded in-line
+ * @return current URIBuilder instance
+ * @see QueryOption#EXPAND
+ */
+ UB expand(String... expandItems);
+
+ /**
+ * Adds format query option.
+ *
+ * @param format media type acceptable in a response.
+ * @return current URIBuilder instance
+ * @see QueryOption#FORMAT
+ */
+ UB format(String format);
+
+ /**
+ * Adds filter for filter query option.
+ *
+ * @param filter filter instance (to be obtained via <tt>ODataFilterFactory</tt>): note that <tt>build()</tt> method
+ * will be immediately invoked.
+ * @return current URIBuilder instance
+ * @see QueryOption#FILTER
+ * @see URIFilter
+ * @see org.apache.olingo.client.api.uri.filter.FilterFactory
+ */
+ UB filter(URIFilter filter);
+
+ /**
+ * Adds filter query option.
+ *
+ * @param filter filter string.
+ * @return current URIBuilder instance
+ * @see QueryOption#FILTER
+ */
+ UB filter(String filter);
+
+ /**
+ * Adds select query option.
+ *
+ * @param selectItems select items
+ * @return current URIBuilder instance
+ * @see QueryOption#SELECT
+ */
+ UB select(String... selectItems);
+
+ /**
+ * Adds orderby query option.
+ *
+ * @param order order string.
+ * @return current URIBuilder instance
+ * @see QueryOption#ORDERBY
+ */
+ UB orderBy(String order);
+
+ /**
+ * Adds top query option.
+ *
+ * @param top maximum number of entities to be returned.
+ * @return current URIBuilder instance
+ * @see QueryOption#TOP
+ */
+ UB top(int top);
+
+ /**
+ * Adds skip query option.
+ *
+ * @param skip number of entities to be skipped into the response.
+ * @return current URIBuilder instance
+ * @see QueryOption#SKIP
+ */
+ UB skip(int skip);
+
+ /**
+ * Adds skiptoken query option.
+ *
+ * @param skipToken opaque token.
+ * @return current URIBuilder instance
+ * @see QueryOption#SKIPTOKEN
+ */
+ UB skipToken(String skipToken);
+
+ /**
+ * Build OData URI.
+ *
+ * @return OData URI.
+ */
+ URI build();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/V3URIBuilder.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/V3URIBuilder.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/V3URIBuilder.java
new file mode 100644
index 0000000..7d4059b
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/V3URIBuilder.java
@@ -0,0 +1,47 @@
+/*
+ * 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.uri;
+
+public interface V3URIBuilder extends URIBuilder<V3URIBuilder> {
+
+ public enum InlineCount {
+
+ allpages,
+ none
+
+ }
+
+ /**
+ * Appends links segment to the URI.
+ *
+ * @param segmentValue segment value
+ * @return current URIBuilder instance
+ */
+ V3URIBuilder appendLinksSegment(String segmentValue);
+
+ /**
+ * Adds inlinecount query option.
+ *
+ * @param inlineCount value
+ * @return current URIBuilder instance
+ * @see QueryOption#INLINECOUNT
+ */
+ V3URIBuilder inlineCount(InlineCount inlineCount);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/V4URIBuilder.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/V4URIBuilder.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/V4URIBuilder.java
new file mode 100644
index 0000000..d98beb3
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/V4URIBuilder.java
@@ -0,0 +1,87 @@
+/*
+ * 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.uri;
+
+public interface V4URIBuilder extends URIBuilder<V4URIBuilder> {
+
+ /**
+ * Appends Singleton segment to the URI.
+ *
+ * @param segmentValue segment value.
+ * @return current URIBuilder instance
+ */
+ V4URIBuilder appendSingletonSegment(String segmentValue);
+
+ /**
+ * Appends entity-id segment to the URI.
+ *
+ * @param segmentValue segment value
+ * @return current URIBuilder instance
+ */
+ V4URIBuilder appendEntityIdSegment(String segmentValue);
+
+ /**
+ * Appends ref segment to the URI.
+ *
+ * @return current URIBuilder instance
+ */
+ V4URIBuilder appendRefSegment();
+
+ /**
+ * Appends cross join segment to the URI.
+ *
+ * @param segmentValues segment values.
+ * @return current URIBuilder instance
+ */
+ V4URIBuilder appendCrossjoinSegment(String... segmentValues);
+
+ /**
+ * Appends all segment to the URI.
+ *
+ * @return current URIBuilder instance
+ */
+ V4URIBuilder appendAllSegment();
+
+ /**
+ * Adds id query option.
+ *
+ * @param idValue opaque token.
+ * @return current URIBuilder instance
+ * @see QueryOption#ID
+ */
+ V4URIBuilder id(String idValue);
+
+ /**
+ * Appends count query option.
+ *
+ * @param value true or false
+ * @return current URIBuilder instance
+ * @see QueryOption#COUNT
+ */
+ V4URIBuilder count(boolean value);
+
+ /**
+ * Appends search query option.
+ *
+ * @param expression search expression
+ * @return current URIBuilder instance
+ * @see QueryOption#SEARCH
+ */
+ V4URIBuilder search(String expression);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterArg.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterArg.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterArg.java
new file mode 100644
index 0000000..10ab250
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterArg.java
@@ -0,0 +1,30 @@
+/*
+ * 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.uri.filter;
+
+/**
+ * Interface for any available filter argument.
+ */
+public interface FilterArg {
+
+ /**
+ * @return String representation of this filter argument.
+ */
+ String build();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterArgFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterArgFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterArgFactory.java
new file mode 100644
index 0000000..f9fad74
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterArgFactory.java
@@ -0,0 +1,83 @@
+/*
+ * 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.uri.filter;
+
+public interface FilterArgFactory {
+
+ FilterArg _null();
+
+ FilterArg add(FilterArg first, FilterArg second);
+
+ FilterArg ceiling(FilterArg param);
+
+ FilterArg concat(FilterArg first, FilterArg second);
+
+ FilterArg day(FilterArg param);
+
+ FilterArg div(FilterArg first, FilterArg second);
+
+ FilterArg endswith(FilterArg first, FilterArg second);
+
+ FilterArg floor(FilterArg param);
+
+ FilterArg hour(FilterArg param);
+
+ FilterArg indexof(FilterArg first, FilterArg second);
+
+ FilterArg isof(FilterArg type);
+
+ FilterArg isof(FilterArg expression, FilterArg type);
+
+ FilterArg length(FilterArg param);
+
+ FilterArg literal(Object value);
+
+ FilterArg minute(FilterArg param);
+
+ FilterArg mod(FilterArg first, FilterArg second);
+
+ FilterArg month(FilterArg param);
+
+ FilterArg mul(FilterArg first, FilterArg second);
+
+ FilterArg property(String propertyPath);
+
+ FilterArg replace(FilterArg first, FilterArg second, FilterArg third);
+
+ FilterArg round(FilterArg param);
+
+ FilterArg second(FilterArg param);
+
+ FilterArg startswith(FilterArg first, FilterArg second);
+
+ FilterArg sub(FilterArg first, FilterArg second);
+
+ FilterArg substring(FilterArg arg, FilterArg pos);
+
+ FilterArg substring(FilterArg arg, FilterArg pos, FilterArg length);
+
+ FilterArg tolower(FilterArg param);
+
+ FilterArg toupper(FilterArg param);
+
+ FilterArg trim(FilterArg param);
+
+ FilterArg year(FilterArg param);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterFactory.java
new file mode 100644
index 0000000..0782daa
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterFactory.java
@@ -0,0 +1,61 @@
+/*
+ * 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.uri.filter;
+
+import java.io.Serializable;
+
+/**
+ * OData filter factory.
+ */
+public interface FilterFactory extends Serializable {
+
+ FilterArgFactory getArgFactory();
+
+ URIFilter match(FilterArg arg);
+
+ URIFilter eq(String key, Object value);
+
+ URIFilter eq(FilterArg left, FilterArg right);
+
+ URIFilter ne(String key, Object value);
+
+ URIFilter ne(FilterArg left, FilterArg right);
+
+ URIFilter gt(String key, Object value);
+
+ URIFilter gt(FilterArg left, FilterArg right);
+
+ URIFilter ge(String key, Object value);
+
+ URIFilter ge(FilterArg left, FilterArg right);
+
+ URIFilter lt(String key, Object value);
+
+ URIFilter lt(FilterArg left, FilterArg right);
+
+ URIFilter le(String key, Object value);
+
+ URIFilter le(FilterArg left, FilterArg right);
+
+ URIFilter and(URIFilter left, URIFilter right);
+
+ URIFilter or(URIFilter left, URIFilter right);
+
+ URIFilter not(URIFilter filter);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/URIFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/URIFilter.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/URIFilter.java
new file mode 100644
index 0000000..0e0737f
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/URIFilter.java
@@ -0,0 +1,32 @@
+/*
+ * 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.uri.filter;
+
+/**
+ * Interface for any available filter; obtain instances via <tt>FilterFactory</tt>.
+ *
+ * @see FilterFactory
+ */
+public interface URIFilter {
+
+ /**
+ * @return String representation of this filter.
+ */
+ String build();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V3FilterArgFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V3FilterArgFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V3FilterArgFactory.java
new file mode 100644
index 0000000..04554f5
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V3FilterArgFactory.java
@@ -0,0 +1,25 @@
+/*
+ * 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.uri.filter;
+
+public interface V3FilterArgFactory extends FilterArgFactory {
+
+ FilterArg substringof(FilterArg first, FilterArg second);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V3FilterFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V3FilterFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V3FilterFactory.java
new file mode 100644
index 0000000..7571c98
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V3FilterFactory.java
@@ -0,0 +1,26 @@
+/*
+ * 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.uri.filter;
+
+public interface V3FilterFactory extends FilterFactory {
+
+ @Override
+ V3FilterArgFactory getArgFactory();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V4FilterArgFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V4FilterArgFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V4FilterArgFactory.java
new file mode 100644
index 0000000..b7bca85
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V4FilterArgFactory.java
@@ -0,0 +1,55 @@
+/*
+ * 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.uri.filter;
+
+public interface V4FilterArgFactory extends FilterArgFactory {
+
+ FilterArg contains(FilterArg first, FilterArg second);
+
+ FilterArg fractionalseconds(FilterArg param);
+
+ FilterArg date(FilterArg param);
+
+ FilterArg time(FilterArg param);
+
+ FilterArg totaloffsetminutes(FilterArg param);
+
+ FilterArg now();
+
+ FilterArg mindatetime();
+
+ FilterArg maxdatetime();
+
+ FilterArg totalseconds(FilterArg param);
+
+ FilterArg cast(FilterArg type);
+
+ FilterArg cast(FilterArg expression, FilterArg type);
+
+ FilterArg geoDistance(FilterArg first, FilterArg second);
+
+ FilterArg geoIntersects(FilterArg first, FilterArg second);
+
+ FilterArg geoLength(FilterArg first, FilterArg second);
+
+ FilterArg any(FilterArg collection, URIFilter expression);
+
+ FilterArg all(FilterArg collection, URIFilter expression);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V4FilterFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V4FilterFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V4FilterFactory.java
new file mode 100644
index 0000000..3050de2
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V4FilterFactory.java
@@ -0,0 +1,32 @@
+/*
+ * 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.uri.filter;
+
+import org.apache.olingo.commons.api.edm.EdmEnumType;
+
+public interface V4FilterFactory extends FilterFactory {
+
+ @Override
+ V4FilterArgFactory getArgFactory();
+
+ URIFilter has(String key, EdmEnumType enumType, String memberName);
+
+ URIFilter has(FilterArg left, EdmEnumType enumType, String memberName);
+
+}