You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2014/11/13 17:33:51 UTC
[5/8] olingo-odata4 git commit: [OLINGO-482] renamed server processor
interfaces and methods
[OLINGO-482] renamed server processor interfaces and methods
Change-Id: I0ff38b194bafab5a802adedf80dfe97ffff82202
Signed-off-by: Christian Amend <ch...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/dd227569
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/dd227569
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/dd227569
Branch: refs/heads/olingo472
Commit: dd227569426964d83ee29cac7a4072213e706feb
Parents: 5b2a6d5
Author: Klaus Straubinger <kl...@sap.com>
Authored: Tue Nov 11 10:13:28 2014 +0100
Committer: Christian Amend <ch...@apache.org>
Committed: Tue Nov 11 12:49:59 2014 +0100
----------------------------------------------------------------------
.../processor/ComplexCollectionProcessor.java | 46 +++++++++++++++
.../server/api/processor/ComplexProcessor.java | 45 +++++++++++++++
.../ComplexTypeCollectionProcessor.java | 46 ---------------
.../api/processor/ComplexTypeProcessor.java | 45 ---------------
.../CountEntityCollectionProcessor.java | 45 +++++++++++++++
.../CountEntityTypeCollectionProcessor.java | 44 --------------
.../processor/EntityCollectionProcessor.java | 44 ++++++++++++++
.../server/api/processor/EntityProcessor.java | 44 ++++++++++++++
.../EntityTypeCollectionProcessor.java | 45 ---------------
.../api/processor/EntityTypeProcessor.java | 44 --------------
.../api/processor/ExceptionProcessor.java | 10 ++--
.../server/api/processor/MetadataProcessor.java | 14 ++---
.../processor/PrimitiveCollectionProcessor.java | 46 +++++++++++++++
.../api/processor/PrimitiveProcessor.java | 60 ++++++++++++++++++++
.../PrimitiveTypeCollectionProcessor.java | 46 ---------------
.../api/processor/PrimitiveTypeProcessor.java | 60 --------------------
.../api/processor/ServiceDocumentProcessor.java | 14 +++--
.../apache/olingo/server/core/ODataHandler.java | 46 +++++++--------
.../processor/TechnicalEntityProcessor.java | 19 +++----
.../TechnicalPrimitiveComplexProcessor.java | 22 +++----
.../olingo/server/core/ODataHandlerTest.java | 55 +++++++++---------
.../server/sample/processor/CarsProcessor.java | 30 +++++-----
22 files changed, 436 insertions(+), 434 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/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
new file mode 100644
index 0000000..a4eaf03
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexCollectionProcessor.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.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.serializer.SerializerException;
+import org.apache.olingo.server.api.uri.UriInfo;
+
+/**
+ * Processor interface for handling a collection of complex-type instances, e.g.,
+ * a property of an entity defined as collection of complex-type instances.
+ */
+public interface ComplexCollectionProcessor extends Processor {
+
+ /**
+ * Reads complex-type collection.
+ * If it is not available, for example due to permissions, the service responds with 404 Not Found.
+ * @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 format requested content type after content negotiation
+ * @throws ODataApplicationException if the service implementation encounters a failure
+ * @throws SerializerException if serialization failed
+ */
+ void readComplexCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
+ throws ODataApplicationException, SerializerException;
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/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
new file mode 100644
index 0000000..e50b299
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexProcessor.java
@@ -0,0 +1,45 @@
+/*
+ * 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.serializer.SerializerException;
+import org.apache.olingo.server.api.uri.UriInfo;
+
+/**
+ * Processor interface for handling an instance of a complex type, e.g., a complex property of an entity.
+ */
+public interface ComplexProcessor extends Processor {
+
+ /**
+ * Reads complex-type instance.
+ * If it is not available, for example due to permissions, the service responds with 404 Not Found.
+ * @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 format requested content type after content negotiation
+ * @throws ODataApplicationException if the service implementation encounters a failure
+ * @throws SerializerException if serialization failed
+ */
+ void readComplex(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
+ throws ODataApplicationException, SerializerException;
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexTypeCollectionProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexTypeCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexTypeCollectionProcessor.java
deleted file mode 100644
index 42f676b..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexTypeCollectionProcessor.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.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.serializer.SerializerException;
-import org.apache.olingo.server.api.uri.UriInfo;
-
-/**
- * Processor interface for handling a collection of complex-type instances, e.g.,
- * a property of an entity defined as collection of complex-type instances.
- */
-public interface ComplexTypeCollectionProcessor extends Processor {
-
- /**
- * Reads complex-type collection.
- * If it is not available, for example due to permissions, the service responds with 404 Not Found.
- * @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 format requested content type after content negotiation
- * @throws ODataApplicationException if the service implementation encounters a failure
- * @throws SerializerException if serialization failed
- */
- void readComplexTypeCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
- throws ODataApplicationException, SerializerException;
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexTypeProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexTypeProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexTypeProcessor.java
deleted file mode 100644
index 05f9c3d..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ComplexTypeProcessor.java
+++ /dev/null
@@ -1,45 +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.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.serializer.SerializerException;
-import org.apache.olingo.server.api.uri.UriInfo;
-
-/**
- * Processor interface for handling a complex type, e.g., a complex property of an entity.
- */
-public interface ComplexTypeProcessor extends Processor {
-
- /**
- * Reads complex type.
- * If it is not available, for example due to permissions, the service responds with 404 Not Found.
- * @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 format requested content type after content negotiation
- * @throws ODataApplicationException if the service implementation encounters a failure
- * @throws SerializerException if serialization failed
- */
- void readComplexType(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
- throws ODataApplicationException, SerializerException;
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountEntityCollectionProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountEntityCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountEntityCollectionProcessor.java
new file mode 100644
index 0000000..1f70b99
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountEntityCollectionProcessor.java
@@ -0,0 +1,45 @@
+/*
+ * 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.serializer.SerializerException;
+import org.apache.olingo.server.api.uri.UriInfo;
+
+/**
+ * Processor interface for handling counting a collection of entities, e.g., an Entity Set.
+ */
+public interface CountEntityCollectionProcessor extends Processor {
+
+ /**
+ * Counts entities from persistence and puts serialized content and status into the response.
+ * Response content type is <code>text/plain</code> by default.
+ * @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 format requested content type after content negotiation
+ * @throws ODataApplicationException if the service implementation encounters a failure
+ * @throws SerializerException if serialization failed
+ */
+ void countEntityCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
+ throws ODataApplicationException, SerializerException;
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountEntityTypeCollectionProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountEntityTypeCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountEntityTypeCollectionProcessor.java
deleted file mode 100644
index ecff637..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/CountEntityTypeCollectionProcessor.java
+++ /dev/null
@@ -1,44 +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.server.api.processor;
-
-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.serializer.SerializerException;
-import org.apache.olingo.server.api.uri.UriInfo;
-
-/**
- * Processor interface for handling counting a collection of entities, e.g., an Entity Set.
- */
-public interface CountEntityTypeCollectionProcessor extends Processor {
-
- /**
- * Counts entities from persistence and puts serialized content and status into the response.
- * Response content type is <code>text/plain</code> by default.
- *
- * @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
- * @throws ODataApplicationException
- * @throws SerializerException
- */
- void countEntityTypeCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo)
- throws ODataApplicationException, SerializerException;
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/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
new file mode 100644
index 0000000..6a65eee
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityCollectionProcessor.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.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.serializer.SerializerException;
+import org.apache.olingo.server.api.uri.UriInfo;
+
+/**
+ * Processor interface for handling a collection of entities, e.g., an Entity Set.
+ */
+public interface EntityCollectionProcessor extends Processor {
+
+ /**
+ * Reads entities data from persistence and puts serialized content and status into the response.
+ * @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 format requested content type after content negotiation
+ * @throws ODataApplicationException if the service implementation encounters a failure
+ * @throws SerializerException if serialization failed
+ */
+ void readEntityCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
+ throws ODataApplicationException, SerializerException;
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/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
new file mode 100644
index 0000000..585a754
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityProcessor.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.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.serializer.SerializerException;
+import org.apache.olingo.server.api.uri.UriInfo;
+
+/**
+ * Processor interface for handling a single instance of an Entity Type.
+ */
+public interface EntityProcessor extends Processor {
+
+ /**
+ * Reads entity data from persistence and puts serialized content and status into the response.
+ * @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 format requested content type after content negotiation
+ * @throws ODataApplicationException if the service implementation encounters a failure
+ * @throws SerializerException if serialization failed
+ */
+ void readEntity(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
+ throws ODataApplicationException, SerializerException;
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityTypeCollectionProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityTypeCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityTypeCollectionProcessor.java
deleted file mode 100644
index 71a4a3d..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityTypeCollectionProcessor.java
+++ /dev/null
@@ -1,45 +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.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.serializer.SerializerException;
-import org.apache.olingo.server.api.uri.UriInfo;
-
-/**
- * Processor interface for handling a collection of entities, e.g., an Entity Set.
- */
-public interface EntityTypeCollectionProcessor extends Processor {
-
- /**
- * Reads entities data from persistence and puts serialized content and status into the response.
- *
- * @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 requestedContentType - requested content type after content negotiation
- * @throws ODataApplicationException
- * @throws SerializerException
- */
- void readEntityTypeCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo,
- ContentType requestedContentType) throws ODataApplicationException, SerializerException;
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityTypeProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityTypeProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityTypeProcessor.java
deleted file mode 100644
index 28df774..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/EntityTypeProcessor.java
+++ /dev/null
@@ -1,44 +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.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.serializer.SerializerException;
-import org.apache.olingo.server.api.uri.UriInfo;
-
-/**
- * Processor interface for handling a single instance of an Entity Type.
- */
-public interface EntityTypeProcessor extends Processor {
-
- /**
- * Reads entity data from persistence and puts serialized content and status into the response.
- * @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 requestedContentType - requested content type after content negotiation
- * @throws ODataApplicationException
- * @throws SerializerException
- */
- void readEntityType(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestedContentType)
- throws ODataApplicationException, SerializerException;
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ExceptionProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ExceptionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ExceptionProcessor.java
index 0c062c0..19d3ae6 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ExceptionProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ExceptionProcessor.java
@@ -30,11 +30,11 @@ public interface ExceptionProcessor extends Processor {
/**
* Processes an exception. MUST NOT throw an exception!
- * @param request the request
- * @param response the response
- * @param serverError the server error
- * @param requestedContentType the requested format for the error message
+ * @param request the request
+ * @param response the response
+ * @param serverError the server error
+ * @param format the requested format for the error message
*/
public void processException(ODataRequest request, ODataResponse response, ODataServerError serverError,
- ContentType requestedContentType);
+ ContentType format);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/MetadataProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/MetadataProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/MetadataProcessor.java
index 33d1551..54e63d3 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/MetadataProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/MetadataProcessor.java
@@ -32,13 +32,13 @@ public interface MetadataProcessor extends Processor {
/**
* Reads data from persistency and puts serialized content and status into the response.
- * @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 requestedContentType - requested content type after content negotiation
- * @throws ODataApplicationException
- * @throws SerializerException
+ * @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 format requested content type after content negotiation
+ * @throws ODataApplicationException if the service implementation encounters a failure
+ * @throws SerializerException if serialization failed
*/
- void readMetadata(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestedContentType)
+ void readMetadata(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
throws ODataApplicationException, SerializerException;
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/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
new file mode 100644
index 0000000..7ceaf61
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveCollectionProcessor.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.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.serializer.SerializerException;
+import org.apache.olingo.server.api.uri.UriInfo;
+
+/**
+ * Processor interface for handling a collection of primitive-type instances, e.g.,
+ * a property of an entity defined as collection of primitive-type instances.
+ */
+public interface PrimitiveCollectionProcessor extends Processor {
+
+ /**
+ * Reads primitive-type collection.
+ * If it is not available, for example due to permissions, the service responds with 404 Not Found.
+ * @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 format requested content type after content negotiation
+ * @throws ODataApplicationException if the service implementation encounters a failure
+ * @throws SerializerException if serialization failed
+ */
+ void readPrimitiveCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
+ throws ODataApplicationException, SerializerException;
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/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
new file mode 100644
index 0000000..fbc692f
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveProcessor.java
@@ -0,0 +1,60 @@
+/*
+ * 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.serializer.SerializerException;
+import org.apache.olingo.server.api.uri.UriInfo;
+
+/**
+ * Processor interface for handling an instance of a primitive type, e.g., a primitive property of an entity.
+ */
+public interface PrimitiveProcessor extends Processor {
+
+ /**
+ * Reads primitive-type instance.
+ * If its value is <code>null</code>, the service responds with 204 No Content.
+ * If it is not available, for example due to permissions, the service responds with 404 Not Found.
+ * @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 format requested content type after content negotiation
+ * @throws ODataApplicationException if the service implementation encounters a failure
+ * @throws SerializerException if serialization failed
+ */
+ void readPrimitive(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
+ throws ODataApplicationException, SerializerException;
+
+ /**
+ * Reads raw value of a primitive-type instance, e.g., of a primitive property of an entity.
+ * If the value is <code>null</code>, the service responds with 204 No Content.
+ * If it is not available, for example due to permissions, the service responds with 404 Not Found.
+ * @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 format requested content type after content negotiation
+ * @throws ODataApplicationException if the service implementation encounters a failure
+ * @throws SerializerException if serialization failed
+ */
+ void readPrimitiveAsValue(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
+ throws ODataApplicationException, SerializerException;
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveTypeCollectionProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveTypeCollectionProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveTypeCollectionProcessor.java
deleted file mode 100644
index 42ccc4b..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveTypeCollectionProcessor.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.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.serializer.SerializerException;
-import org.apache.olingo.server.api.uri.UriInfo;
-
-/**
- * Processor interface for handling a collection of primitive-type instances, e.g.,
- * a property of an entity defined as collection of primitive-type instances.
- */
-public interface PrimitiveTypeCollectionProcessor extends Processor {
-
- /**
- * Reads primitive-type collection.
- * If it is not available, for example due to permissions, the service responds with 404 Not Found.
- * @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 format requested content type after content negotiation
- * @throws ODataApplicationException if the service implementation encounters a failure
- * @throws SerializerException if serialization failed
- */
- void readPrimitiveTypeCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
- throws ODataApplicationException, SerializerException;
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveTypeProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveTypeProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveTypeProcessor.java
deleted file mode 100644
index ec2e81d..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/PrimitiveTypeProcessor.java
+++ /dev/null
@@ -1,60 +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.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.serializer.SerializerException;
-import org.apache.olingo.server.api.uri.UriInfo;
-
-/**
- * Processor interface for handling a primitive type, e.g., a primitive property of an entity.
- */
-public interface PrimitiveTypeProcessor extends Processor {
-
- /**
- * Reads primitive type.
- * If its value is <code>null</code>, the service responds with 204 No Content.
- * If it is not available, for example due to permissions, the service responds with 404 Not Found.
- * @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 format requested content type after content negotiation
- * @throws ODataApplicationException if the service implementation encounters a failure
- * @throws SerializerException if serialization failed
- */
- void readPrimitiveType(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
- throws ODataApplicationException, SerializerException;
-
- /**
- * Reads raw value of a primitive type, e.g., of a primitive property of an entity.
- * If the value is <code>null</code>, the service responds with 204 No Content.
- * If it is not available, for example due to permissions, the service responds with 404 Not Found.
- * @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 format requested content type after content negotiation
- * @throws ODataApplicationException if the service implementation encounters a failure
- * @throws SerializerException if serialization failed
- */
- void readPrimitiveTypeAsValue(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
- throws ODataApplicationException, SerializerException;
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ServiceDocumentProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ServiceDocumentProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ServiceDocumentProcessor.java
index ac2e4d5..3c8fba3 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ServiceDocumentProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/ServiceDocumentProcessor.java
@@ -32,11 +32,13 @@ public interface ServiceDocumentProcessor extends Processor {
/**
* Reads service-document information from persistency and puts serialized content and status into the response.
- * @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 requestedContentType - requested content type after content negotiation
+ * @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 format requested content type after content negotiation
+ * @throws ODataApplicationException if the service implementation encounters a failure
+ * @throws SerializerException if serialization failed
*/
- void readServiceDocument(ODataRequest request, ODataResponse response, UriInfo uriInfo,
- ContentType requestedContentType) throws ODataApplicationException, SerializerException;
+ void readServiceDocument(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
+ throws ODataApplicationException, SerializerException;
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/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 1d90f55..f72b6bd 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
@@ -35,16 +35,16 @@ import org.apache.olingo.server.api.ODataRequest;
import org.apache.olingo.server.api.ODataResponse;
import org.apache.olingo.server.api.ODataServerError;
import org.apache.olingo.server.api.ServiceMetadata;
-import org.apache.olingo.server.api.processor.ComplexTypeCollectionProcessor;
-import org.apache.olingo.server.api.processor.ComplexTypeProcessor;
-import org.apache.olingo.server.api.processor.CountEntityTypeCollectionProcessor;
+import org.apache.olingo.server.api.processor.ComplexCollectionProcessor;
+import org.apache.olingo.server.api.processor.ComplexProcessor;
+import org.apache.olingo.server.api.processor.CountEntityCollectionProcessor;
import org.apache.olingo.server.api.processor.DefaultProcessor;
-import org.apache.olingo.server.api.processor.EntityTypeCollectionProcessor;
-import org.apache.olingo.server.api.processor.EntityTypeProcessor;
+import org.apache.olingo.server.api.processor.EntityCollectionProcessor;
+import org.apache.olingo.server.api.processor.EntityProcessor;
import org.apache.olingo.server.api.processor.ExceptionProcessor;
import org.apache.olingo.server.api.processor.MetadataProcessor;
-import org.apache.olingo.server.api.processor.PrimitiveTypeCollectionProcessor;
-import org.apache.olingo.server.api.processor.PrimitiveTypeProcessor;
+import org.apache.olingo.server.api.processor.PrimitiveCollectionProcessor;
+import org.apache.olingo.server.api.processor.PrimitiveProcessor;
import org.apache.olingo.server.api.processor.Processor;
import org.apache.olingo.server.api.processor.ServiceDocumentProcessor;
import org.apache.olingo.server.api.serializer.CustomContentTypeSupport;
@@ -198,8 +198,8 @@ public class ODataHandler {
final ContentType requestedContentType = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),
request, customContentTypeSupport, RepresentationType.COLLECTION_ENTITY);
- selectProcessor(EntityTypeCollectionProcessor.class)
- .readEntityTypeCollection(request, response, uriInfo, requestedContentType);
+ selectProcessor(EntityCollectionProcessor.class)
+ .readEntityCollection(request, response, uriInfo, requestedContentType);
} else {
throw new ODataHandlerException("not implemented",
ODataHandlerException.MessageKeys.FUNCTIONALITY_NOT_IMPLEMENTED);
@@ -209,8 +209,8 @@ public class ODataHandler {
final ContentType requestedContentType = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),
request, customContentTypeSupport, RepresentationType.ENTITY);
- selectProcessor(EntityTypeProcessor.class)
- .readEntityType(request, response, uriInfo, requestedContentType);
+ selectProcessor(EntityProcessor.class)
+ .readEntity(request, response, uriInfo, requestedContentType);
} else {
throw new ODataHandlerException("not implemented",
ODataHandlerException.MessageKeys.FUNCTIONALITY_NOT_IMPLEMENTED);
@@ -222,8 +222,8 @@ public class ODataHandler {
if (method.equals(HttpMethod.GET)) {
final UriResource resource = uriInfo.getUriResourceParts().get(lastPathSegmentIndex - 1);
if (resource instanceof UriResourceEntitySet || resource instanceof UriResourceNavigation) {
- selectProcessor(CountEntityTypeCollectionProcessor.class)
- .countEntityTypeCollection(request, response, uriInfo);
+ selectProcessor(CountEntityCollectionProcessor.class)
+ .countEntityCollection(request, response, uriInfo, ContentType.TEXT_PLAIN);
} else {
throw new ODataHandlerException(
"Count of collections of primitive-type or complex-type instances is not implemented.",
@@ -243,11 +243,11 @@ public class ODataHandler {
final ContentType requestedContentType = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),
request, customContentTypeSupport, representationType);
if (representationType == RepresentationType.PRIMITIVE) {
- selectProcessor(PrimitiveTypeProcessor.class)
- .readPrimitiveType(request, response, uriInfo, requestedContentType);
+ selectProcessor(PrimitiveProcessor.class)
+ .readPrimitive(request, response, uriInfo, requestedContentType);
} else {
- selectProcessor(PrimitiveTypeCollectionProcessor.class)
- .readPrimitiveTypeCollection(request, response, uriInfo, requestedContentType);
+ selectProcessor(PrimitiveCollectionProcessor.class)
+ .readPrimitiveCollection(request, response, uriInfo, requestedContentType);
}
} else {
throw new ODataHandlerException("not implemented",
@@ -263,11 +263,11 @@ public class ODataHandler {
final ContentType requestedContentType = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),
request, customContentTypeSupport, representationType);
if (representationType == RepresentationType.COMPLEX) {
- selectProcessor(ComplexTypeProcessor.class)
- .readComplexType(request, response, uriInfo, requestedContentType);
+ selectProcessor(ComplexProcessor.class)
+ .readComplex(request, response, uriInfo, requestedContentType);
} else {
- selectProcessor(ComplexTypeCollectionProcessor.class)
- .readComplexTypeCollection(request, response, uriInfo, requestedContentType);
+ selectProcessor(ComplexCollectionProcessor.class)
+ .readComplexCollection(request, response, uriInfo, requestedContentType);
}
} else {
throw new ODataHandlerException("not implemented",
@@ -286,8 +286,8 @@ public class ODataHandler {
final ContentType requestedContentType = ContentNegotiator.doContentNegotiation(uriInfo.getFormatOption(),
request, customContentTypeSupport, representationType);
- selectProcessor(PrimitiveTypeProcessor.class)
- .readPrimitiveTypeAsValue(request, response, uriInfo, requestedContentType);
+ selectProcessor(PrimitiveProcessor.class)
+ .readPrimitiveAsValue(request, response, uriInfo, requestedContentType);
} else {
throw new ODataHandlerException("Media Entity is not implemented.",
ODataHandlerException.MessageKeys.FUNCTIONALITY_NOT_IMPLEMENTED);
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/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 1873629..34da317 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
@@ -29,15 +29,14 @@ import org.apache.olingo.commons.api.data.EntitySet;
import org.apache.olingo.commons.api.edm.EdmEntitySet;
import org.apache.olingo.commons.api.format.ContentType;
import org.apache.olingo.commons.api.format.ODataFormat;
-import org.apache.olingo.commons.api.http.HttpContentType;
import org.apache.olingo.commons.api.http.HttpHeader;
import org.apache.olingo.commons.api.http.HttpStatusCode;
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.processor.CountEntityTypeCollectionProcessor;
-import org.apache.olingo.server.api.processor.EntityTypeCollectionProcessor;
-import org.apache.olingo.server.api.processor.EntityTypeProcessor;
+import org.apache.olingo.server.api.processor.CountEntityCollectionProcessor;
+import org.apache.olingo.server.api.processor.EntityCollectionProcessor;
+import org.apache.olingo.server.api.processor.EntityProcessor;
import org.apache.olingo.server.api.serializer.ODataSerializer;
import org.apache.olingo.server.api.serializer.ODataSerializerOptions;
import org.apache.olingo.server.api.serializer.SerializerException;
@@ -52,14 +51,14 @@ import org.apache.olingo.server.tecsvc.data.DataProvider;
* Technical Processor for entity-related functionality.
*/
public class TechnicalEntityProcessor extends TechnicalProcessor
- implements EntityTypeCollectionProcessor, CountEntityTypeCollectionProcessor, EntityTypeProcessor {
+ implements EntityCollectionProcessor, CountEntityCollectionProcessor, EntityProcessor {
public TechnicalEntityProcessor(final DataProvider dataProvider) {
super(dataProvider);
}
@Override
- public void readEntityTypeCollection(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
+ public void readEntityCollection(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
final ContentType requestedContentType) throws ODataApplicationException, SerializerException {
validateOptions(uriInfo.asUriInfoResource());
if (uriInfo.asUriInfoResource().getUriResourceParts().size() > 1) {
@@ -90,8 +89,8 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
}
@Override
- public void countEntityTypeCollection(final ODataRequest request, ODataResponse response, final UriInfo uriInfo)
- throws ODataApplicationException, SerializerException {
+ public void countEntityCollection(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
+ final ContentType requestedContentType) throws ODataApplicationException, SerializerException {
validateOptions(uriInfo.asUriInfoResource());
final List<UriResource> resourceParts = uriInfo.asUriInfoResource().getUriResourceParts();
final int pos = resourceParts.size() - 2;
@@ -106,12 +105,12 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
} else {
response.setContent(new ByteArrayInputStream(entitySet.getCount().toString().getBytes()));
response.setStatusCode(HttpStatusCode.OK.getStatusCode());
- response.setHeader(HttpHeader.CONTENT_TYPE, HttpContentType.TEXT_PLAIN);
+ response.setHeader(HttpHeader.CONTENT_TYPE, requestedContentType.toContentTypeString());
}
}
@Override
- public void readEntityType(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
+ public void readEntity(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
final ContentType requestedContentType) throws ODataApplicationException, SerializerException {
validateOptions(uriInfo.asUriInfoResource());
if (uriInfo.asUriInfoResource().getUriResourceParts().size() > 1) {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/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 9666f6d..037ffcb 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
@@ -40,10 +40,10 @@ import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
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.processor.ComplexTypeCollectionProcessor;
-import org.apache.olingo.server.api.processor.ComplexTypeProcessor;
-import org.apache.olingo.server.api.processor.PrimitiveTypeCollectionProcessor;
-import org.apache.olingo.server.api.processor.PrimitiveTypeProcessor;
+import org.apache.olingo.server.api.processor.ComplexCollectionProcessor;
+import org.apache.olingo.server.api.processor.ComplexProcessor;
+import org.apache.olingo.server.api.processor.PrimitiveCollectionProcessor;
+import org.apache.olingo.server.api.processor.PrimitiveProcessor;
import org.apache.olingo.server.api.serializer.ODataSerializer;
import org.apache.olingo.server.api.serializer.ODataSerializerOptions;
import org.apache.olingo.server.api.serializer.SerializerException;
@@ -59,33 +59,33 @@ 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 PrimitiveTypeProcessor, PrimitiveTypeCollectionProcessor,
- ComplexTypeProcessor, ComplexTypeCollectionProcessor {
+ implements PrimitiveProcessor, PrimitiveCollectionProcessor,
+ ComplexProcessor, ComplexCollectionProcessor {
public TechnicalPrimitiveComplexProcessor(final DataProvider dataProvider) {
super(dataProvider);
}
@Override
- public void readPrimitiveType(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
+ public void readPrimitive(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
final ContentType contentType) throws ODataApplicationException, SerializerException {
readProperty(response, uriInfo, contentType);
}
@Override
- public void readPrimitiveTypeCollection(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
+ public void readPrimitiveCollection(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
final ContentType contentType) throws ODataApplicationException, SerializerException {
readProperty(response, uriInfo, contentType);
}
@Override
- public void readComplexType(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
+ public void readComplex(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
final ContentType contentType) throws ODataApplicationException, SerializerException {
readProperty(response, uriInfo, contentType);
}
@Override
- public void readComplexTypeCollection(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
+ public void readComplexCollection(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
final ContentType contentType) throws ODataApplicationException, SerializerException {
readProperty(response, uriInfo, contentType);
}
@@ -170,7 +170,7 @@ public class TechnicalPrimitiveComplexProcessor extends TechnicalProcessor
}
@Override
- public void readPrimitiveTypeAsValue(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
+ public void readPrimitiveAsValue(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
final ContentType contentType) throws ODataApplicationException, SerializerException {
final UriInfoResource resource = uriInfo.asUriInfoResource();
validateOptions(resource);
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/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 8785845..b4e04fb 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
@@ -23,6 +23,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
@@ -47,14 +48,14 @@ 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.ComplexTypeCollectionProcessor;
-import org.apache.olingo.server.api.processor.ComplexTypeProcessor;
-import org.apache.olingo.server.api.processor.CountEntityTypeCollectionProcessor;
-import org.apache.olingo.server.api.processor.EntityTypeCollectionProcessor;
-import org.apache.olingo.server.api.processor.EntityTypeProcessor;
+import org.apache.olingo.server.api.processor.ComplexCollectionProcessor;
+import org.apache.olingo.server.api.processor.ComplexProcessor;
+import org.apache.olingo.server.api.processor.CountEntityCollectionProcessor;
+import org.apache.olingo.server.api.processor.EntityCollectionProcessor;
+import org.apache.olingo.server.api.processor.EntityProcessor;
import org.apache.olingo.server.api.processor.MetadataProcessor;
-import org.apache.olingo.server.api.processor.PrimitiveTypeCollectionProcessor;
-import org.apache.olingo.server.api.processor.PrimitiveTypeProcessor;
+import org.apache.olingo.server.api.processor.PrimitiveCollectionProcessor;
+import org.apache.olingo.server.api.processor.PrimitiveProcessor;
import org.apache.olingo.server.api.processor.Processor;
import org.apache.olingo.server.api.processor.ServiceDocumentProcessor;
import org.apache.olingo.server.api.uri.UriInfo;
@@ -219,84 +220,84 @@ public class ODataHandlerTest {
@Test
public void dispatchEntitySet() throws Exception {
- final EntityTypeCollectionProcessor processor = mock(EntityTypeCollectionProcessor.class);
+ final EntityCollectionProcessor processor = mock(EntityCollectionProcessor.class);
dispatch(HttpMethod.GET, "ESAllPrim", processor);
- verify(processor).readEntityTypeCollection(
+ verify(processor).readEntityCollection(
any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), any(ContentType.class));
}
@Test
public void dispatchEntitySetCount() throws Exception {
- final CountEntityTypeCollectionProcessor processor = mock(CountEntityTypeCollectionProcessor.class);
+ final CountEntityCollectionProcessor processor = mock(CountEntityCollectionProcessor.class);
dispatch(HttpMethod.GET, "ESAllPrim/$count", processor);
- verify(processor).countEntityTypeCollection(
- any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class));
+ verify(processor).countEntityCollection(
+ any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), eq(ContentType.TEXT_PLAIN));
dispatchMethodNotAllowed(HttpMethod.POST, "ESAllPrim/$count", processor);
}
@Test
public void dispatchCountWithNavigation() throws Exception {
- final CountEntityTypeCollectionProcessor processor = mock(CountEntityTypeCollectionProcessor.class);
+ final CountEntityCollectionProcessor processor = mock(CountEntityCollectionProcessor.class);
dispatch(HttpMethod.GET, "ESAllPrim(0)/NavPropertyETTwoPrimMany/$count", processor);
- verify(processor).countEntityTypeCollection(
- any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class));
+ verify(processor).countEntityCollection(
+ any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), eq(ContentType.TEXT_PLAIN));
}
@Test
public void dispatchEntity() throws Exception {
- final EntityTypeProcessor processor = mock(EntityTypeProcessor.class);
+ final EntityProcessor processor = mock(EntityProcessor.class);
dispatch(HttpMethod.GET, "ESAllPrim(0)", processor);
- verify(processor).readEntityType(
+ verify(processor).readEntity(
any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), any(ContentType.class));
}
@Test
public void dispatchPrimitiveProperty() throws Exception {
- final PrimitiveTypeProcessor processor = mock(PrimitiveTypeProcessor.class);
+ final PrimitiveProcessor processor = mock(PrimitiveProcessor.class);
dispatch(HttpMethod.GET, "ESAllPrim(0)/PropertyInt16", processor);
- verify(processor).readPrimitiveType(
+ verify(processor).readPrimitive(
any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), any(ContentType.class));
}
@Test
public void dispatchPrimitivePropertyValue() throws Exception {
- final PrimitiveTypeProcessor processor = mock(PrimitiveTypeProcessor.class);
+ final PrimitiveProcessor processor = mock(PrimitiveProcessor.class);
dispatch(HttpMethod.GET, "ESAllPrim(0)/PropertyInt16/$value", processor);
- verify(processor).readPrimitiveTypeAsValue(
+ verify(processor).readPrimitiveAsValue(
any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), any(ContentType.class));
}
@Test
public void dispatchPrimitiveCollectionProperty() throws Exception {
- final PrimitiveTypeCollectionProcessor processor = mock(PrimitiveTypeCollectionProcessor.class);
+ final PrimitiveCollectionProcessor processor = mock(PrimitiveCollectionProcessor.class);
dispatch(HttpMethod.GET, "ESMixPrimCollComp(7)/CollPropertyString", processor);
- verify(processor).readPrimitiveTypeCollection(
+ verify(processor).readPrimitiveCollection(
any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), any(ContentType.class));
}
@Test
public void dispatchComplexProperty() throws Exception {
- final ComplexTypeProcessor processor = mock(ComplexTypeProcessor.class);
+ final ComplexProcessor processor = mock(ComplexProcessor.class);
dispatch(HttpMethod.GET, "ESMixPrimCollComp(7)/PropertyComp", processor);
- verify(processor).readComplexType(
+ verify(processor).readComplex(
any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), any(ContentType.class));
}
@Test
public void dispatchComplexCollectionProperty() throws Exception {
- final ComplexTypeCollectionProcessor processor = mock(ComplexTypeCollectionProcessor.class);
+ final ComplexCollectionProcessor processor = mock(ComplexCollectionProcessor.class);
dispatch(HttpMethod.GET, "ESMixPrimCollComp(7)/CollPropertyComp", processor);
- verify(processor).readComplexTypeCollection(
+ verify(processor).readComplexCollection(
any(ODataRequest.class), any(ODataResponse.class), any(UriInfo.class), any(ContentType.class));
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/dd227569/samples/server/src/main/java/org/apache/olingo/server/sample/processor/CarsProcessor.java
----------------------------------------------------------------------
diff --git a/samples/server/src/main/java/org/apache/olingo/server/sample/processor/CarsProcessor.java b/samples/server/src/main/java/org/apache/olingo/server/sample/processor/CarsProcessor.java
index 5f4d351..bf3aa17 100644
--- a/samples/server/src/main/java/org/apache/olingo/server/sample/processor/CarsProcessor.java
+++ b/samples/server/src/main/java/org/apache/olingo/server/sample/processor/CarsProcessor.java
@@ -38,12 +38,12 @@ 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.ServiceMetadata;
-import org.apache.olingo.server.api.processor.ComplexTypeCollectionProcessor;
-import org.apache.olingo.server.api.processor.ComplexTypeProcessor;
-import org.apache.olingo.server.api.processor.EntityTypeCollectionProcessor;
-import org.apache.olingo.server.api.processor.EntityTypeProcessor;
-import org.apache.olingo.server.api.processor.PrimitiveTypeCollectionProcessor;
-import org.apache.olingo.server.api.processor.PrimitiveTypeProcessor;
+import org.apache.olingo.server.api.processor.ComplexCollectionProcessor;
+import org.apache.olingo.server.api.processor.ComplexProcessor;
+import org.apache.olingo.server.api.processor.EntityCollectionProcessor;
+import org.apache.olingo.server.api.processor.EntityProcessor;
+import org.apache.olingo.server.api.processor.PrimitiveCollectionProcessor;
+import org.apache.olingo.server.api.processor.PrimitiveProcessor;
import org.apache.olingo.server.api.serializer.ODataSerializer;
import org.apache.olingo.server.api.serializer.ODataSerializerOptions;
import org.apache.olingo.server.api.serializer.SerializerException;
@@ -62,8 +62,8 @@ import org.apache.olingo.server.sample.data.DataProvider.DataProviderException;
* This is a very simple example which should give you a rough guideline on how to implement such an processor.
* See the JavaDoc of the server.api interfaces for more information.
*/
-public class CarsProcessor implements EntityTypeCollectionProcessor, EntityTypeProcessor, PrimitiveTypeProcessor,
- PrimitiveTypeCollectionProcessor, ComplexTypeProcessor, ComplexTypeCollectionProcessor {
+public class CarsProcessor implements EntityCollectionProcessor, EntityProcessor, PrimitiveProcessor,
+ PrimitiveCollectionProcessor, ComplexProcessor, ComplexCollectionProcessor {
private OData odata;
private DataProvider dataProvider;
@@ -80,7 +80,7 @@ public class CarsProcessor implements EntityTypeCollectionProcessor, EntityTypeP
}
@Override
- public void readEntityTypeCollection(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
+ public void readEntityCollection(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
final ContentType requestedContentType) throws ODataApplicationException, SerializerException {
// First we have to figure out which entity set to use
final EdmEntitySet edmEntitySet = getEdmEntitySet(uriInfo.asUriInfoResource());
@@ -112,7 +112,7 @@ public class CarsProcessor implements EntityTypeCollectionProcessor, EntityTypeP
}
@Override
- public void readEntityType(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
+ public void readEntity(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
final ContentType requestedContentType) throws ODataApplicationException, SerializerException {
// First we have to figure out which entity set the requested entity is in
final EdmEntitySet edmEntitySet = getEdmEntitySet(uriInfo.asUriInfoResource());
@@ -229,32 +229,32 @@ public class CarsProcessor implements EntityTypeCollectionProcessor, EntityTypeP
}
@Override
- public void readComplexTypeCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo,
+ public void readComplexCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo,
ContentType format) throws ODataApplicationException, SerializerException {
readProperty(request, response, uriInfo, format);
}
@Override
- public void readComplexType(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
+ public void readComplex(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
throws ODataApplicationException, SerializerException {
readProperty(request, response, uriInfo, format);
}
@Override
- public void readPrimitiveTypeCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo,
+ public void readPrimitiveCollection(ODataRequest request, ODataResponse response, UriInfo uriInfo,
ContentType format) throws ODataApplicationException, SerializerException {
readProperty(request, response, uriInfo, format);
}
@Override
- public void readPrimitiveType(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
+ public void readPrimitive(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
throws ODataApplicationException, SerializerException {
readProperty(request, response, uriInfo, format);
}
@Override
public void
- readPrimitiveTypeAsValue(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
+ readPrimitiveAsValue(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType format)
throws ODataApplicationException, SerializerException {
throw new ODataApplicationException("Not implemented for this sample", HttpStatusCode.NOT_IMPLEMENTED
.getStatusCode(), Locale.ENGLISH);