Repository: olingo-odata4 Updated Branches: refs/heads/master c8865db8e -> 111239d7c
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/FilterFactoryImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/FilterFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/FilterFactoryImpl.java deleted file mode 100644 index d994855..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/FilterFactoryImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.uri.v4; - -import org.apache.olingo.client.api.uri.FilterArg; -import org.apache.olingo.client.api.uri.URIFilter; -import org.apache.olingo.client.api.uri.v4.FilterArgFactory; -import org.apache.olingo.client.api.uri.v4.FilterFactory; -import org.apache.olingo.client.core.uri.AbstractFilterFactory; -import org.apache.olingo.client.core.uri.FilterProperty; -import org.apache.olingo.client.core.uri.HasFilter; -import org.apache.olingo.commons.api.edm.EdmEnumType; -import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; - -public class FilterFactoryImpl extends AbstractFilterFactory implements FilterFactory { - - public FilterFactoryImpl(ODataServiceVersion version) { - super(version); - } - - @Override - public FilterArgFactory getArgFactory() { - return new FilterArgFactoryImpl(version); - } - - @Override - public URIFilter has(final String key, final EdmEnumType enumType, final String memberName) { - return has(getArgFactory().property(key), enumType, memberName); - } - - @Override - public URIFilter has(final FilterArg left, final EdmEnumType enumType, final String memberName) { - return new HasFilter(left, new FilterProperty(enumType.toUriLiteral(memberName))); - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/URIBuilderImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/URIBuilderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/URIBuilderImpl.java deleted file mode 100644 index e5a156c..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/URIBuilderImpl.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.uri.v4; - -import java.util.LinkedHashMap; -import java.util.Map; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.tuple.Pair; -import org.apache.olingo.client.api.Configuration; -import org.apache.olingo.client.api.uri.QueryOption; -import org.apache.olingo.client.api.uri.SegmentType; -import org.apache.olingo.client.api.uri.v4.URIBuilder; -import org.apache.olingo.client.api.uri.v4.URISearch; -import org.apache.olingo.client.core.uri.AbstractURIBuilder; -import org.apache.olingo.commons.api.edm.EdmEnumType; -import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; - -public class URIBuilderImpl extends AbstractURIBuilder<URIBuilder> implements URIBuilder { - - public URIBuilderImpl( - final ODataServiceVersion version, final Configuration configuration, final String serviceRoot) { - super(version, configuration, serviceRoot); - } - - @Override - public URIBuilder appendKeySegment(final EdmEnumType enumType, final String memberName) { - return appendKeySegment(enumType.toUriLiteral(memberName)); - } - - @Override - public URIBuilder appendKeySegment(final Map<String, Pair<EdmEnumType, String>> enumValues, - final Map<String, Object> segmentValues) { - - final Map<String, Object> values = new LinkedHashMap<String, Object>(); - for (Map.Entry<String, Pair<EdmEnumType, String>> entry : enumValues.entrySet()) { - values.put(entry.getKey(), entry.getValue().getKey().toUriLiteral(entry.getValue().getValue())); - } - values.putAll(segmentValues); - - return appendKeySegment(values); - } - - @Override - protected URIBuilder getThis() { - return this; - } - - @Override - protected String noKeysWrapper() { - return "()"; - } - - @Override - protected char getBoundOperationSeparator() { - return '.'; - } - - @Override - protected String getOperationInvokeMarker() { - return "()"; - } - - @Override - public URIBuilder appendSingletonSegment(final String segmentValue) { - segments.add(new Segment(SegmentType.SINGLETON, segmentValue)); - return getThis(); - } - - @Override - public URIBuilder appendEntityIdSegment(final String segmentValue) { - segments.add(new Segment(SegmentType.ENTITY, null)); - return addQueryOption(QueryOption.ID, segmentValue); - } - - @Override - public URIBuilder appendRefSegment() { - segments.add(new Segment(SegmentType.REF, SegmentType.REF.getValue())); - return getThis(); - } - - @Override - public URIBuilder appendCrossjoinSegment(final String... segmentValues) { - final StringBuilder segValue = new StringBuilder(SegmentType.CROSS_JOIN.getValue()). - append('(').append(StringUtils.join(segmentValues, ",")).append(')'); - segments.add(new Segment(SegmentType.CROSS_JOIN, segValue.toString())); - return getThis(); - } - - @Override - public URIBuilder appendAllSegment() { - segments.add(new Segment(SegmentType.ALL, SegmentType.ALL.getValue())); - return getThis(); - } - - @Override - public URIBuilder id(final String idValue) { - return addQueryOption(QueryOption.ID, idValue); - } - - @Override - public URIBuilder search(final URISearch search) { - return search(search.build()); - } - - @Override - public URIBuilder search(final String expression) { - return addQueryOption(QueryOption.SEARCH, expression); - } - - @Override - public URIBuilder count(final boolean value) { - return addQueryOption(QueryOption.COUNT, Boolean.toString(value)); - } - - @Override - public URIBuilder expandWithOptions(final String expandItem, final Map<QueryOption, Object> options) { - final Map<String, Object> _options = new LinkedHashMap<String, Object>(); - for (Map.Entry<QueryOption, Object> entry : options.entrySet()) { - _options.put("$" + entry.getKey().toString(), entry.getValue()); - } - return expand(expandItem + buildMultiKeySegment(_options, false)); - } - - @Override - public URIBuilder expandWithSelect(final String expandItem, final String... selectItems) { - return expand(expandItem + "($select=" + StringUtils.join(selectItems, ",") + ")"); - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/AndSearch.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/AndSearch.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/AndSearch.java deleted file mode 100644 index 1dc4e51..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/AndSearch.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.v4; - -import org.apache.olingo.client.api.uri.v4.URISearch; - -public class AndSearch implements URISearch { - - private final URISearch left; - - private final URISearch right; - - AndSearch(final URISearch left, final URISearch right) { - this.left = left; - this.right = right; - } - - @Override - public String build() { - return new StringBuilder(). - append('(').append(left.build()). - append(" AND "). - append(right.build()).append(')'). - toString(); - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/EdmEnabledODataClientImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/EdmEnabledODataClientImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/EdmEnabledODataClientImpl.java deleted file mode 100644 index 5baac81..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/EdmEnabledODataClientImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.v4; - -import org.apache.olingo.client.api.communication.request.invoke.EdmEnabledInvokeRequestFactory; -import org.apache.olingo.client.api.communication.request.retrieve.EdmMetadataRequest; -import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; -import org.apache.olingo.client.api.uri.v4.URIBuilder; -import org.apache.olingo.client.api.v4.EdmEnabledODataClient; -import org.apache.olingo.client.core.communication.request.invoke.v4.EdmEnabledInvokeRequestFactoryImpl; -import org.apache.olingo.client.core.uri.v4.URIBuilderImpl; -import org.apache.olingo.commons.api.edm.Edm; - -public class EdmEnabledODataClientImpl extends ODataClientImpl implements EdmEnabledODataClient { - - private final String serviceRoot; - - private Edm edm; - - private String metadataETag; - - private EdmEnabledInvokeRequestFactory edmEnabledInvokeRequestFactory; - - public EdmEnabledODataClientImpl(final String serviceRoot, final Edm edm, final String metadataETag) { - super(); - - this.serviceRoot = serviceRoot; - this.edm = edm; - this.metadataETag = metadataETag; - } - - @Override - public String getServiceRoot() { - return serviceRoot; - } - - @Override - public Edm getEdm(final String metadataETag) { - synchronized (this) { - if (this.edm == null || (metadataETag != null && !metadataETag.equals(this.metadataETag))) { - final EdmMetadataRequest metadataReq = getRetrieveRequestFactory().getMetadataRequest(serviceRoot); - final ODataRetrieveResponse<Edm> metadataRes = metadataReq.execute(); - this.metadataETag = metadataRes.getETag(); - this.edm = metadataRes.getBody(); - } - } - return this.edm; - } - - @Override - public Edm getCachedEdm() { - if (this.edm == null) { - getEdm(null); - } - return this.edm; - } - - @Override - public URIBuilder newURIBuilder() { - return new URIBuilderImpl(getServiceVersion(), configuration, serviceRoot); - } - - @Override - public EdmEnabledInvokeRequestFactory getInvokeRequestFactory() { - if (edmEnabledInvokeRequestFactory == null) { - edmEnabledInvokeRequestFactory = new EdmEnabledInvokeRequestFactoryImpl(this); - } - return edmEnabledInvokeRequestFactory; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/LiteralSearch.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/LiteralSearch.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/LiteralSearch.java deleted file mode 100644 index 011698c..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/LiteralSearch.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.v4; - -import org.apache.olingo.client.api.uri.v4.URISearch; - -public class LiteralSearch implements URISearch { - - private final String value; - - LiteralSearch(final String value) { - this.value = value; - } - - @Override - public String build() { - return value; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/NotSearch.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/NotSearch.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/NotSearch.java deleted file mode 100644 index 39d0fe3..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/NotSearch.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.v4; - -import org.apache.olingo.client.api.uri.v4.URISearch; - -public class NotSearch implements URISearch { - - private final URISearch filter; - - NotSearch(final URISearch left) { - this.filter = left; - } - - @Override - public String build() { - return new StringBuilder("NOT (").append(filter.build()).append(')').toString(); - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/ODataClientImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/ODataClientImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/ODataClientImpl.java deleted file mode 100644 index d88a63b..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/ODataClientImpl.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.v4; - -import org.apache.olingo.client.api.communication.header.HeaderName; -import org.apache.olingo.client.api.communication.header.ODataHeaders; -import org.apache.olingo.client.api.communication.request.batch.v4.BatchRequestFactory; -import org.apache.olingo.client.api.communication.request.cud.v4.CUDRequestFactory; -import org.apache.olingo.client.api.communication.request.cud.v4.UpdateType; -import org.apache.olingo.client.api.communication.request.invoke.InvokeRequestFactory; -import org.apache.olingo.client.api.communication.request.retrieve.v4.RetrieveRequestFactory; -import org.apache.olingo.client.api.communication.request.v4.AsyncRequestFactory; -import org.apache.olingo.client.api.serialization.v4.ODataBinder; -import org.apache.olingo.client.api.serialization.v4.ODataDeserializer; -import org.apache.olingo.client.api.serialization.v4.ODataReader; -import org.apache.olingo.client.api.uri.v4.FilterFactory; -import org.apache.olingo.client.api.uri.v4.SearchFactory; -import org.apache.olingo.client.api.uri.v4.URIBuilder; -import org.apache.olingo.client.api.v4.ODataClient; -import org.apache.olingo.client.core.AbstractODataClient; -import org.apache.olingo.client.core.communication.header.ODataHeadersImpl; -import org.apache.olingo.client.core.communication.request.batch.v4.BatchRequestFactoryImpl; -import org.apache.olingo.client.core.communication.request.cud.v4.CUDRequestFactoryImpl; -import org.apache.olingo.client.core.communication.request.invoke.v4.InvokeRequestFactoryImpl; -import org.apache.olingo.client.core.communication.request.retrieve.v4.RetrieveRequestFactoryImpl; -import org.apache.olingo.client.core.communication.request.v4.AsyncRequestFactoryImpl; -import org.apache.olingo.client.core.serialization.v4.ODataBinderImpl; -import org.apache.olingo.client.core.serialization.v4.ODataDeserializerImpl; -import org.apache.olingo.client.core.serialization.v4.ODataReaderImpl; -import org.apache.olingo.client.core.uri.v4.FilterFactoryImpl; -import org.apache.olingo.client.core.uri.v4.URIBuilderImpl; -import org.apache.olingo.commons.api.domain.v4.ODataObjectFactory; -import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; -import org.apache.olingo.commons.api.format.ODataFormat; -import org.apache.olingo.commons.api.serialization.ODataSerializer; -import org.apache.olingo.commons.core.domain.v4.ODataObjectFactoryImpl; -import org.apache.olingo.commons.core.serialization.AtomSerializer; -import org.apache.olingo.commons.core.serialization.JsonSerializer; - -public class ODataClientImpl extends AbstractODataClient<UpdateType> implements ODataClient { - - private final FilterFactory filterFactory = new FilterFactoryImpl(getServiceVersion()); - - private final SearchFactory searchFactory = new SearchFactoryImpl(); - - private final ODataReader reader = new ODataReaderImpl(this); - - private final ODataBinder binder = new ODataBinderImpl(this); - - private final ODataObjectFactory objectFactory = new ODataObjectFactoryImpl(getServiceVersion()); - - private final AsyncRequestFactory asyncReqFact = new AsyncRequestFactoryImpl(this); - - private final RetrieveRequestFactory retrieveReqFact = new RetrieveRequestFactoryImpl(this); - - private final CUDRequestFactory cudReqFact = new CUDRequestFactoryImpl(this); - - private final InvokeRequestFactory invokeReqFact = new InvokeRequestFactoryImpl(this); - - private final BatchRequestFactory batchReqFact = new BatchRequestFactoryImpl(this); - - @Override - public ODataServiceVersion getServiceVersion() { - return ODataServiceVersion.V40; - } - - @Override - public ODataHeaders newVersionHeaders() { - final ODataHeadersImpl odataHeaders = new ODataHeadersImpl(); - odataHeaders.setHeader(HeaderName.odataMaxVersion, ODataServiceVersion.V40.toString()); - odataHeaders.setHeader(HeaderName.odataVersion, ODataServiceVersion.V40.toString()); - return odataHeaders; - } - - @Override - public URIBuilder newURIBuilder(final String serviceRoot) { - return new URIBuilderImpl(getServiceVersion(), getConfiguration(), serviceRoot); - } - - @Override - public FilterFactory getFilterFactory() { - return filterFactory; - } - - @Override - public SearchFactory getSearchFactory() { - return searchFactory; - } - - @Override - public ODataDeserializer getDeserializer(final ODataFormat format) { - return new ODataDeserializerImpl(getServiceVersion(), false, format); - } - - @Override - public ODataSerializer getSerializer(final ODataFormat format) { - return format == ODataFormat.ATOM || format == ODataFormat.XML ? - new AtomSerializer(getServiceVersion()) : - new JsonSerializer(getServiceVersion(), false, format); - } - - @Override - public ODataReader getReader() { - return reader; - } - - @Override - public ODataBinder getBinder() { - return binder; - } - - @Override - public ODataObjectFactory getObjectFactory() { - return objectFactory; - } - - @Override - public AsyncRequestFactory getAsyncRequestFactory() { - return asyncReqFact; - } - - @Override - public RetrieveRequestFactory getRetrieveRequestFactory() { - return retrieveReqFact; - } - - @Override - public CUDRequestFactory getCUDRequestFactory() { - return cudReqFact; - } - - @Override - public InvokeRequestFactory getInvokeRequestFactory() { - return invokeReqFact; - } - - @Override - public BatchRequestFactory getBatchRequestFactory() { - return batchReqFact; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/OrSearch.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/OrSearch.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/OrSearch.java deleted file mode 100644 index 862142c..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/OrSearch.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.v4; - -import org.apache.olingo.client.api.uri.v4.URISearch; - -public class OrSearch implements URISearch { - - private final URISearch left; - - private final URISearch right; - - OrSearch(final URISearch left, final URISearch right) { - this.left = left; - this.right = right; - } - - @Override - public String build() { - return new StringBuilder(). - append('(').append(left.build()). - append(" OR "). - append(right.build()).append(')'). - toString(); - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/SearchFactoryImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/SearchFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/SearchFactoryImpl.java deleted file mode 100644 index e37c05e..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/v4/SearchFactoryImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.v4; - -import org.apache.olingo.client.api.uri.v4.SearchFactory; -import org.apache.olingo.client.api.uri.v4.URISearch; - -public class SearchFactoryImpl implements SearchFactory { - - @Override - public URISearch literal(final String value) { - return new LiteralSearch(value); - } - - @Override - public URISearch and(final URISearch left, final URISearch right) { - return new AndSearch(left, right); - } - - @Override - public URISearch or(final URISearch left, final URISearch right) { - return new OrSearch(left, right); - } - - @Override - public URISearch not(final URISearch filter) { - return new NotSearch(filter); - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/test/java/org/apache/olingo/client/core/AbstractTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/AbstractTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/AbstractTest.java index ccb544c..0dc980b 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/AbstractTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/AbstractTest.java @@ -25,7 +25,7 @@ import org.junit.BeforeClass; public abstract class AbstractTest { - protected static org.apache.olingo.client.api.v4.ODataClient v4Client; + protected static org.apache.olingo.client.api.ODataClient v4Client; protected abstract CommonODataClient<?> getClient(); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/URIEscapeTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/URIEscapeTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/URIEscapeTest.java index 43072ba..37cb309 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/URIEscapeTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/URIEscapeTest.java @@ -19,7 +19,7 @@ package org.apache.olingo.client.core.uri; import org.apache.olingo.client.core.edm.EdmEnumTypeImpl; -import org.apache.olingo.client.core.edm.xml.v4.EnumTypeImpl; +import org.apache.olingo.client.core.edm.xml.EnumTypeImpl; import org.apache.olingo.commons.api.Constants; import org.apache.olingo.commons.api.edm.EdmEnumType; import org.apache.olingo.commons.api.edm.FullQualifiedName; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/v4/FilterFactoryTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/v4/FilterFactoryTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/v4/FilterFactoryTest.java index dff0d34..f6b3f9c 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/v4/FilterFactoryTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/v4/FilterFactoryTest.java @@ -18,13 +18,13 @@ */ package org.apache.olingo.client.core.uri.v4; +import org.apache.olingo.client.api.ODataClient; +import org.apache.olingo.client.api.uri.FilterArgFactory; +import org.apache.olingo.client.api.uri.FilterFactory; import org.apache.olingo.client.api.uri.URIFilter; -import org.apache.olingo.client.api.uri.v4.FilterArgFactory; -import org.apache.olingo.client.api.uri.v4.FilterFactory; -import org.apache.olingo.client.api.v4.ODataClient; import org.apache.olingo.client.core.AbstractTest; import org.apache.olingo.client.core.edm.EdmEnumTypeImpl; -import org.apache.olingo.client.core.edm.xml.v4.EnumTypeImpl; +import org.apache.olingo.client.core.edm.xml.EnumTypeImpl; import org.apache.olingo.commons.api.Constants; import org.apache.olingo.commons.api.edm.EdmEnumType; import org.apache.olingo.commons.api.edm.FullQualifiedName; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/v4/URIBuilderTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/v4/URIBuilderTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/v4/URIBuilderTest.java index 3a37b91..6686963 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/v4/URIBuilderTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/v4/URIBuilderTest.java @@ -18,9 +18,9 @@ */ package org.apache.olingo.client.core.uri.v4; +import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.api.uri.QueryOption; -import org.apache.olingo.client.api.uri.v4.URIBuilder; -import org.apache.olingo.client.api.v4.ODataClient; +import org.apache.olingo.client.api.uri.URIBuilder; import org.apache.olingo.client.core.AbstractTest; import org.junit.Test; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/AtomTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/AtomTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/AtomTest.java index 9998398..3d445d8 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/AtomTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/AtomTest.java @@ -21,15 +21,17 @@ package org.apache.olingo.client.core.v4; import static org.junit.Assert.assertTrue; import org.apache.commons.io.IOUtils; -import org.apache.olingo.client.api.v4.ODataClient; +import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.core.AtomLinksQualifier; import org.apache.olingo.commons.api.format.ODataFormat; import org.custommonkey.xmlunit.Diff; + import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; + import java.io.ByteArrayInputStream; import java.io.StringWriter; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntitySetTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntitySetTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntitySetTest.java index 4407815..bd0158f 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntitySetTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntitySetTest.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.client.core.v4; -import org.apache.olingo.client.api.v4.ODataClient; +import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.core.AbstractTest; import org.apache.olingo.commons.api.data.EntitySet; import org.apache.olingo.commons.api.data.ResWrap; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntityTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntityTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntityTest.java index 4760103..8f6f253 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntityTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntityTest.java @@ -26,9 +26,11 @@ import static org.junit.Assert.assertTrue; import java.io.InputStream; import java.net.URI; import java.util.Iterator; -import org.apache.olingo.client.api.v4.EdmEnabledODataClient; -import org.apache.olingo.client.api.v4.ODataClient; + +import org.apache.olingo.client.api.EdmEnabledODataClient; +import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.core.AbstractTest; +import org.apache.olingo.client.core.EdmEnabledODataClientImpl; import org.apache.olingo.commons.api.data.Entity; import org.apache.olingo.commons.api.data.ResWrap; import org.apache.olingo.commons.api.domain.ODataInlineEntitySet; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ErrorTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ErrorTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ErrorTest.java index cfd8f65..c0067bc 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ErrorTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ErrorTest.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.client.core.v4; -import org.apache.olingo.client.api.v4.ODataClient; +import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.core.AbstractTest; import org.apache.olingo.commons.api.domain.ODataError; import org.apache.olingo.commons.api.format.ODataFormat; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/JSONTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/JSONTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/JSONTest.java index 27abb6f..d70a07f 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/JSONTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/JSONTest.java @@ -25,14 +25,16 @@ import static org.junit.Assert.assertTrue; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; + import java.io.ByteArrayInputStream; import java.io.StringWriter; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; + import org.apache.commons.io.IOUtils; -import org.apache.olingo.client.api.v4.ODataClient; +import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.core.AbstractTest; import org.apache.olingo.commons.api.Constants; import org.apache.olingo.commons.api.data.Delta; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java index ab58fff..8a4da6f 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java @@ -18,30 +18,32 @@ */ package org.apache.olingo.client.core.v4; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import org.apache.olingo.client.api.edm.xml.v4.Annotation; -import org.apache.olingo.client.api.edm.xml.v4.Annotations; -import org.apache.olingo.client.api.edm.xml.v4.ComplexType; -import org.apache.olingo.client.api.edm.xml.v4.EntityContainer; -import org.apache.olingo.client.api.edm.xml.v4.EntityType; -import org.apache.olingo.client.api.edm.xml.v4.Function; -import org.apache.olingo.client.api.edm.xml.v4.FunctionImport; -import org.apache.olingo.client.api.edm.xml.v4.Schema; -import org.apache.olingo.client.api.edm.xml.v4.Singleton; -import org.apache.olingo.client.api.edm.xml.v4.XMLMetadata; -import org.apache.olingo.client.api.edm.xml.v4.annotation.Apply; -import org.apache.olingo.client.api.edm.xml.v4.annotation.Collection; -import org.apache.olingo.client.api.edm.xml.v4.annotation.ConstantAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.v4.annotation.TwoParamsOpDynamicAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.v4.annotation.UrlRef; -import org.apache.olingo.client.api.v4.ODataClient; +import java.util.List; + +import org.apache.olingo.client.api.ODataClient; +import org.apache.olingo.client.api.edm.xml.Annotation; +import org.apache.olingo.client.api.edm.xml.Annotations; +import org.apache.olingo.client.api.edm.xml.ComplexType; +import org.apache.olingo.client.api.edm.xml.EntityContainer; +import org.apache.olingo.client.api.edm.xml.EntityType; +import org.apache.olingo.client.api.edm.xml.Function; +import org.apache.olingo.client.api.edm.xml.FunctionImport; +import org.apache.olingo.client.api.edm.xml.Schema; +import org.apache.olingo.client.api.edm.xml.Singleton; +import org.apache.olingo.client.api.edm.xml.XMLMetadata; +import org.apache.olingo.client.api.edm.xml.annotation.Apply; +import org.apache.olingo.client.api.edm.xml.annotation.Collection; +import org.apache.olingo.client.api.edm.xml.annotation.ConstantAnnotationExpression; +import org.apache.olingo.client.api.edm.xml.annotation.TwoParamsOpDynamicAnnotationExpression; +import org.apache.olingo.client.api.edm.xml.annotation.UrlRef; import org.apache.olingo.client.core.AbstractTest; -import org.apache.olingo.client.core.edm.xml.v4.annotation.ConstantAnnotationExpressionImpl; -import org.apache.olingo.client.core.edm.xml.v4.annotation.PathImpl; +import org.apache.olingo.client.core.edm.xml.annotation.ConstantAnnotationExpressionImpl; +import org.apache.olingo.client.core.edm.xml.annotation.PathImpl; import org.apache.olingo.commons.api.Constants; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmAction; @@ -67,8 +69,6 @@ import org.apache.olingo.commons.core.edm.primitivetype.EdmInt32; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; import org.junit.Test; -import java.util.List; - public class MetadataTest extends AbstractTest { @Override http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PrimitiveValueTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PrimitiveValueTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PrimitiveValueTest.java index 82509ac..5728812 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PrimitiveValueTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PrimitiveValueTest.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.client.core.v4; -import org.apache.olingo.client.api.v4.ODataClient; +import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.core.AbstractTest; import org.apache.olingo.commons.api.domain.ODataValue; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PropertyTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PropertyTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PropertyTest.java index 0aab3c7..91d0752 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PropertyTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PropertyTest.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.client.core.v4; -import org.apache.olingo.client.api.v4.ODataClient; +import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.core.AbstractTest; import org.apache.olingo.commons.api.domain.ODataCollectionValue; import org.apache.olingo.commons.api.domain.ODataComplexValue; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ServiceDocumentTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ServiceDocumentTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ServiceDocumentTest.java index 67154ab..096591c 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ServiceDocumentTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ServiceDocumentTest.java @@ -18,8 +18,8 @@ */ package org.apache.olingo.client.core.v4; +import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.api.data.ServiceDocument; -import org.apache.olingo.client.api.v4.ODataClient; import org.apache.olingo.client.core.AbstractTest; import org.apache.olingo.commons.api.data.ResWrap; import org.apache.olingo.commons.api.domain.ODataServiceDocument;
