Repository: olingo-odata4 Updated Branches: refs/heads/OLINGO-507_MinorRefactoring 2f6b35ff5 -> 40e0ae5ec
[OLINGO-507] Created seperate Action_ interfaces Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/40e0ae5e Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/40e0ae5e Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/40e0ae5e Branch: refs/heads/OLINGO-507_MinorRefactoring Commit: 40e0ae5ecd4e6146d57b04cbc570edde82ce6a54 Parents: 2f6b35f Author: Michael Bolz <[email protected]> Authored: Wed Jan 14 06:34:52 2015 +0100 Committer: Michael Bolz <[email protected]> Committed: Wed Jan 14 06:34:52 2015 +0100 ---------------------------------------------------------------------- .../ActionComplexCollectionProcessor.java | 48 ++++++++++++++++++++ .../api/processor/ActionComplexProcessor.java | 48 ++++++++++++++++++++ .../ActionEntityCollectionProcessor.java | 48 ++++++++++++++++++++ .../api/processor/ActionEntityProcessor.java | 48 ++++++++++++++++++++ .../ActionPrimitiveCollectionProcessor.java | 48 ++++++++++++++++++++ .../api/processor/ActionPrimitiveProcessor.java | 48 ++++++++++++++++++++ .../processor/ComplexCollectionProcessor.java | 14 ------ .../server/api/processor/ComplexProcessor.java | 15 ------ .../processor/EntityCollectionProcessor.java | 14 ------ .../server/api/processor/EntityProcessor.java | 14 ------ .../processor/PrimitiveCollectionProcessor.java | 16 ------- .../api/processor/PrimitiveProcessor.java | 14 ------ .../apache/olingo/server/core/ODataHandler.java | 29 +++++++----- .../processor/TechnicalEntityProcessor.java | 9 ++-- .../TechnicalPrimitiveComplexProcessor.java | 30 ++++++++---- .../olingo/server/core/ODataHandlerTest.java | 40 +++++++++------- 16 files changed, 355 insertions(+), 128 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/40e0ae5e/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionComplexCollectionProcessor.java ---------------------------------------------------------------------- diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionComplexCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionComplexCollectionProcessor.java new file mode 100644 index 0000000..31c525f --- /dev/null +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionComplexCollectionProcessor.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.server.api.processor; + +import org.apache.olingo.commons.api.format.ContentType; +import org.apache.olingo.server.api.ODataApplicationException; +import org.apache.olingo.server.api.ODataRequest; +import org.apache.olingo.server.api.ODataResponse; +import org.apache.olingo.server.api.deserializer.DeserializerException; +import org.apache.olingo.server.api.serializer.SerializerException; +import org.apache.olingo.server.api.uri.UriInfo; + +/** + * Processor interface for handling an action import request which has a + * return type of ComplexCollection. + */ +public interface ActionComplexCollectionProcessor extends ComplexCollectionProcessor { + /** + * Process an action which has as return type a complex-type collection. + * @param request OData request object containing raw HTTP information + * @param response OData response object for collecting response data + * @param uriInfo information of a parsed OData URI + * @param requestFormat content type of body sent with request + * @param responseFormat requested content type after content negotiation + * @throws org.apache.olingo.server.api.ODataApplicationException if the service implementation encounters a failure + * @throws org.apache.olingo.server.api.deserializer.DeserializerException if deserialization failed + * @throws org.apache.olingo.server.api.serializer.SerializerException if serialization failed + */ + void processActionComplexCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo, + ContentType requestFormat, ContentType responseFormat) + throws ODataApplicationException, DeserializerException, SerializerException; +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/40e0ae5e/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionComplexProcessor.java ---------------------------------------------------------------------- diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionComplexProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionComplexProcessor.java new file mode 100644 index 0000000..11e8345 --- /dev/null +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionComplexProcessor.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.server.api.processor; + +import org.apache.olingo.commons.api.format.ContentType; +import org.apache.olingo.server.api.ODataApplicationException; +import org.apache.olingo.server.api.ODataRequest; +import org.apache.olingo.server.api.ODataResponse; +import org.apache.olingo.server.api.deserializer.DeserializerException; +import org.apache.olingo.server.api.serializer.SerializerException; +import org.apache.olingo.server.api.uri.UriInfo; + +/** + * Processor interface for handling an action import request which has a + * return type of Complex. + */ +public interface ActionComplexProcessor extends ComplexProcessor { + /** + * Process an action which has as return type a complex-type. + * @param request OData request object containing raw HTTP information + * @param response OData response object for collecting response data + * @param uriInfo information of a parsed OData URI + * @param requestFormat content type of body sent with request + * @param responseFormat requested content type after content negotiation + * @throws org.apache.olingo.server.api.ODataApplicationException if the service implementation encounters a failure + * @throws org.apache.olingo.server.api.deserializer.DeserializerException if deserialization failed + * @throws org.apache.olingo.server.api.serializer.SerializerException if serialization failed + */ + void processActionComplex(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestFormat, + ContentType responseFormat) + throws ODataApplicationException, DeserializerException, SerializerException; +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/40e0ae5e/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionEntityCollectionProcessor.java ---------------------------------------------------------------------- diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionEntityCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionEntityCollectionProcessor.java new file mode 100644 index 0000000..edabfce --- /dev/null +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionEntityCollectionProcessor.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.server.api.processor; + +import org.apache.olingo.commons.api.format.ContentType; +import org.apache.olingo.server.api.ODataApplicationException; +import org.apache.olingo.server.api.ODataRequest; +import org.apache.olingo.server.api.ODataResponse; +import org.apache.olingo.server.api.deserializer.DeserializerException; +import org.apache.olingo.server.api.serializer.SerializerException; +import org.apache.olingo.server.api.uri.UriInfo; + +/** + * Processor interface for handling an action import request which has a + * return type of Entity Collection. + */ +public interface ActionEntityCollectionProcessor extends EntityCollectionProcessor { + /** + * Process an action which has as return type a collection of entities. + * @param request OData request object containing raw HTTP information + * @param response OData response object for collecting response data + * @param uriInfo information of a parsed OData URI + * @param requestFormat content type of body sent with request + * @param responseFormat requested content type after content negotiation + * @throws org.apache.olingo.server.api.ODataApplicationException if the service implementation encounters a failure + * @throws org.apache.olingo.server.api.deserializer.DeserializerException if deserialization failed + * @throws org.apache.olingo.server.api.serializer.SerializerException if serialization failed + */ + void processActionEntityCollection(ODataRequest request, ODataResponse response, + UriInfo uriInfo, ContentType requestFormat, ContentType responseFormat) + throws ODataApplicationException, DeserializerException, SerializerException; +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/40e0ae5e/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionEntityProcessor.java ---------------------------------------------------------------------- diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionEntityProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionEntityProcessor.java new file mode 100644 index 0000000..8a2043e --- /dev/null +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionEntityProcessor.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.server.api.processor; + +import org.apache.olingo.commons.api.format.ContentType; +import org.apache.olingo.server.api.ODataApplicationException; +import org.apache.olingo.server.api.ODataRequest; +import org.apache.olingo.server.api.ODataResponse; +import org.apache.olingo.server.api.deserializer.DeserializerException; +import org.apache.olingo.server.api.serializer.SerializerException; +import org.apache.olingo.server.api.uri.UriInfo; + +/** + * Processor interface for handling an action import request which has a + * return type of Entity. + */ +public interface ActionEntityProcessor extends EntityProcessor { + /** + * Process an action which has as return type an entity. + * @param request OData request object containing raw HTTP information + * @param response OData response object for collecting response data + * @param uriInfo information of a parsed OData URI + * @param requestFormat content type of body sent with request + * @param responseFormat requested content type after content negotiation + * @throws org.apache.olingo.server.api.ODataApplicationException if the service implementation encounters a failure + * @throws org.apache.olingo.server.api.deserializer.DeserializerException if deserialization failed + * @throws org.apache.olingo.server.api.serializer.SerializerException if serialization failed + */ + void processActionEntity(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestFormat, + ContentType responseFormat) + throws ODataApplicationException, DeserializerException, SerializerException; +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/40e0ae5e/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionPrimitiveCollectionProcessor.java ---------------------------------------------------------------------- diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionPrimitiveCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionPrimitiveCollectionProcessor.java new file mode 100644 index 0000000..9fd7549 --- /dev/null +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionPrimitiveCollectionProcessor.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.server.api.processor; + +import org.apache.olingo.commons.api.format.ContentType; +import org.apache.olingo.server.api.ODataApplicationException; +import org.apache.olingo.server.api.ODataRequest; +import org.apache.olingo.server.api.ODataResponse; +import org.apache.olingo.server.api.deserializer.DeserializerException; +import org.apache.olingo.server.api.serializer.SerializerException; +import org.apache.olingo.server.api.uri.UriInfo; + +/** + * Processor interface for handling an action import request which has a + * return type of Primitive Collection. + */ +public interface ActionPrimitiveCollectionProcessor extends PrimitiveCollectionProcessor { + /** + * Process an action which has as return type a primitive-type collection. + * @param request OData request object containing raw HTTP information + * @param response OData response object for collecting response data + * @param uriInfo information of a parsed OData URI + * @param requestFormat content type of body sent with request + * @param responseFormat requested content type after content negotiation + * @throws org.apache.olingo.server.api.ODataApplicationException if the service implementation encounters a failure + * @throws org.apache.olingo.server.api.deserializer.DeserializerException if deserialization failed + * @throws org.apache.olingo.server.api.serializer.SerializerException if serialization failed + */ + void processActionPrimitiveCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo, + ContentType requestFormat, ContentType responseFormat) + throws ODataApplicationException, DeserializerException, SerializerException; +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/40e0ae5e/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionPrimitiveProcessor.java ---------------------------------------------------------------------- diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionPrimitiveProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionPrimitiveProcessor.java new file mode 100644 index 0000000..362621b --- /dev/null +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ActionPrimitiveProcessor.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.server.api.processor; + +import org.apache.olingo.commons.api.format.ContentType; +import org.apache.olingo.server.api.ODataApplicationException; +import org.apache.olingo.server.api.ODataRequest; +import org.apache.olingo.server.api.ODataResponse; +import org.apache.olingo.server.api.deserializer.DeserializerException; +import org.apache.olingo.server.api.serializer.SerializerException; +import org.apache.olingo.server.api.uri.UriInfo; + +/** + * Processor interface for handling an action import request which has a + * return type of Primitive. + */ +public interface ActionPrimitiveProcessor extends PrimitiveProcessor { + /** + * Process an action which has as return type a primitive-type. + * @param request OData request object containing raw HTTP information + * @param response OData response object for collecting response data + * @param uriInfo information of a parsed OData URI + * @param requestFormat content type of body sent with request + * @param responseFormat requested content type after content negotiation + * @throws org.apache.olingo.server.api.ODataApplicationException if the service implementation encounters a failure + * @throws org.apache.olingo.server.api.deserializer.DeserializerException if deserialization failed + * @throws org.apache.olingo.server.api.serializer.SerializerException if serialization failed + */ + void processActionPrimitive(ODataRequest request, ODataResponse response, UriInfo uriInfo, + ContentType requestFormat, ContentType responseFormat) + throws ODataApplicationException, DeserializerException, SerializerException; +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/40e0ae5e/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexCollectionProcessor.java ---------------------------------------------------------------------- diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexCollectionProcessor.java index f6e3e79..1fe0b0c 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexCollectionProcessor.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexCollectionProcessor.java @@ -64,20 +64,6 @@ public interface ComplexCollectionProcessor extends Processor { throws ODataApplicationException, DeserializerException, SerializerException; /** - * Process an action which has as return type a complex-type collection. - * @param request OData request object containing raw HTTP information - * @param response OData response object for collecting response data - * @param uriInfo information of a parsed OData URI - * @param requestFormat content type of body sent with request - * @param responseFormat requested content type after content negotiation - * @throws ODataApplicationException if the service implementation encounters a failure - * @throws DeserializerException if deserialization failed - * @throws SerializerException if serialization failed - */ - void processComplexCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo, - ContentType requestFormat, ContentType responseFormat) - throws ODataApplicationException, DeserializerException, SerializerException; - /** * Deletes complex-type collection from an entity and puts the status into the response. * Deletion for complex-type collection is equal to * set the content to <code>EMPTY</code>. http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/40e0ae5e/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexProcessor.java ---------------------------------------------------------------------- diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexProcessor.java index 3c74660..58d9bc8 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexProcessor.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexProcessor.java @@ -61,21 +61,6 @@ public interface ComplexProcessor extends Processor { throws ODataApplicationException, DeserializerException, SerializerException; /** - * Process an action which has as return type a complex-type. - * @param request OData request object containing raw HTTP information - * @param response OData response object for collecting response data - * @param uriInfo information of a parsed OData URI - * @param requestFormat content type of body sent with request - * @param responseFormat requested content type after content negotiation - * @throws ODataApplicationException if the service implementation encounters a failure - * @throws DeserializerException if deserialization failed - * @throws SerializerException if serialization failed - */ - void processComplex(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestFormat, - ContentType responseFormat) - throws ODataApplicationException, DeserializerException, SerializerException; - - /** * Deletes complex-type value from an entity and puts the status into the response. * Deletion for complex-type values is equal to * set the value to <code>NULL</code> (see chapter "11.4.9.2 Set a Value to Null") http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/40e0ae5e/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityCollectionProcessor.java ---------------------------------------------------------------------- diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityCollectionProcessor.java index 91fb94c..09043a3 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityCollectionProcessor.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityCollectionProcessor.java @@ -43,18 +43,4 @@ public interface EntityCollectionProcessor extends Processor { void readEntityCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType responseFormat) throws ODataApplicationException, SerializerException; - /** - * Process an action which has as return type a collection of entities. - * @param request OData request object containing raw HTTP information - * @param response OData response object for collecting response data - * @param uriInfo information of a parsed OData URI - * @param requestFormat content type of body sent with request - * @param responseFormat requested content type after content negotiation - * @throws ODataApplicationException if the service implementation encounters a failure - * @throws org.apache.olingo.server.api.deserializer.DeserializerException if deserialization failed - * @throws SerializerException if serialization failed - */ - void processEntityCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestFormat, - ContentType responseFormat) - throws ODataApplicationException, DeserializerException, SerializerException; } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/40e0ae5e/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityProcessor.java ---------------------------------------------------------------------- diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityProcessor.java index 06d88f3..dbce4f2 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityProcessor.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityProcessor.java @@ -82,18 +82,4 @@ public interface EntityProcessor extends Processor { */ void deleteEntity(ODataRequest request, ODataResponse response, UriInfo uriInfo) throws ODataApplicationException; - /** - * Process an action which has as return type an entity. - * @param request OData request object containing raw HTTP information - * @param response OData response object for collecting response data - * @param uriInfo information of a parsed OData URI - * @param requestFormat content type of body sent with request - * @param responseFormat requested content type after content negotiation - * @throws ODataApplicationException if the service implementation encounters a failure - * @throws DeserializerException if deserialization failed - * @throws SerializerException if serialization failed - */ - void processEntity(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestFormat, - ContentType responseFormat) - throws ODataApplicationException, DeserializerException, SerializerException; } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/40e0ae5e/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveCollectionProcessor.java ---------------------------------------------------------------------- diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveCollectionProcessor.java index 9770b3b..07f3678 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveCollectionProcessor.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveCollectionProcessor.java @@ -75,20 +75,4 @@ public interface PrimitiveCollectionProcessor extends Processor { */ void deletePrimitiveCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo) throws ODataApplicationException; - - - /** - * Process an action which has as return type a primitive-type collection. - * @param request OData request object containing raw HTTP information - * @param response OData response object for collecting response data - * @param uriInfo information of a parsed OData URI - * @param requestFormat content type of body sent with request - * @param responseFormat requested content type after content negotiation - * @throws ODataApplicationException if the service implementation encounters a failure - * @throws DeserializerException if deserialization failed - * @throws SerializerException if serialization failed - */ - void processPrimitiveCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo, - ContentType requestFormat, ContentType responseFormat) - throws ODataApplicationException, DeserializerException, SerializerException; } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/40e0ae5e/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveProcessor.java ---------------------------------------------------------------------- diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveProcessor.java index 86eee10..8c24060 100644 --- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveProcessor.java +++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveProcessor.java @@ -73,18 +73,4 @@ public interface PrimitiveProcessor extends Processor { void deletePrimitive(ODataRequest request, ODataResponse response, UriInfo uriInfo) throws ODataApplicationException; - /** - * Process an action which has as return type a primitive-type. - * @param request OData request object containing raw HTTP information - * @param response OData response object for collecting response data - * @param uriInfo information of a parsed OData URI - * @param requestFormat content type of body sent with request - * @param responseFormat requested content type after content negotiation - * @throws ODataApplicationException if the service implementation encounters a failure - * @throws DeserializerException if deserialization failed - * @throws SerializerException if serialization failed - */ - void processPrimitive(ODataRequest request, ODataResponse response, UriInfo uriInfo, - ContentType requestFormat, ContentType responseFormat) - throws ODataApplicationException, DeserializerException, SerializerException; } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/40e0ae5e/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java index d14717c..4528d3a 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandler.java @@ -42,6 +42,12 @@ import org.apache.olingo.server.api.ODataServerError; import org.apache.olingo.server.api.ServiceMetadata; import org.apache.olingo.server.api.batch.exception.BatchDeserializerException; import org.apache.olingo.server.api.deserializer.DeserializerException; +import org.apache.olingo.server.api.processor.ActionComplexCollectionProcessor; +import org.apache.olingo.server.api.processor.ActionComplexProcessor; +import org.apache.olingo.server.api.processor.ActionEntityCollectionProcessor; +import org.apache.olingo.server.api.processor.ActionEntityProcessor; +import org.apache.olingo.server.api.processor.ActionPrimitiveCollectionProcessor; +import org.apache.olingo.server.api.processor.ActionPrimitiveProcessor; import org.apache.olingo.server.api.processor.BatchProcessor; import org.apache.olingo.server.api.processor.ComplexCollectionProcessor; import org.apache.olingo.server.api.processor.ComplexProcessor; @@ -476,11 +482,11 @@ public class ODataHandler { final ContentType responseFormat = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(), request, customContentTypeSupport, complexRepresentationType); if (complexRepresentationType == RepresentationType.COMPLEX) { - selectProcessor(ComplexProcessor.class) - .processComplex(request, response, uriInfo, requestFormat, responseFormat); + selectProcessor(ActionComplexProcessor.class) + .processActionComplex(request, response, uriInfo, requestFormat, responseFormat); } else { - selectProcessor(ComplexCollectionProcessor.class) - .processComplexCollection(request, response, uriInfo, requestFormat, responseFormat); + selectProcessor(ActionComplexCollectionProcessor.class) + .processActionComplexCollection(request, response, uriInfo, requestFormat, responseFormat); } } else if (method == HttpMethod.DELETE) { if (complexRepresentationType == RepresentationType.COMPLEX) { @@ -535,11 +541,11 @@ public class ODataHandler { final ContentType responseFormat = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(), request, customContentTypeSupport, representationType); if (representationType == RepresentationType.PRIMITIVE) { - selectProcessor(PrimitiveProcessor.class) - .processPrimitive(request, response, uriInfo, requestFormat, responseFormat); + selectProcessor(ActionPrimitiveProcessor.class) + .processActionPrimitive(request, response, uriInfo, requestFormat, responseFormat); } else { - selectProcessor(PrimitiveCollectionProcessor.class) - .processPrimitiveCollection(request, response, uriInfo, requestFormat, responseFormat); + selectProcessor(ActionPrimitiveCollectionProcessor.class) + .processActionPrimitiveCollection(request, response, uriInfo, requestFormat, responseFormat); } } else { throw new ODataHandlerException("HTTP method " + method + " is not allowed.", @@ -601,8 +607,8 @@ public class ODataHandler { checkContentTypeSupport(requestFormat, RepresentationType.ENTITY); final ContentType responseFormat = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(), request, customContentTypeSupport, RepresentationType.ENTITY); - selectProcessor(EntityCollectionProcessor.class) - .processEntityCollection(request, response, uriInfo, requestFormat, responseFormat); + selectProcessor(ActionEntityCollectionProcessor.class) + .processActionEntityCollection(request, response, uriInfo, requestFormat, responseFormat); } else { checkContentTypeSupport(requestFormat, RepresentationType.ENTITY); final ContentType responseFormat = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(), @@ -631,7 +637,8 @@ public class ODataHandler { checkContentTypeSupport(requestFormat, RepresentationType.ENTITY); final ContentType responseFormat = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(), request, customContentTypeSupport, RepresentationType.ENTITY); - selectProcessor(EntityProcessor.class).processEntity(request, response, uriInfo, requestFormat, responseFormat); + selectProcessor(ActionEntityProcessor.class).processActionEntity( + request, response, uriInfo, requestFormat, responseFormat); } else if (method == HttpMethod.DELETE) { selectProcessor(isMedia ? MediaEntityProcessor.class : EntityProcessor.class) .deleteEntity(request, response, uriInfo); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/40e0ae5e/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java ---------------------------------------------------------------------- diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java index e5bd0ff..f86a64c 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java @@ -35,6 +35,8 @@ import org.apache.olingo.server.api.ODataApplicationException; import org.apache.olingo.server.api.ODataRequest; import org.apache.olingo.server.api.ODataResponse; import org.apache.olingo.server.api.deserializer.DeserializerException; +import org.apache.olingo.server.api.processor.ActionEntityCollectionProcessor; +import org.apache.olingo.server.api.processor.ActionEntityProcessor; import org.apache.olingo.server.api.processor.CountEntityCollectionProcessor; import org.apache.olingo.server.api.processor.EntityCollectionProcessor; import org.apache.olingo.server.api.processor.EntityProcessor; @@ -55,7 +57,8 @@ import org.apache.olingo.server.tecsvc.data.DataProvider; * Technical Processor for entity-related functionality. */ public class TechnicalEntityProcessor extends TechnicalProcessor - implements EntityCollectionProcessor, CountEntityCollectionProcessor, EntityProcessor, MediaEntityProcessor { + implements EntityCollectionProcessor, ActionEntityCollectionProcessor, CountEntityCollectionProcessor, + EntityProcessor, ActionEntityProcessor, MediaEntityProcessor { public TechnicalEntityProcessor(final DataProvider dataProvider) { super(dataProvider); @@ -90,7 +93,7 @@ public class TechnicalEntityProcessor extends TechnicalProcessor } @Override - public void processEntityCollection(final ODataRequest request, final ODataResponse response, + public void processActionEntityCollection(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo, final ContentType requestFormat, final ContentType responseFormat) throws ODataApplicationException, DeserializerException, SerializerException { @@ -257,7 +260,7 @@ public class TechnicalEntityProcessor extends TechnicalProcessor } @Override - public void processEntity(final ODataRequest request, final ODataResponse response, + public void processActionEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo, final ContentType requestFormat, final ContentType responseFormat) throws ODataApplicationException, DeserializerException, SerializerException { http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/40e0ae5e/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalPrimitiveComplexProcessor.java ---------------------------------------------------------------------- diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalPrimitiveComplexProcessor.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalPrimitiveComplexProcessor.java index a98a988..75e3dcc 100644 --- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalPrimitiveComplexProcessor.java +++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalPrimitiveComplexProcessor.java @@ -41,6 +41,10 @@ import org.apache.olingo.server.api.ODataApplicationException; import org.apache.olingo.server.api.ODataRequest; import org.apache.olingo.server.api.ODataResponse; import org.apache.olingo.server.api.deserializer.DeserializerException; +import org.apache.olingo.server.api.processor.ActionComplexCollectionProcessor; +import org.apache.olingo.server.api.processor.ActionComplexProcessor; +import org.apache.olingo.server.api.processor.ActionPrimitiveCollectionProcessor; +import org.apache.olingo.server.api.processor.ActionPrimitiveProcessor; import org.apache.olingo.server.api.processor.ComplexCollectionProcessor; import org.apache.olingo.server.api.processor.ComplexProcessor; import org.apache.olingo.server.api.processor.PrimitiveCollectionProcessor; @@ -68,8 +72,10 @@ import org.apache.olingo.server.tecsvc.data.DataProvider; * Technical Processor which provides functionality related to primitive and complex types and collections thereof. */ public class TechnicalPrimitiveComplexProcessor extends TechnicalProcessor - implements PrimitiveProcessor, PrimitiveValueProcessor, PrimitiveCollectionProcessor, - ComplexProcessor, ComplexCollectionProcessor { + implements PrimitiveProcessor, PrimitiveValueProcessor, ActionPrimitiveProcessor, + PrimitiveCollectionProcessor, ActionPrimitiveCollectionProcessor, + ComplexProcessor, ActionComplexProcessor, + ComplexCollectionProcessor, ActionComplexCollectionProcessor { public TechnicalPrimitiveComplexProcessor(final DataProvider dataProvider) { super(dataProvider); @@ -96,8 +102,9 @@ public class TechnicalPrimitiveComplexProcessor extends TechnicalProcessor } @Override - public void processPrimitive(ODataRequest request, ODataResponse response, UriInfo uriInfo, - ContentType requestFormat, ContentType responseFormat) + public void processActionPrimitive(final ODataRequest request, final ODataResponse response, + final UriInfo uriInfo, + final ContentType requestFormat, final ContentType responseFormat) throws ODataApplicationException, DeserializerException, SerializerException { throw new ODataApplicationException("Not supported yet.", HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT); @@ -124,8 +131,10 @@ public class TechnicalPrimitiveComplexProcessor extends TechnicalProcessor } @Override - public void processPrimitiveCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType - requestFormat, ContentType responseFormat) throws ODataApplicationException, DeserializerException, + public void processActionPrimitiveCollection(final ODataRequest request, final ODataResponse response, + final UriInfo uriInfo, + final ContentType requestFormat, final ContentType responseFormat) + throws ODataApplicationException, DeserializerException, SerializerException { throw new ODataApplicationException("Not supported yet.", HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT); @@ -146,7 +155,7 @@ public class TechnicalPrimitiveComplexProcessor extends TechnicalProcessor } @Override - public void processComplex(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType + public void processActionComplex(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestFormat, ContentType responseFormat) throws ODataApplicationException, DeserializerException, SerializerException { throw new ODataApplicationException("Not supported yet.", @@ -174,9 +183,10 @@ public class TechnicalPrimitiveComplexProcessor extends TechnicalProcessor } @Override - public void processComplexCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType - requestFormat, ContentType responseFormat) throws ODataApplicationException, DeserializerException, - SerializerException { + public void processActionComplexCollection(ODataRequest request, ODataResponse response, + UriInfo uriInfo, ContentType requestFormat, + ContentType responseFormat) + throws ODataApplicationException, DeserializerException, SerializerException { throw new ODataApplicationException("Not supported yet.", HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/40e0ae5e/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java ---------------------------------------------------------------------- diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java index c7181d8..72d2956 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/ODataHandlerTest.java @@ -49,6 +49,12 @@ import org.apache.olingo.server.api.ServiceMetadata; import org.apache.olingo.server.api.edm.provider.EdmProvider; import org.apache.olingo.server.api.edm.provider.EntitySet; import org.apache.olingo.server.api.edmx.EdmxReference; +import org.apache.olingo.server.api.processor.ActionComplexCollectionProcessor; +import org.apache.olingo.server.api.processor.ActionComplexProcessor; +import org.apache.olingo.server.api.processor.ActionEntityCollectionProcessor; +import org.apache.olingo.server.api.processor.ActionEntityProcessor; +import org.apache.olingo.server.api.processor.ActionPrimitiveCollectionProcessor; +import org.apache.olingo.server.api.processor.ActionPrimitiveProcessor; import org.apache.olingo.server.api.processor.BatchProcessor; import org.apache.olingo.server.api.processor.ComplexCollectionProcessor; import org.apache.olingo.server.api.processor.ComplexProcessor; @@ -319,57 +325,57 @@ public class ODataHandlerTest { @Test public void dispatchAction() throws Exception { - PrimitiveProcessor primitiveProcessor = mock(PrimitiveProcessor.class); + ActionPrimitiveProcessor primitiveProcessor = mock(ActionPrimitiveProcessor.class); dispatch(HttpMethod.POST, ContainerProvider.AIRT_STRING, primitiveProcessor); - verify(primitiveProcessor).processPrimitive( + verify(primitiveProcessor).processActionPrimitive( any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), any(ContentType.class), any(ContentType.class)); - PrimitiveCollectionProcessor primitiveCollectionProcessor = mock(PrimitiveCollectionProcessor.class); + ActionPrimitiveCollectionProcessor primitiveCollectionProcessor = mock(ActionPrimitiveCollectionProcessor.class); dispatch(HttpMethod.POST, ContainerProvider.AIRT_COLL_STRING_TWO_PARAM, primitiveCollectionProcessor); - verify(primitiveCollectionProcessor).processPrimitiveCollection( + verify(primitiveCollectionProcessor).processActionPrimitiveCollection( any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), any(ContentType.class), any(ContentType.class)); - ComplexProcessor complexProcessor = mock(ComplexProcessor.class); + ActionComplexProcessor complexProcessor = mock(ActionComplexProcessor.class); dispatch(HttpMethod.POST, ContainerProvider.AIRTCT_TWO_PRIM_PARAM, complexProcessor); - verify(complexProcessor).processComplex( + verify(complexProcessor).processActionComplex( any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), any(ContentType.class), any(ContentType.class)); - ComplexCollectionProcessor complexCollectionProcessor = mock(ComplexCollectionProcessor.class); + ActionComplexCollectionProcessor complexCollectionProcessor = mock(ActionComplexCollectionProcessor.class); dispatch(HttpMethod.POST, ContainerProvider.AIRT_COLL_CT_TWO_PRIM_PARAM, complexCollectionProcessor); - verify(complexCollectionProcessor).processComplexCollection( + verify(complexCollectionProcessor).processActionComplexCollection( any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), any(ContentType.class), any(ContentType.class)); - EntityProcessor entityProcessor = mock(EntityProcessor.class); + ActionEntityProcessor entityProcessor = mock(ActionEntityProcessor.class); dispatch(HttpMethod.POST, ContainerProvider.AIRTET_TWO_KEY_TWO_PRIM_PARAM, entityProcessor); - verify(entityProcessor).processEntity( + verify(entityProcessor).processActionEntity( any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), any(ContentType.class), any(ContentType.class)); - EntityCollectionProcessor entityCollectionProcessor = mock(EntityCollectionProcessor.class); + ActionEntityCollectionProcessor entityCollectionProcessor = mock(ActionEntityCollectionProcessor.class); dispatch(HttpMethod.POST, ContainerProvider.AIRT_COLL_ET_KEY_NAV_PARAM, entityCollectionProcessor); - verify(entityCollectionProcessor).processEntityCollection( + verify(entityCollectionProcessor).processActionEntityCollection( any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), any(ContentType.class), any(ContentType.class)); - EntityProcessor entityProcessorEs = mock(EntityProcessor.class); + ActionEntityProcessor entityProcessorEs = mock(ActionEntityProcessor.class); dispatch(HttpMethod.POST, ContainerProvider.AIRTES_ALL_PRIM_PARAM, entityProcessorEs); - verify(entityProcessorEs).processEntity( + verify(entityProcessorEs).processActionEntity( any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), any(ContentType.class), any(ContentType.class)); - EntityCollectionProcessor entityCollectionProcessorEs = mock(EntityCollectionProcessor.class); + ActionEntityCollectionProcessor entityCollectionProcessorEs = mock(ActionEntityCollectionProcessor.class); dispatch(HttpMethod.POST, ContainerProvider.AIRT_COLL_ES_ALL_PRIM_PARAM, entityCollectionProcessorEs); - verify(entityCollectionProcessorEs).processEntityCollection( + verify(entityCollectionProcessorEs).processActionEntityCollection( any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), any(ContentType.class), any(ContentType.class)); dispatchMethodNotAllowed(HttpMethod.GET, "AIRTString", mock(Processor.class)); } - + @Test public void dispatchEntity() throws Exception { final String uri = "ESAllPrim(0)";
