You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by sk...@apache.org on 2013/08/28 15:34:35 UTC
[31/43] source distribution
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/GetMetadataUriInfo.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/GetMetadataUriInfo.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/GetMetadataUriInfo.java
new file mode 100644
index 0000000..9e9e9ee
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/GetMetadataUriInfo.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * 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.odata2.api.uri.info;
+
+import java.util.Map;
+
+/**
+ * Access to the parts of the request URI that are relevant for GET requests
+ * of the metadata document.
+ * @org.apache.olingo.odata2.DoNotImplement
+ *
+ */
+public interface GetMetadataUriInfo {
+ /**
+ * Gets the custom query options as Map from option names to their
+ * corresponding String values, or an empty list if no custom query options
+ * are given in the URI.
+ * @return Map of {@literal <String, String>} custom query options
+ */
+ public Map<String, String> getCustomQueryOptions();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/GetServiceDocumentUriInfo.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/GetServiceDocumentUriInfo.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/GetServiceDocumentUriInfo.java
new file mode 100644
index 0000000..a12b75f
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/GetServiceDocumentUriInfo.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * 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.odata2.api.uri.info;
+
+import java.util.Map;
+
+/**
+ * Access to the parts of the request URI that are relevant for GET requests
+ * of the service document.
+ * @org.apache.olingo.odata2.DoNotImplement
+ *
+ */
+public interface GetServiceDocumentUriInfo {
+ /**
+ * Gets the value of the $format system query option.
+ * @return the format (as set as <code>$format</code> query parameter) or null
+ */
+ public String getFormat();
+
+ /**
+ * Gets the custom query options as Map from option names to their
+ * corresponding String values, or an empty list if no custom query options
+ * are given in the URI.
+ * @return Map of {@literal <String, String>} custom query options
+ */
+ public Map<String, String> getCustomQueryOptions();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/GetSimplePropertyUriInfo.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/GetSimplePropertyUriInfo.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/GetSimplePropertyUriInfo.java
new file mode 100644
index 0000000..bcd20cc
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/GetSimplePropertyUriInfo.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * 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.odata2.api.uri.info;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.odata2.api.edm.EdmEntityContainer;
+import org.apache.olingo.odata2.api.edm.EdmEntitySet;
+import org.apache.olingo.odata2.api.edm.EdmFunctionImport;
+import org.apache.olingo.odata2.api.edm.EdmLiteral;
+import org.apache.olingo.odata2.api.edm.EdmProperty;
+import org.apache.olingo.odata2.api.edm.EdmType;
+import org.apache.olingo.odata2.api.uri.KeyPredicate;
+import org.apache.olingo.odata2.api.uri.NavigationSegment;
+
+/**
+ * Access to the parts of the request URI that are relevant for GET requests
+ * of simple properties.
+ * @org.apache.olingo.odata2.DoNotImplement
+ *
+ */
+public interface GetSimplePropertyUriInfo {
+ /**
+ * Gets the target entity container.
+ * @return {@link EdmEntityContainer} the target entity container
+ */
+ public EdmEntityContainer getEntityContainer();
+
+ /**
+ * Gets the start entity set - identical to the target entity set if no navigation
+ * has been used.
+ * @return {@link EdmEntitySet}
+ */
+ public EdmEntitySet getStartEntitySet();
+
+ /**
+ * Gets the target entity set after navigation.
+ * @return {@link EdmEntitySet} target entity set
+ */
+ public EdmEntitySet getTargetEntitySet();
+
+ /**
+ * Gets the function import.
+ * @return {@link EdmFunctionImport} the function import
+ */
+ public EdmFunctionImport getFunctionImport();
+
+ /**
+ * Gets the target simple type of the request.
+ * @return {@link EdmType} the target type
+ */
+ public EdmType getTargetType();
+
+ /**
+ * Gets the key predicates used to select a single entity out of the start entity set,
+ * or an empty list if not used.
+ * @return List of {@link KeyPredicate}
+ * @see #getStartEntitySet()
+ */
+ public List<KeyPredicate> getKeyPredicates();
+
+ /**
+ * Gets the key predicates used to select a single entity out of the target entity set,
+ * or an empty list if not used - identical to the key predicates from the last entry
+ * retrieved from {@link #getNavigationSegments()} or, if no navigation has been used,
+ * to the result of {@link #getKeyPredicates()}.
+ * @return List of {@link KeyPredicate}
+ * @see #getTargetEntitySet()
+ */
+ public List<KeyPredicate> getTargetKeyPredicates();
+
+ /**
+ * Gets the navigation segments, or an empty list if no navigation has been used.
+ * @return List of {@link NavigationSegment}
+ */
+ public List<NavigationSegment> getNavigationSegments();
+
+ /**
+ * Gets the path used to select a (simple or complex) property of an entity,
+ * or an empty list if no property is accessed.
+ * @return List of {@link EdmProperty}
+ */
+ public List<EdmProperty> getPropertyPath();
+
+ /**
+ * Determines whether $value has been used in the request URI.
+ * @return whether $value has been used
+ */
+ public boolean isValue();
+
+ /**
+ * Gets the value of the $format system query option.
+ * @return the format (as set as <code>$format</code> query parameter) or null
+ */
+ public String getFormat();
+
+ /**
+ * Gets the parameters of a function import as Map from parameter names to
+ * their corresponding typed values, or an empty list if no function import
+ * is used or no parameters are given in the URI.
+ * @return Map of {@literal <String,} {@link EdmLiteral}{@literal >} function import parameters
+ */
+ public Map<String, EdmLiteral> getFunctionImportParameters();
+
+ /**
+ * Gets the custom query options as Map from option names to their
+ * corresponding String values, or an empty list if no custom query options
+ * are given in the URI.
+ * @return Map of {@literal <String, String>} custom query options
+ */
+ public Map<String, String> getCustomQueryOptions();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/PostUriInfo.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/PostUriInfo.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/PostUriInfo.java
new file mode 100644
index 0000000..d3356c6
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/PostUriInfo.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * 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.odata2.api.uri.info;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.odata2.api.edm.EdmEntityContainer;
+import org.apache.olingo.odata2.api.edm.EdmEntitySet;
+import org.apache.olingo.odata2.api.edm.EdmFunctionImport;
+import org.apache.olingo.odata2.api.edm.EdmLiteral;
+import org.apache.olingo.odata2.api.edm.EdmType;
+import org.apache.olingo.odata2.api.uri.KeyPredicate;
+import org.apache.olingo.odata2.api.uri.NavigationSegment;
+
+/**
+ * Access to the parts of the request URI that are relevant for POST requests.
+ * @org.apache.olingo.odata2.DoNotImplement
+ *
+ */
+public interface PostUriInfo {
+ /**
+ * Gets the target entity container.
+ * @return {@link EdmEntityContainer} the target entity container
+ */
+ public EdmEntityContainer getEntityContainer();
+
+ /**
+ * Gets the start entity set - identical to the target entity set if no navigation
+ * has been used.
+ * @return {@link EdmEntitySet}
+ */
+ public EdmEntitySet getStartEntitySet();
+
+ /**
+ * Gets the target entity set after navigation.
+ * @return {@link EdmEntitySet} target entity set
+ */
+ public EdmEntitySet getTargetEntitySet();
+
+ /**
+ * Gets the function import.
+ * @return {@link EdmFunctionImport} the function import
+ */
+ public EdmFunctionImport getFunctionImport();
+
+ /**
+ * Gets the target entity type of the request.
+ * @return {@link EdmType} the target type
+ */
+ public EdmType getTargetType();
+
+ /**
+ * Gets the key predicates used to select a single entity out of the start entity set,
+ * or an empty list if not used.
+ * @return List of {@link KeyPredicate}
+ * @see #getStartEntitySet()
+ */
+ public List<KeyPredicate> getKeyPredicates();
+
+ /**
+ * Gets the navigation segments, or an empty list if no navigation has been used.
+ * @return List of {@link NavigationSegment}
+ */
+ public List<NavigationSegment> getNavigationSegments();
+
+ /**
+ * Gets the parameters of a function import as Map from parameter names to
+ * their corresponding typed values, or an empty list if no function import
+ * is used or no parameters are given in the URI.
+ * @return Map of {@literal <String,} {@link EdmLiteral}{@literal >} function import parameters
+ */
+ public Map<String, EdmLiteral> getFunctionImportParameters();
+
+ /**
+ * Gets the custom query options as Map from option names to their
+ * corresponding String values, or an empty list if no custom query options
+ * are given in the URI.
+ * @return Map of {@literal <String, String>} custom query options
+ */
+ public Map<String, String> getCustomQueryOptions();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/PutMergePatchUriInfo.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/PutMergePatchUriInfo.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/PutMergePatchUriInfo.java
new file mode 100644
index 0000000..7505c86
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/PutMergePatchUriInfo.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * 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.odata2.api.uri.info;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.odata2.api.edm.EdmEntityContainer;
+import org.apache.olingo.odata2.api.edm.EdmEntitySet;
+import org.apache.olingo.odata2.api.edm.EdmFunctionImport;
+import org.apache.olingo.odata2.api.edm.EdmLiteral;
+import org.apache.olingo.odata2.api.edm.EdmProperty;
+import org.apache.olingo.odata2.api.edm.EdmType;
+import org.apache.olingo.odata2.api.uri.KeyPredicate;
+import org.apache.olingo.odata2.api.uri.NavigationSegment;
+import org.apache.olingo.odata2.api.uri.expression.FilterExpression;
+
+/**
+ * Access to the parts of the request URI that are relevant for PUT, PATCH, or MERGE requests.
+ * @org.apache.olingo.odata2.DoNotImplement
+ *
+ */
+public interface PutMergePatchUriInfo {
+ /**
+ * Gets the target entity container.
+ * @return {@link EdmEntityContainer} the target entity container
+ */
+ public EdmEntityContainer getEntityContainer();
+
+ /**
+ * Gets the start entity set - identical to the target entity set if no navigation
+ * has been used.
+ * @return {@link EdmEntitySet}
+ */
+ public EdmEntitySet getStartEntitySet();
+
+ /**
+ * Gets the target entity set after navigation.
+ * @return {@link EdmEntitySet} target entity set
+ */
+ public EdmEntitySet getTargetEntitySet();
+
+ /**
+ * Gets the function import.
+ * @return {@link EdmFunctionImport} the function import
+ */
+ public EdmFunctionImport getFunctionImport();
+
+ /**
+ * Gets the target type of the request: an entity type, a simple type, or a complex type.
+ * @return {@link EdmType} the target type
+ */
+ public EdmType getTargetType();
+
+ /**
+ * Gets the key predicates used to select a single entity out of the start entity set,
+ * or an empty list if not used.
+ * @return List of {@link KeyPredicate}
+ * @see #getStartEntitySet()
+ */
+ public List<KeyPredicate> getKeyPredicates();
+
+ /**
+ * Gets the key predicates used to select a single entity out of the target entity set,
+ * or an empty list if not used - identical to the key predicates from the last entry
+ * retrieved from {@link #getNavigationSegments()} or, if no navigation has been used,
+ * to the result of {@link #getKeyPredicates()}.
+ * @return List of {@link KeyPredicate}
+ * @see #getTargetEntitySet()
+ */
+ public List<KeyPredicate> getTargetKeyPredicates();
+
+ /**
+ * Gets the navigation segments, or an empty list if no navigation has been used.
+ * @return List of {@link NavigationSegment}
+ */
+ public List<NavigationSegment> getNavigationSegments();
+
+ /**
+ * Gets the path used to select a (simple or complex) property of an entity,
+ * or an empty list if no property is accessed.
+ * @return List of {@link EdmProperty}
+ */
+ public List<EdmProperty> getPropertyPath();
+
+ /**
+ * Gets the value of the $filter system query option as root object of the
+ * expression tree built during URI parsing.
+ * @return the filter expression or null
+ */
+ public FilterExpression getFilter();
+
+ /**
+ * Gets the parameters of a function import as Map from parameter names to
+ * their corresponding typed values, or an empty list if no function import
+ * is used or no parameters are given in the URI.
+ * @return Map of {@literal <String,} {@link EdmLiteral}{@literal >} function import parameters
+ */
+ public Map<String, EdmLiteral> getFunctionImportParameters();
+
+ /**
+ * Gets the custom query options as Map from option names to their
+ * corresponding String values, or an empty list if no custom query options
+ * are given in the URI.
+ * @return Map of {@literal <String, String>} custom query options
+ */
+ public Map<String, String> getCustomQueryOptions();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/package-info.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/package-info.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/package-info.java
new file mode 100644
index 0000000..f92781b
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/info/package-info.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+/**
+ * <p>URI Parser Result Views</p>
+ * <p>The interfaces of this package provide access to the relevant parts of the parsed
+ * request URI for the methods that process a request inside the dispatcher.</p>
+ */
+package org.apache.olingo.odata2.api.uri.info;
+
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/package-info.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/package-info.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/package-info.java
new file mode 100644
index 0000000..7643ff1
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/package-info.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+/**
+ * <p>URI Parser Facade</p>
+ * <p>The URI package has one central class {@link org.apache.olingo.odata2.api.uri.UriParser} to parse a request URI
+ * as well as several interfaces that provide access to parsed parts of the URI.
+ * <br>The {@link org.apache.olingo.odata2.api.uri.UriParser} class also provides the possibility to parse a filter or an orderBy Statement. Both are specified in the OData Protocol Specification.
+ * <br>The URI syntax is specified in the OData Protocol Specification in the form of an ABNF. </p>
+ */
+package org.apache.olingo.odata2.api.uri;
+
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/ContentNegotiator.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/ContentNegotiator.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/ContentNegotiator.java
new file mode 100644
index 0000000..f9767c3
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/ContentNegotiator.java
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * 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.odata2.core;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.olingo.odata2.api.exception.ODataBadRequestException;
+import org.apache.olingo.odata2.api.exception.ODataException;
+import org.apache.olingo.odata2.api.exception.ODataNotAcceptableException;
+import org.apache.olingo.odata2.core.commons.ContentType;
+import org.apache.olingo.odata2.core.commons.ContentType.ODataFormat;
+import org.apache.olingo.odata2.core.uri.UriInfoImpl;
+import org.apache.olingo.odata2.core.uri.UriType;
+
+/**
+ *
+ */
+public class ContentNegotiator {
+ private static final String URI_INFO_FORMAT_JSON = "json";
+ private static final String URI_INFO_FORMAT_ATOM = "atom";
+ private static final String URI_INFO_FORMAT_XML = "xml";
+ static final String DEFAULT_CHARSET = "utf-8";
+
+ public String doContentNegotiation(final UriInfoImpl uriInfo, final List<String> acceptHeaderContentTypes, final List<String> supportedContentTypes) throws ODataException {
+ ContentType contentType;
+ if (uriInfo.getFormat() == null) {
+ contentType = doContentNegotiationForAcceptHeader(acceptHeaderContentTypes, ContentType.create(supportedContentTypes));
+ } else {
+ contentType = doContentNegotiationForFormat(uriInfo, ContentType.create(supportedContentTypes));
+ }
+
+ if (contentType.getODataFormat() == ODataFormat.CUSTOM) {
+ return contentType.getType();
+ }
+ return contentType.toContentTypeString();
+ }
+
+ private ContentType doContentNegotiationForFormat(final UriInfoImpl uriInfo, final List<ContentType> supportedContentTypes) throws ODataException {
+ validateFormatQuery(uriInfo);
+ ContentType formatContentType = mapFormat(uriInfo);
+ formatContentType = formatContentType.receiveWithCharsetParameter(DEFAULT_CHARSET);
+
+ for (final ContentType contentType : supportedContentTypes) {
+ if (contentType.equals(formatContentType)) {
+ return formatContentType;
+ }
+ }
+
+ throw new ODataNotAcceptableException(ODataNotAcceptableException.NOT_SUPPORTED_CONTENT_TYPE.addContent(uriInfo.getFormat()));
+ }
+
+ /**
+ * Validates that <code>dollar format query/syntax</code> is correct for further processing.
+ * If some validation error occurs an exception is thrown.
+ *
+ * @param uriInfo
+ * @throws ODataBadRequestException
+ */
+ private void validateFormatQuery(final UriInfoImpl uriInfo) throws ODataBadRequestException {
+ if (uriInfo.isValue()) {
+ throw new ODataBadRequestException(ODataBadRequestException.INVALID_SYNTAX);
+ }
+ }
+
+ private ContentType mapFormat(final UriInfoImpl uriInfo) {
+ final String format = uriInfo.getFormat();
+ if (URI_INFO_FORMAT_XML.equals(format)) {
+ return ContentType.APPLICATION_XML;
+ } else if (URI_INFO_FORMAT_ATOM.equals(format)) {
+ if (uriInfo.getUriType() == UriType.URI0) {
+ // special handling for serviceDocument uris (UriType.URI0)
+ return ContentType.APPLICATION_ATOM_SVC;
+ }
+ return ContentType.APPLICATION_ATOM_XML;
+ } else if (URI_INFO_FORMAT_JSON.equals(format)) {
+ return ContentType.APPLICATION_JSON;
+ }
+
+ return ContentType.create(format);
+ }
+
+ private ContentType doContentNegotiationForAcceptHeader(final List<String> acceptHeaderContentTypes, final List<ContentType> supportedContentTypes) throws ODataException {
+ return contentNegotiation(extractAcceptHeaders(acceptHeaderContentTypes), supportedContentTypes);
+ }
+
+ private List<ContentType> extractAcceptHeaders(final List<String> acceptHeaderValues) throws ODataBadRequestException {
+ final List<ContentType> mediaTypes = new ArrayList<ContentType>();
+ if (acceptHeaderValues != null) {
+ for (final String mediaType : acceptHeaderValues) {
+ try {
+ mediaTypes.add(ContentType.create(mediaType.toString()));
+ } catch (IllegalArgumentException e) {
+ throw new ODataBadRequestException(ODataBadRequestException.INVALID_HEADER.addContent("Accept")
+ .addContent(mediaType.toString()), e);
+ }
+ }
+ }
+
+ return mediaTypes;
+ }
+
+ ContentType contentNegotiation(final List<ContentType> acceptedContentTypes, final List<ContentType> supportedContentTypes) throws ODataException {
+ final Set<ContentType> setSupported = new HashSet<ContentType>(supportedContentTypes);
+
+ if (acceptedContentTypes.isEmpty()) {
+ if (!setSupported.isEmpty()) {
+ return supportedContentTypes.get(0);
+ }
+ } else {
+ for (ContentType contentType : acceptedContentTypes) {
+ contentType = contentType.receiveWithCharsetParameter(DEFAULT_CHARSET);
+ final ContentType match = contentType.match(supportedContentTypes);
+ if (match != null) {
+ return match;
+ }
+ }
+ }
+
+ throw new ODataNotAcceptableException(ODataNotAcceptableException.NOT_SUPPORTED_ACCEPT_HEADER.addContent(acceptedContentTypes.toString()));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/Dispatcher.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/Dispatcher.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/Dispatcher.java
new file mode 100644
index 0000000..f0db8af
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/Dispatcher.java
@@ -0,0 +1,304 @@
+/*******************************************************************************
+ * 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.odata2.core;
+
+import java.io.InputStream;
+
+import org.apache.olingo.odata2.api.ODataService;
+import org.apache.olingo.odata2.api.ODataServiceFactory;
+import org.apache.olingo.odata2.api.batch.BatchHandler;
+import org.apache.olingo.odata2.api.commons.ODataHttpMethod;
+import org.apache.olingo.odata2.api.exception.ODataBadRequestException;
+import org.apache.olingo.odata2.api.exception.ODataException;
+import org.apache.olingo.odata2.api.exception.ODataMethodNotAllowedException;
+import org.apache.olingo.odata2.api.processor.ODataProcessor;
+import org.apache.olingo.odata2.api.processor.ODataResponse;
+import org.apache.olingo.odata2.api.processor.part.BatchProcessor;
+import org.apache.olingo.odata2.api.processor.part.EntityComplexPropertyProcessor;
+import org.apache.olingo.odata2.api.processor.part.EntityLinkProcessor;
+import org.apache.olingo.odata2.api.processor.part.EntityLinksProcessor;
+import org.apache.olingo.odata2.api.processor.part.EntityMediaProcessor;
+import org.apache.olingo.odata2.api.processor.part.EntityProcessor;
+import org.apache.olingo.odata2.api.processor.part.EntitySetProcessor;
+import org.apache.olingo.odata2.api.processor.part.EntitySimplePropertyProcessor;
+import org.apache.olingo.odata2.api.processor.part.EntitySimplePropertyValueProcessor;
+import org.apache.olingo.odata2.api.processor.part.FunctionImportProcessor;
+import org.apache.olingo.odata2.api.processor.part.FunctionImportValueProcessor;
+import org.apache.olingo.odata2.api.processor.part.MetadataProcessor;
+import org.apache.olingo.odata2.api.processor.part.ServiceDocumentProcessor;
+import org.apache.olingo.odata2.core.batch.BatchHandlerImpl;
+import org.apache.olingo.odata2.core.exception.ODataRuntimeException;
+import org.apache.olingo.odata2.core.uri.UriInfoImpl;
+
+/**
+ * Request dispatching according to URI type and HTTP method.
+ *
+ */
+public class Dispatcher {
+
+ private final ODataService service;
+ private final ODataServiceFactory serviceFactory;
+
+ public Dispatcher(final ODataServiceFactory serviceFactory, final ODataService service) {
+ this.service = service;
+ this.serviceFactory = serviceFactory;
+ }
+
+ public ODataResponse dispatch(final ODataHttpMethod method, final UriInfoImpl uriInfo, final InputStream content, final String requestContentType, final String contentType) throws ODataException {
+ switch (uriInfo.getUriType()) {
+ case URI0:
+ if (method == ODataHttpMethod.GET) {
+ return service.getServiceDocumentProcessor().readServiceDocument(uriInfo, contentType);
+ } else {
+ throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
+ }
+
+ case URI1:
+ case URI6B:
+ switch (method) {
+ case GET:
+ return service.getEntitySetProcessor().readEntitySet(uriInfo, contentType);
+ case POST:
+ return service.getEntitySetProcessor().createEntity(uriInfo, content, requestContentType, contentType);
+ default:
+ throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
+ }
+
+ case URI2:
+ switch (method) {
+ case GET:
+ return service.getEntityProcessor().readEntity(uriInfo, contentType);
+ case PUT:
+ return service.getEntityProcessor().updateEntity(uriInfo, content, requestContentType, false, contentType);
+ case PATCH:
+ case MERGE:
+ return service.getEntityProcessor().updateEntity(uriInfo, content, requestContentType, true, contentType);
+ case DELETE:
+ return service.getEntityProcessor().deleteEntity(uriInfo, contentType);
+ default:
+ throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
+ }
+
+ case URI3:
+ switch (method) {
+ case GET:
+ return service.getEntityComplexPropertyProcessor().readEntityComplexProperty(uriInfo, contentType);
+ case PUT:
+ return service.getEntityComplexPropertyProcessor().updateEntityComplexProperty(uriInfo, content, requestContentType, false, contentType);
+ case PATCH:
+ case MERGE:
+ return service.getEntityComplexPropertyProcessor().updateEntityComplexProperty(uriInfo, content, requestContentType, true, contentType);
+ default:
+ throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
+ }
+
+ case URI4:
+ case URI5:
+ switch (method) {
+ case GET:
+ if (uriInfo.isValue()) {
+ return service.getEntitySimplePropertyValueProcessor().readEntitySimplePropertyValue(uriInfo, contentType);
+ } else {
+ return service.getEntitySimplePropertyProcessor().readEntitySimpleProperty(uriInfo, contentType);
+ }
+ case PUT:
+ case PATCH:
+ case MERGE:
+ if (uriInfo.isValue()) {
+ return service.getEntitySimplePropertyValueProcessor().updateEntitySimplePropertyValue(uriInfo, content, requestContentType, contentType);
+ } else {
+ return service.getEntitySimplePropertyProcessor().updateEntitySimpleProperty(uriInfo, content, requestContentType, contentType);
+ }
+ case DELETE:
+ if (uriInfo.isValue()) {
+ return service.getEntitySimplePropertyValueProcessor().deleteEntitySimplePropertyValue(uriInfo, contentType);
+ } else {
+ throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
+ }
+ default:
+ throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
+ }
+
+ case URI6A:
+ switch (method) {
+ case GET:
+ return service.getEntityProcessor().readEntity(uriInfo, contentType);
+ case PUT:
+ case PATCH:
+ case MERGE:
+ case DELETE:
+ throw new ODataBadRequestException(ODataBadRequestException.NOTSUPPORTED);
+ default:
+ throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
+ }
+
+ case URI7A:
+ switch (method) {
+ case GET:
+ return service.getEntityLinkProcessor().readEntityLink(uriInfo, contentType);
+ case PUT:
+ case PATCH:
+ case MERGE:
+ return service.getEntityLinkProcessor().updateEntityLink(uriInfo, content, requestContentType, contentType);
+ case DELETE:
+ return service.getEntityLinkProcessor().deleteEntityLink(uriInfo, contentType);
+ default:
+ throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
+ }
+
+ case URI7B:
+ switch (method) {
+ case GET:
+ return service.getEntityLinksProcessor().readEntityLinks(uriInfo, contentType);
+ case POST:
+ return service.getEntityLinksProcessor().createEntityLink(uriInfo, content, requestContentType, contentType);
+ default:
+ throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
+ }
+
+ case URI8:
+ if (method == ODataHttpMethod.GET) {
+ return service.getMetadataProcessor().readMetadata(uriInfo, contentType);
+ } else {
+ throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
+ }
+
+ case URI9:
+ if (method == ODataHttpMethod.POST) {
+ BatchHandler handler = new BatchHandlerImpl(serviceFactory, service);
+ return service.getBatchProcessor().executeBatch(handler, requestContentType, content);
+ } else {
+ throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
+ }
+
+ case URI10:
+ case URI11:
+ case URI12:
+ case URI13:
+ return service.getFunctionImportProcessor().executeFunctionImport(uriInfo, contentType);
+
+ case URI14:
+ if (uriInfo.isValue()) {
+ return service.getFunctionImportValueProcessor().executeFunctionImportValue(uriInfo, contentType);
+ } else {
+ return service.getFunctionImportProcessor().executeFunctionImport(uriInfo, contentType);
+ }
+
+ case URI15:
+ if (method == ODataHttpMethod.GET) {
+ return service.getEntitySetProcessor().countEntitySet(uriInfo, contentType);
+ } else {
+ throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
+ }
+
+ case URI16:
+ if (method == ODataHttpMethod.GET) {
+ return service.getEntityProcessor().existsEntity(uriInfo, contentType);
+ } else {
+ throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
+ }
+
+ case URI17:
+ switch (method) {
+ case GET:
+ return service.getEntityMediaProcessor().readEntityMedia(uriInfo, contentType);
+ case PUT:
+ return service.getEntityMediaProcessor().updateEntityMedia(uriInfo, content, requestContentType, contentType);
+ case DELETE:
+ return service.getEntityMediaProcessor().deleteEntityMedia(uriInfo, contentType);
+ default:
+ throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
+ }
+
+ case URI50A:
+ if (method == ODataHttpMethod.GET) {
+ return service.getEntityLinkProcessor().existsEntityLink(uriInfo, contentType);
+ } else {
+ throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
+ }
+
+ case URI50B:
+ if (method == ODataHttpMethod.GET) {
+ return service.getEntityLinksProcessor().countEntityLinks(uriInfo, contentType);
+ } else {
+ throw new ODataMethodNotAllowedException(ODataMethodNotAllowedException.DISPATCH);
+ }
+
+ default:
+ throw new ODataRuntimeException("Unknown or not implemented URI type: " + uriInfo.getUriType());
+ }
+ }
+
+ protected static Class<? extends ODataProcessor> mapUriTypeToProcessorFeature(final UriInfoImpl uriInfo) {
+ Class<? extends ODataProcessor> feature;
+
+ switch (uriInfo.getUriType()) {
+ case URI0:
+ feature = ServiceDocumentProcessor.class;
+ break;
+ case URI1:
+ case URI6B:
+ case URI15:
+ feature = EntitySetProcessor.class;
+ break;
+ case URI2:
+ case URI6A:
+ case URI16:
+ feature = EntityProcessor.class;
+ break;
+ case URI3:
+ feature = EntityComplexPropertyProcessor.class;
+ break;
+ case URI4:
+ case URI5:
+ feature = uriInfo.isValue() ? EntitySimplePropertyValueProcessor.class : EntitySimplePropertyProcessor.class;
+ break;
+ case URI7A:
+ case URI50A:
+ feature = EntityLinkProcessor.class;
+ break;
+ case URI7B:
+ case URI50B:
+ feature = EntityLinksProcessor.class;
+ break;
+ case URI8:
+ feature = MetadataProcessor.class;
+ break;
+ case URI9:
+ feature = BatchProcessor.class;
+ break;
+ case URI10:
+ case URI11:
+ case URI12:
+ case URI13:
+ feature = FunctionImportProcessor.class;
+ break;
+ case URI14:
+ feature = uriInfo.isValue() ? FunctionImportValueProcessor.class : FunctionImportProcessor.class;
+ break;
+ case URI17:
+ feature = EntityMediaProcessor.class;
+ break;
+ default:
+ throw new ODataRuntimeException("Unknown or not implemented URI type: " + uriInfo.getUriType());
+ }
+
+ return feature;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/ODataContextImpl.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/ODataContextImpl.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/ODataContextImpl.java
new file mode 100644
index 0000000..a820742
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/ODataContextImpl.java
@@ -0,0 +1,314 @@
+/*******************************************************************************
+ * 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.odata2.core;
+
+import java.lang.management.ManagementFactory;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import org.apache.olingo.odata2.api.ODataDebugCallback;
+import org.apache.olingo.odata2.api.ODataService;
+import org.apache.olingo.odata2.api.ODataServiceFactory;
+import org.apache.olingo.odata2.api.exception.ODataException;
+import org.apache.olingo.odata2.api.processor.ODataContext;
+import org.apache.olingo.odata2.api.processor.ODataRequest;
+import org.apache.olingo.odata2.api.uri.PathInfo;
+import org.apache.olingo.odata2.core.debug.ODataDebugResponseWrapper;
+
+/**
+ *
+ */
+public class ODataContextImpl implements ODataContext {
+
+ private static final String ODATA_BATCH_PARENT_CONTEXT = "~odataBatchParentContext";
+ private static final String ODATA_REQUEST = "~odataRequest";
+ private static final String DEBUG_MODE = "~debugMode";
+ private static final String SERVICE = "~service";
+ private static final String SERVICE_FACTORY = "~serviceFactory";
+ private static final String PATH_INFO = "~pathInfo";
+ private static final String RUNTIME_MEASUREMENTS = "~runtimeMeasurements";
+ private static final String HTTP_METHOD = "~httpMethod";
+
+ private Map<String, Object> parameterTable = new HashMap<String, Object>();
+
+ private List<Locale> acceptableLanguages;
+
+ public ODataContextImpl(final ODataRequest request, final ODataServiceFactory factory) {
+ setServiceFactory(factory);
+ setRequest(request);
+ setPathInfo(request.getPathInfo());
+ if (request.getMethod() != null) {
+ setHttpMethod(request.getMethod().name());
+ }
+ setAcceptableLanguages(request.getAcceptableLanguages());
+ setDebugMode(checkDebugMode(request.getQueryParameters()));
+ }
+
+ @Override
+ public void setParameter(final String name, final Object value) {
+ parameterTable.put(name, value);
+ }
+
+ @Override
+ public void removeParameter(final String name) {
+ parameterTable.remove(name);
+ }
+
+ @Override
+ public Object getParameter(final String name) {
+ return parameterTable.get(name);
+ }
+
+ @Override
+ public boolean isInDebugMode() {
+ return getParameter(DEBUG_MODE) != null && (Boolean) getParameter(DEBUG_MODE);
+ }
+
+ @Override
+ public void setDebugMode(final boolean debugMode) {
+ setParameter(DEBUG_MODE, debugMode);
+ }
+
+ public void setService(final ODataService service) {
+ setParameter(SERVICE, service);
+ }
+
+ @Override
+ public ODataService getService() throws ODataException {
+ return (ODataService) getParameter(SERVICE);
+ }
+
+ public void setPathInfo(final PathInfo uriInfo) {
+ setParameter(PATH_INFO, uriInfo);
+ }
+
+ @Override
+ public PathInfo getPathInfo() throws ODataException {
+ return (PathInfo) getParameter(PATH_INFO);
+ }
+
+ public void setServiceFactory(final ODataServiceFactory serviceFactory) {
+ setParameter(SERVICE_FACTORY, serviceFactory);
+ }
+
+ @Override
+ public ODataServiceFactory getServiceFactory() {
+ return (ODataServiceFactory) getParameter(SERVICE_FACTORY);
+ }
+
+ @Override
+ public int startRuntimeMeasurement(final String className, final String methodName) {
+ if (isInDebugMode()) {
+ List<RuntimeMeasurement> runtimeMeasurements = getRuntimeMeasurements();
+ int handleId = runtimeMeasurements.size();
+
+ final RuntimeMeasurement measurement = new RuntimeMeasurementImpl();
+ measurement.setTimeStarted(System.nanoTime());
+ measurement.setClassName(className);
+ measurement.setMethodName(methodName);
+ measurement.setMemoryStarted(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed());
+
+ runtimeMeasurements.add(measurement);
+
+ return handleId;
+ } else {
+ return 0;
+ }
+ }
+
+ @Override
+ public void stopRuntimeMeasurement(final int handle) {
+ if (isInDebugMode()) {
+ long stopTime = System.nanoTime();
+ long stopMemory = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed();
+
+ RuntimeMeasurement runtimeMeasurement = getRuntimeMeasurement(handle);
+ if (runtimeMeasurement != null) {
+ runtimeMeasurement.setTimeStopped(stopTime);
+ runtimeMeasurement.setMemoryStopped(stopMemory);
+ }
+ }
+ }
+
+ private RuntimeMeasurement getRuntimeMeasurement(final int handle) {
+ List<RuntimeMeasurement> runtimeMeasurements = getRuntimeMeasurements();
+ if (handle >= 0 && handle < runtimeMeasurements.size()) {
+ return runtimeMeasurements.get(handle);
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<RuntimeMeasurement> getRuntimeMeasurements() {
+ List<RuntimeMeasurement> runtimeMeasurements = (List<RuntimeMeasurement>) getParameter(RUNTIME_MEASUREMENTS);
+ if (runtimeMeasurements == null) {
+ runtimeMeasurements = new ArrayList<RuntimeMeasurement>();
+ setParameter(RUNTIME_MEASUREMENTS, runtimeMeasurements);
+ }
+ return runtimeMeasurements;
+ }
+
+ protected class RuntimeMeasurementImpl implements RuntimeMeasurement {
+ private String className;
+ private String methodName;
+ private long timeStarted;
+ private long timeStopped;
+ private long memoryStarted;
+ private long memoryStopped;
+
+ @Override
+ public void setClassName(final String className) {
+ this.className = className;
+ }
+
+ @Override
+ public String getClassName() {
+ return className;
+ }
+
+ @Override
+ public void setMethodName(final String methodName) {
+ this.methodName = methodName;
+ }
+
+ @Override
+ public String getMethodName() {
+ return methodName;
+ }
+
+ @Override
+ public void setTimeStarted(final long start) {
+ timeStarted = start;
+ }
+
+ @Override
+ public long getTimeStarted() {
+ return timeStarted;
+ }
+
+ @Override
+ public void setTimeStopped(final long stop) {
+ timeStopped = stop;
+ }
+
+ @Override
+ public long getTimeStopped() {
+ return timeStopped;
+ }
+
+ @Override
+ public String toString() {
+ return className + "." + methodName + ": duration: " + (timeStopped - timeStarted) + ", memory: " + (memoryStopped - memoryStarted);
+ }
+
+ @Override
+ public void setMemoryStarted(final long used) {
+ memoryStarted = used;
+ }
+
+ @Override
+ public void setMemoryStopped(final long used) {
+ memoryStopped = used;
+ }
+
+ @Override
+ public long getMemoryStarted() {
+ return memoryStarted;
+ }
+
+ @Override
+ public long getMemoryStopped() {
+ return memoryStopped;
+ }
+ }
+
+ @Override
+ public String getRequestHeader(final String name) {
+ ODataRequest request = (ODataRequest) parameterTable.get(ODATA_REQUEST);
+ return request.getRequestHeaderValue(name);
+ }
+
+ @Override
+ public Map<String, List<String>> getRequestHeaders() {
+ ODataRequest request = (ODataRequest) parameterTable.get(ODATA_REQUEST);
+ return request.getRequestHeaders();
+ }
+
+ @Override
+ public List<Locale> getAcceptableLanguages() {
+ return Collections.unmodifiableList(acceptableLanguages);
+ }
+
+ public void setAcceptableLanguages(final List<Locale> acceptableLanguages) {
+ this.acceptableLanguages = acceptableLanguages;
+
+ if (this.acceptableLanguages.isEmpty()) {
+ final Locale wildcard = new Locale("*");
+ this.acceptableLanguages.add(wildcard);
+ }
+ }
+
+ public void setHttpMethod(final String httpMethod) {
+ setParameter(HTTP_METHOD, httpMethod);
+ }
+
+ @Override
+ public String getHttpMethod() {
+ return (String) getParameter(HTTP_METHOD);
+ }
+
+ public void setRequest(final ODataRequest request) {
+ setParameter(ODATA_REQUEST, request);
+ }
+
+ private boolean checkDebugMode(final Map<String, String> queryParameters) {
+ if (getQueryDebugValue(queryParameters) == null) {
+ return false;
+ } else {
+ final ODataDebugCallback callback = getServiceFactory().getCallback(ODataDebugCallback.class);
+ return callback != null && callback.isDebugEnabled();
+ }
+ }
+
+ private static String getQueryDebugValue(final Map<String, String> queryParameters) {
+ final String debugValue = queryParameters.get(ODataDebugResponseWrapper.ODATA_DEBUG_QUERY_PARAMETER);
+ return ODataDebugResponseWrapper.ODATA_DEBUG_JSON.equals(debugValue) ?
+ debugValue : null;
+ }
+
+ public void setBatchParentContext(final ODataContext ctx) {
+ setParameter(ODATA_BATCH_PARENT_CONTEXT, ctx);
+ }
+
+ @Override
+ public ODataContext getBatchParentContext() {
+ return (ODataContext) parameterTable.get(ODATA_BATCH_PARENT_CONTEXT);
+ }
+
+ @Override
+ public boolean isInBatchMode() {
+ return parameterTable.containsKey(ODATA_BATCH_PARENT_CONTEXT);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/ODataExceptionWrapper.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/ODataExceptionWrapper.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/ODataExceptionWrapper.java
new file mode 100644
index 0000000..ada0e30
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/ODataExceptionWrapper.java
@@ -0,0 +1,338 @@
+/*******************************************************************************
+ * 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.odata2.core;
+
+import java.net.URI;
+import java.text.ParseException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.UriInfo;
+
+import org.apache.olingo.odata2.api.ODataServiceFactory;
+import org.apache.olingo.odata2.api.batch.BatchException;
+import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
+import org.apache.olingo.odata2.api.ep.EntityProvider;
+import org.apache.olingo.odata2.api.ep.EntityProviderException;
+import org.apache.olingo.odata2.api.exception.MessageReference;
+import org.apache.olingo.odata2.api.exception.ODataApplicationException;
+import org.apache.olingo.odata2.api.exception.ODataException;
+import org.apache.olingo.odata2.api.exception.ODataHttpException;
+import org.apache.olingo.odata2.api.exception.ODataMessageException;
+import org.apache.olingo.odata2.api.processor.ODataContext;
+import org.apache.olingo.odata2.api.processor.ODataErrorCallback;
+import org.apache.olingo.odata2.api.processor.ODataErrorContext;
+import org.apache.olingo.odata2.api.processor.ODataResponse;
+import org.apache.olingo.odata2.core.commons.ContentType;
+import org.apache.olingo.odata2.core.ep.ProviderFacadeImpl;
+import org.apache.olingo.odata2.core.exception.MessageService;
+import org.apache.olingo.odata2.core.exception.MessageService.Message;
+import org.apache.olingo.odata2.core.exception.ODataRuntimeException;
+
+/**
+ *
+ */
+public class ODataExceptionWrapper {
+
+ private static final String DOLLAR_FORMAT = "$format";
+ private static final String DOLLAR_FORMAT_JSON = "json";
+ private static final Locale DEFAULT_RESPONSE_LOCALE = Locale.ENGLISH;
+
+ private final String contentType;
+ private final Locale messageLocale;
+ private final Map<String, List<String>> httpRequestHeaders;
+ private final ODataErrorCallback callback;
+ private final ODataErrorContext errorContext = new ODataErrorContext();
+ private final URI requestUri;
+
+ public ODataExceptionWrapper(final ODataContext context, final Map<String, String> queryParameters, final List<String> acceptHeaderContentTypes) {
+ contentType = getContentType(queryParameters, acceptHeaderContentTypes).toContentTypeString();
+ messageLocale = MessageService.getSupportedLocale(getLanguages(context), DEFAULT_RESPONSE_LOCALE);
+ httpRequestHeaders = context.getRequestHeaders();
+ try {
+ requestUri = context.getPathInfo().getRequestUri();
+ errorContext.setPathInfo(context.getPathInfo());
+ callback = getErrorHandlerCallbackFromContext(context);
+ } catch (Exception e) {
+ throw new ODataRuntimeException("Exception occurred", e);
+ }
+ }
+
+ public ODataExceptionWrapper(final UriInfo uriInfo, final HttpHeaders httpHeaders, final ServletConfig servletConfig, final HttpServletRequest servletRequest) {
+ contentType = getContentType(uriInfo, httpHeaders).toContentTypeString();
+ messageLocale = MessageService.getSupportedLocale(getLanguages(httpHeaders), DEFAULT_RESPONSE_LOCALE);
+ httpRequestHeaders = httpHeaders.getRequestHeaders();
+ requestUri = uriInfo.getRequestUri();
+ try {
+ callback = getErrorHandlerCallbackFromServletConfig(servletConfig, servletRequest);
+ } catch (Exception e) {
+ throw new ODataRuntimeException("Exception occurred", e);
+ }
+ }
+
+ public ODataResponse wrapInExceptionResponse(final Exception exception) {
+ try {
+ final Exception toHandleException = extractException(exception);
+ fillErrorContext(toHandleException);
+ if (toHandleException instanceof ODataApplicationException) {
+ enhanceContextWithApplicationException((ODataApplicationException) toHandleException);
+ } else if (toHandleException instanceof ODataMessageException) {
+ enhanceContextWithMessageException((ODataMessageException) toHandleException);
+ }
+
+ ODataResponse oDataResponse;
+ if (callback != null) {
+ oDataResponse = handleErrorCallback(callback);
+ } else {
+ oDataResponse = EntityProvider.writeErrorDocument(errorContext);
+ }
+ return oDataResponse;
+ } catch (Exception e) {
+ ODataResponse response = ODataResponse.entity("Exception during error handling occured!")
+ .contentHeader(ContentType.TEXT_PLAIN.toContentTypeString())
+ .status(HttpStatusCodes.INTERNAL_SERVER_ERROR).build();
+ return response;
+ }
+ }
+
+ private ODataResponse handleErrorCallback(final ODataErrorCallback callback) throws EntityProviderException {
+ ODataResponse oDataResponse;
+ try {
+ oDataResponse = callback.handleError(errorContext);
+ } catch (ODataApplicationException e) {
+ fillErrorContext(e);
+ enhanceContextWithApplicationException(e);
+ oDataResponse = new ProviderFacadeImpl().writeErrorDocument(errorContext);
+ }
+ return oDataResponse;
+ }
+
+ private void enhanceContextWithApplicationException(final ODataApplicationException toHandleException) {
+ errorContext.setHttpStatus(toHandleException.getHttpStatus());
+ errorContext.setErrorCode(toHandleException.getCode());
+ }
+
+ private void enhanceContextWithMessageException(final ODataMessageException toHandleException) {
+ errorContext.setErrorCode(toHandleException.getErrorCode());
+ MessageReference messageReference = toHandleException.getMessageReference();
+ Message localizedMessage = messageReference == null ? null : extractEntity(messageReference);
+ if (localizedMessage != null) {
+ errorContext.setMessage(localizedMessage.getText());
+ errorContext.setLocale(localizedMessage.getLocale());
+ }
+ if (toHandleException instanceof ODataHttpException) {
+ errorContext.setHttpStatus(((ODataHttpException) toHandleException).getHttpStatus());
+ } else if (toHandleException instanceof EntityProviderException) {
+ errorContext.setHttpStatus(HttpStatusCodes.BAD_REQUEST);
+ } else if (toHandleException instanceof BatchException) {
+ errorContext.setHttpStatus(HttpStatusCodes.BAD_REQUEST);
+ }
+
+ }
+
+ /**
+ * Fill current error context ({@link #errorContext}) with values from given {@link Exception} parameter.
+ *
+ * @param exception exception with values to be set on error context
+ */
+ private void fillErrorContext(final Exception exception) {
+ errorContext.setContentType(contentType);
+ errorContext.setException(exception);
+ errorContext.setHttpStatus(HttpStatusCodes.INTERNAL_SERVER_ERROR);
+ errorContext.setErrorCode(null);
+ errorContext.setMessage(exception.getMessage());
+ errorContext.setLocale(DEFAULT_RESPONSE_LOCALE);
+ errorContext.setRequestUri(requestUri);
+
+ if (httpRequestHeaders != null) {
+ for (Entry<String, List<String>> entry : httpRequestHeaders.entrySet()) {
+ errorContext.putRequestHeader(entry.getKey(), entry.getValue());
+ }
+ }
+ }
+
+ private Exception extractException(final Exception exception) {
+ if (exception instanceof ODataException) {
+ ODataException odataException = (ODataException) exception;
+ if (odataException.isCausedByApplicationException()) {
+ return odataException.getApplicationExceptionCause();
+ } else if (odataException.isCausedByHttpException()) {
+ return odataException.getHttpExceptionCause();
+ } else if (odataException.isCausedByMessageException()) {
+ return odataException.getMessageExceptionCause();
+ }
+ }
+ return exception;
+ }
+
+ private Message extractEntity(final MessageReference context) {
+ return MessageService.getMessage(messageLocale, context);
+ }
+
+ private List<Locale> getLanguages(final ODataContext context) {
+ try {
+ if (context.getAcceptableLanguages().isEmpty()) {
+ return Arrays.asList(DEFAULT_RESPONSE_LOCALE);
+ }
+ return context.getAcceptableLanguages();
+ } catch (WebApplicationException e) {
+ if (e.getCause() != null && e.getCause().getClass() == ParseException.class) {
+ // invalid accept-language string in http header
+ // compensate exception with using default locale
+ return Arrays.asList(DEFAULT_RESPONSE_LOCALE);
+ }
+ // not able to compensate exception -> re-throw
+ throw e;
+ }
+ }
+
+ private List<Locale> getLanguages(final HttpHeaders httpHeaders) {
+ try {
+ if (httpHeaders.getAcceptableLanguages().isEmpty()) {
+ return Arrays.asList(DEFAULT_RESPONSE_LOCALE);
+ }
+ return httpHeaders.getAcceptableLanguages();
+ } catch (WebApplicationException e) {
+ if (e.getCause() != null && e.getCause().getClass() == ParseException.class) {
+ // invalid accept-language string in http header
+ // compensate exception with using default locale
+ return Arrays.asList(DEFAULT_RESPONSE_LOCALE);
+ }
+ // not able to compensate exception -> re-throw
+ throw e;
+ }
+ }
+
+ private ContentType getContentType(final Map<String, String> queryParameters, final List<String> acceptHeaderContentTypes) {
+ ContentType contentType = getContentTypeByUriInfo(queryParameters);
+ if (contentType == null) {
+ contentType = getContentTypeByAcceptHeader(acceptHeaderContentTypes);
+ }
+ return contentType;
+ }
+
+ private ContentType getContentTypeByUriInfo(final Map<String, String> queryParameters) {
+ ContentType contentType = null;
+ if (queryParameters != null) {
+ if (queryParameters.containsKey(DOLLAR_FORMAT)) {
+ String contentTypeString = queryParameters.get(DOLLAR_FORMAT);
+ if (DOLLAR_FORMAT_JSON.equals(contentTypeString)) {
+ contentType = ContentType.APPLICATION_JSON;
+ } else {
+ //Any format mentioned in the $format parameter other than json results in an application/xml content type for error messages
+ //due to the OData V2 Specification
+ contentType = ContentType.APPLICATION_XML;
+ }
+ }
+ }
+ return contentType;
+ }
+
+ private ContentType getContentTypeByAcceptHeader(final List<String> acceptHeaderContentTypes) {
+ for (String acceptContentType : acceptHeaderContentTypes) {
+ if (ContentType.isParseable(acceptContentType)) {
+ ContentType convertedContentType = ContentType.create(acceptContentType);
+ if (convertedContentType.isWildcard()
+ || ContentType.APPLICATION_XML.equals(convertedContentType) || ContentType.APPLICATION_XML_CS_UTF_8.equals(convertedContentType)
+ || ContentType.APPLICATION_ATOM_XML.equals(convertedContentType) || ContentType.APPLICATION_ATOM_XML_CS_UTF_8.equals(convertedContentType)) {
+ return ContentType.APPLICATION_XML;
+ } else if (ContentType.APPLICATION_JSON.equals(convertedContentType) || ContentType.APPLICATION_JSON_CS_UTF_8.equals(convertedContentType)) {
+ return ContentType.APPLICATION_JSON;
+ }
+ }
+ }
+ return ContentType.APPLICATION_XML;
+ }
+
+ private ContentType getContentType(final UriInfo uriInfo, final HttpHeaders httpHeaders) {
+ ContentType contentType = getContentTypeByUriInfo(uriInfo);
+ if (contentType == null) {
+ contentType = getContentTypeByAcceptHeader(httpHeaders);
+ }
+ return contentType;
+ }
+
+ private ContentType getContentTypeByUriInfo(final UriInfo uriInfo) {
+ ContentType contentType = null;
+ if (uriInfo != null && uriInfo.getQueryParameters() != null) {
+ MultivaluedMap<String, String> queryParameters = uriInfo.getQueryParameters();
+ if (queryParameters.containsKey(DOLLAR_FORMAT)) {
+ String contentTypeString = queryParameters.getFirst(DOLLAR_FORMAT);
+ if (DOLLAR_FORMAT_JSON.equals(contentTypeString)) {
+ contentType = ContentType.APPLICATION_JSON;
+ } else {
+ //Any format mentioned in the $format parameter other than json results in an application/xml content type
+ //for error messages due to the OData V2 Specification.
+ contentType = ContentType.APPLICATION_XML;
+ }
+ }
+ }
+ return contentType;
+ }
+
+ private ContentType getContentTypeByAcceptHeader(final HttpHeaders httpHeaders) {
+ for (MediaType type : httpHeaders.getAcceptableMediaTypes()) {
+ if (ContentType.isParseable(type.toString())) {
+ ContentType convertedContentType = ContentType.create(type.toString());
+ if (convertedContentType.isWildcard()
+ || ContentType.APPLICATION_XML.equals(convertedContentType) || ContentType.APPLICATION_XML_CS_UTF_8.equals(convertedContentType)
+ || ContentType.APPLICATION_ATOM_XML.equals(convertedContentType) || ContentType.APPLICATION_ATOM_XML_CS_UTF_8.equals(convertedContentType)) {
+ return ContentType.APPLICATION_XML;
+ } else if (ContentType.APPLICATION_JSON.equals(convertedContentType) || ContentType.APPLICATION_JSON_CS_UTF_8.equals(convertedContentType)) {
+ return ContentType.APPLICATION_JSON;
+ }
+ }
+ }
+ return ContentType.APPLICATION_XML;
+ }
+
+ private ODataErrorCallback getErrorHandlerCallbackFromContext(final ODataContext context) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
+ ODataErrorCallback callback = null;
+ ODataServiceFactory serviceFactory = context.getServiceFactory();
+ callback = serviceFactory.getCallback(ODataErrorCallback.class);
+ return callback;
+ }
+
+ private ODataErrorCallback getErrorHandlerCallbackFromServletConfig(final ServletConfig servletConfig, final HttpServletRequest servletRequest) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+ ODataErrorCallback callback = null;
+ final String factoryClassName = servletConfig.getInitParameter(ODataServiceFactory.FACTORY_LABEL);
+ if (factoryClassName != null) {
+ ClassLoader cl = (ClassLoader) servletRequest.getAttribute(ODataServiceFactory.FACTORY_CLASSLOADER_LABEL);
+ Class<?> factoryClass;
+ if (cl == null) {
+ factoryClass = Class.forName(factoryClassName);
+ } else {
+ factoryClass = Class.forName(factoryClassName, true, cl);
+ }
+ final ODataServiceFactory serviceFactory = (ODataServiceFactory) factoryClass.newInstance();
+
+ callback = serviceFactory.getCallback(ODataErrorCallback.class);
+ }
+ return callback;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/ODataPathSegmentImpl.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/ODataPathSegmentImpl.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/ODataPathSegmentImpl.java
new file mode 100644
index 0000000..48948ac
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/core/ODataPathSegmentImpl.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.odata2.core;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.odata2.api.uri.PathSegment;
+
+/**
+ *
+ */
+public class ODataPathSegmentImpl implements PathSegment {
+
+ private String path;
+ private Map<String, List<String>> matrixParameter;
+
+ public ODataPathSegmentImpl(final String path, final Map<String, List<String>> matrixParameters) {
+ this.path = path;
+
+ Map<String, List<String>> unmodifiableMap = new HashMap<String, List<String>>();
+ if (matrixParameters != null) {
+ for (String key : matrixParameters.keySet()) {
+ List<String> values = Collections.unmodifiableList(matrixParameters.get(key));
+ unmodifiableMap.put(key, values);
+ }
+ }
+
+ matrixParameter = Collections.unmodifiableMap(unmodifiableMap);
+ }
+
+ @Override
+ public String getPath() {
+ return path;
+ }
+
+ @Override
+ public Map<String, List<String>> getMatrixParameters() {
+ return matrixParameter;
+ }
+
+}