You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by il...@apache.org on 2014/02/21 17:28:08 UTC

[05/14] [OLINGO-169] First huge import from ODataJClient: for the moment, it just build (no tests yet) and dummy Edm interfaces are used instead of the ones from commons-api

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/Path.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/Path.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/Path.java
new file mode 100644
index 0000000..8416a36
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/Path.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.odata4.client.core.edm.v4.annotation;
+
+public class Path extends AbstractElOrAttrConstruct {
+
+  private static final long serialVersionUID = -2551058493469292082L;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyPath.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyPath.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyPath.java
new file mode 100644
index 0000000..96288e2
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyPath.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.odata4.client.core.edm.v4.annotation;
+
+public class PropertyPath extends AbstractElOrAttrConstruct {
+
+  private static final long serialVersionUID = 2328584735437885159L;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyValue.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyValue.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyValue.java
new file mode 100644
index 0000000..5bbdc06
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyValue.java
@@ -0,0 +1,48 @@
+/*
+ * 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.odata4.client.core.edm.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = PropertyValueDeserializer.class)
+public class PropertyValue extends AnnotatedDynExprConstruct {
+
+  private static final long serialVersionUID = 3081968466425707461L;
+
+  private String property;
+
+  private ExprConstruct value;
+
+  public String getProperty() {
+    return property;
+  }
+
+  public void setProperty(final String property) {
+    this.property = property;
+  }
+
+  public ExprConstruct getValue() {
+    return value;
+  }
+
+  public void setValue(final ExprConstruct value) {
+    this.value = value;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyValueDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyValueDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyValueDeserializer.java
new file mode 100644
index 0000000..66793ab
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyValueDeserializer.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.odata4.client.core.edm.v4.annotation;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import java.io.IOException;
+import org.apache.olingo.odata4.client.core.data.impl.AbstractEdmDeserializer;
+import org.apache.olingo.odata4.client.core.edm.v4.AnnotationImpl;
+
+public class PropertyValueDeserializer extends AbstractEdmDeserializer<PropertyValue> {
+
+  @Override
+  protected PropertyValue doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+          throws IOException, JsonProcessingException {
+
+    final PropertyValue propValue = new PropertyValue();
+
+    for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+      final JsonToken token = jp.getCurrentToken();
+      if (token == JsonToken.FIELD_NAME) {
+        if ("Property".equals(jp.getCurrentName())) {
+          propValue.setProperty(jp.nextTextValue());
+        } else if ("Annotation".equals(jp.getCurrentName())) {
+          propValue.setAnnotation(jp.getCodec().readValue(jp, AnnotationImpl.class));
+        } else if (isAnnotationConstExprConstruct(jp)) {
+          propValue.setValue(parseAnnotationConstExprConstruct(jp));
+        } else {
+          propValue.setValue(jp.getCodec().readValue(jp, DynExprConstruct.class));
+        }
+      }
+    }
+
+    return propValue;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/Record.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/Record.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/Record.java
new file mode 100644
index 0000000..2bed70c
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/Record.java
@@ -0,0 +1,46 @@
+/*
+ * 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.odata4.client.core.edm.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.util.ArrayList;
+import java.util.List;
+
+@JsonDeserialize(using = RecordDeserializer.class)
+public class Record extends AnnotatedDynExprConstruct {
+
+  private static final long serialVersionUID = -2886526224721870304L;
+
+  private String type;
+
+  private final List<PropertyValue> propertyValues = new ArrayList<PropertyValue>();
+
+  public String getType() {
+    return type;
+  }
+
+  public void setType(final String type) {
+    this.type = type;
+  }
+
+  public List<PropertyValue> getPropertyValues() {
+    return propertyValues;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/RecordDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/RecordDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/RecordDeserializer.java
new file mode 100644
index 0000000..5d9c4ab
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/RecordDeserializer.java
@@ -0,0 +1,53 @@
+/*
+ * 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.odata4.client.core.edm.v4.annotation;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import java.io.IOException;
+import org.apache.olingo.odata4.client.core.data.impl.AbstractEdmDeserializer;
+import org.apache.olingo.odata4.client.core.edm.v4.AnnotationImpl;
+
+public class RecordDeserializer extends AbstractEdmDeserializer<Record> {
+
+  @Override
+  protected Record doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+          throws IOException, JsonProcessingException {
+
+    final Record record = new Record();
+
+    for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+      final JsonToken token = jp.getCurrentToken();
+      if (token == JsonToken.FIELD_NAME) {
+        if ("Tyoe".equals(jp.getCurrentName())) {
+          record.setType(jp.nextTextValue());
+        } else if ("Annotation".equals(jp.getCurrentName())) {
+          record.setAnnotation(jp.getCodec().readValue(jp, AnnotationImpl.class));
+        } else {
+          record.getPropertyValues().add(jp.getCodec().readValue(jp, PropertyValue.class));
+        }
+      }
+    }
+
+    return record;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/UrlRef.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/UrlRef.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/UrlRef.java
new file mode 100644
index 0000000..164ddfe
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/UrlRef.java
@@ -0,0 +1,38 @@
+/*
+ * 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.odata4.client.core.edm.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = UrlRefDeserializer.class)
+public class UrlRef extends DynExprConstruct {
+
+  private static final long serialVersionUID = 3755101394647430897L;
+
+  private ExprConstruct value;
+
+  public ExprConstruct getValue() {
+    return value;
+  }
+
+  public void setValue(final ExprConstruct value) {
+    this.value = value;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/UrlRefDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/UrlRefDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/UrlRefDeserializer.java
new file mode 100644
index 0000000..57a9f5c
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/UrlRefDeserializer.java
@@ -0,0 +1,50 @@
+/*
+ * 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.odata4.client.core.edm.v4.annotation;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import java.io.IOException;
+import org.apache.olingo.odata4.client.core.data.impl.AbstractEdmDeserializer;
+
+public class UrlRefDeserializer extends AbstractEdmDeserializer<UrlRef> {
+
+  @Override
+  protected UrlRef doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+          throws IOException, JsonProcessingException {
+
+    final UrlRef urlref = new UrlRef();
+
+    for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+      final JsonToken token = jp.getCurrentToken();
+      if (token == JsonToken.FIELD_NAME) {
+        if (isAnnotationConstExprConstruct(jp)) {
+          urlref.setValue(parseAnnotationConstExprConstruct(jp));
+        } else {
+          urlref.setValue(jp.getCodec().readValue(jp, DynExprConstruct.class));
+        }
+      }
+    }
+
+    return urlref;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/AbstractBasicAuthHttpClientFactory.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/AbstractBasicAuthHttpClientFactory.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/AbstractBasicAuthHttpClientFactory.java
new file mode 100644
index 0000000..1c3d8fd
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/AbstractBasicAuthHttpClientFactory.java
@@ -0,0 +1,50 @@
+/*
+ * 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.odata4.client.core.http;
+
+import java.net.URI;
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.HttpClient;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.olingo.odata4.client.api.http.HttpMethod;
+
+/**
+ * Base implementation for working with Basic Authentication: needs to be subclassed in order to provide actual username
+ * and password.
+ */
+public abstract class AbstractBasicAuthHttpClientFactory extends DefaultHttpClientFactory {
+
+  private static final long serialVersionUID = 7985626503125490244L;
+
+  protected abstract String getUsername();
+
+  protected abstract String getPassword();
+
+  @Override
+  public HttpClient createHttpClient(final HttpMethod method, final URI uri) {
+    final DefaultHttpClient httpclient = (DefaultHttpClient) super.createHttpClient(method, uri);
+
+    httpclient.getCredentialsProvider().setCredentials(
+            new AuthScope(uri.getHost(), uri.getPort()),
+            new UsernamePasswordCredentials(getUsername(), getPassword()));
+
+    return httpclient;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/AbstractNTLMAuthHttpClientFactory.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/AbstractNTLMAuthHttpClientFactory.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/AbstractNTLMAuthHttpClientFactory.java
new file mode 100644
index 0000000..579032b
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/AbstractNTLMAuthHttpClientFactory.java
@@ -0,0 +1,62 @@
+/*
+ * 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.odata4.client.core.http;
+
+import java.net.URI;
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.NTCredentials;
+import org.apache.http.client.CredentialsProvider;
+import org.apache.http.client.HttpClient;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.olingo.odata4.client.api.http.HttpMethod;
+
+/**
+ * Base implementation for working with NTLM Authentication via embedded HttpClient features: needs to be subclassed in
+ * order to provide all needed login information.
+ * <br/>
+ * External NTLM engine such as <a href="http://jcifs.samba.org/">JCIFS</a> library developed by the
+ * <a href="http://www.samba.org/">Samba</a> project as a part of their Windows interoperability suite of programs.
+ *
+ * @see NTCredentials
+ * @see http://hc.apache.org/httpcomponents-client-ga/ntlm.html#Using_Samba_JCIFS_as_an_alternative_NTLM_engine
+ */
+public abstract class AbstractNTLMAuthHttpClientFactory extends DefaultHttpClientFactory {
+
+  protected abstract String getUsername();
+
+  protected abstract String getPassword();
+
+  protected abstract String getWorkstation();
+
+  protected abstract String getDomain();
+
+  @Override
+  public HttpClient createHttpClient(final HttpMethod method, final URI uri) {
+    final DefaultHttpClient httpclient = (DefaultHttpClient) super.createHttpClient(method, uri);
+
+    final CredentialsProvider credsProvider = new BasicCredentialsProvider();
+    credsProvider.setCredentials(AuthScope.ANY,
+            new NTCredentials(getUsername(), getPassword(), getWorkstation(), getDomain()));
+
+    httpclient.setCredentialsProvider(credsProvider);
+
+    return httpclient;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/DefaultHttpClientFactory.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/DefaultHttpClientFactory.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/DefaultHttpClientFactory.java
new file mode 100644
index 0000000..f008ff5
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/DefaultHttpClientFactory.java
@@ -0,0 +1,39 @@
+/*
+ * 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.odata4.client.core.http;
+
+import java.io.Serializable;
+import java.net.URI;
+import org.apache.http.client.HttpClient;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.olingo.odata4.client.api.http.HttpClientFactory;
+import org.apache.olingo.odata4.client.api.http.HttpMethod;
+
+/**
+ * Default implementation returning HttpClients with default parameters.
+ */
+public class DefaultHttpClientFactory implements HttpClientFactory, Serializable {
+
+  private static final long serialVersionUID = -2461355444507227332L;
+
+  @Override
+  public HttpClient createHttpClient(final HttpMethod method, final URI uri) {
+    return new DefaultHttpClient();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/DefaultHttpUriRequestFactory.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/DefaultHttpUriRequestFactory.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/DefaultHttpUriRequestFactory.java
new file mode 100644
index 0000000..10b2e85
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/DefaultHttpUriRequestFactory.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.odata4.client.core.http;
+
+import java.net.URI;
+import org.apache.http.client.methods.HttpDelete;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.client.methods.HttpUriRequest;
+import org.apache.olingo.odata4.client.api.http.HttpMethod;
+import org.apache.olingo.odata4.client.api.http.HttpUriRequestFactory;
+
+/**
+ * Default implementation returning default HttpUriRequest implementations.
+ */
+public class DefaultHttpUriRequestFactory implements HttpUriRequestFactory {
+
+  @Override
+  public HttpUriRequest createHttpUriRequest(final HttpMethod method, final URI uri) {
+    HttpUriRequest result;
+
+    switch (method) {
+      case POST:
+        result = new HttpPost(uri);
+        break;
+
+      case PUT:
+        result = new HttpPut(uri);
+        break;
+
+      case PATCH:
+        result = new HttpPatch(uri);
+        break;
+
+      case MERGE:
+        result = new HttpMerge(uri);
+        break;
+
+      case DELETE:
+        result = new HttpDelete(uri);
+        break;
+
+      case GET:
+      default:
+        result = new HttpGet(uri);
+        break;
+    }
+
+    return result;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/HttpMerge.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/HttpMerge.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/HttpMerge.java
new file mode 100644
index 0000000..ffe20a9
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/HttpMerge.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.odata4.client.core.http;
+
+import java.net.URI;
+import org.apache.http.annotation.NotThreadSafe;
+import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
+
+/**
+ * Class identifying MERGE HTTP method.
+ */
+@NotThreadSafe
+public class HttpMerge extends HttpEntityEnclosingRequestBase {
+
+  public final static String METHOD_NAME = "MERGE";
+
+  /**
+   * Constructor.
+   */
+  public HttpMerge() {
+    super();
+  }
+
+  /**
+   * Constructor.
+   *
+   * @param uri request URI.
+   */
+  public HttpMerge(final URI uri) {
+    super();
+    setURI(uri);
+  }
+
+  /**
+   * Constructor.
+   *
+   * @param uri request URI.
+   * @throws IllegalArgumentException if the uri is invalid.
+   */
+  public HttpMerge(final String uri) {
+    super();
+    setURI(URI.create(uri));
+  }
+
+  /**
+   * Gets HTTP method name.
+   *
+   * @return HTTP method name.
+   */
+  @Override
+  public String getMethod() {
+    return METHOD_NAME;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/HttpPatch.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/HttpPatch.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/HttpPatch.java
new file mode 100644
index 0000000..244bdc1
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/http/HttpPatch.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.odata4.client.core.http;
+
+import java.net.URI;
+import org.apache.http.annotation.NotThreadSafe;
+import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
+
+/**
+ * Class identifying PATCH HTTP method.
+ */
+@NotThreadSafe
+public class HttpPatch extends HttpEntityEnclosingRequestBase {
+
+  public final static String METHOD_NAME = "PATCH";
+
+  /**
+   * Constructor.
+   */
+  public HttpPatch() {
+    super();
+  }
+
+  /**
+   * Constructor.
+   *
+   * @param uri request URI.
+   */
+  public HttpPatch(final URI uri) {
+    super();
+    setURI(uri);
+  }
+
+  /**
+   * Constructor.
+   *
+   * @param uri request URI.
+   * @throws IllegalArgumentException if the uri is invalid.
+   */
+  public HttpPatch(final String uri) {
+    super();
+    setURI(URI.create(uri));
+  }
+
+  /**
+   * Gets HTTP method name.
+   *
+   * @return HTTP method name.
+   */
+  @Override
+  public String getMethod() {
+    return METHOD_NAME;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/utils/AbstractDOMParser.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/utils/AbstractDOMParser.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/utils/AbstractDOMParser.java
new file mode 100644
index 0000000..49f3285
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/utils/AbstractDOMParser.java
@@ -0,0 +1,46 @@
+/*
+ * 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.odata4.client.core.utils;
+
+import java.io.InputStream;
+import java.io.Writer;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * DOM Parser.
+ */
+public abstract class AbstractDOMParser {
+
+  /**
+   * Parses the given input into a DOM tree.
+   *
+   * @param input stream to be parsed and de-serialized.
+   * @return DOM tree
+   */
+  public abstract Element deserialize(InputStream input);
+
+  /**
+   * Writes DOM object by the given writer.
+   *
+   * @param content DOM to be streamed.
+   * @param writer writer.
+   */
+  public abstract void serialize(Node content, Writer writer);
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/utils/AndroidDOMParserImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/utils/AndroidDOMParserImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/utils/AndroidDOMParserImpl.java
new file mode 100644
index 0000000..bbf5bd8
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/utils/AndroidDOMParserImpl.java
@@ -0,0 +1,49 @@
+/*
+ * 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.odata4.client.core.utils;
+
+import java.io.InputStream;
+import java.io.Writer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class AndroidDOMParserImpl extends AbstractDOMParser {
+
+  @Override
+  public Element deserialize(final InputStream input) {
+    try {
+      return XMLUtils.DOC_BUILDER_FACTORY.newDocumentBuilder().parse(input).getDocumentElement();
+    } catch (Exception e) {
+      throw new IllegalArgumentException("Could not parse DOM", e);
+    }
+  }
+
+  @Override
+  public void serialize(final Node content, final Writer writer) {
+    try {
+      TransformerFactory.newInstance().newTransformer().
+              transform(new DOMSource(content), new StreamResult(writer));
+    } catch (Exception e) {
+      throw new IllegalArgumentException("While serializing DOM element", e);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/utils/DefaultDOMParserImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/utils/DefaultDOMParserImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/utils/DefaultDOMParserImpl.java
new file mode 100644
index 0000000..d8215f7
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/utils/DefaultDOMParserImpl.java
@@ -0,0 +1,78 @@
+/*
+ * 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.odata4.client.core.utils;
+
+import java.io.InputStream;
+import java.io.Writer;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.bootstrap.DOMImplementationRegistry;
+import org.w3c.dom.ls.DOMImplementationLS;
+import org.w3c.dom.ls.LSInput;
+import org.w3c.dom.ls.LSOutput;
+import org.w3c.dom.ls.LSParser;
+import org.w3c.dom.ls.LSSerializer;
+
+public class DefaultDOMParserImpl extends AbstractDOMParser {
+
+  private static final Object MONITOR = new Object();
+
+  private static DOMImplementationLS DOM_IMPL;
+
+  private void lazyInit() throws ClassNotFoundException, InstantiationException, IllegalAccessException {
+    synchronized (MONITOR) {
+      if (DOM_IMPL == null) {
+        final DOMImplementationRegistry reg = DOMImplementationRegistry.newInstance();
+        DOM_IMPL = (DOMImplementationLS) reg.getDOMImplementation("LS");
+      }
+    }
+  }
+
+  @Override
+  public Element deserialize(final InputStream input) {
+    try {
+      lazyInit();
+
+      final LSParser parser = DOM_IMPL.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null);
+
+      final LSInput lsinput = DOM_IMPL.createLSInput();
+      lsinput.setByteStream(input);
+
+      return parser.parse(lsinput).getDocumentElement();
+    } catch (Exception e) {
+      throw new IllegalArgumentException("Could not parse DOM", e);
+    }
+  }
+
+  @Override
+  public void serialize(final Node content, final Writer writer) {
+    try {
+      lazyInit();
+
+      final LSSerializer serializer = DOM_IMPL.createLSSerializer();
+
+      final LSOutput lso = DOM_IMPL.createLSOutput();
+      lso.setCharacterStream(writer);
+
+      serializer.write(content, lso);
+    } catch (Exception e) {
+      throw new IllegalArgumentException("While serializing DOM element", e);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/utils/XMLUtils.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/utils/XMLUtils.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/utils/XMLUtils.java
new file mode 100644
index 0000000..90f5743
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/utils/XMLUtils.java
@@ -0,0 +1,186 @@
+/*
+ * 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.odata4.client.core.utils;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ServiceLoader;
+import javax.xml.parsers.DocumentBuilderFactory;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.odata4.client.api.Constants;
+import org.apache.olingo.odata4.client.core.data.EdmSimpleType;
+import org.apache.olingo.odata4.client.core.data.geospatial.Geospatial;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * XML utilities.
+ */
+public final class XMLUtils {
+
+  /**
+   * DOM factory.
+   */
+  public static final DocumentBuilderFactory DOC_BUILDER_FACTORY = DocumentBuilderFactory.newInstance();
+
+  public static final AbstractDOMParser PARSER;
+
+  static {
+    final Iterator<AbstractDOMParser> itor
+            = ServiceLoader.load(AbstractDOMParser.class, Thread.currentThread().getContextClassLoader()).iterator();
+    PARSER = itor.hasNext() ? itor.next() : new DefaultDOMParserImpl();
+  }
+
+  private XMLUtils() {
+    // Empty private constructor for static utility classes       
+  }
+
+  /**
+   * Gets XML node name.
+   *
+   * @param node node.
+   * @return node name.
+   */
+  public static String getSimpleName(final Node node) {
+    return node.getLocalName() == null
+            ? node.getNodeName().substring(node.getNodeName().indexOf(':') + 1)
+            : node.getLocalName();
+  }
+
+  /**
+   * Gets the given node's children of the given type.
+   *
+   * @param node parent.
+   * @param nodetype searched child type.
+   * @return children.
+   */
+  public static List<Node> getChildNodes(final Node node, final short nodetype) {
+    final List<Node> result = new ArrayList<Node>();
+
+    final NodeList children = node.getChildNodes();
+    for (int i = 0; i < children.getLength(); i++) {
+      final Node child = children.item(i);
+      if (child.getNodeType() == nodetype) {
+        result.add(child);
+      }
+    }
+
+    return result;
+  }
+
+  /**
+   * Gets the given node's children with the given name.
+   *
+   * @param node parent.
+   * @param name searched child name.
+   * @return children.
+   */
+  public static List<Element> getChildElements(final Element node, final String name) {
+    final List<Element> result = new ArrayList<Element>();
+
+    if (StringUtils.isNotBlank(name)) {
+      final NodeList children = node.getChildNodes();
+      for (int i = 0; i < children.getLength(); i++) {
+        final Node child = children.item(i);
+        if ((child instanceof Element) && name.equals(child.getNodeName())) {
+          result.add((Element) child);
+        }
+      }
+    }
+
+    return result;
+  }
+
+  /**
+   * Checks if the given node has <tt>element</tt> children.
+   *
+   * @param node parent.
+   * @return 'TRUE' if the given node has at least one <tt>element</tt> child; 'FALSE' otherwise.
+   */
+  public static boolean hasElementsChildNode(final Node node) {
+    boolean found = false;
+
+    for (Node child : getChildNodes(node, Node.ELEMENT_NODE)) {
+      if (Constants.ELEM_ELEMENT.equals(XMLUtils.getSimpleName(child))) {
+        found = true;
+      }
+    }
+
+    return found;
+  }
+
+  /**
+   * Checks if the given node has only text children.
+   *
+   * @param node parent.
+   * @return 'TRUE' if the given node has only text children; 'FALSE' otherwise.
+   */
+  public static boolean hasOnlyTextChildNodes(final Node node) {
+    boolean result = true;
+    final NodeList children = node.getChildNodes();
+    for (int i = 0; result && i < children.getLength(); i++) {
+      final Node child = children.item(i);
+      if (child.getNodeType() != Node.TEXT_NODE) {
+        result = false;
+      }
+    }
+
+    return result;
+  }
+
+  public static EdmSimpleType simpleTypeForNode(final Geospatial.Dimension dimension, final Node node) {
+    EdmSimpleType type = null;
+
+    if (Constants.ELEM_POINT.equals(node.getNodeName())) {
+      type = dimension == Geospatial.Dimension.GEOGRAPHY
+              ? EdmSimpleType.GeographyPoint
+              : EdmSimpleType.GeometryPoint;
+    } else if (Constants.ELEM_MULTIPOINT.equals(node.getNodeName())) {
+      type = dimension == Geospatial.Dimension.GEOGRAPHY
+              ? EdmSimpleType.GeographyMultiPoint
+              : EdmSimpleType.GeometryMultiPoint;
+    } else if (Constants.ELEM_LINESTRING.equals(node.getNodeName())) {
+      type = dimension == Geospatial.Dimension.GEOGRAPHY
+              ? EdmSimpleType.GeographyLineString
+              : EdmSimpleType.GeometryLineString;
+    } else if (Constants.ELEM_MULTILINESTRING.equals(node.getNodeName())) {
+      type = dimension == Geospatial.Dimension.GEOGRAPHY
+              ? EdmSimpleType.GeographyMultiLineString
+              : EdmSimpleType.GeometryMultiLineString;
+    } else if (Constants.ELEM_POLYGON.equals(node.getNodeName())) {
+      type = dimension == Geospatial.Dimension.GEOGRAPHY
+              ? EdmSimpleType.GeographyPolygon
+              : EdmSimpleType.GeometryPolygon;
+    } else if (Constants.ELEM_MULTIPOLYGON.equals(node.getNodeName())) {
+      type = dimension == Geospatial.Dimension.GEOGRAPHY
+              ? EdmSimpleType.GeographyMultiPolygon
+              : EdmSimpleType.GeometryMultiPolygon;
+    } else if (Constants.ELEM_GEOCOLLECTION.equals(node.getNodeName())
+            || Constants.ELEM_GEOMEMBERS.equals(node.getNodeName())) {
+
+      type = dimension == Geospatial.Dimension.GEOGRAPHY
+              ? EdmSimpleType.GeographyCollection
+              : EdmSimpleType.GeometryCollection;
+    }
+
+    return type;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/test/java/org/apache/olingo/odata4/client/core/ODataClientTest.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/test/java/org/apache/olingo/odata4/client/core/ODataClientTest.java b/odata4-lib/odata4-client-core/src/test/java/org/apache/olingo/odata4/client/core/ODataClientTest.java
index 814435b..0dc7004 100644
--- a/odata4-lib/odata4-client-core/src/test/java/org/apache/olingo/odata4/client/core/ODataClientTest.java
+++ b/odata4-lib/odata4-client-core/src/test/java/org/apache/olingo/odata4/client/core/ODataClientTest.java
@@ -19,15 +19,22 @@
 package org.apache.olingo.odata4.client.core;
 
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
 
 import org.apache.olingo.odata4.client.api.ODataClient;
+import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
 import org.junit.Test;
 
 public class ODataClientTest {
 
   @Test
   public void before() {
-    ODataClient client = ODataClient.create();
+    ODataClient client = ODataClientFactory.getV3();
     assertNotNull(client);
+    assertEquals(ODataServiceVersion.V30, client.getServiceVersion());
+
+    client = ODataClientFactory.getV4();
+    assertNotNull(client);
+    assertEquals(ODataServiceVersion.V40, client.getServiceVersion());
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/test/java/org/apache/olingo/odata4/client/core/deserializer/JsonReaderPerformance.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/test/java/org/apache/olingo/odata4/client/core/deserializer/JsonReaderPerformance.java b/odata4-lib/odata4-client-core/src/test/java/org/apache/olingo/odata4/client/core/deserializer/JsonReaderPerformance.java
index ff4d6c3..12d1bca 100644
--- a/odata4-lib/odata4-client-core/src/test/java/org/apache/olingo/odata4/client/core/deserializer/JsonReaderPerformance.java
+++ b/odata4-lib/odata4-client-core/src/test/java/org/apache/olingo/odata4/client/core/deserializer/JsonReaderPerformance.java
@@ -24,36 +24,40 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
 import java.io.InputStream;
+import org.apache.commons.io.IOUtils;
 
 import org.apache.olingo.odata4.client.api.deserializer.ComplexValue;
 import org.apache.olingo.odata4.client.api.deserializer.Property;
 import org.apache.olingo.odata4.client.api.deserializer.StructuralProperty;
 import org.apache.olingo.odata4.client.api.deserializer.Value;
-import org.apache.olingo.odata4.client.core.testutil.StringHelper;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class JsonReaderPerformance {
 
+  private static final Logger LOG = LoggerFactory.getLogger(JsonReaderPerformance.class);
+
   @Test
   public void testComplexPropertyPerformance() throws Exception {
     JsonReader consumer = new JsonReader();
     int runs = 1000; // * 100;
 
     InputStream in = JsonReaderPerformance.class.getResourceAsStream("/complexProperty.json");
-    String content = StringHelper.inputStreamToString(in);
+    String content = IOUtils.toString(in);
 
-//    System.out.println("Started...");
+    LOG.debug("Started...");
     ComplexValue complex = null;
-//    long startTime = System.currentTimeMillis();
+    long startTime = System.currentTimeMillis();
     for (int i = 0; i < runs; i++) {
-      Property property = consumer.readProperty(StringHelper.encapsulate(content));
+      Property property = consumer.readProperty(IOUtils.toInputStream(content));
       complex = (ComplexValue) ((StructuralProperty) property).getValue();
     }
-//    long endTime = System.currentTimeMillis();
+    long endTime = System.currentTimeMillis();
 
-//    long duration = endTime - startTime;
-//    System.out.println("Duration: " + duration + " ms");
-//    System.out.println("Duration per run: " + (duration / (float) runs) + " ms");
+    long duration = endTime - startTime;
+    LOG.debug("Duration: " + duration + " ms");
+    LOG.debug("Duration per run: " + (duration / (float) runs) + " ms");
     testComplexProperty(complex);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/test/java/org/apache/olingo/odata4/client/core/testutil/StringHelper.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/test/java/org/apache/olingo/odata4/client/core/testutil/StringHelper.java b/odata4-lib/odata4-client-core/src/test/java/org/apache/olingo/odata4/client/core/testutil/StringHelper.java
deleted file mode 100644
index 90b7479..0000000
--- a/odata4-lib/odata4-client-core/src/test/java/org/apache/olingo/odata4/client/core/testutil/StringHelper.java
+++ /dev/null
@@ -1,108 +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.odata4.client.core.testutil;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.nio.charset.Charset;
-
-// TODO: remove this class in favor of StringUtils, IOUtils, ...
-public class StringHelper {
-
-  public static String inputStreamToString(final InputStream in, final boolean preserveLineBreaks) throws IOException {
-    final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(in, Charset.forName("UTF-8")));
-    final StringBuilder stringBuilder = new StringBuilder();
-    String line = null;
-
-    while ((line = bufferedReader.readLine()) != null) {
-      stringBuilder.append(line);
-      if (preserveLineBreaks) {
-        stringBuilder.append("\n");
-      }
-    }
-
-    bufferedReader.close();
-
-    final String result = stringBuilder.toString();
-
-    return result;
-  }
-
-  public static String inputStreamToString(final InputStream in) throws IOException {
-    return inputStreamToString(in, false);
-  }
-
-  /**
-   * Encapsulate given content in an {@link InputStream} with charset <code>UTF-8</code>.
-   *
-   * @param content to encapsulate content
-   * @return content as stream
-   */
-  public static InputStream encapsulate(final String content) {
-    try {
-      return encapsulate(content, "UTF-8");
-    } catch (UnsupportedEncodingException e) {
-      // we know that UTF-8 is supported
-      throw new RuntimeException("UTF-8 MUST be supported.", e);
-    }
-  }
-
-  /**
-   * Encapsulate given content in an {@link InputStream} with given charset.
-   *
-   * @param content to encapsulate content
-   * @param charset to be used charset
-   * @return content as stream
-   * @throws UnsupportedEncodingException if charset is not supported
-   */
-  public static InputStream encapsulate(final String content, final String charset)
-          throws UnsupportedEncodingException {
-    return new ByteArrayInputStream(content.getBytes(charset));
-  }
-
-  /**
-   * Generate a string with given length containing random upper case characters ([A-Z]).
-   *
-   * @param len length of to generated string
-   * @return random upper case characters ([A-Z]).
-   */
-  public static InputStream generateDataStream(final int len) {
-    return encapsulate(generateData(len));
-  }
-
-  /**
-   * Generate a string with given length containing random upper case characters ([A-Z]).
-   *
-   * @param len length of to generated string
-   * @return random upper case characters ([A-Z]).
-   */
-  public static String generateData(final int len) {
-    final StringBuilder builder = new StringBuilder(len);
-    for (int j = 0; j < len; j++) {
-      final char c = (char) (Math.random() * 26 + 65);
-      builder.append(c);
-    }
-    return builder.toString();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/ConcurrencyMode.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/ConcurrencyMode.java b/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/ConcurrencyMode.java
new file mode 100644
index 0000000..335ae8d
--- /dev/null
+++ b/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/ConcurrencyMode.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.odata4.commons.api.edm.constants;
+
+public enum ConcurrencyMode {
+
+  None,
+  Fixed
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmContentKind.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmContentKind.java b/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmContentKind.java
new file mode 100644
index 0000000..9ec3c7a
--- /dev/null
+++ b/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmContentKind.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.odata4.commons.api.edm.constants;
+
+/**
+ * Specifies the content type of the value of the property being mapped via a customizable feed mapping.
+ */
+public enum EdmContentKind {
+
+  text,
+  html,
+  xhtml;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/ODataServiceVersion.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/ODataServiceVersion.java b/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/ODataServiceVersion.java
index 9c6a3fa..4f35ebd 100644
--- a/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/ODataServiceVersion.java
+++ b/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/ODataServiceVersion.java
@@ -18,35 +18,61 @@
  */
 package org.apache.olingo.odata4.commons.api.edm.constants;
 
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 /**
  * This class is a container for the supported ODataServiceVersions.
  */
-public class ODataServiceVersion {
+public enum ODataServiceVersion {
+
+  V10("1.0"),
+  V20("2.0"),
+  V30("3.0"),
+  V40("4.0");
 
   private static final Pattern DATASERVICEVERSIONPATTERN = Pattern.compile("(\\p{Digit}+\\.\\p{Digit}+)(:?;.*)?");
 
-  /**
-   * ODataServiceVersion 1.0
-   */
-  public static final String V10 = "1.0";
+  public static final String NS_DATASERVICES = "dataservices";
 
-  /**
-   * ODataServiceVersion 2.0
-   */
-  public static final String V20 = "2.0";
+  public static final String NS_METADATA = "metadata";
 
-  /**
-   * ODataServiceVersion 3.0
-   */
-  public static final String V30 = "3.0";
+  public static final String NS_DATA = "data";
 
-  /**
-   * ODataServiceVersion 4.0
-   */
-  public static final String V40 = "4.0";
+  public static final String NS_SCHEME = "scheme";
+
+  public static final String NAVIGATION_LINK_REL = "navigationLinkRel";
+
+  public static final String ASSOCIATION_LINK_REL = "associationLinkRel";
+
+  public static final String MEDIA_EDIT_LINK_REL = "mediaEditLinkRel";
+
+  private static final Map<String, String> V30_NAMESPACES = Collections.unmodifiableMap(new HashMap<String, String>() {
+
+    private static final long serialVersionUID = 3109256773218160485L;
+
+    {
+      put(NS_DATASERVICES, "http://schemas.microsoft.com/ado/2007/08/dataservices");
+      put(NS_METADATA, "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata");
+      put(NS_SCHEME, "http://schemas.microsoft.com/ado/2007/08/dataservices/scheme");
+      put(NAVIGATION_LINK_REL, "http://schemas.microsoft.com/ado/2007/08/dataservices/related/");
+      put(ASSOCIATION_LINK_REL, "http://schemas.microsoft.com/ado/2007/08/dataservices/relatedlinks/");
+      put(MEDIA_EDIT_LINK_REL, "http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/");
+    }
+  });
+
+  private static final Map<String, String> V40_NAMESPACES = Collections.unmodifiableMap(new HashMap<String, String>() {
+
+    private static final long serialVersionUID = 3109256773218160485L;
+
+    {
+      put(NS_METADATA, "http://docs.oasis-open.org/odata/ns/metadata");
+      put(NS_DATA, "http://docs.oasis-open.org/odata/ns/data");
+    }
+  });
 
   /**
    * Validates format and range of a data service version string.
@@ -58,10 +84,10 @@ public class ODataServiceVersion {
     final Matcher matcher = DATASERVICEVERSIONPATTERN.matcher(version);
     if (matcher.matches()) {
       final String possibleDataServiceVersion = matcher.group(1);
-      return V10.equals(possibleDataServiceVersion)
-              || V20.equals(possibleDataServiceVersion)
-              || V30.equals(possibleDataServiceVersion)
-              || V40.equals(possibleDataServiceVersion);
+      return V10.toString().equals(possibleDataServiceVersion)
+              || V20.toString().equals(possibleDataServiceVersion)
+              || V30.toString().equals(possibleDataServiceVersion)
+              || V40.toString().equals(possibleDataServiceVersion);
     } else {
       throw new IllegalArgumentException(version);
     }
@@ -93,5 +119,22 @@ public class ODataServiceVersion {
 
     return null;
   }
+  private final String version;
+
+  private ODataServiceVersion(final String version) {
+    this.version = version;
+  }
 
+  public Map<String, String> getNamespaceMap() {
+    return this == V10 || this == V20
+            ? Collections.<String, String>emptyMap()
+            : this == V30
+            ? V30_NAMESPACES
+            : V40_NAMESPACES;
+  }
+
+  @Override
+  public String toString() {
+    return version;
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/StoreGeneratedPattern.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/StoreGeneratedPattern.java b/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/StoreGeneratedPattern.java
new file mode 100644
index 0000000..3dad36b
--- /dev/null
+++ b/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/StoreGeneratedPattern.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.odata4.commons.api.edm.constants;
+
+public enum StoreGeneratedPattern {
+
+  None,
+  Identity,
+  Computed
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmServiceMetadataImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmServiceMetadataImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmServiceMetadataImpl.java
index 8b09be8..f44f1d6 100644
--- a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmServiceMetadataImpl.java
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmServiceMetadataImpl.java
@@ -55,7 +55,7 @@ public class EdmServiceMetadataImpl implements EdmServiceMetadata {
 
   @Override
   public String getDataServiceVersion() {
-    return ODataServiceVersion.V40;
+    return ODataServiceVersion.V40.toString();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-server-core/src/test/java/org/apache/olingo/odata4/server/core/edm/provider/EdmServiceMetadataImplTest.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/test/java/org/apache/olingo/odata4/server/core/edm/provider/EdmServiceMetadataImplTest.java b/odata4-lib/odata4-server-core/src/test/java/org/apache/olingo/odata4/server/core/edm/provider/EdmServiceMetadataImplTest.java
index 0933288..5c7f154 100644
--- a/odata4-lib/odata4-server-core/src/test/java/org/apache/olingo/odata4/server/core/edm/provider/EdmServiceMetadataImplTest.java
+++ b/odata4-lib/odata4-server-core/src/test/java/org/apache/olingo/odata4/server/core/edm/provider/EdmServiceMetadataImplTest.java
@@ -74,7 +74,7 @@ public class EdmServiceMetadataImplTest {
   public void initialProvider() {
     EdmProvider provider = new EdmProvider() {};
     EdmServiceMetadata serviceMetadata = new EdmServiceMetadataImpl(provider);
-    assertEquals(ODataServiceVersion.V40, serviceMetadata.getDataServiceVersion());
+    assertEquals(ODataServiceVersion.V40.toString(), serviceMetadata.getDataServiceVersion());
   }
 
   @Test(expected = EdmException.class)

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index ec5487f..5a1e0a2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -62,49 +62,92 @@
   </modules>
 
   <properties>
+    <commons.codec.version>1.9</commons.codec.version>
+    <commons.io.version>2.4</commons.io.version>
+    <commons.lang3.version>3.2.1</commons.lang3.version>
+
+    <hc.client.version>4.2.6</hc.client.version>
+    <jackson.version>2.3.1</jackson.version>
+
     <antlr.version>4.1</antlr.version>
+    
+    <sl4j.version>1.7.5</sl4j.version>    
   </properties>
 
   <dependencyManagement>
     <dependencies>
       <dependency>
-        <groupId>junit</groupId>
-        <artifactId>junit</artifactId>
-        <version>4.11</version>
-        <scope>test</scope>
+        <groupId>commons-codec</groupId>
+        <artifactId>commons-codec</artifactId>
+        <version>${commons.codec.version}</version>
       </dependency>
       <dependency>
-        <groupId>org.mockito</groupId>
-        <artifactId>mockito-all</artifactId>
-        <version>1.9.5</version>
-        <scope>test</scope>
+        <groupId>commons-io</groupId>
+        <artifactId>commons-io</artifactId>
+        <version>${commons.io.version}</version>
       </dependency>
       <dependency>
-        <groupId>commons-codec</groupId>
-        <artifactId>commons-codec</artifactId>
-        <version>1.9</version>
+        <groupId>org.apache.commons</groupId>
+        <artifactId>commons-lang3</artifactId>
+        <version>${commons.lang3.version}</version>
       </dependency>
+
       <dependency>
         <groupId>org.antlr</groupId>
         <artifactId>antlr4-runtime</artifactId>
         <version>${antlr.version}</version>
-        <scope>compile</scope>
       </dependency>
+
+      <dependency>
+        <groupId>org.apache.httpcomponents</groupId>
+        <artifactId>httpclient</artifactId>
+        <version>${hc.client.version}</version>
+      </dependency>
+      
       <dependency>
         <groupId>com.fasterxml.jackson.core</groupId>
         <artifactId>jackson-core</artifactId>
-        <version>2.2.3</version>
+        <version>${jackson.version}</version>
       </dependency>
       <dependency>
         <groupId>com.fasterxml.jackson.core</groupId>
         <artifactId>jackson-databind</artifactId>
-        <version>2.2.3</version>
+        <version>${jackson.version}</version>
       </dependency>
       <dependency>
         <groupId>com.fasterxml.jackson.core</groupId>
         <artifactId>jackson-annotations</artifactId>
-        <version>2.2.3</version>
+        <version>${jackson.version}</version>
       </dependency>
+      <dependency>
+        <groupId>com.fasterxml.jackson.dataformat</groupId>
+        <artifactId>jackson-dataformat-xml</artifactId>
+        <version>${jackson.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>com.fasterxml</groupId>
+        <artifactId>aalto-xml</artifactId>
+        <version>0.9.9</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>slf4j-api</artifactId>
+        <version>${sl4j.version}</version>
+      </dependency>
+            
+      <dependency>
+        <groupId>junit</groupId>
+        <artifactId>junit</artifactId>
+        <version>4.11</version>
+        <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.mockito</groupId>
+        <artifactId>mockito-all</artifactId>
+        <version>1.9.5</version>
+        <scope>test</scope>
+      </dependency>      
     </dependencies>
   </dependencyManagement>