You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2015/04/28 23:12:21 UTC
[05/17] olingo-odata4 git commit: [OLINGO-564] Renamed 'OData*' to
'Client*' classes
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientCollectionValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientCollectionValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientCollectionValue.java
new file mode 100644
index 0000000..0497dc6
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientCollectionValue.java
@@ -0,0 +1,57 @@
+/*
+ * 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.commons.api.domain;
+
+import java.util.Collection;
+
+/**
+ * OData collection property value.
+ *
+ * @param <OV> The actual ODataValue interface.
+ */
+public interface ClientCollectionValue<OV extends ClientValue> extends ClientValue, Iterable<OV> {
+
+ /**
+ * Adds a value to the collection.
+ *
+ * @param value value to be added.
+ */
+ ClientCollectionValue<OV> add(ClientValue value);
+
+ /**
+ * Checks if collection is empty.
+ *
+ * @return 'TRUE' if empty; 'FALSE' otherwise.
+ */
+ boolean isEmpty();
+
+ /**
+ * Gets collection size.
+ *
+ * @return collection size.
+ */
+ int size();
+
+ /**
+ * Converts this instance as POJO collection.
+ *
+ * @return this instance as POJO collection
+ */
+ Collection<Object> asJavaCollection();
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientComplexValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientComplexValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientComplexValue.java
new file mode 100644
index 0000000..3c2931a
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientComplexValue.java
@@ -0,0 +1,58 @@
+/*
+ * 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.commons.api.domain;
+
+import java.util.Map;
+
+/**
+ * OData complex property value.
+ *
+ */
+public interface ClientComplexValue extends ClientValue, ClientLinked, ClientAnnotatable, Iterable<ClientProperty> {
+
+ /**
+ * Adds field to the complex type.
+ *
+ * @param field field to be added.
+ * @return this (for fluent-style calls)
+ */
+ ClientComplexValue add(ClientProperty field);
+
+ /**
+ * Gets field.
+ *
+ * @param name name of the field to be retrieved.
+ * @return requested field.
+ */
+ ClientProperty get(String name);
+
+ /**
+ * Gets number of fields.
+ *
+ * @return number of fields.
+ */
+ int size();
+
+ /**
+ * Converts this instance as POJO collection.
+ *
+ * @return this instance as POJO collection
+ */
+ Map<String, Object> asJavaMap();
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDeletedEntity.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDeletedEntity.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDeletedEntity.java
new file mode 100644
index 0000000..3cdcb7b
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDeletedEntity.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.commons.api.domain;
+
+import java.net.URI;
+
+public interface ClientDeletedEntity {
+
+ enum Reason {
+
+ deleted,
+ changed
+
+ }
+
+ URI getId();
+
+ Reason getReason();
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDelta.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDelta.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDelta.java
new file mode 100644
index 0000000..7092e6f
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDelta.java
@@ -0,0 +1,31 @@
+/*
+ * 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.commons.api.domain;
+
+import java.util.List;
+
+public interface ClientDelta extends ClientEntitySet {
+
+ List<ClientDeletedEntity> getDeletedEntities();
+
+ List<ClientDeltaLink> getAddedLinks();
+
+ List<ClientDeltaLink> getDeletedLinks();
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDeltaLink.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDeltaLink.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDeltaLink.java
new file mode 100644
index 0000000..d12aedf
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDeltaLink.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.commons.api.domain;
+
+import java.net.URI;
+
+public interface ClientDeltaLink extends ClientAnnotatable {
+
+ URI getSource();
+
+ void setSource(URI source);
+
+ String getRelationship();
+
+ void setRelationship(String relationship);
+
+ URI getTarget();
+
+ void setTarget(URI target);
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEntity.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEntity.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEntity.java
new file mode 100644
index 0000000..39736cc
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEntity.java
@@ -0,0 +1,202 @@
+/*
+ * 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.commons.api.domain;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+import java.net.URI;
+import java.util.List;
+
+/**
+ * OData entity.
+ */
+public interface ClientEntity extends ClientLinked, ClientAnnotatable, ClientInvokeResult {
+
+ /**
+ * @return the type name of this entity.
+ */
+ FullQualifiedName getTypeName();
+
+ /**
+ * @return self link.
+ */
+ URI getLink();
+
+ /**
+ * Returns OData entity edit link.
+ *
+ * @return entity edit link.
+ */
+ URI getEditLink();
+
+ /**
+ * Sets OData entity edit link.
+ *
+ * @param editLink edit link.
+ */
+ void setEditLink(URI editLink);
+
+ /**
+ * Gets ETag.
+ *
+ * @return ETag.
+ */
+ String getETag();
+
+ /**
+ * Sets ETag.
+ *
+ * @param eTag ETag.
+ */
+ void setETag(String eTag);
+
+ /**
+ * Searches for operation with given title.
+ *
+ * @param title operation to look for
+ * @return operation if found with given title, <tt>null</tt> otherwise
+ */
+ ClientOperation getOperation(String title);
+
+ /**
+ * Gets operations.
+ *
+ * @return operations.
+ */
+ List<ClientOperation> getOperations();
+
+ /**
+ * Searches for property with given name.
+ *
+ * @param name property to look for
+ * @return property if found with given name, <tt>null</tt> otherwise
+ */
+ ClientProperty getProperty(String name);
+
+ /**
+ * Returns OData entity properties.
+ *
+ * @return OData entity properties.
+ */
+ List<ClientProperty> getProperties();
+
+ /**
+ * To request entity references in place of the actual entities, the client issues a GET request with /$ref appended
+ * to the resource path.
+ * <br />
+ * If the resource path does not identify an entity or a collection of entities, the service returns 404 Not Found.
+ * <br />
+ * If the resource path terminates on a collection, the response MUST be the format-specific representation of a
+ * collection of entity references pointing to the related entities. If no entities are related, the response is the
+ * format-specific representation of an empty collection.
+ * <br />
+ * If the resource path terminates on a single entity, the response MUST be the format-specific representation of an
+ * entity reference pointing to the related single entity. If the resource path terminates on a single entity and no
+ * such entity exists, the service returns 404 Not Found.
+ *
+ * @return entity reference.
+ */
+ URI getId();
+
+ /**
+ * Set id for this OData entity.
+ *
+ * @param id the if for this entity
+ */
+ void setId(URI id);
+
+ /**
+ * Gets media-edit link with given name, if available, otherwise <tt>null</tt>.
+ *
+ * @param name candidate link name
+ * @return media-edit link with given name, if available, otherwise <tt>null</tt>
+ */
+ ClientLink getMediaEditLink(final String name);
+
+ /**
+ * Returns entity media edit links.
+ *
+ * @return OData entity links.
+ */
+ List<ClientLink> getMediaEditLinks();
+
+ /**
+ * TRUE if read-only entity.
+ *
+ * @return TRUE if read-only; FALSE otherwise.
+ */
+ boolean isReadOnly();
+
+ /**
+ * Checks if the current entity is a media entity.
+ *
+ * @return 'TRUE' if media entity; 'FALSE' otherwise.
+ */
+ boolean isMediaEntity();
+
+ /**
+ * Sets media entity flag.
+ *
+ * @param isMediaEntity media entity flag value.
+ */
+ void setMediaEntity(boolean isMediaEntity);
+
+ /**
+ * Gets media content type.
+ *
+ * @return media content type.
+ */
+ String getMediaContentType();
+
+ /**
+ * Sets media content type.
+ *
+ * @param mediaContentType media content type.
+ */
+ void setMediaContentType(String mediaContentType);
+
+ /**
+ * Gets media content source.
+ *
+ * @return media content source.
+ */
+ URI getMediaContentSource();
+
+ /**
+ * Sets media content source.
+ *
+ * @param mediaContentSource media content source.
+ */
+ void setMediaContentSource(URI mediaContentSource);
+
+ /**
+ * ETag of the binary stream represented by this media entity or named stream property.
+ *
+ * @return media ETag value
+ */
+ String getMediaETag();
+
+ /**
+ * Set media ETag.
+ *
+ * @param eTag media ETag value
+ */
+ void setMediaETag(String eTag);
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEntitySet.java
new file mode 100644
index 0000000..36a8161
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEntitySet.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.commons.api.domain;
+
+import java.net.URI;
+import java.util.List;
+
+/**
+ * OData entity collection. If pagination was used to get this instance, forward page navigation URI will be available.
+ */
+public interface ClientEntitySet extends ClientInvokeResult, ClientAnnotatable {
+
+ /**
+ * Gets next page link.
+ *
+ * @return next page link; null value if single page or last page reached.
+ */
+ URI getNext();
+
+ /**
+ * Gets contained entities.
+ *
+ * @return entity set's entities.
+ */
+ List<ClientEntity> getEntities();
+
+ /**
+ * Gets in-line count.
+ *
+ * @return in-line count value.
+ */
+ Integer getCount();
+
+ /**
+ * Sets in-line count.
+ *
+ * @param count in-line count value.
+ */
+ void setCount(final int count);
+
+
+ /**
+ * Gets delta link if exists.
+ *
+ * @return delta link if exists; null otherwise.
+ */
+ URI getDeltaLink();
+
+ /**
+ * Sets delta link.
+ *
+ * @param deltaLink delta link.
+ */
+ void setDeltaLink(URI deltaLink);
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEnumValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEnumValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEnumValue.java
new file mode 100644
index 0000000..cc88a94
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEnumValue.java
@@ -0,0 +1,27 @@
+/*
+ * 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.commons.api.domain;
+
+public interface ClientEnumValue extends ClientValue {
+
+ String getValue();
+
+ @Override
+ String toString();
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientError.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientError.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientError.java
new file mode 100644
index 0000000..11b6ca8
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientError.java
@@ -0,0 +1,132 @@
+/*
+ * 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.commons.api.domain;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * OData error.
+ */
+public class ClientError {
+
+ private String code;
+ private String message;
+ private String target;
+ private List<ClientErrorDetail> details;
+ private Map<String, String> innerError;
+
+ /**
+ * The value for the code name/value pair is a language-independent string. Its value is a service-defined error code.
+ * This code serves as a sub-status for the HTTP error code specified in the response. MAY be null.
+ * @return the error code as a string
+ */
+ public String getCode() {
+ return code;
+ }
+
+ /**
+ * The value for the code name/value pair is a language-independent string. Its value is a service-defined error code.
+ * This code serves as a sub-status for the HTTP error code specified in the response. MAY be null.
+ * @param code
+ * @return this for method chaining
+ */
+ public ClientError setCode(String code) {
+ this.code = code;
+ return this;
+ }
+
+ /**
+ * The value for the message name/value pair MUST be a human-readable, language-dependent representation of the error.
+ * MUST not be null
+ * @return the message string
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * The value for the message name/value pair MUST be a human-readable, language-dependent representation of the error.
+ * MUST not be null
+ * @param message
+ * @return this for method chaining
+ */
+ public ClientError setMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+ /**
+ * The value for the target name/value pair is the target of the particular error (for example, the name of the
+ * property in error). MAY be null.
+ * @return the target string
+ */
+ public String getTarget() {
+ return target;
+ }
+
+ /**
+ * The value for the target name/value pair is the target of the particular error (for example, the name of the
+ * property in error). MAY be null.
+ * @param target
+ * @return this for method chaining
+ */
+ public ClientError setTarget(String target) {
+ this.target = target;
+ return this;
+ }
+
+ /**
+ * Gets error details.
+ *
+ * @return ODataErrorDetail list.
+ */
+ public List<ClientErrorDetail> getDetails() {
+ return details;
+ }
+
+ /**
+ * Sets error details.
+ *
+ * @return this for method chaining.
+ */
+ public ClientError setDetails(List<ClientErrorDetail> details) {
+ this.details = details;
+ return this;
+ }
+
+ /**
+ * Gets server defined key-value pairs for debug environment only.
+ *
+ * @return a pair representing server defined object. MAY be null.
+ */
+ public Map<String, String> getInnerError() {
+ return innerError;
+ }
+
+ /**
+ * Sets server defined key-value pairs for debug environment only.
+ *
+ * @return this for method chaining.
+ */
+ public ClientError setInnerError(Map<String, String> innerError) {
+ this.innerError = innerError;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientErrorDetail.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientErrorDetail.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientErrorDetail.java
new file mode 100644
index 0000000..77316ef
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientErrorDetail.java
@@ -0,0 +1,73 @@
+/*
+ * 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.commons.api.domain;
+
+/**
+ * OData details, for example <tt>{ "error": {..., "details":[
+ * {"code": "301","target": "$search" ,"message": "$search query option not supported"}
+ * ],...}}</tt>.
+ */
+public class ClientErrorDetail {
+
+ private String code;
+ private String message;
+ private String target;
+
+ /**
+ * Gets error code.
+ *
+ * @return error code.
+ */
+ public String getCode() {
+ return code;
+ }
+
+ public ClientErrorDetail setCode(final String code) {
+ this.code = code;
+ return this;
+ }
+
+ /**
+ * Gets error message.
+ *
+ * @return error message.
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ public ClientErrorDetail setMessage(final String message) {
+ this.message = message;
+ return this;
+ }
+
+ /**
+ * Gets error target.
+ *
+ * @return error message.
+ */
+ public String getTarget() {
+ return target;
+ }
+
+ public ClientErrorDetail setTarget(final String target) {
+ this.target = target;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInlineEntity.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInlineEntity.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInlineEntity.java
new file mode 100644
index 0000000..e3fb699
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInlineEntity.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.commons.api.domain;
+
+import java.net.URI;
+
+/**
+ * OData in-line entity.
+ */
+public class ClientInlineEntity extends ClientLink {
+
+ private final ClientEntity entity;
+
+ /**
+ * Constructor.
+ *
+ * @param uri edit link.
+ * @param type type.
+ * @param title title.
+ * @param entity entity.
+ */
+ public ClientInlineEntity(final URI uri, final ClientLinkType type, final String title, final ClientEntity entity) {
+
+ super(uri, type, title);
+ this.entity = entity;
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param baseURI base URI.
+ * @param href href.
+ * @param type type.
+ * @param title title.
+ * @param entity entity.
+ */
+ public ClientInlineEntity(final URI baseURI, final String href, final ClientLinkType type, final String title,
+ final ClientEntity entity) {
+
+ super(baseURI, href, type, title);
+ this.entity = entity;
+ }
+
+ /**
+ * Gets wrapped entity.
+ *
+ * @return wrapped entity.
+ */
+ public ClientEntity getEntity() {
+ return entity;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInlineEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInlineEntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInlineEntitySet.java
new file mode 100644
index 0000000..a14933f
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInlineEntitySet.java
@@ -0,0 +1,69 @@
+/*
+ * 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.commons.api.domain;
+
+import java.net.URI;
+
+/**
+ * OData in-line entity set.
+ */
+public class ClientInlineEntitySet extends ClientLink {
+
+ private ClientEntitySet entitySet;
+
+ /**
+ * Constructor.
+ *
+ * @param uri edit link.
+ * @param type type.
+ * @param title title.
+ * @param entitySet entity set.
+ */
+ public ClientInlineEntitySet(final URI uri, final ClientLinkType type,
+ final String title, final ClientEntitySet entitySet) {
+
+ super(uri, type, title);
+ this.entitySet = entitySet;
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param baseURI base URI.
+ * @param href href.
+ * @param type type.
+ * @param title title.
+ * @param entitySet entity set.
+ */
+ public ClientInlineEntitySet(final URI baseURI, final String href,
+ final ClientLinkType type, final String title, final ClientEntitySet entitySet) {
+
+ super(baseURI, href, type, title);
+ this.entitySet = entitySet;
+ }
+
+ /**
+ * Gets wrapped entity set.
+ *
+ * @return wrapped entity set.
+ */
+ public ClientEntitySet getEntitySet() {
+ return entitySet;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInvokeResult.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInvokeResult.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInvokeResult.java
new file mode 100644
index 0000000..a28c078
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInvokeResult.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.commons.api.domain;
+
+/**
+ * Marker interface for any OData domain object that can be returned by an operation invocation.
+ *
+ * @see ClientEntitySet
+ * @see ClientEntity
+ * @see ClientProperty
+ */
+public interface ClientInvokeResult {
+//No additional methods needed for now.
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientItem.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientItem.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientItem.java
new file mode 100644
index 0000000..1279aea
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientItem.java
@@ -0,0 +1,96 @@
+/*
+ * 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.commons.api.domain;
+
+import java.net.URI;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Abstract representation of OData entities and links.
+ */
+public abstract class ClientItem {
+
+ /**
+ * Logger.
+ */
+ protected static final Logger LOG = LoggerFactory.getLogger(ClientItem.class);
+
+ /**
+ * OData entity name/type.
+ */
+ private final String name;
+
+ /**
+ * OData item self link.
+ */
+ protected URI link;
+
+ /**
+ * Constructor.
+ *
+ * @param name ODataItem name (it's entity type for {@link ClientEntity}).
+ */
+ public ClientItem(final String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return ODataItem name (it's entity type for {@link ClientEntity}).
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return ODataItem link (it's edit link for {@link ClientEntity}).
+ */
+ public URI getLink() {
+ return link;
+ }
+
+ /**
+ * Sets ODataItem link (it's edit link for {@link ClientEntity}).
+ *
+ * @param link link.
+ */
+ public void setLink(final URI link) {
+ this.link = link;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ return EqualsBuilder.reflectionEquals(this, obj);
+ }
+
+ @Override
+ public int hashCode() {
+ return HashCodeBuilder.reflectionHashCode(this);
+ }
+
+ @Override
+ public String toString() {
+ return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLink.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLink.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLink.java
new file mode 100644
index 0000000..d19c3c5
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLink.java
@@ -0,0 +1,187 @@
+/*
+ * 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.commons.api.domain;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.commons.api.Constants;
+
+/**
+ * OData link.
+ */
+public class ClientLink extends ClientItem implements ClientAnnotatable {
+
+ public static class Builder {
+
+ protected URI uri;
+
+ protected ClientLinkType type;
+
+ protected String title;
+
+ public Builder setURI(final URI uri) {
+ this.uri = uri;
+ return this;
+ }
+
+ public Builder setURI(final URI baseURI, final String href) {
+ uri = getURI(baseURI, href);
+ return this;
+ }
+
+ public Builder setType(final ClientLinkType type) {
+ this.type = type;
+ return this;
+ }
+
+ public Builder setTitle(final String title) {
+ this.title = title;
+ return this;
+ }
+
+ public ClientLink build() {
+ return new ClientLink(uri, type, title);
+ }
+ }
+
+ /**
+ * Build URI starting from the given base and href.
+ * <br/>
+ * If href is absolute or base is null then base will be ignored.
+ *
+ * @param base URI prefix.
+ * @param href URI suffix.
+ * @return built URI.
+ */
+ private static URI getURI(final URI base, final String href) {
+ if (href == null) {
+ throw new IllegalArgumentException("Null link provided");
+ }
+
+ URI uri = URI.create(href);
+
+ if (!uri.isAbsolute() && base != null) {
+ uri = URI.create(base.toASCIIString() + "/" + href);
+ }
+
+ return uri.normalize();
+ }
+
+ /**
+ * Link type.
+ */
+ protected final ClientLinkType type;
+
+ /**
+ * Link rel.
+ */
+ protected final String rel;
+
+ /**
+ * ETag for media edit links.
+ */
+ protected String mediaETag;
+
+ private final List<ClientAnnotation> annotations = new ArrayList<ClientAnnotation>();
+
+ /**
+ * Constructor.
+ *
+ * @param uri URI.
+ * @param type type.
+ * @param title title.
+ */
+ public ClientLink(final URI uri, final ClientLinkType type, final String title) {
+ super(title);
+
+ link = uri;
+ this.type = type;
+
+ switch (this.type) {
+ case ASSOCIATION:
+ rel = Constants.NS_ASSOCIATION_LINK_REL + title;
+ break;
+
+ case ENTITY_NAVIGATION:
+ case ENTITY_SET_NAVIGATION:
+ rel = Constants.NS_NAVIGATION_LINK_REL + title;
+ break;
+
+ case MEDIA_EDIT:
+ default:
+ rel = Constants.NS_MEDIA_EDIT_LINK_REL + title;
+ break;
+ }
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param version OData service version.
+ * @param baseURI base URI.
+ * @param href href.
+ * @param type type.
+ * @param title title.
+ */
+ protected ClientLink(final URI baseURI, final String href, final ClientLinkType type, final String title) {
+
+ this(getURI(baseURI, href), type, title);
+ }
+
+ /**
+ * Gets link type.
+ *
+ * @return link type;
+ */
+ public ClientLinkType getType() {
+ return type;
+ }
+
+ public ClientInlineEntity asInlineEntity() {
+ return (this instanceof ClientInlineEntity) ? (ClientInlineEntity) this : null;
+ }
+
+ public ClientInlineEntitySet asInlineEntitySet() {
+ return (this instanceof ClientInlineEntitySet) ? (ClientInlineEntitySet) this : null;
+ }
+
+ /**
+ * Gets link rel.
+ *
+ * @return link rel
+ */
+ public String getRel() {
+ return rel;
+ }
+
+ /**
+ * Gets Media ETag.
+ *
+ * @return media ETag
+ */
+ public String getMediaETag() {
+ return mediaETag;
+ }
+
+ public List<ClientAnnotation> getAnnotations() {
+ return annotations;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLinkType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLinkType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLinkType.java
new file mode 100644
index 0000000..8b13c33
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLinkType.java
@@ -0,0 +1,105 @@
+/*
+ * 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.commons.api.domain;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.commons.api.Constants;
+import org.apache.olingo.commons.api.format.ContentType;
+
+/**
+ * OData link types.
+ */
+public enum ClientLinkType {
+
+ /**
+ * Entity navigation link.
+ */
+ ENTITY_NAVIGATION(ContentType.APPLICATION_ATOM_XML_ENTRY),
+ /**
+ * Entity set navigation link.
+ */
+ ENTITY_SET_NAVIGATION(ContentType.APPLICATION_ATOM_XML_FEED),
+ /**
+ * Association link.
+ */
+ ASSOCIATION(ContentType.APPLICATION_XML),
+ /**
+ * Media-edit link.
+ */
+ MEDIA_EDIT("*/*"),
+
+ /**
+ * Entity binding link.
+ */
+ ENTITY_BINDING(ContentType.APPLICATION_XML),
+
+ /**
+ * Entity collection binding link.
+ */
+ ENTITY_COLLECTION_BINDING(ContentType.APPLICATION_XML);
+
+ private String type;
+
+ private ClientLinkType(final String type) {
+ this.type = type;
+ }
+
+ private ClientLinkType(final ContentType contentType) {
+ this(contentType.toContentTypeString());
+ }
+
+ private ClientLinkType setType(final String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Gets
+ * <code>LinkType</code> instance from the given rel and type.
+ *
+ * @param rel rel.
+ * @param type type.
+ * @return <code>ODataLinkType</code> object.
+ */
+ public static ClientLinkType fromString(final String rel, final String type) {
+ if (StringUtils.isNotBlank(rel) && rel.startsWith(Constants.NS_MEDIA_EDIT_LINK_REL)) {
+
+ return MEDIA_EDIT.setType(StringUtils.isBlank(type) ? "*/*" : type);
+ }
+
+ if (ClientLinkType.ENTITY_NAVIGATION.type.equals(type)) {
+ return ENTITY_NAVIGATION;
+ }
+
+ if (ClientLinkType.ENTITY_SET_NAVIGATION.type.equals(type)) {
+ return ENTITY_SET_NAVIGATION;
+ }
+
+ if (ClientLinkType.ASSOCIATION.type.equals(type)) {
+ return ASSOCIATION;
+ }
+
+ throw new IllegalArgumentException("Invalid link type: " + type);
+ }
+
+ @Override
+ public String toString() {
+ return type;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLinked.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLinked.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLinked.java
new file mode 100644
index 0000000..92b3a42
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLinked.java
@@ -0,0 +1,70 @@
+/*
+ * 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.commons.api.domain;
+
+import java.util.List;
+
+public interface ClientLinked {
+
+ /**
+ * Puts the given link into one of available lists, based on its type.
+ *
+ * @param link to be added
+ * @return <tt>true</tt> if the given link was added in one of available lists
+ */
+ boolean addLink(ClientLink link);
+
+ /**
+ * Removes the given link from any list (association, navigation, edit-media).
+ *
+ * @param link to be removed
+ * @return <tt>true</tt> if the given link was contained in one of available lists
+ */
+ boolean removeLink(ClientLink link);
+
+ /**
+ * Gets association link with given name, if available, otherwise <tt>null</tt>.
+ *
+ * @param name candidate link name
+ * @return association link with given name, if available, otherwise <tt>null</tt>
+ */
+ ClientLink getAssociationLink(String name);
+
+ /**
+ * Returns all entity association links.
+ *
+ * @return OData entity links.
+ */
+ List<ClientLink> getAssociationLinks();
+
+ /**
+ * Gets navigation link with given name, if available, otherwise <tt>null</tt>.
+ *
+ * @param name candidate link name
+ * @return navigation link with given name, if available, otherwise <tt>null</tt>
+ */
+ ClientLink getNavigationLink(String name);
+
+ /**
+ * Returns all entity navigation links (including inline entities / entity sets).
+ *
+ * @return OData entity links.
+ */
+ List<ClientLink> getNavigationLinks();
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientObjectFactory.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientObjectFactory.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientObjectFactory.java
new file mode 100644
index 0000000..d9a2e9f
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientObjectFactory.java
@@ -0,0 +1,168 @@
+/*
+ * 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.commons.api.domain;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+import java.net.URI;
+
+/**
+ * Entry point for generating OData domain objects.
+ */
+public interface ClientObjectFactory {
+
+ /**
+ * Instantiates a new entity set.
+ *
+ * @return entity set.
+ */
+ ClientEntitySet newEntitySet();
+
+ /**
+ * Instantiates a new entity set.
+ *
+ * @param next next link.
+ * @return entity set.
+ */
+ ClientEntitySet newEntitySet(URI next);
+
+ /**
+ * Instantiates a new entity.
+ *
+ * @param typeName OData entity type name.
+ * @return entity.
+ */
+ ClientEntity newEntity(FullQualifiedName typeName);
+
+ /**
+ * Instantiates a new entity.
+ *
+ * @param typeName OData entity type name.
+ * @param link self link.
+ * @return entity.
+ */
+ ClientEntity newEntity(FullQualifiedName typeName, URI link);
+
+ /**
+ * Instantiates a new entity set (for deep insert).
+ *
+ * @param name name.
+ * @param entitySet entity set.
+ * @return in-line entity set.
+ */
+ ClientInlineEntitySet newDeepInsertEntitySet(String name, ClientEntitySet entitySet);
+
+ /**
+ * Instantiates a new entity (for deep insert).
+ *
+ * @param name name.
+ * @param entity entity.
+ * @return in-line entity.
+ */
+ ClientInlineEntity newDeepInsertEntity(String name, ClientEntity entity);
+
+ /**
+ * Instantiates a new entity set navigation link.
+ *
+ * @param name name.
+ * @param link link.
+ * @return entity set navigation link.
+ */
+ ClientLink newEntitySetNavigationLink(String name, URI link);
+
+ /**
+ * Instantiates a new singleton entity.
+ *
+ * @param typeName OData singleton entity type name.
+ * @return new singleton entity.
+ */
+ ClientSingleton newSingleton(FullQualifiedName typeName);
+
+ /**
+ * Instantiates a new entity navigation link.
+ *
+ * @param name name.
+ * @param link link.
+ * @return entity navigation link.
+ */
+ ClientLink newEntityNavigationLink(String name, URI link);
+
+ ClientLink newAssociationLink(String name, URI link);
+
+ ClientLink newMediaEditLink(String name, URI link);
+
+ ClientPrimitiveValue.Builder newPrimitiveValueBuilder();
+
+ ClientEnumValue newEnumValue(String typeName, String value);
+
+ ClientComplexValue newComplexValue(String typeName);
+
+ ClientCollectionValue<ClientValue> newCollectionValue(String typeName);
+
+ /**
+ * Instantiates a new primitive property.
+ *
+ * @param name name.
+ * @param value primitive value.
+ * @return primitive property.
+ */
+ ClientProperty newPrimitiveProperty(String name, ClientPrimitiveValue value);
+
+ /**
+ * Instantiates a new complex property.
+ *
+ * @param name name.
+ * @param value value.
+ * @return complex property.
+ */
+ ClientProperty newComplexProperty(String name, ClientComplexValue value);
+
+ /**
+ * Instantiates a new collection property.
+ *
+ * @param name name.
+ * @param value value.
+ * @return collection property.
+ */
+ ClientProperty newCollectionProperty(String name, ClientCollectionValue<? extends ClientValue> value);
+
+ /**
+ * Instantiates a new enum property.
+ *
+ * @param name name.
+ * @param value value.
+ * @return new enum property.
+ */
+ ClientProperty newEnumProperty(String name, ClientEnumValue value);
+
+ /**
+ * Instantiates a new delta property.
+ *
+ * @return new delta property.
+ */
+ ClientDelta newDelta();
+
+ /**
+ * Instantiates a new delta property.
+ *
+ * @param next next link for delta property
+ * @return new delta property.
+ */
+ ClientDelta newDelta(URI next);
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientOperation.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientOperation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientOperation.java
new file mode 100644
index 0000000..e5c5845
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientOperation.java
@@ -0,0 +1,85 @@
+/*
+ * 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.commons.api.domain;
+
+import java.net.URI;
+
+public class ClientOperation {
+
+ private String metadataAnchor;
+
+ private String title;
+
+ private URI target;
+
+ /**
+ * Gets metadata anchor.
+ *
+ * @return metadata anchor.
+ */
+ public String getMetadataAnchor() {
+ return metadataAnchor;
+ }
+
+ /**
+ * Sets metadata anchor.
+ *
+ * @param metadataAnchor metadata anchor.
+ */
+ public void setMetadataAnchor(final String metadataAnchor) {
+ this.metadataAnchor = metadataAnchor;
+ }
+
+ /**
+ * Gets title.
+ *
+ * @return title.
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * Sets title.
+ *
+ * @param title title.
+ */
+ public void setTitle(final String title) {
+ this.title = title;
+ }
+
+ /**
+ * Gets target.
+ *
+ * @return target.
+ */
+ public URI getTarget() {
+ return target;
+ }
+
+ /**
+ * Sets target.
+ *
+ * @param target target.
+ */
+ public void setTarget(final URI target) {
+ this.target = target;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientPrimitiveValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientPrimitiveValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientPrimitiveValue.java
new file mode 100644
index 0000000..a3da64a
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientPrimitiveValue.java
@@ -0,0 +1,88 @@
+/*
+ * 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.commons.api.domain;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.api.edm.EdmType;
+
+import java.util.UUID;
+
+public interface ClientPrimitiveValue extends ClientValue {
+
+ interface Builder {
+
+ Builder setType(EdmType type);
+
+ Builder setType(EdmPrimitiveTypeKind type);
+
+ Builder setValue(Object value);
+
+ ClientPrimitiveValue build();
+
+ ClientPrimitiveValue buildBoolean(Boolean value);
+
+ ClientPrimitiveValue buildInt16(Short value);
+
+ ClientPrimitiveValue buildInt32(Integer value);
+
+ ClientPrimitiveValue buildInt64(Long value);
+
+ ClientPrimitiveValue buildSingle(Float value);
+
+ ClientPrimitiveValue buildDouble(Double value);
+
+ ClientPrimitiveValue buildString(String value);
+
+ ClientPrimitiveValue buildGuid(UUID value);
+
+ ClientPrimitiveValue buildBinary(byte[] value);
+ }
+
+ EdmPrimitiveTypeKind getTypeKind();
+
+ EdmPrimitiveType getType();
+
+ /**
+ * Returns the current value as generic Object.
+ *
+ * @return an uncasted instance of this value
+ */
+ Object toValue();
+
+ /**
+ * Returns the current value casted to the given type.
+ *
+ * @param <T> cast type
+ * @param reference class reference
+ * @return the current value as typed java instance
+ * @throws EdmPrimitiveTypeException if the object is not assignable to the type T.
+ */
+ <T> T toCastValue(Class<T> reference) throws EdmPrimitiveTypeException;
+
+ /**
+ * Serialize the current value as String.
+ *
+ * @return a String representation of this value
+ */
+ @Override
+ String toString();
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientProperty.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientProperty.java
new file mode 100644
index 0000000..8d7a490
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientProperty.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.commons.api.domain;
+
+/**
+ * OData entity property.
+ */
+public interface ClientProperty extends ClientInvokeResult, ClientAnnotatable, ClientValuable {
+
+ /**
+ * Returns property name.
+ *
+ * @return property name.
+ */
+ String getName();
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientPropertyType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientPropertyType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientPropertyType.java
new file mode 100644
index 0000000..96ab250
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientPropertyType.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.commons.api.domain;
+
+public enum ClientPropertyType {
+
+ /**
+ * Primitive (including geospatial).
+ */
+ PRIMITIVE,
+ /**
+ * Enum.
+ */
+ ENUM,
+ /**
+ * Collection.
+ */
+ COLLECTION,
+ /**
+ * Complex.
+ */
+ COMPLEX,
+ /**
+ * Empty type (possibly, no type information could be retrieved).
+ */
+ EMPTY
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientServiceDocument.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientServiceDocument.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientServiceDocument.java
new file mode 100644
index 0000000..a2af9ab
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientServiceDocument.java
@@ -0,0 +1,163 @@
+/*
+ * 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.commons.api.domain;
+
+import java.net.URI;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+public class ClientServiceDocument {
+
+ private final Map<String, URI> entitySets = new HashMap<String, URI>();
+
+ private final Map<String, URI> functionImports = new HashMap<String, URI>();
+
+ private final Map<String, URI> singletons = new HashMap<String, URI>();
+
+ private final Map<String, URI> relatedServiceDocuments = new HashMap<String, URI>();
+
+ public Map<String, URI> getEntitySets() {
+ return entitySets;
+ }
+
+ /**
+ * Gets entity set names.
+ *
+ * @return entity set names.
+ */
+ public Collection<String> getEntitySetNames() {
+ return entitySets.keySet();
+ }
+
+ /**
+ * Gets entity set URIs.
+ *
+ * @return entity set URIs.
+ */
+ public Collection<URI> getEntitySetURIs() {
+ return entitySets.values();
+ }
+
+ /**
+ * Gets URI about the given entity set.
+ *
+ * @param name name.
+ * @return URI.
+ */
+ public URI getEntitySetURI(final String name) {
+ return entitySets.get(name);
+ }
+
+ public Map<String, URI> getFunctionImports() {
+ return functionImports;
+ }
+
+ /**
+ * Gets function import names.
+ *
+ * @return function import names.
+ */
+ public Collection<String> getFunctionImportNames() {
+ return functionImports.keySet();
+ }
+
+ /**
+ * Gets function import URIs.
+ *
+ * @return function import URIs.
+ */
+ public Collection<URI> getFunctionImportURIs() {
+ return functionImports.values();
+ }
+
+ /**
+ * Gets URI of the given function import.
+ *
+ * @param name name.
+ * @return URI.
+ */
+ public URI getFunctionImportURI(final String name) {
+ return functionImports.get(name);
+ }
+
+ public Map<String, URI> getSingletons() {
+ return singletons;
+ }
+
+ /**
+ * Gets singleton names.
+ *
+ * @return singleton names.
+ */
+ public Collection<String> getSingletonNames() {
+ return singletons.keySet();
+ }
+
+ /**
+ * Gets singleton URIs.
+ *
+ * @return singleton URIs.
+ */
+ public Collection<URI> getSingletonURIs() {
+ return singletons.values();
+ }
+
+ /**
+ * Gets URI of the given singleton.
+ *
+ * @param name name.
+ * @return URI.
+ */
+ public URI getSingletonURI(final String name) {
+ return singletons.get(name);
+ }
+
+ public Map<String, URI> getRelatedServiceDocuments() {
+ return relatedServiceDocuments;
+ }
+
+ /**
+ * Gets related service documents names.
+ *
+ * @return related service documents names.
+ */
+ public Collection<String> getRelatedServiceDocumentsNames() {
+ return relatedServiceDocuments.keySet();
+ }
+
+ /**
+ * Gets related service documents URIs.
+ *
+ * @return related service documents URIs.
+ */
+ public Collection<URI> getRelatedServiceDocumentsURIs() {
+ return relatedServiceDocuments.values();
+ }
+
+ /**
+ * Gets URI of the given related service documents.
+ *
+ * @param name name.
+ * @return URI.
+ */
+ public URI getRelatedServiceDocumentURI(final String name) {
+ return relatedServiceDocuments.get(name);
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientSingleton.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientSingleton.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientSingleton.java
new file mode 100644
index 0000000..aa474b7
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientSingleton.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.commons.api.domain;
+
+public interface ClientSingleton extends ClientEntity {
+//No additional methods needed for now.
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientValuable.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientValuable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientValuable.java
new file mode 100644
index 0000000..636972a
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientValuable.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.commons.api.domain;
+
+
+public interface ClientValuable {
+
+ /**
+ * Returns annotation value.
+ *
+ * @return annotation value.
+ */
+ ClientValue getValue();
+
+ /**
+ * Checks if has null value.
+ *
+ * @return 'TRUE' if has null value; 'FALSE' otherwise.
+ */
+ boolean hasNullValue();
+
+ /**
+ * Checks if has primitive value.
+ *
+ * @return 'TRUE' if has primitive value; 'FALSE' otherwise.
+ */
+ boolean hasPrimitiveValue();
+
+ /**
+ * Gets primitive value.
+ *
+ * @return primitive value if exists; null otherwise.
+ */
+ ClientPrimitiveValue getPrimitiveValue();
+
+ /**
+ * Checks if has collection value.
+ *
+ * @return 'TRUE' if has collection value; 'FALSE' otherwise.
+ */
+ boolean hasCollectionValue();
+
+ /**
+ * Gets collection value.
+ *
+ * @return collection value if exists; null otherwise.
+ */
+ ClientCollectionValue<ClientValue> getCollectionValue();
+
+ /**
+ * Checks if has complex value.
+ *
+ * @return 'TRUE' if has complex value; 'FALSE' otherwise.
+ */
+ boolean hasComplexValue();
+
+ /**
+ * Gets complex value.
+ *
+ * @return complex value if exists; null otherwise.
+ */
+ ClientComplexValue getComplexValue();
+
+ /**
+ * Checks if has enum value.
+ *
+ * @return 'TRUE' if has enum value; 'FALSE' otherwise.
+ */
+ boolean hasEnumValue();
+
+ /**
+ * Gets enum value.
+ *
+ * @return enum value if exists; null otherwise.
+ */
+ ClientEnumValue getEnumValue();
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientValue.java
new file mode 100644
index 0000000..ba41bc0
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientValue.java
@@ -0,0 +1,91 @@
+/*
+ * 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.commons.api.domain;
+
+
+/**
+ * Abstract representation of an OData entity property value.
+ */
+public interface ClientValue {
+
+ /**
+ * Gets value type name.
+ *
+ * @return value type name.
+ */
+ String getTypeName();
+
+ /**
+ * Check is is a primitive value.
+ *
+ * @return 'TRUE' if primitive; 'FALSE' otherwise.
+ */
+ boolean isPrimitive();
+
+ /**
+ * Casts to primitive value.
+ *
+ * @return primitive value.
+ */
+ ClientPrimitiveValue asPrimitive();
+
+ /**
+ * Check is is a collection value.
+ *
+ * @return 'TRUE' if collection; 'FALSE' otherwise.
+ */
+ boolean isCollection();
+
+ /**
+ * Casts to collection value.
+ *
+ * @param <OV> The actual ODataValue interface.
+ * @return collection value.
+ */
+ <OV extends ClientValue> ClientCollectionValue<OV> asCollection();
+
+ /**
+ * Casts to complex value.
+ *
+ * @return complex value.
+ */
+ ClientComplexValue asComplex();
+
+ /**
+ * Check is is a linked complex value.
+ *
+ * @return 'TRUE' if linked complex; 'FALSE' otherwise.
+ */
+ boolean isComplex();
+
+ /**
+ * Check is is an enum value.
+ *
+ * @return 'TRUE' if enum; 'FALSE' otherwise.
+ */
+ boolean isEnum();
+
+ /**
+ * Casts to enum value.
+ *
+ * @return enum value.
+ */
+ ClientEnumValue asEnum();
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataAnnotatable.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataAnnotatable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataAnnotatable.java
deleted file mode 100644
index fe10fba..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataAnnotatable.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.domain;
-
-import java.util.List;
-
-public interface ODataAnnotatable {
-
- List<ODataAnnotation> getAnnotations();
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataAnnotation.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataAnnotation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataAnnotation.java
deleted file mode 100644
index ec00417..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataAnnotation.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.domain;
-
-public interface ODataAnnotation extends ODataValuable {
-
- /**
- * Returns annotation name.
- *
- * @return annotation name.
- */
- String getTerm();
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataCollectionValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataCollectionValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataCollectionValue.java
deleted file mode 100644
index 2444f2a..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataCollectionValue.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.domain;
-
-import java.util.Collection;
-
-/**
- * OData collection property value.
- *
- * @param <OV> The actual ODataValue interface.
- */
-public interface ODataCollectionValue<OV extends ODataValue> extends ODataValue, Iterable<OV> {
-
- /**
- * Adds a value to the collection.
- *
- * @param value value to be added.
- */
- ODataCollectionValue<OV> add(ODataValue value);
-
- /**
- * Checks if collection is empty.
- *
- * @return 'TRUE' if empty; 'FALSE' otherwise.
- */
- boolean isEmpty();
-
- /**
- * Gets collection size.
- *
- * @return collection size.
- */
- int size();
-
- /**
- * Converts this instance as POJO collection.
- *
- * @return this instance as POJO collection
- */
- Collection<Object> asJavaCollection();
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataComplexValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataComplexValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataComplexValue.java
deleted file mode 100644
index ad64559..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataComplexValue.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.domain;
-
-import java.util.Map;
-
-/**
- * OData complex property value.
- *
- */
-public interface ODataComplexValue extends ODataValue, ODataLinked, ODataAnnotatable, Iterable<ODataProperty> {
-
- /**
- * Adds field to the complex type.
- *
- * @param field field to be added.
- * @return this (for fluent-style calls)
- */
- ODataComplexValue add(ODataProperty field);
-
- /**
- * Gets field.
- *
- * @param name name of the field to be retrieved.
- * @return requested field.
- */
- ODataProperty get(String name);
-
- /**
- * Gets number of fields.
- *
- * @return number of fields.
- */
- int size();
-
- /**
- * Converts this instance as POJO collection.
- *
- * @return this instance as POJO collection
- */
- Map<String, Object> asJavaMap();
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDeletedEntity.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDeletedEntity.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDeletedEntity.java
deleted file mode 100644
index ba7401e..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDeletedEntity.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.domain;
-
-import java.net.URI;
-
-public interface ODataDeletedEntity {
-
- enum Reason {
-
- deleted,
- changed
-
- }
-
- URI getId();
-
- Reason getReason();
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDelta.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDelta.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDelta.java
deleted file mode 100644
index 5492750..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDelta.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 org.apache.olingo.commons.api.domain;
-
-import java.util.List;
-
-public interface ODataDelta extends ODataEntitySet {
-
- List<ODataDeletedEntity> getDeletedEntities();
-
- List<ODataDeltaLink> getAddedLinks();
-
- List<ODataDeltaLink> getDeletedLinks();
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c37d4da5/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDeltaLink.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDeltaLink.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDeltaLink.java
deleted file mode 100644
index 757def9..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDeltaLink.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.domain;
-
-import java.net.URI;
-
-public interface ODataDeltaLink extends ODataAnnotatable {
-
- URI getSource();
-
- void setSource(URI source);
-
- String getRelationship();
-
- void setRelationship(String relationship);
-
- URI getTarget();
-
- void setTarget(URI target);
-}