├── NOTICE ├── src ├── etc │ └── header.txt ├── doc │ └── EnablingJPAModelsAsODataServicesV1.0_en.pdf ├── eclipse │ ├── eclipse-codetemplates.xml │ └── codetemplates.xml └── git │ └── hooks │ └── pre-commit ├── odata-core └── src │ ├── main │ ├── resources │ │ ├── i18n_en_US.properties │ │ ├── i18n_de_DE.properties │ │ └── i18n_de.properties │ └── java │ │ └── com │ │ └── sap │ │ └── core │ │ └── odata │ │ └── core │ │ ├── batch │ │ ├── BatchChangeSetImpl.java │ │ ├── BatchHelper.java │ │ └── BatchSingleResponseImpl.java │ │ ├── uri │ │ ├── SystemQueryOption.java │ │ └── expression │ │ │ ├── TokenizerRTException.java │ │ │ └── ActualBinaryOperator.java │ │ ├── rest │ │ ├── MERGE.java │ │ └── PATCH.java │ │ ├── servicedocument │ │ ├── TitleImpl.java │ │ └── AcceptImpl.java │ │ ├── debug │ │ └── DebugInfo.java │ │ ├── ep │ │ ├── feed │ │ │ ├── ODataFeedImpl.java │ │ │ └── FeedMetadataImpl.java │ │ └── aggregator │ │ │ └── NavigationPropertyInfo.java │ │ ├── exception │ │ └── ODataRuntimeException.java │ │ └── edm │ │ └── provider │ │ └── EdmComplexTypeImplProv.java │ └── test │ ├── java │ ├── META-INF │ │ └── MANIFEST.MF │ └── com │ │ └── sap │ │ └── core │ │ └── odata │ │ └── core │ │ ├── rt │ │ └── RuntimeDelegateTest.java │ │ ├── uri │ │ └── UriParserFacadeTest.java │ │ ├── edm │ │ └── provider │ │ │ └── EdmNamedImplProvTest.java │ │ └── ep │ │ └── producer │ │ └── TombstoneCallbackImpl.java │ └── resources │ ├── invalidSvcDocJson.txt │ ├── InvalidSvcDocJson2.txt │ ├── svcDocJson.txt │ ├── i18n_test_SAP.properties │ ├── JsonBuildingWithoutD │ ├── JsonTeam │ ├── JsonBuilding │ ├── JsonInvalidTeamDoubleNameProperty │ ├── invalidSvcExample.xml │ ├── svcDocWithoutTitle.xml │ ├── serviceDocument.xml │ ├── JsonTeamsWithoutD │ ├── JsonTeams │ ├── JsonTeamsWithCountWithoutD │ ├── JsonTeamsWithCount │ ├── JsonBuildingWithInlineRooms │ ├── JsonBuildingWithInlineRoomsAndNextLinkAndCount │ ├── batchWithPost.txt │ ├── svcAtomExample.xml │ ├── JsonEmployee │ ├── batchRequest.txt │ ├── JsonEmployeeWithInlineTeam │ └── batchResponse.txt ├── com.sap.core.odata.processor.api ├── src │ └── main │ │ └── java │ │ ├── META-INF │ │ └── MANIFEST.MF │ │ └── com │ │ └── sap │ │ └── core │ │ └── odata │ │ └── processor │ │ └── api │ │ └── jpa │ │ ├── access │ │ ├── package-info.java │ │ ├── JPAProcessorRegistry.java │ │ ├── JPAProcessorOperation.java │ │ ├── JPAProcessorExtension.java │ │ └── JPAMethodContextView.java │ │ ├── model │ │ ├── package-info.java │ │ └── mapping │ │ │ └── package-info.java │ │ ├── jpql │ │ └── package-info.java │ │ ├── exception │ │ └── package-info.java │ │ ├── factory │ │ └── package-info.java │ │ └── package-info.java └── .gitignore ├── com.sap.core.odata.api.annotation ├── src │ └── main │ │ └── java │ │ ├── META-INF │ │ └── MANIFEST.MF │ │ └── com │ │ └── sap │ │ └── core │ │ └── odata │ │ └── api │ │ └── annotation │ │ ├── edm │ │ ├── Documentation.java │ │ ├── Facets.java │ │ └── FunctionImport.java │ │ └── edmx │ │ └── HttpMethod.java └── .gitignore ├── com.sap.core.odata.processor.core ├── src │ ├── main │ │ └── java │ │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ │ └── com │ │ │ └── sap │ │ │ └── core │ │ │ └── odata │ │ │ └── processor │ │ │ └── core │ │ │ └── jpa │ │ │ └── model │ │ │ └── JPAEdmMappingImpl.java │ └── test │ │ └── java │ │ ├── META-INF │ │ └── MANIFEST.MF │ │ └── com │ │ └── sap │ │ └── core │ │ └── odata │ │ └── processor │ │ └── core │ │ └── jpa │ │ ├── common │ │ └── ODataJPATestConstants.java │ │ └── mock │ │ └── data │ │ ├── SalesOrderLineItem.java │ │ ├── SalesOrderLineItemKey.java │ │ └── SalesOrderHeader.java └── .gitignore ├── odata-ref └── src │ └── main │ ├── resources │ ├── female_6_BaySu.jpg │ ├── male_1_WinterW.jpg │ ├── male_2_FallF.jpg │ ├── male_3_SmithJo.jpg │ ├── male_4_BurkeP.jpg │ └── male_5_FieldJ.jpg │ └── java │ └── com │ └── sap │ └── core │ └── odata │ └── ref │ └── model │ ├── ModelException.java │ ├── Manager.java │ ├── City.java │ └── Location.java ├── odata-api └── src │ └── main │ └── java │ └── com │ └── sap │ └── core │ └── odata │ └── api │ ├── processor │ ├── part │ │ ├── package-info.java │ │ ├── MetadataProcessor.java │ │ ├── ServiceDocumentProcessor.java │ │ ├── FunctionImportProcessor.java │ │ └── FunctionImportValueProcessor.java │ ├── feature │ │ ├── package-info.java │ │ └── ODataProcessorFeature.java │ ├── package-info.java │ └── ODataProcessor.java │ ├── commons │ ├── package-info.java │ ├── InlineCount.java │ ├── ODataHttpMethod.java │ └── ODataHttpHeaders.java │ ├── rt │ └── package-info.java │ ├── ep │ ├── feed │ │ ├── package-info.java │ │ ├── FeedMetadata.java │ │ └── ODataFeed.java │ ├── entry │ │ ├── package-info.java │ │ ├── MediaMetadata.java │ │ └── EntryMetadata.java │ ├── callback │ │ ├── package-info.java │ │ ├── WriteEntryCallbackContext.java │ │ ├── WriteFeedCallbackContext.java │ │ └── OnWriteFeedContent.java │ └── package-info.java │ ├── uri │ ├── info │ │ ├── package-info.java │ │ ├── GetMetadataUriInfo.java │ │ └── GetServiceDocumentUriInfo.java │ ├── expression │ │ ├── package-info.java │ │ ├── FilterExpression.java │ │ ├── LiteralExpression.java │ │ └── SortOrder.java │ ├── package-info.java │ ├── NavigationPropertySegment.java │ ├── KeyPredicate.java │ ├── SelectItem.java │ └── PathInfo.java │ ├── client │ └── batch │ │ ├── BatchPart.java │ │ ├── BatchChangeSet.java │ │ └── BatchSingleResponse.java │ ├── edm │ ├── package-info.java │ ├── EdmLiteralKind.java │ ├── EdmTypeKind.java │ ├── EdmAction.java │ ├── EdmNamed.java │ ├── provider │ │ ├── EdmProviderAccessor.java │ │ └── EdmProviderFactory.java │ ├── EdmContentKind.java │ ├── EdmConcurrencyMode.java │ ├── EdmParameter.java │ ├── EdmComplexType.java │ ├── EdmMappable.java │ ├── EdmAnnotatable.java │ ├── EdmAssociation.java │ ├── EdmType.java │ ├── EdmElement.java │ ├── EdmAssociationSetEnd.java │ ├── EdmMapping.java │ ├── EdmTyped.java │ ├── EdmAssociationEnd.java │ ├── EdmAnnotationAttribute.java │ ├── EdmProperty.java │ ├── EdmAssociationSet.java │ ├── EdmEntitySetInfo.java │ └── EdmNavigationProperty.java │ ├── ODataCallback.java │ ├── servicedocument │ ├── Fixed.java │ ├── ServiceDocumentParser.java │ ├── Title.java │ ├── ServiceDocumentParserException.java │ ├── Accept.java │ ├── CommonAttributes.java │ ├── Category.java │ ├── ServiceDocument.java │ ├── ExtensionAttribute.java │ ├── AtomInfo.java │ └── Workspace.java │ ├── ODataDebugCallback.java │ └── batch │ └── BatchRequestPart.java ├── odata-fit └── src │ └── test │ ├── resources │ ├── i18n.properties │ ├── i18n_it.properties │ ├── simple.batch │ ├── error.batch │ ├── changeset.batch │ └── batchWithContentId.batch │ └── java │ └── com │ └── sap │ └── core │ └── odata │ └── fit │ ├── ref │ └── AbstractRefJsonTest.java │ └── mapping │ └── MapFactory.java ├── .gitignore ├── .reuse └── dep5 ├── odata-web └── src │ └── main │ ├── version │ └── version.html │ ├── resources │ └── log4j.xml │ └── webapp │ └── WEB-INF │ └── web.xml └── odata-testutil └── src └── main ├── resources └── log4j.xml └── java └── com └── sap └── core └── odata └── testutil ├── server └── ServerRuntimeException.java ├── fit └── Log4JConfigurationTest.java ├── TestUtilRuntimeException.java ├── helper ├── HttpMerge.java └── HttpSomethingUnsupported.java └── mock └── TecEdmInfo.java /NOTICE: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/etc/header.txt: -------------------------------------------------------------------------------- 1 | (c) 2013 by SAP AG -------------------------------------------------------------------------------- /odata-core/src/main/resources/i18n_en_US.properties: -------------------------------------------------------------------------------- 1 | # English translations 2 | # 3 | -------------------------------------------------------------------------------- /odata-core/src/test/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /com.sap.core.odata.processor.api/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /com.sap.core.odata.api.annotation/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /com.sap.core.odata.processor.core/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /com.sap.core.odata.processor.core/src/test/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /com.sap.core.odata.processor.api/.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | .classpath 3 | .settings 4 | target 5 | bin 6 | *.bak 7 | classes 8 | .DS_Store -------------------------------------------------------------------------------- /com.sap.core.odata.processor.core/.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | .classpath 3 | .settings 4 | target 5 | bin 6 | *.bak 7 | classes 8 | .DS_Store -------------------------------------------------------------------------------- /odata-core/src/test/resources/invalidSvcDocJson.txt: -------------------------------------------------------------------------------- 1 | {"d":{"EntitySets":"Employees","Teams","Rooms","Managers","Buildings","Container2.Photos"]}} -------------------------------------------------------------------------------- /odata-core/src/test/resources/InvalidSvcDocJson2.txt: -------------------------------------------------------------------------------- 1 | {"d":{"EntitySets":["Employees","Teams","Rooms","Managers","Buildings","Container2.Photos"]}}} -------------------------------------------------------------------------------- /com.sap.core.odata.api.annotation/.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | .classpath 3 | .settings 4 | target 5 | bin 6 | *.bak 7 | classes 8 | .DS_Store 9 | -------------------------------------------------------------------------------- /odata-core/src/test/resources/svcDocJson.txt: -------------------------------------------------------------------------------- 1 | {"d":{"EntitySets":["Container.Nr1.Employees","Teams","Rooms","Managers","Buildings","Container2.Photos"]}} -------------------------------------------------------------------------------- /odata-ref/src/main/resources/female_6_BaySu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-archive/cloud-odata-java/HEAD/odata-ref/src/main/resources/female_6_BaySu.jpg -------------------------------------------------------------------------------- /odata-ref/src/main/resources/male_1_WinterW.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-archive/cloud-odata-java/HEAD/odata-ref/src/main/resources/male_1_WinterW.jpg -------------------------------------------------------------------------------- /odata-ref/src/main/resources/male_2_FallF.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-archive/cloud-odata-java/HEAD/odata-ref/src/main/resources/male_2_FallF.jpg -------------------------------------------------------------------------------- /odata-ref/src/main/resources/male_3_SmithJo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-archive/cloud-odata-java/HEAD/odata-ref/src/main/resources/male_3_SmithJo.jpg -------------------------------------------------------------------------------- /odata-ref/src/main/resources/male_4_BurkeP.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-archive/cloud-odata-java/HEAD/odata-ref/src/main/resources/male_4_BurkeP.jpg -------------------------------------------------------------------------------- /odata-ref/src/main/resources/male_5_FieldJ.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-archive/cloud-odata-java/HEAD/odata-ref/src/main/resources/male_5_FieldJ.jpg -------------------------------------------------------------------------------- /odata-core/src/main/resources/i18n_de_DE.properties: -------------------------------------------------------------------------------- 1 | # German translations 2 | # 3 | com.sap.core.odata.api.exception.ODataMessageException.COMMON=Allgemeiner Fehler -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/processor/part/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Processor Parts
3 | */ 4 | package com.sap.core.odata.api.processor.part; -------------------------------------------------------------------------------- /src/doc/EnablingJPAModelsAsODataServicesV1.0_en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-archive/cloud-odata-java/HEAD/src/doc/EnablingJPAModelsAsODataServicesV1.0_en.pdf -------------------------------------------------------------------------------- /odata-fit/src/test/resources/i18n.properties: -------------------------------------------------------------------------------- 1 | # Language Negotiation Test 2 | # 3 | 4 | com.sap.core.odata.fit.basic.LanguageNegotiationTest$MyException.TEST=fallbackLanguage -------------------------------------------------------------------------------- /odata-fit/src/test/resources/i18n_it.properties: -------------------------------------------------------------------------------- 1 | # Language Negotiation Test 2 | # 3 | 4 | com.sap.core.odata.fit.basic.LanguageNegotiationTest$MyException.TEST=itLanguage 5 | -------------------------------------------------------------------------------- /odata-fit/src/test/resources/simple.batch: -------------------------------------------------------------------------------- 1 | --batch_123 2 | Content-Type: application/http 3 | Content-Transfer-Encoding:binary 4 | 5 | GET $metadata HTTP/1.1 6 | 7 | 8 | --batch_123-- -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .pmd 2 | .project 3 | .classpath 4 | .settings 5 | target 6 | bin 7 | *.bak 8 | classes 9 | .DS_Store 10 | nwcloud.properties 11 | performanceTestTool.properties 12 | -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/commons/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The commons package contains constants used in the HTTP and OData protocol. 3 | */ 4 | package com.sap.core.odata.api.commons; -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/rt/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Runtime Support
3 | * 4 | * Provides a mechanism for loading of implementation classes for interfaces. 5 | */ 6 | package com.sap.core.odata.api.rt; -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/processor/feature/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Processor Features
3 | * 4 | * Optional feature interfaces. Can be implemented by custom data processors. 5 | */ 6 | package com.sap.core.odata.api.processor.feature; -------------------------------------------------------------------------------- /odata-core/src/main/resources/i18n_de.properties: -------------------------------------------------------------------------------- 1 | # German translations 2 | # 3 | com.sap.core.odata.api.exception.ODataMessageException.COMMON=Allgemeiner Fehler 4 | 5 | com.sap.core.odata.api.exception.ODataNotFoundException.ENTITY=Die angefragte Entit\u00e4t wurde nicht gefunden. -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/ep/feed/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Entity Provider Feed
3 | * 4 | * The com.sap.core.odata.api.ep.feed package contains all classes related and necessary for an {@link com.sap.core.odata.api.ep.feed.ODataFeed}. 5 | *
6 | */ 7 | package com.sap.core.odata.api.ep.feed; -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/ep/entry/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Entity Provider Entries
3 | * 4 | * The com.sap.core.odata.api.ep.entry package contains all classes related and necessary for an {@link com.sap.core.odata.api.ep.entry.ODataEntry}. 5 | *
6 | */ 7 | package com.sap.core.odata.api.ep.entry; -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/uri/info/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | *
URI Parser Result Views
3 | *The interfaces of this package provide access to the relevant parts of the parsed 4 | * request URI for the methods that process a request inside the dispatcher.
5 | */ 6 | package com.sap.core.odata.api.uri.info; -------------------------------------------------------------------------------- /src/eclipse/eclipse-codetemplates.xml: -------------------------------------------------------------------------------- 1 | 2 | BatchPartRequest represents a distinct part of a Batch Request body. It can be a ChangeSet or Query Operation.
6 | *
7 | * @author SAP AG
8 | *
9 | */
10 | public interface BatchPart {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/odata-core/src/test/resources/i18n_test_SAP.properties:
--------------------------------------------------------------------------------
1 | # English translations
2 | #
3 | # TEST
4 | #
5 | com.sap.core.odata.api.exception.ODataMessageException.COMMON=Common exception
6 | com.sap.core.odata.api.exception.ODataMessageException.ONE_REPLACEMENTS=Only replacement is [%1$s]!
7 | com.sap.core.odata.api.exception.ODataMessageException.TWO_REPLACEMENTS=First was [%1$s] and second was [%2$s]!
--------------------------------------------------------------------------------
/src/eclipse/codetemplates.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
| name | ${name} |
| version | ${version} |
| timestamp | ${timestamp} |
| basedir | ${basedir} |
| project.build.finalName | ${project.build.finalName} |
| build server | ${env.HOSTNAME} |
| user | ${env.USER} |
This package contains all classes necessary to decribe an expression tree(e.g. a filter or order by tree) 4 | * 5 | *
Trees can be traversed by implementing the {@link com.sap.core.odata.api.uri.expression.ExpressionVisitor} interface and calling the accept() method.
6 | *
Different types of expressions can be found in {@link com.sap.core.odata.api.uri.expression.ExpressionKind}.
7 | */
8 | package com.sap.core.odata.api.uri.expression;
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/edm/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
The Entity Data Model is described in the OData protocol specification 4 | * as well as in the Conceptual Schema Definition for the OData Protocol. 5 | * Both can be found at http://www.odata.org/.
6 | *Many classes and interfaces contain the pragma:" @com.sap.core.odata.DoNotImplement " 7 | * to indicate these classes should only be used and not implemented.
8 | */ 9 | package com.sap.core.odata.api.edm; -------------------------------------------------------------------------------- /odata-core/src/test/resources/JsonInvalidTeamDoubleNameProperty: -------------------------------------------------------------------------------- 1 | { 2 | "d" : { 3 | "__metadata" : { 4 | "id" : "http://localhost:8080/ReferenceScenario.svc/Teams('1')", 5 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('1')", 6 | "type" : "RefScenario.Team" 7 | }, 8 | "Id" : "1", 9 | "Name" : "Team 1", 10 | "Name" : "Wrong TeamName", 11 | "isScrumTeam" : false, 12 | "nt_Employees" : { 13 | "__deferred" : { 14 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('1')/nt_Employees" 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /com.sap.core.odata.processor.api/src/main/java/com/sap/core/odata/processor/api/jpa/model/mapping/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | *URI Parser Facade
3 | *The URI package has one central class {@link com.sap.core.odata.api.uri.UriParser} to parse a request URI
4 | * as well as several interfaces that provide access to parsed parts of the URI.
5 | *
The {@link com.sap.core.odata.api.uri.UriParser} class also provides the possibility to parse a filter or an orderBy Statement. Both are specified in the OData Protocol Specification.
6 | *
The URI syntax is specified in the OData Protocol Specification in the form of an ABNF.
3 | * These callbacks will be used to support the $expand query option. Callbacks have to implement the {@link com.sap.core.odata.api.ODataCallback} as a marker.
4 | *
To support an expanded entry the {@link com.sap.core.odata.api.ep.callback.OnWriteEntryContent} interface has to be implemented.
5 | *
To support an expanded feed the {@link com.sap.core.odata.api.ep.callback.OnWriteFeedContent} interface has to be implemented.
6 | *
7 | *
All callbacks are registered for a navigation property in a HashMap See Also:{@link com.sap.core.odata.processor.api.jpa.ODataJPAServiceFactory}
3 | *
4 | * The com.sap.core.odata.api.ep package contains all classes related and necessary to provide an {@link com.sap.core.odata.api.ep.EntityProvider}.
5 | *
6 | * An {@link com.sap.core.odata.api.ep.EntityProvider} provides all necessary read and write methods for accessing
7 | * the entities defined in an
11 | * For support of additional formats it is recommended to handle those directly within an implementation of a
12 | * Fixed indicates whether the list of categories is a fixed or an open set
21 | * Fixed can either be yes or no
22 | * @author SAP AG
23 | */
24 | public enum Fixed {
25 | YES, NO;
26 | }
27 |
--------------------------------------------------------------------------------
/odata-core/src/test/resources/JsonBuildingWithInlineRooms:
--------------------------------------------------------------------------------
1 | {
2 | "d" : {
3 | "__metadata" : {
4 | "id" : "http://localhost:8080/ReferenceScenario.svc/Buildings('1')",
5 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Buildings('1')",
6 | "type" : "RefScenario.Building"
7 | },
8 | "Id" : "1",
9 | "Name" : "Building 1",
10 | "Image" : null,
11 | "nb_Rooms" : {
12 | "results" : [{
13 | "__metadata" : {
14 | "id" : "http://localhost:8080/ReferenceScenario.svc/Rooms('1')",
15 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Rooms('1')",
16 | "type" : "RefScenario.Room",
17 | "etag" : "W/\"1\""
18 | },
19 | "Id" : "1",
20 | "Name" : "Room 1",
21 | "Seats" : 1,
22 | "Version" : 1,
23 | "nr_Employees" : {
24 | "__deferred" : {
25 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Rooms('1')/nr_Employees"
26 | }
27 | },
28 | "nr_Building" : {
29 | "__deferred" : {
30 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Rooms('1')/nr_Building"
31 | }
32 | }
33 | }
34 | ]
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/commons/ODataHttpHeaders.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.commons;
17 |
18 | /**
19 | * HTTP header constants as used in the OData protocol
20 | * @author SAP AG
21 | */
22 | public class ODataHttpHeaders {
23 |
24 | public static final String DATASERVICEVERSION = "DataServiceVersion";
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/edm/EdmTypeKind.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.edm;
17 |
18 | /**
19 | * @com.sap.core.odata.DoNotImplement
20 | * EdmTypeKind specifies the type of an EDM element.
21 | * @author SAP AG
22 | */
23 | public enum EdmTypeKind {
24 |
25 | UNDEFINED, SIMPLE, COMPLEX, ENTITY, NAVIGATION, ASSOCIATION, SYSTEM;
26 | }
27 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/servicedocument/ServiceDocumentParser.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.servicedocument;
17 |
18 | import java.io.InputStream;
19 |
20 | /**
21 | * @author SAP AG
22 | */
23 | public interface ServiceDocumentParser {
24 | public ServiceDocument parseXml(InputStream in) throws ServiceDocumentParserException;
25 | }
26 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/servicedocument/Title.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.servicedocument;
17 |
18 | /**
19 | * A Title element
20 | * Title element gives a human-readable title
21 | * @author SAP AG
22 | */
23 | public interface Title {
24 | /**
25 | * @return text as String
26 | */
27 | public String getText();
28 | }
29 |
--------------------------------------------------------------------------------
/odata-fit/src/test/resources/changeset.batch:
--------------------------------------------------------------------------------
1 | --batch_123
2 | Content-Type: application/http
3 | Content-Transfer-Encoding: binary
4 |
5 | GET Employees('2')/EmployeeName HTTP/1.1
6 | Accept: application/atomsvc+xml;q=0.8, application/json;odata=verbose;q=0.5, */*;q=0.1
7 | MaxDataServiceVersion: 2.0
8 |
9 |
10 | --batch_123
11 | Content-Type: multipart/mixed; boundary=changeset_105a-d600-0156
12 |
13 | --changeset_105a-d600-0156
14 | Content-Type: application/http
15 | Content-Transfer-Encoding: binary
16 |
17 | PUT Employees('2')/EmployeeName HTTP/1.1
18 | Content-Length: 100000
19 | Accept: application/atomsvc+xml;q=0.8, application/json;odata=verbose;q=0.5, */*;q=0.1
20 | DataServiceVersion: 1.0
21 | Content-Type: application/json;odata=verbose
22 | MaxDataServiceVersion: 2.0
23 |
24 | {"EmployeeName":"Frederic Fall MODIFIED"}
25 |
26 | --changeset_105a-d600-0156--
27 |
28 | --batch_123
29 | Content-Type: application/http
30 | Content-Transfer-Encoding: binary
31 |
32 | GET Employees('2')/EmployeeName HTTP/1.1
33 | Accept: application/atomsvc+xml;q=0.8, application/json;odata=verbose;q=0.5, */*;q=0.1
34 | MaxDataServiceVersion: 2.0
35 |
36 |
37 | --batch_123--
--------------------------------------------------------------------------------
/odata-ref/src/main/java/com/sap/core/odata/ref/model/ModelException.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.ref.model;
17 |
18 | /**
19 | * @author SAP AG
20 | */
21 | public class ModelException extends RuntimeException {
22 |
23 | private static final long serialVersionUID = 1L;
24 |
25 | public ModelException(final Exception e) {
26 | super(e);
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/odata-core/src/main/java/com/sap/core/odata/core/batch/BatchHelper.java:
--------------------------------------------------------------------------------
1 | package com.sap.core.odata.core.batch;
2 |
3 | import java.io.UnsupportedEncodingException;
4 | import java.util.UUID;
5 |
6 | import com.sap.core.odata.core.exception.ODataRuntimeException;
7 |
8 | public class BatchHelper {
9 |
10 | public static final String BINARY_ENCODING = "binary";
11 |
12 | public static final String DEFAULT_ENCODING = "utf-8";
13 |
14 | public static final String HTTP_CONTENT_TRANSFER_ENCODING = "Content-Transfer-Encoding";
15 |
16 | public static final String HTTP_CONTENT_ID = "Content-Id";
17 |
18 | public static final String MIME_HEADER_CONTENT_ID = "MimeHeader-ContentId";
19 |
20 | public static final String REQUEST_HEADER_CONTENT_ID = "RequestHeader-ContentId";
21 |
22 | protected static String generateBoundary(final String value) {
23 | return value + "_" + UUID.randomUUID().toString();
24 | }
25 |
26 | protected static byte[] getBytes(final String body) {
27 | try {
28 | return body.getBytes(DEFAULT_ENCODING);
29 | } catch (UnsupportedEncodingException e) {
30 | throw new ODataRuntimeException(e);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/odata-testutil/src/main/java/com/sap/core/odata/testutil/server/ServerRuntimeException.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.testutil.server;
17 |
18 | /**
19 | * @author SAP AG
20 | */
21 | public class ServerRuntimeException extends RuntimeException {
22 |
23 | public ServerRuntimeException(final Exception e) {
24 | super(e);
25 | }
26 |
27 | private static final long serialVersionUID = 1L;
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/odata-core/src/test/resources/JsonBuildingWithInlineRoomsAndNextLinkAndCount:
--------------------------------------------------------------------------------
1 | {
2 | "d" : {
3 | "__metadata" : {
4 | "id" : "http://localhost:8080/ReferenceScenario.svc/Buildings('1')",
5 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Buildings('1')",
6 | "type" : "RefScenario.Building"
7 | },
8 | "Id" : "1",
9 | "Name" : "Building 1",
10 | "Image" : null,
11 | "nb_Rooms" : {
12 | "__count" : "1",
13 | "results" : [{
14 | "__metadata" : {
15 | "id" : "http://localhost:8080/ReferenceScenario.svc/Rooms('1')",
16 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Rooms('1')",
17 | "type" : "RefScenario.Room",
18 | "etag" : "W/\"1\""
19 | },
20 | "Id" : "1",
21 | "Name" : "Room 1",
22 | "Seats" : 1,
23 | "Version" : 1,
24 | "nr_Employees" : {
25 | "__deferred" : {
26 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Rooms('1')/nr_Employees"
27 | }
28 | },
29 | "nr_Building" : {
30 | "__deferred" : {
31 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Rooms('1')/nr_Building"
32 | }
33 | }
34 | }
35 | ],
36 | "__next" : "nextLink"
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/edm/EdmAction.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.edm;
17 |
18 | /**
19 | * @com.sap.core.odata.DoNotImplement
20 | * A CSDL Action Element
21 | * EdmAction can either be Cascade or None. Cascade implies that a delete operation on an entity also should delete the relationship instances.
22 | * @author SAP AG
23 | */
24 | public enum EdmAction {
25 |
26 | Cascade, None;
27 | }
28 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/edm/EdmNamed.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.edm;
17 |
18 | /**
19 | * @com.sap.core.odata.DoNotImplement
20 | * EdmName is the base interface for nearly all CSDL constructs.
21 | * @author SAP AG
22 | */
23 | public interface EdmNamed {
24 |
25 | /**
26 | * @return name as String
27 | * @throws EdmException
28 | */
29 | String getName() throws EdmException;
30 | }
31 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/servicedocument/ServiceDocumentParserException.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.servicedocument;
17 |
18 | /**
19 | * @author SAP AG
20 | */
21 | public class ServiceDocumentParserException extends Exception {
22 |
23 | private static final long serialVersionUID = 1L;
24 |
25 | public ServiceDocumentParserException(final String message) {
26 | super(message);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/edm/provider/EdmProviderAccessor.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.edm.provider;
17 |
18 | /**
19 | * This interface can be used to access the {@link EdmProvider} within an application.
20 | * @author SAP AG
21 | *
22 | */
23 | public interface EdmProviderAccessor {
24 |
25 | /**
26 | * @return {@link EdmProvider} of this service
27 | */
28 | public EdmProvider getEdmProvider();
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/odata-core/src/main/java/com/sap/core/odata/core/rest/MERGE.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.core.rest;
17 |
18 | import java.lang.annotation.ElementType;
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 |
23 | import javax.ws.rs.HttpMethod;
24 |
25 | @Target(ElementType.METHOD)
26 | @Retention(RetentionPolicy.RUNTIME)
27 | @HttpMethod("MERGE")
28 | public @interface MERGE {}
29 |
--------------------------------------------------------------------------------
/odata-core/src/main/java/com/sap/core/odata/core/rest/PATCH.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.core.rest;
17 |
18 | import java.lang.annotation.ElementType;
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 |
23 | import javax.ws.rs.HttpMethod;
24 |
25 | @Target(ElementType.METHOD)
26 | @Retention(RetentionPolicy.RUNTIME)
27 | @HttpMethod("PATCH")
28 | public @interface PATCH {}
29 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/processor/feature/ODataProcessorFeature.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.processor.feature;
17 |
18 | /**
19 | * Marker interface for data processor features. A feature is like a call back where
20 | * the OData library can request additional information from the processor to change
21 | * control over request handling.
22 | *
23 | * @author SAP AG
24 | */
25 | public interface ODataProcessorFeature {
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/edm/EdmContentKind.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.edm;
17 |
18 | /**
19 | * @com.sap.core.odata.DoNotImplement
20 | * EdmContentType is used for Feed Customization.
21 | * It specifies the content type of the value of the property being mapped via a customizable feed mapping.
22 | * This value can be "text", "html" or "xhtml".
23 | * @author SAP AG
24 | */
25 | public enum EdmContentKind {
26 |
27 | text, html, xhtml;
28 | }
29 |
--------------------------------------------------------------------------------
/odata-testutil/src/main/java/com/sap/core/odata/testutil/fit/Log4JConfigurationTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.testutil.fit;
17 |
18 | import static org.junit.Assert.assertNotNull;
19 |
20 | import java.net.URL;
21 |
22 | import org.junit.Test;
23 |
24 | public class Log4JConfigurationTest {
25 |
26 | @Test
27 | public void testConfiguration() {
28 | final URL url = Log4JConfigurationTest.class.getResource("/log4j.xml");
29 | assertNotNull(url);
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/ep/callback/WriteEntryCallbackContext.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.ep.callback;
17 |
18 | /**
19 | * Context given if the target of an expand is an entry. It contains the source entity set, the navigation property pointing to the entry which has to be expanded, the current expand select tree node and the data of the source entry.
20 | * @author SAP AG
21 | *
22 | */
23 | public class WriteEntryCallbackContext extends WriteCallbackContext {}
24 |
--------------------------------------------------------------------------------
/odata-core/src/main/java/com/sap/core/odata/core/uri/expression/TokenizerRTException.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.core.uri.expression;
17 |
18 | /**
19 | * Internal error. If used(thrown) the thrower
20 | * @author SAP AG
21 | */
22 | public class TokenizerRTException extends Exception {
23 |
24 | /**
25 | *
26 | */
27 | private static final long serialVersionUID = 1L;
28 |
29 | /**
30 | *
31 | */
32 | public TokenizerRTException() {
33 | super();
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/edm/EdmConcurrencyMode.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.edm;
17 |
18 | /**
19 | * @com.sap.core.odata.DoNotImplement
20 | * EdmConcurrencyMode can be applied to any primitive Entity Data Model (EDM) type.
21 | * Possible values are "None", which is the default, and "Fixed". Fixed implies that the property should be used for optimistic concurrency checks.
22 | * @author SAP AG
23 | */
24 | public enum EdmConcurrencyMode {
25 |
26 | None, Fixed;
27 | }
28 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/edm/EdmParameter.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.edm;
17 |
18 | /**
19 | * @com.sap.core.odata.DoNotImplement
20 | * A CSDL FunctionImportParameter element
21 | * EdmParameter defines a function import parameter (which is used as input parameter). FunctionImports are described in {@link com.sap.core.odata.api.edm.provider.FunctionImport} or in the OData protocol.
22 | * @author SAP AG
23 | */
24 | public interface EdmParameter extends EdmElement {
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/odata-core/src/main/java/com/sap/core/odata/core/servicedocument/TitleImpl.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.core.servicedocument;
17 |
18 | import com.sap.core.odata.api.servicedocument.Title;
19 |
20 | /**
21 | * @author SAP AG
22 | */
23 | public class TitleImpl implements Title {
24 | private String text;
25 |
26 | @Override
27 | public String getText() {
28 | return text;
29 | }
30 |
31 | public TitleImpl setText(final String text) {
32 | this.text = text;
33 | return this;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/odata-core/src/test/resources/batchWithPost.txt:
--------------------------------------------------------------------------------
1 | --batch_8194-cf13-1f56
2 | Content-Type: application/http
3 | Content-Transfer-Encoding: binary
4 |
5 | GET http://localhost/odata/Employees('2')/EmployeeName?$format=json HTTP/1.1
6 | Accept: application/atomsvc+xml;q=0.8, application/json;odata=verbose;q=0.5, */*;q=0.1
7 | Accept-Language:en-US,en;q=0.7,en-UK;q=0.9
8 | MaxDataServiceVersion: 2.0
9 |
10 |
11 | --batch_8194-cf13-1f56
12 | Content-Type: multipart/mixed; boundary=changeset_f980-1cb6-94dd
13 |
14 | --changeset_f980-1cb6-94dd
15 | Content-Type: application/http
16 | Content-Transfer-Encoding: binary
17 |
18 | PUT Employees('2')/EmployeeName HTTP/1.1
19 | Content-Length: 100000
20 | Accept: application/atomsvc+xml;q=0.8, application/json;odata=verbose;q=0.5, */*;q=0.1
21 | DataServiceVersion: 1.0
22 | Content-Type: application/json;odata=verbose
23 | MaxDataServiceVersion: 2.0
24 |
25 | {"EmployeeName":"Frederic Fall MODIFIED"}
26 |
27 | --changeset_f980-1cb6-94dd--
28 |
29 | --batch_8194-cf13-1f56
30 | Content-Type: application/http
31 | Content-Transfer-Encoding: binary
32 |
33 | GET Employees('2')/EmployeeName?$format=json HTTP/1.1
34 | Accept: application/atomsvc+xml;q=0.8, application/json;odata=verbose;q=0.5, */*;q=0.1
35 | MaxDataServiceVersion: 2.0
36 |
37 |
38 | --batch_8194-cf13-1f56--
39 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/edm/EdmComplexType.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.edm;
17 |
18 | /**
19 | * A CSDL ComplexType element. EdmComplexType holds a set of related information like {@link EdmSimpleType}
21 | * properties and EdmComplexType properties.
22 | * @author SAP AG
23 | * @com.sap.core.odata.DoNotImplement
24 | */
25 | public interface EdmComplexType extends EdmStructuralType {
26 |
27 | @Override
28 | EdmComplexType getBaseType() throws EdmException;
29 | }
30 |
--------------------------------------------------------------------------------
/odata-core/src/test/java/com/sap/core/odata/core/rt/RuntimeDelegateTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.core.rt;
17 |
18 | import static org.junit.Assert.assertNotNull;
19 |
20 | import org.junit.Test;
21 |
22 | import com.sap.core.odata.api.rt.RuntimeDelegate;
23 | import com.sap.core.odata.testutil.fit.BaseTest;
24 |
25 | public class RuntimeDelegateTest extends BaseTest {
26 |
27 | @Test
28 | public void testInstance() {
29 | assertNotNull(RuntimeDelegate.createODataResponseBuilder());
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/odata-ref/src/main/java/com/sap/core/odata/ref/model/Manager.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.ref.model;
17 |
18 | import java.util.ArrayList;
19 | import java.util.List;
20 |
21 | /**
22 | * @author SAP AG
23 | */
24 | public class Manager extends Employee {
25 |
26 | private List BatchChangeSet represents a Change Set, that consists of change requests
10 | *
11 | * @author SAP AG
12 | */
13 | public abstract class BatchChangeSet implements BatchPart {
14 |
15 | /**
16 | * Add a new change request to the ChangeSet
17 | * @param BatchChangeSetPart {@link BatchChangeSetPart}
18 | */
19 | public abstract void add(BatchChangeSetPart request);
20 |
21 | /**
22 | * Get change requests
23 | * @return a list of {@link BatchChangeSetPart}
24 | */
25 | public abstract List BatchSingleResponse represents a single response of a Batch Response body. It can be a response to a change request of ChangeSet or a response to a retrieve request
9 | * @author SAP AG
10 | */
11 | public interface BatchSingleResponse {
12 | /**
13 | * @return a result code of the attempt to understand and satisfy the request
14 | */
15 | public String getStatusCode();
16 |
17 | /**
18 | * @return a short textual description of the status code
19 | */
20 | public String getStatusInfo();
21 |
22 | /**
23 | * @return a value of the Content-Id header
24 | */
25 | public String getContentId();
26 |
27 | /**
28 | * @return a body part of a response message
29 | */
30 | public String getBody();
31 |
32 | /**
33 | * @return all available headers
34 | */
35 | public Map EdmAssociation defines the relationship of two entity types.
23 | * @author SAP AG
24 | */
25 | public interface EdmAssociation extends EdmType {
26 |
27 | /**
28 | * Get the {@link EdmAssociationEnd} by role
29 | * @param role
30 | * @return {@link EdmAssociationEnd}
31 | * @throws EdmException
32 | */
33 | EdmAssociationEnd getEnd(String role) throws EdmException;
34 | }
35 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/servicedocument/Accept.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.servicedocument;
17 |
18 | /**
19 | * An Accept element
20 | * Accept element indicates the types of representation accepted by the Collection
21 | * @author SAP AG
22 | */
23 | public interface Accept {
24 |
25 | /**
26 | * Get the media range
27 | *
28 | * @return value as String
29 | */
30 | public String getValue();
31 |
32 | /**
33 | * Get common attributes
34 | *
35 | * @return {@link CommonAttributes}
36 | */
37 | public CommonAttributes getCommonAttributes();
38 | }
39 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/edm/EdmType.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.edm;
17 |
18 | /**
19 | * @com.sap.core.odata.DoNotImplement
20 | * EdmType holds the namespace of a given type and its type as {@link EdmTypeKind}.
21 | * @author SAP AG
22 | */
23 | public interface EdmType extends EdmNamed {
24 |
25 | /**
26 | * Namespace of this {@link EdmType}
27 | * @return namespace as String
28 | * @throws EdmException
29 | */
30 | String getNamespace() throws EdmException;
31 |
32 | /**
33 | * @return {@link EdmTypeKind} of this {@link EdmType}
34 | */
35 | EdmTypeKind getKind();
36 | }
37 |
--------------------------------------------------------------------------------
/com.sap.core.odata.api.annotation/src/main/java/com/sap/core/odata/api/annotation/edm/Facets.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.annotation.edm;
17 |
18 | import java.lang.annotation.ElementType;
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 |
23 | @Retention(RetentionPolicy.RUNTIME)
24 | @Target(ElementType.ANNOTATION_TYPE)
25 | public @interface Facets {
26 | int maxLength() default 0;
27 |
28 | int scale() default -1;
29 |
30 | int precision() default 0;
31 |
32 | boolean nullable() default false;
33 | }
34 |
--------------------------------------------------------------------------------
/com.sap.core.odata.api.annotation/src/main/java/com/sap/core/odata/api/annotation/edmx/HttpMethod.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.annotation.edmx;
17 |
18 | import java.lang.annotation.ElementType;
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 |
23 | @Retention(RetentionPolicy.RUNTIME)
24 | @Target(ElementType.ANNOTATION_TYPE)
25 | public @interface HttpMethod {
26 | enum Name {
27 | POST,
28 | PUT,
29 | GET,
30 | MERGE,
31 | DELETE,
32 | PATCH
33 | };
34 |
35 | Name name();
36 | }
37 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/edm/EdmElement.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.edm;
17 |
18 | /**
19 | * @com.sap.core.odata.DoNotImplement
20 | * EdmElement is the base interface for {@link EdmParameter} and {@link EdmProperty} and provides
21 | * the information by which facets further specialize the usage of the type.
22 | * @author SAP AG
23 | */
24 | public interface EdmElement extends EdmMappable, EdmTyped {
25 |
26 | /**
27 | * Get the facet information for an element
28 | *
29 | * @return {@link EdmFacets}
30 | * @throws EdmException
31 | */
32 | EdmFacets getFacets() throws EdmException;
33 | }
34 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/ep/feed/FeedMetadata.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.ep.feed;
17 |
18 | /**
19 | * {@link FeedMetadata} objects contain metadata information about one feed.
20 | * @author SAP AG
21 | *
22 | */
23 | public interface FeedMetadata {
24 |
25 | /**
26 | * @return inlineCount may be null if no inlineCount is set.
27 | */
28 | public Integer getInlineCount();
29 |
30 | /**
31 | * @return nextLink may be null if no next link is set
32 | */
33 | public String getNextLink();
34 |
35 | /**
36 | * @return deltaLink may be null if no delta link is set
37 | */
38 | public String getDeltaLink();
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/odata-core/src/test/resources/JsonEmployee:
--------------------------------------------------------------------------------
1 | {
2 | "d" : {
3 | "__metadata" : {
4 | "id" : "http://localhost:8080/ReferenceScenario.svc/Employees('1')",
5 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Employees('1')",
6 | "type" : "RefScenario.Employee",
7 | "content_type" : "image/jpeg",
8 | "media_src" : "Employees('1')/$value",
9 | "edit_media" : "http://localhost:8080/ReferenceScenario.svc/Employees('1')/$value"
10 | },
11 | "EmployeeId" : "1",
12 | "EmployeeName" : "Walter Winter",
13 | "ManagerId" : "1",
14 | "RoomId" : "1",
15 | "TeamId" : "1",
16 | "Location" : {
17 | "__metadata" : {
18 | "type" : "RefScenario.c_Location"
19 | },
20 | "City" : {
21 | "__metadata" : {
22 | "type" : "RefScenario.c_City"
23 | },
24 | "PostalCode" : "69124",
25 | "CityName" : "Heidelberg"
26 | },
27 | "Country" : "Germany"
28 | },
29 | "Age" : 52,
30 | "EntryDate" : "\/Date(915148800000)\/",
31 | "ImageUrl" : "Employees('1')/$value",
32 | "ne_Manager" : {
33 | "__deferred" : {
34 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Employees('1')/ne_Manager"
35 | }
36 | },
37 | "ne_Team" : {
38 | "__deferred" : {
39 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Employees('1')/ne_Team"
40 | }
41 | },
42 | "ne_Room" : {
43 | "__deferred" : {
44 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Employees('1')/ne_Room"
45 | }
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/edm/EdmAssociationSetEnd.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.edm;
17 |
18 | /**
19 | * @com.sap.core.odata.DoNotImplement
20 | * A CSDL AssociationSetEnd element
21 | *
22 | * EdmAssociationSetEnd defines one side of the relationship of two entity sets.
23 | * @author SAP AG
24 | */
25 | public interface EdmAssociationSetEnd {
26 |
27 | /**
28 | * Get the role name
29 | *
30 | * @return String
31 | */
32 | String getRole();
33 |
34 | /**
35 | * Get the entity set
36 | *
37 | * @return {@link EdmEntitySet}
38 | * @throws EdmException
39 | */
40 | EdmEntitySet getEntitySet() throws EdmException;
41 | }
42 |
--------------------------------------------------------------------------------
/odata-testutil/src/main/java/com/sap/core/odata/testutil/TestUtilRuntimeException.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.testutil;
17 |
18 | /**
19 | * This class is a helper to throw RuntimeExceptions in test util methods
20 | * @author SAP AG
21 | *
22 | */
23 | public class TestUtilRuntimeException extends RuntimeException {
24 |
25 | private static final long serialVersionUID = 1L;
26 |
27 | public TestUtilRuntimeException(final Throwable e) {
28 | super(e);
29 | }
30 |
31 | public TestUtilRuntimeException(final String msg) {
32 | super(msg);
33 | }
34 |
35 | public TestUtilRuntimeException(final String msg, final Throwable e) {
36 | super(msg, e);
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/odata-fit/src/test/java/com/sap/core/odata/fit/ref/AbstractRefJsonTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.fit.ref;
17 |
18 | import com.google.gson.Gson;
19 | import com.google.gson.internal.StringMap;
20 | import com.google.gson.reflect.TypeToken;
21 |
22 | /**
23 | * @author SAP AG
24 | */
25 | public class AbstractRefJsonTest extends AbstractRefTest {
26 | public StringMap> getStringMap(final String body) {
27 | Gson gson = new Gson();
28 | final StringMap> map = gson.fromJson(body, new TypeToken BatchPart represents a distinct MIME part of a Batch Request body. It can be ChangeSet or Query Operation
25 | * @author SAP AG
26 | */
27 | public interface BatchRequestPart {
28 |
29 | /**
30 | * Get the info if a BatchPart is a ChangeSet
31 | * @return true or false
32 | */
33 | public boolean isChangeSet();
34 |
35 | /**
36 | * Get requests. If a BatchPart is a Query Operation, the list contains one request.
37 | * @return a list of {@link ODataRequest}
38 | */
39 | public List Category element
21 | * @author SAP AG
22 | */
23 | public interface Category {
24 | /**
25 | * Get the scheme
26 | *
27 | * @return scheme as String
28 | */
29 | public String getScheme();
30 |
31 | /**
32 | * Get the term
33 | *
34 | * @return term as String
35 | */
36 | public String getTerm();
37 |
38 | /**
39 | * Get common attributes
40 | *
41 | * @return {@link CommonAttributes}
42 | */
43 | public CommonAttributes getCommonAttributes();
44 |
45 | /**
46 | * Get the label
47 | *
48 | * @return label as String
49 | */
50 | public String getLabel();
51 | }
52 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/edm/EdmTyped.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.edm;
17 |
18 | /**
19 | * @com.sap.core.odata.DoNotImplement
20 | * EdmTyped indicates if an EDM element is of a special type and holds the multiplicity of that type.
21 | * @author SAP AG
22 | */
23 | public interface EdmTyped extends EdmNamed {
24 |
25 | /**
26 | * See {@link EdmType} for more information about possible types.
27 | *
28 | * @return {@link EdmType}
29 | * @throws EdmException
30 | */
31 | EdmType getType() throws EdmException;
32 |
33 | /**
34 | * See {@link EdmMultiplicity} for more information about possible multiplicities.
35 | *
36 | * @return {@link EdmMultiplicity}
37 | * @throws EdmException
38 | */
39 | EdmMultiplicity getMultiplicity() throws EdmException;
40 | }
41 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/processor/part/ServiceDocumentProcessor.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.processor.part;
17 |
18 | import com.sap.core.odata.api.exception.ODataException;
19 | import com.sap.core.odata.api.processor.ODataProcessor;
20 | import com.sap.core.odata.api.processor.ODataResponse;
21 | import com.sap.core.odata.api.uri.info.GetServiceDocumentUriInfo;
22 |
23 | /**
24 | * Execute a OData service document request.
25 | *
26 | * @author SAP AG
27 | */
28 | public interface ServiceDocumentProcessor extends ODataProcessor {
29 |
30 | /**
31 | * @param contentType
32 | * @return a {@link ODataResponse} object
33 | * @throws ODataException
34 | */
35 | ODataResponse readServiceDocument(GetServiceDocumentUriInfo uriInfo, String contentType) throws ODataException;
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/uri/NavigationPropertySegment.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.uri;
17 |
18 | import com.sap.core.odata.api.edm.EdmEntitySet;
19 | import com.sap.core.odata.api.edm.EdmNavigationProperty;
20 |
21 | /**
22 | * Navigation property segment, consisting of a navigation property and its
23 | * target entity set.
24 | * @com.sap.core.odata.DoNotImplement
25 | * @author SAP AG
26 | */
27 | public interface NavigationPropertySegment {
28 |
29 | /**
30 | * Gets the navigation property.
31 | * @return {@link EdmNavigationProperty} navigation property
32 | */
33 | public EdmNavigationProperty getNavigationProperty();
34 |
35 | /**
36 | * Gets the target entity set.
37 | * @return {@link EdmEntitySet} the target entity set
38 | */
39 | public EdmEntitySet getTargetEntitySet();
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/servicedocument/ServiceDocument.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.servicedocument;
17 |
18 | import java.util.List;
19 |
20 | import com.sap.core.odata.api.edm.EdmEntitySetInfo;
21 | import com.sap.core.odata.api.ep.EntityProviderException;
22 |
23 | /**
24 | * A Service document
25 | * Service document lists all EntitySets
26 | * @author SAP AG
27 | */
28 | public interface ServiceDocument {
29 | /**
30 | * Get the list of the EntitySets
31 | *
32 | * @return a list of {@link EdmEntitySetInfo}
33 | */
34 | public List ExtensionAttribute is an attribute of an extension element
21 | * @author SAP AG
22 | */
23 | public interface ExtensionAttribute {
24 | /**
25 | * Get the namespace
26 | *
27 | * @return namespace as String
28 | */
29 | public String getNamespace();
30 |
31 | /**
32 | * Get the prefix of the attribute
33 | *
34 | * @return prefix as String
35 | */
36 | public String getPrefix();
37 |
38 | /**
39 | * Get the local name of the attribute
40 | *
41 | * @return name as String
42 | */
43 | public String getName();
44 |
45 | /**
46 | * Get the text
47 | *
48 | * @return text as String
49 | */
50 | public String getText();
51 | }
52 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/edm/EdmAssociationEnd.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.edm;
17 |
18 | /**
19 | * @com.sap.core.odata.DoNotImplement
20 | * A CSDL AssociationEnd element
21 | *
22 | * EdmAssociationEnd defines one side of the relationship of two entity types.
23 | * @author SAP AG
24 | */
25 | public interface EdmAssociationEnd {
26 |
27 | /**
28 | * @return the role of this {@link EdmAssociationEnd} as a String.
29 | */
30 | String getRole();
31 |
32 | /**
33 | * @return {@link EdmEntityType} this association end points to.
34 | * @throws EdmException
35 | */
36 | EdmEntityType getEntityType() throws EdmException;
37 |
38 | /**
39 | * See {@link EdmMultiplicity} for more information about possible multiplicities.
40 | * @return {@link EdmMultiplicity}
41 | */
42 | EdmMultiplicity getMultiplicity();
43 | }
44 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/servicedocument/AtomInfo.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.servicedocument;
17 |
18 | import java.util.List;
19 |
20 | /**
21 | * A AtomInfo
22 | * AtomInfo represents the structure of Service Document according RFC 5023 (for ATOM format)
23 | * @author SAP AG
24 | */
25 | public interface AtomInfo {
26 |
27 | /**
28 | * Get the list of workspaces
29 | *
30 | * @return a list of {@link Workspace}
31 | */
32 | public List
3 | *
4 | * A data processor implements all create, read, update and delete (CRUD) methods of an OData service. A processor as
5 | * part of a OData service implementation is created by the service factory and then called during request handling.
6 | * In dependency of the http context (http method, requestheaders ...) and the parsed uri semantic the OData Library
7 | * will call an appropriate processor method. Within this method a service can perform operations on data. In a final
8 | * step the data result can be transformed using a {@link com.sap.core.odata.api.ep.EntityProvider} (for Json, Atom and XML) and is returned as
9 | * a {@link com.sap.core.odata.api.processor.ODataResponse}.
10 | *
11 | * A processor gets access to context information either via method parameters or a {@link com.sap.core.odata.api.processor.ODataContext} which is attached
12 | * to the processor object.
13 | *
14 | * A processor can support optional features {@link com.sap.core.odata.api.processor.feature} and implement
15 | * parts {@link com.sap.core.odata.api.processor.part} which is more or less a grouping for different OData CRUD operations.
16 | *
17 | * {@link com.sap.core.odata.api.processor.ODataSingleProcessor} is a convenience abstract class that implements all interface parts and has default implementations
18 | * for handling OData service document and metadata. Usually the {@link com.sap.core.odata.api.processor.ODataSingleProcessor} is used together with a
19 | * EdmAnnotationAttribute is a custom XML attribute which can be applied to a CSDL element.
22 | * @author SAP AG
23 | */
24 | public interface EdmAnnotationAttribute {
25 |
26 | /**
27 | * Get the namespace of the custom attribute
28 | *
29 | * @return String
30 | */
31 | String getNamespace();
32 |
33 | /**
34 | * Get the prefix of the custom attribute
35 | *
36 | * @return String
37 | */
38 | String getPrefix();
39 |
40 | /**
41 | * Get the name of the custom attribute
42 | *
43 | * @return String
44 | */
45 | String getName();
46 |
47 | /**
48 | * Get the text of the custom attribute
49 | *
50 | * @return String
51 | */
52 | String getText();
53 | }
54 |
--------------------------------------------------------------------------------
/com.sap.core.odata.processor.api/src/main/java/com/sap/core/odata/processor/api/jpa/access/JPAProcessorExtension.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.processor.api.jpa.access;
17 |
18 | import java.util.HashMap;
19 | import java.util.List;
20 |
21 | public class JPAProcessorExtension {
22 |
23 | private JPAProcessor jpaProcessor;
24 | private HashMap Gets the literal String in default representation. The description for {@link com.sap.core.odata.api.edm.EdmLiteral} has some motivation for using
30 | * this representation. A literal expression node is inserted in the expression tree for any token witch is no
25 | * valid operator, method or property.
26 | * For example the filter "$filter=age eq 12" will result in an expression tree
29 | * with a literal expression node for "12".
30 | * EdmProperty defines a simple type or a complex type.
21 | * @com.sap.core.odata.DoNotImplement
22 | * @author SAP AG
23 | */
24 | public interface EdmProperty extends EdmElement {
25 |
26 | /**
27 | * Get customizable feed mappings for this property
28 | *
29 | * @return {@link EdmCustomizableFeedMappings}
30 | * @throws EdmException
31 | */
32 | EdmCustomizableFeedMappings getCustomizableFeedMappings() throws EdmException;
33 |
34 | /**
35 | * Get the related mime type for the property
36 | *
37 | * @return mime type as String
38 | * @throws EdmException
39 | */
40 | String getMimeType() throws EdmException;
41 |
42 | /**
43 | * Get the info if the property is a simple property
44 | *
45 | * @return true, if it is a simple property
46 | */
47 | boolean isSimple();
48 | }
49 |
--------------------------------------------------------------------------------
/odata-core/src/main/java/com/sap/core/odata/core/ep/feed/FeedMetadataImpl.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.core.ep.feed;
17 |
18 | import com.sap.core.odata.api.ep.feed.FeedMetadata;
19 |
20 | public class FeedMetadataImpl implements FeedMetadata {
21 |
22 | private Integer inlineCount = null;
23 | private String nextLink = null;
24 | private String deltaLink;
25 |
26 | public void setInlineCount(final int inlineCount) {
27 | this.inlineCount = inlineCount;
28 | }
29 |
30 | @Override
31 | public Integer getInlineCount() {
32 | return inlineCount;
33 | }
34 |
35 | public void setNextLink(final String nextLink) {
36 | this.nextLink = nextLink;
37 | }
38 |
39 | @Override
40 | public String getNextLink() {
41 | return nextLink;
42 | }
43 |
44 | public void setDeltaLink(final String deltaLink) {
45 | this.deltaLink = deltaLink;
46 | }
47 |
48 | @Override
49 | public String getDeltaLink() {
50 | return deltaLink;
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/edm/provider/EdmProviderFactory.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.edm.provider;
17 |
18 | import java.io.InputStream;
19 |
20 | import com.sap.core.odata.api.ep.EntityProviderException;
21 | import com.sap.core.odata.api.rt.RuntimeDelegate;
22 |
23 | /**
24 | * EDM Provider Factory which can be used to create an edm provider (e.g. from a metadata document)
25 | * @author SAP AG
26 | *
27 | */
28 | public class EdmProviderFactory {
29 |
30 | /**
31 | * Creates and returns an edm provider.
32 | * @param metadataXml a metadata xml input stream (means the metadata document)
33 | * @param validate true if semantic checks for metadata document input stream shall be done
34 | * @return an instance of EdmProvider
35 | */
36 | public static EdmProvider getEdmProvider(final InputStream metadataXml, final boolean validate) throws EntityProviderException {
37 | return RuntimeDelegate.createEdmProvider(metadataXml, validate);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/uri/expression/SortOrder.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.uri.expression;
17 |
18 | /**
19 | * Enumeration describing all possible sort orders used in an $orderby expression
20 | * @author SAP AG
21 | */
22 | public enum SortOrder {
23 |
24 | /**
25 | * Sort order ascending
26 | */
27 | asc("asc"),
28 |
29 | /**
30 | * Sort order descending
31 | */
32 | desc("desc");
33 |
34 | private String syntax;
35 | private String stringRespresentation;
36 |
37 | private SortOrder(final String syntax) {
38 | this.syntax = syntax;
39 | stringRespresentation = syntax;
40 | }
41 |
42 | /**
43 | * @return Operators name for usage in in text
44 | */
45 | @Override
46 | public String toString() {
47 | return stringRespresentation;
48 | }
49 |
50 | /**
51 | * @return URI literal of the unary operator as used in the URL.
52 | */
53 | public String toUriLiteral() {
54 | return syntax;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/odata-core/src/test/java/com/sap/core/odata/core/edm/provider/EdmNamedImplProvTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.core.edm.provider;
17 |
18 | import static org.mockito.Mockito.mock;
19 |
20 | import org.junit.Test;
21 |
22 | import com.sap.core.odata.api.edm.EdmException;
23 | import com.sap.core.odata.api.edm.EdmSimpleTypeKind;
24 | import com.sap.core.odata.api.edm.provider.EdmProvider;
25 | import com.sap.core.odata.api.edm.provider.SimpleProperty;
26 | import com.sap.core.odata.testutil.fit.BaseTest;
27 |
28 | public class EdmNamedImplProvTest extends BaseTest {
29 |
30 | @Test(expected = EdmException.class)
31 | public void testPropertySimple() throws Exception {
32 |
33 | EdmProvider edmProvider = mock(EdmProvider.class);
34 | EdmImplProv edmImplProv = new EdmImplProv(edmProvider);
35 |
36 | SimpleProperty propertySimple = new SimpleProperty().setName("Prop;ertyName").setType(EdmSimpleTypeKind.String);
37 | new EdmSimplePropertyImplProv(edmImplProv, propertySimple);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/odata-core/src/main/java/com/sap/core/odata/core/batch/BatchSingleResponseImpl.java:
--------------------------------------------------------------------------------
1 | package com.sap.core.odata.core.batch;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 | import java.util.Set;
6 |
7 | import com.sap.core.odata.api.client.batch.BatchSingleResponse;
8 |
9 | public class BatchSingleResponseImpl implements BatchSingleResponse {
10 |
11 | private String statusCode;
12 | private String statusInfo;
13 | private String body;
14 | private Map Workspaces are server-defined groups of Collections.
23 | * @author SAP AG
24 | */
25 | public interface Workspace {
26 | /**
27 | * Get the human-readable title for the Workspace
28 | *
29 | * @return {@link Title}
30 | */
31 | public Title getTitle();
32 |
33 | /**
34 | * Get the list of the Collections
35 | *
36 | * @return a list of {@link Collection}
37 | */
38 | public ListOData JPA Processor API Library
3 | * The library provides a way for the developers to create an OData Service from a Java Persistence Model.
4 | * The library supports Java Persistence 2.0 and is dependent on OData library.
5 | *
6 | * To create an OData service from JPA models
7 | *
11 | *
12 | * @author SAP AG
13 | */
14 | package com.sap.core.odata.processor.api.jpa;
15 |
16 |
--------------------------------------------------------------------------------
/odata-web/src/main/resources/log4j.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Entity Data Model.
8 | * Therefore this library provides (in its core packages) as convenience basic {@link com.sap.core.odata.api.ep.EntityProvider}
9 | * for accessing entities in the XML and JSON format.
10 | * ODataProcessor (it is possible but not recommended to implement an own
13 | * {@link com.sap.core.odata.api.ep.EntityProvider} for support of additional formats).
14 | */
15 | package com.sap.core.odata.api.ep;
--------------------------------------------------------------------------------
/odata-core/src/test/resources/JsonTeamsWithoutD:
--------------------------------------------------------------------------------
1 | {
2 | "results" : [{
3 | "__metadata" : {
4 | "id" : "http://localhost:8080/ReferenceScenario.svc/Teams('1')",
5 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('1')",
6 | "type" : "RefScenario.Team"
7 | },
8 | "Id" : "1",
9 | "Name" : "Team 1",
10 | "isScrumTeam" : false,
11 | "nt_Employees" : {
12 | "__deferred" : {
13 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('1')/nt_Employees"
14 | }
15 | }
16 | }, {
17 | "__metadata" : {
18 | "id" : "http://localhost:8080/ReferenceScenario.svc/Teams('2')",
19 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('2')",
20 | "type" : "RefScenario.Team"
21 | },
22 | "Id" : "2",
23 | "Name" : "Team 2",
24 | "isScrumTeam" : true,
25 | "nt_Employees" : {
26 | "__deferred" : {
27 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('2')/nt_Employees"
28 | }
29 | }
30 | }
31 | ]
32 | }
33 |
34 |
--------------------------------------------------------------------------------
/odata-core/src/test/resources/JsonTeams:
--------------------------------------------------------------------------------
1 | {
2 | "d" : {
3 | "results" : [{
4 | "__metadata" : {
5 | "id" : "http://localhost:8080/ReferenceScenario.svc/Teams('1')",
6 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('1')",
7 | "type" : "RefScenario.Team"
8 | },
9 | "Id" : "1",
10 | "Name" : "Team 1",
11 | "isScrumTeam" : false,
12 | "nt_Employees" : {
13 | "__deferred" : {
14 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('1')/nt_Employees"
15 | }
16 | }
17 | }, {
18 | "__metadata" : {
19 | "id" : "http://localhost:8080/ReferenceScenario.svc/Teams('2')",
20 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('2')",
21 | "type" : "RefScenario.Team"
22 | },
23 | "Id" : "2",
24 | "Name" : "Team 2",
25 | "isScrumTeam" : true,
26 | "nt_Employees" : {
27 | "__deferred" : {
28 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('2')/nt_Employees"
29 | }
30 | }
31 | }
32 | ]
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/odata-core/src/test/resources/JsonTeamsWithCountWithoutD:
--------------------------------------------------------------------------------
1 | {
2 | "__count" : "3",
3 | "results" : [{
4 | "__metadata" : {
5 | "id" : "http://localhost:8080/ReferenceScenario.svc/Teams('2')",
6 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('2')",
7 | "type" : "RefScenario.Team"
8 | },
9 | "Id" : "2",
10 | "Name" : "Team 2",
11 | "isScrumTeam" : true,
12 | "nt_Employees" : {
13 | "__deferred" : {
14 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('2')/nt_Employees"
15 | }
16 | }
17 | }, {
18 | "__metadata" : {
19 | "id" : "http://localhost:8080/ReferenceScenario.svc/Teams('3')",
20 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('3')",
21 | "type" : "RefScenario.Team"
22 | },
23 | "Id" : "3",
24 | "Name" : "Team 3",
25 | "isScrumTeam" : false,
26 | "nt_Employees" : {
27 | "__deferred" : {
28 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('3')/nt_Employees"
29 | }
30 | }
31 | }
32 | ]
33 | }
34 |
35 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/commons/InlineCount.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.commons;
17 |
18 | /**
19 | * Inlinecount constants as described in the OData protocol
20 | * @author SAP AG
21 | */
22 | public enum InlineCount {
23 | ALLPAGES, NONE;
24 | }
25 |
--------------------------------------------------------------------------------
/odata-core/src/test/resources/JsonTeamsWithCount:
--------------------------------------------------------------------------------
1 | {
2 | "d" : {
3 | "__count" : "3",
4 | "results" : [{
5 | "__metadata" : {
6 | "id" : "http://localhost:8080/ReferenceScenario.svc/Teams('2')",
7 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('2')",
8 | "type" : "RefScenario.Team"
9 | },
10 | "Id" : "2",
11 | "Name" : "Team 2",
12 | "isScrumTeam" : true,
13 | "nt_Employees" : {
14 | "__deferred" : {
15 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('2')/nt_Employees"
16 | }
17 | }
18 | }, {
19 | "__metadata" : {
20 | "id" : "http://localhost:8080/ReferenceScenario.svc/Teams('3')",
21 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('3')",
22 | "type" : "RefScenario.Team"
23 | },
24 | "Id" : "3",
25 | "Name" : "Team 3",
26 | "isScrumTeam" : false,
27 | "nt_Employees" : {
28 | "__deferred" : {
29 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('3')/nt_Employees"
30 | }
31 | }
32 | }
33 | ]
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/com.sap.core.odata.processor.api/src/main/java/com/sap/core/odata/processor/api/jpa/access/JPAProcessorRegistry.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.processor.api.jpa.access;
17 |
18 | /**
19 | *
20 | * @author SAP AG
21 | *
22 | */
23 | public class JPAProcessorRegistry {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/commons/ODataHttpMethod.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 |
17 | package com.sap.core.odata.api.commons;
18 |
19 | /**
20 | * The supported HTTP methods.
21 | * @author SAP AG
22 | */
23 | public enum ODataHttpMethod {
24 | GET, PUT, POST, DELETE, PATCH, MERGE;
25 | }
26 |
--------------------------------------------------------------------------------
/com.sap.core.odata.processor.api/src/main/java/com/sap/core/odata/processor/api/jpa/access/JPAProcessorOperation.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.processor.api.jpa.access;
17 |
18 | public enum JPAProcessorOperation {
19 | Read,
20 | Query,
21 | Create,
22 | Update,
23 | Delete
24 | }
25 |
--------------------------------------------------------------------------------
/odata-core/src/main/java/com/sap/core/odata/core/uri/SystemQueryOption.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.core.uri;
17 |
18 | /**
19 | * @author SAP AG
20 | */
21 | public enum SystemQueryOption {
22 | $format, $filter, $inlinecount, $orderby, $skiptoken, $skip, $top, $expand, $select;
23 | }
24 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/ODataCallback.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api;
17 |
18 | /**
19 | * Common OData callback interface. Every callback implementation has to implement this interface as a marker.
20 | *
21 | * @author SAP AG
22 | *
23 | */
24 | public interface ODataCallback {}
25 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/edm/EdmLiteralKind.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.edm;
17 |
18 | /**
19 | * @com.sap.core.odata.DoNotImplement
20 | * EdmLiteralKind indicates the format of an EDM literal.
21 | * @author SAP AG
22 | */
23 | public enum EdmLiteralKind {
24 |
25 | DEFAULT, URI, JSON;
26 | }
27 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/servicedocument/Fixed.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.servicedocument;
17 |
18 | /**
19 | * Fixed
20 | * true if the system is in debug mode
28 | * and the current user has the rights to debug the OData service
29 | */
30 | boolean isDebugEnabled();
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/client/batch/BatchChangeSet.java:
--------------------------------------------------------------------------------
1 | package com.sap.core.odata.api.client.batch;
2 |
3 | import java.util.List;
4 |
5 | import com.sap.core.odata.api.rt.RuntimeDelegate;
6 |
7 | /**
8 | * A BatchChangeSet
9 | * ODataSingleService default implementation.
20 | *
21 | */
22 | package com.sap.core.odata.api.processor;
--------------------------------------------------------------------------------
/odata-fit/src/test/resources/batchWithContentId.batch:
--------------------------------------------------------------------------------
1 | --batch_123
2 | Content-Type: multipart/mixed; boundary=changeset_7638-3d26-8efd
3 |
4 | --changeset_7638-3d26-8efd
5 | Content-Type: application/http
6 | Content-Transfer-Encoding: binary
7 | Content-Id: newEmployee
8 |
9 | POST Employees HTTP/1.1
10 | Accept: application/atomsvc+xml;q=0.8, application/json;odata=verbose;q=0.5, */*;q=0.1
11 | MaxDataServiceVersion: 2.0
12 | Content-Type: application/octet-stream
13 | Content-Id: 1
14 |
15 | Loml/s/2aje2bUNbJcpOZhijEEOfIcSPMrtqgm0xZWu20Vpo46S20sNLSs4NihYGtHuV6EAUVFEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERB//9k=
16 |
17 | --changeset_7638-3d26-8efd
18 | Content-Type: application/http
19 | Content-Transfer-Encoding: binary
20 |
21 | PUT $newEmployee/EmployeeName HTTP/1.1
22 | Content-Length: 100
23 | DataServiceVersion: 1.0
24 | Content-Type: application/json;odata=verbose
25 | MaxDataServiceVersion: 2.0
26 | Content-Id: 2
27 |
28 | {"EmployeeName":"Frederic Fall MODIFIED"}
29 |
30 | --changeset_7638-3d26-8efd
31 | Content-Type: application/http
32 | Content-Transfer-Encoding: binary
33 |
34 | PUT $newEmployee/Age HTTP/1.1
35 | Content-Length: 100
36 | DataServiceVersion: 1.0
37 | Content-Type: application/json;odata=verbose
38 | MaxDataServiceVersion: 2.0
39 | Content-Id: 3
40 |
41 | {"Age":40}
42 |
43 | --changeset_7638-3d26-8efd--
44 |
45 | --batch_123
46 | Content-Type: application/http
47 | Content-Transfer-Encoding: binary
48 | Content-Id: AAA
49 |
50 | GET Employees('7') HTTP/1.1
51 | Accept: application/atomsvc+xml;q=0.8, application/json;odata=verbose;q=0.5, */*;q=0.1
52 | MaxDataServiceVersion: 2.0
53 | Content-Id: 4
54 |
55 |
56 | --batch_123--
57 |
--------------------------------------------------------------------------------
/odata-core/src/main/java/com/sap/core/odata/core/servicedocument/AcceptImpl.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.core.servicedocument;
17 |
18 | import com.sap.core.odata.api.servicedocument.Accept;
19 | import com.sap.core.odata.api.servicedocument.CommonAttributes;
20 |
21 | /**
22 | * @author SAP AG
23 | */
24 | public class AcceptImpl implements Accept {
25 | private String value;
26 | private CommonAttributes commonAttributes;
27 |
28 | @Override
29 | public String getValue() {
30 | return value;
31 | }
32 |
33 | @Override
34 | public CommonAttributes getCommonAttributes() {
35 | return commonAttributes;
36 | }
37 |
38 | public AcceptImpl setText(final String text) {
39 | value = text;
40 | return this;
41 | }
42 |
43 | public AcceptImpl setCommonAttributes(final CommonAttributes commonAttributes) {
44 | this.commonAttributes = commonAttributes;
45 | return this;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/edm/EdmAnnotationAttribute.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.edm;
17 |
18 | /**
19 | * @com.sap.core.odata.DoNotImplement
20 | * A CSDL AnnotationAttribute element.
21 | * OData library and
20 | * base exception for all OData-related exceptions
21 | * caused by programming errors and/or unexpected behavior within the code.
22 | * @author SAP AG
23 | */
24 | public final class ODataRuntimeException extends RuntimeException {
25 |
26 | private static final long serialVersionUID = 1L;
27 |
28 | public ODataRuntimeException() {
29 | super();
30 | }
31 |
32 | public ODataRuntimeException(final Throwable throwable) {
33 | super(throwable);
34 | }
35 |
36 | public ODataRuntimeException(final String message) {
37 | super(message);
38 | }
39 |
40 | public ODataRuntimeException(final String message, final Throwable throwable) {
41 | super(message, throwable);
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/uri/info/GetServiceDocumentUriInfo.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.uri.info;
17 |
18 | import java.util.Map;
19 |
20 | /**
21 | * Access to the parts of the request URI that are relevant for GET requests
22 | * of the service document.
23 | * @com.sap.core.odata.DoNotImplement
24 | * @author SAP AG
25 | */
26 | public interface GetServiceDocumentUriInfo {
27 | /**
28 | * Gets the value of the $format system query option.
29 | * @return the format (as set as $format query parameter) or null
30 | */
31 | public String getFormat();
32 |
33 | /**
34 | * Gets the custom query options as Map from option names to their
35 | * corresponding String values, or an empty list if no custom query options
36 | * are given in the URI.
37 | * @return Map of {@literal true if select=*
31 | * @return true if select=*
32 | */
33 | public boolean isStar();
34 |
35 | /**
36 | * Gets the EDM property.
37 | * @return {@link EdmProperty} property of this select item
38 | */
39 | public EdmProperty getProperty();
40 |
41 | /**
42 | * Gets the navigation-property segments for this select item.
43 | * @return List of {@link NavigationPropertySegment} for this select item or Collection.EmptyList
44 | */
45 | public ListODataProcessor is the root interface for processor implementation.
22 | * A processor handles OData requests like reading or writing entities. All possible
23 | * actions are defined in the {@link com.sap.core.odata.api.processor.feature} package.
24 | * @author SAP AG
25 | * @com.sap.core.odata.DoNotImplement
26 | */
27 | public interface ODataProcessor {
28 |
29 | /**
30 | * @param context A request context object which is usually injected by the OData library itself.
31 | * @throws ODataException
32 | */
33 | void setContext(ODataContext context) throws ODataException;
34 |
35 | /**
36 | * @return A request context object.
37 | * @throws ODataException
38 | */
39 | ODataContext getContext() throws ODataException;
40 | }
41 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/uri/PathInfo.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.uri;
17 |
18 | import java.net.URI;
19 | import java.util.List;
20 |
21 | /**
22 | * Object to keep OData URI information.
23 | * @com.sap.core.odata.DoNotImplement
24 | * @author SAP AG
25 | */
26 | public interface PathInfo {
27 |
28 | /**
29 | * Gets preceding path segments.
30 | * @return List of path segments
31 | */
32 | List
23 | *
24 | *
27 | *
28 | *
31 | *
32 | * @author SAP AG
33 | */
34 | public interface LiteralExpression extends CommonExpression {
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/edm/EdmProperty.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.edm;
17 |
18 | /**
19 | * A CSDL Property element
20 | * edit link.
25 | *
26 | * @return edit link.
27 | */
28 | public abstract String getEditLink();
29 |
30 | /**
31 | * Get content type in as specified in
32 | * RFC 2616 Section 14.
33 | *
34 | * @return content type.
35 | */
36 | public abstract String getContentType();
37 |
38 | /**
39 | * Get etag.
40 | *
41 | * @return etag.
42 | */
43 | public abstract String getEtag();
44 |
45 | /**
46 | * Get source link.
47 | *
48 | * @return source link.
49 | */
50 | public abstract String getSourceLink();
51 | }
52 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/ep/callback/WriteFeedCallbackContext.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.ep.callback;
17 |
18 | import java.net.URI;
19 |
20 | /**
21 | * Context given if the target of an expand is a feed. It contains the source entity set, the navigation property pointing to the entry which has to be expanded, the current expand select tree node and the data of the source entry.
22 | * @author SAP AG
23 | *
24 | */
25 | public class WriteFeedCallbackContext extends WriteCallbackContext {
26 |
27 | private URI selfLink;
28 |
29 | /**
30 | * Sets the self Link for this feed.
31 | * @param selfLink
32 | */
33 | public void setSelfLink(final URI selfLink) {
34 | this.selfLink = selfLink;
35 | }
36 |
37 | /**
38 | * This self link is the same as the link displayed for the navigation property e.g. Rooms(1)/nr_Buildings.
39 | * @return the self link calculated by the library
40 | */
41 | public URI getSelfLink() {
42 | return selfLink;
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/odata-api/src/main/java/com/sap/core/odata/api/servicedocument/Workspace.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2013 SAP AG
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | ******************************************************************************/
16 | package com.sap.core.odata.api.servicedocument;
17 |
18 | import java.util.List;
19 |
20 | /**
21 | * A Workspace element
22 | *