├── .gitignore ├── .reuse └── dep5 ├── LICENSE ├── LICENSES └── Apache-2.0.txt ├── NOTICE ├── README.md ├── com.sap.core.odata.api.annotation ├── .gitignore ├── pom.xml └── src │ └── main │ └── java │ ├── META-INF │ └── MANIFEST.MF │ └── com │ └── sap │ └── core │ └── odata │ └── api │ └── annotation │ ├── edm │ ├── Documentation.java │ ├── Facets.java │ ├── FunctionImport.java │ └── Parameter.java │ └── edmx │ └── HttpMethod.java ├── com.sap.core.odata.processor.api ├── .gitignore ├── pom.xml └── src │ └── main │ ├── java │ ├── META-INF │ │ └── MANIFEST.MF │ └── com │ │ └── sap │ │ └── core │ │ └── odata │ │ └── processor │ │ └── api │ │ └── jpa │ │ ├── ODataJPAContext.java │ │ ├── ODataJPAProcessor.java │ │ ├── ODataJPAServiceFactory.java │ │ ├── access │ │ ├── JPAEdmBuilder.java │ │ ├── JPAEdmMappingModelAccess.java │ │ ├── JPAFunction.java │ │ ├── JPAJoinClause.java │ │ ├── JPAMethodContext.java │ │ ├── JPAMethodContextView.java │ │ ├── JPAProcessor.java │ │ ├── JPAProcessorExtension.java │ │ ├── JPAProcessorOperation.java │ │ ├── JPAProcessorRegistry.java │ │ └── package-info.java │ │ ├── exception │ │ ├── ODataJPAException.java │ │ ├── ODataJPAMessageService.java │ │ ├── ODataJPAModelException.java │ │ ├── ODataJPARuntimeException.java │ │ └── package-info.java │ │ ├── factory │ │ ├── JPAAccessFactory.java │ │ ├── JPQLBuilderFactory.java │ │ ├── ODataJPAAccessFactory.java │ │ ├── ODataJPAFactory.java │ │ └── package-info.java │ │ ├── jpql │ │ ├── JPQLContext.java │ │ ├── JPQLContextType.java │ │ ├── JPQLContextView.java │ │ ├── JPQLJoinContextView.java │ │ ├── JPQLJoinSelectSingleContextView.java │ │ ├── JPQLSelectContextView.java │ │ ├── JPQLSelectSingleContextView.java │ │ ├── JPQLStatement.java │ │ └── package-info.java │ │ ├── model │ │ ├── JPAEdmAssociationEndView.java │ │ ├── JPAEdmAssociationSetView.java │ │ ├── JPAEdmAssociationView.java │ │ ├── JPAEdmBaseView.java │ │ ├── JPAEdmComplexPropertyView.java │ │ ├── JPAEdmComplexTypeView.java │ │ ├── JPAEdmEntityContainerView.java │ │ ├── JPAEdmEntitySetView.java │ │ ├── JPAEdmEntityTypeView.java │ │ ├── JPAEdmExtension.java │ │ ├── JPAEdmFunctionImportView.java │ │ ├── JPAEdmKeyView.java │ │ ├── JPAEdmMapping.java │ │ ├── JPAEdmModelView.java │ │ ├── JPAEdmNavigationPropertyView.java │ │ ├── JPAEdmPropertyView.java │ │ ├── JPAEdmReferentialConstraintRoleView.java │ │ ├── JPAEdmReferentialConstraintView.java │ │ ├── JPAEdmSchemaView.java │ │ ├── mapping │ │ │ ├── JPAAttributeMapType.java │ │ │ ├── JPAEdmMappingModel.java │ │ │ ├── JPAEdmMappingModelFactory.java │ │ │ ├── JPAEmbeddableTypeMapType.java │ │ │ ├── JPAEmbeddableTypesMapType.java │ │ │ ├── JPAEntityTypeMapType.java │ │ │ ├── JPAEntityTypesMapType.java │ │ │ ├── JPAPersistenceUnitMapType.java │ │ │ ├── JPARelationshipMapType.java │ │ │ └── package-info.java │ │ └── package-info.java │ │ └── package-info.java │ └── resources │ └── JPAEDMMappingModel.xsd ├── com.sap.core.odata.processor.core ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ └── com │ │ │ └── sap │ │ │ └── core │ │ │ └── odata │ │ │ └── processor │ │ │ └── core │ │ │ └── jpa │ │ │ ├── ODataEntityParser.java │ │ │ ├── ODataExpressionParser.java │ │ │ ├── ODataJPAContextImpl.java │ │ │ ├── ODataJPAProcessorDefault.java │ │ │ ├── ODataJPAResponseBuilder.java │ │ │ ├── access │ │ │ ├── data │ │ │ │ ├── JPAEntity.java │ │ │ │ ├── JPAEntityParser.java │ │ │ │ ├── JPAExpandCallBack.java │ │ │ │ ├── JPAFunctionContext.java │ │ │ │ ├── JPALink.java │ │ │ │ └── JPAProcessorImpl.java │ │ │ └── model │ │ │ │ ├── EdmTypeConvertor.java │ │ │ │ ├── JPAEdmMappingModelService.java │ │ │ │ ├── JPAEdmNameBuilder.java │ │ │ │ └── JPATypeConvertor.java │ │ │ ├── edm │ │ │ └── ODataJPAEdmProvider.java │ │ │ ├── exception │ │ │ └── ODataJPAMessageServiceDefault.java │ │ │ ├── factory │ │ │ └── ODataJPAFactoryImpl.java │ │ │ ├── jpql │ │ │ ├── JPQLJoinSelectContext.java │ │ │ ├── JPQLJoinSelectSingleContext.java │ │ │ ├── JPQLJoinSelectSingleStatementBuilder.java │ │ │ ├── JPQLJoinStatementBuilder.java │ │ │ ├── JPQLSelectContext.java │ │ │ ├── JPQLSelectSingleContext.java │ │ │ ├── JPQLSelectSingleStatementBuilder.java │ │ │ └── JPQLSelectStatementBuilder.java │ │ │ └── model │ │ │ ├── JPAEdmAssociation.java │ │ │ ├── JPAEdmAssociationEnd.java │ │ │ ├── JPAEdmAssociationSet.java │ │ │ ├── JPAEdmBaseViewImpl.java │ │ │ ├── JPAEdmComplexType.java │ │ │ ├── JPAEdmEntityContainer.java │ │ │ ├── JPAEdmEntitySet.java │ │ │ ├── JPAEdmEntityType.java │ │ │ ├── JPAEdmFacets.java │ │ │ ├── JPAEdmFunctionImport.java │ │ │ ├── JPAEdmKey.java │ │ │ ├── JPAEdmMappingImpl.java │ │ │ ├── JPAEdmModel.java │ │ │ ├── JPAEdmNavigationProperty.java │ │ │ ├── JPAEdmProperty.java │ │ │ ├── JPAEdmReferentialConstraint.java │ │ │ ├── JPAEdmReferentialConstraintRole.java │ │ │ └── JPAEdmSchema.java │ └── resources │ │ └── jpaprocessor_msg.properties │ └── test │ ├── java │ ├── META-INF │ │ └── MANIFEST.MF │ └── com │ │ └── sap │ │ └── core │ │ └── odata │ │ └── processor │ │ └── core │ │ └── jpa │ │ ├── JPAEntityParserTest.java │ │ ├── ODataExpressionParserTest.java │ │ ├── ODataJPAContextImplTest.java │ │ ├── ODataJPAProcessorDefaultTest.java │ │ ├── ODataJPAResponseBuilderTest.java │ │ ├── access │ │ ├── data │ │ │ ├── JPAEntityPropertyTest.java │ │ │ ├── JPAEntityTest.java │ │ │ ├── JPAExpandCallBackTest.java │ │ │ ├── JPAFunctionContextTest.java │ │ │ └── JPAProcessorImplTest.java │ │ └── model │ │ │ ├── JPAEdmMappingModelServiceTest.java │ │ │ ├── JPAEdmNameBuilderTest.java │ │ │ └── JPATypeConvertorTest.java │ │ ├── common │ │ └── ODataJPATestConstants.java │ │ ├── edm │ │ ├── ODataJPAEdmProviderNegativeTest.java │ │ └── ODataJPAEdmProviderTest.java │ │ ├── jpql │ │ ├── JPQLBuilderFactoryTest.java │ │ ├── JPQLJoinContextTest.java │ │ ├── JPQLJoinSelectSingleContextTest.java │ │ ├── JPQLJoinSelectSingleStatementBuilderTest.java │ │ ├── JPQLJoinStatementBuilderTest.java │ │ ├── JPQLSelectContextImplTest.java │ │ ├── JPQLSelectSingleContextImplTest.java │ │ ├── JPQLSelectSingleStatementBuilderTest.java │ │ └── JPQLSelectStatementBuilderTest.java │ │ ├── mock │ │ ├── ODataJPAContextMock.java │ │ ├── data │ │ │ ├── EdmMockUtil.java │ │ │ ├── EdmMockUtilV2.java │ │ │ ├── JPATypeMock.java │ │ │ ├── ODataEntryMockUtil.java │ │ │ ├── SalesOrderHeader.java │ │ │ ├── SalesOrderLineItem.java │ │ │ └── SalesOrderLineItemKey.java │ │ └── model │ │ │ ├── EdmSchemaMock.java │ │ │ ├── JPAAttributeMock.java │ │ │ ├── JPACustomProcessorMock.java │ │ │ ├── JPACustomProcessorNegativeMock.java │ │ │ ├── JPAEdmMockData.java │ │ │ ├── JPAEmbeddableMock.java │ │ │ ├── JPAEmbeddableTypeMock.java │ │ │ ├── JPAEntityTypeMock.java │ │ │ ├── JPAJavaMemberMock.java │ │ │ ├── JPAManagedTypeMock.java │ │ │ ├── JPAMetaModelMock.java │ │ │ ├── JPAPluralAttributeMock.java │ │ │ └── JPASingularAttributeMock.java │ │ └── model │ │ ├── JPAEdmAssociationEndTest.java │ │ ├── JPAEdmAssociationSetTest.java │ │ ├── JPAEdmAssociationTest.java │ │ ├── JPAEdmBaseViewImplTest.java │ │ ├── JPAEdmComplexTypeTest.java │ │ ├── JPAEdmEntityContainerTest.java │ │ ├── JPAEdmEntitySetTest.java │ │ ├── JPAEdmEntityTypeTest.java │ │ ├── JPAEdmFunctionImportTest.java │ │ ├── JPAEdmKeyTest.java │ │ ├── JPAEdmModelTest.java │ │ ├── JPAEdmNavigationPropertyTest.java │ │ ├── JPAEdmPropertyTest.java │ │ ├── JPAEdmReferentialConstraintRoleTest.java │ │ ├── JPAEdmReferentialConstraintTest.java │ │ ├── JPAEdmSchemaTest.java │ │ └── JPAEdmTestModelView.java │ └── resources │ └── SalesOrderProcessingMappingModels.xml ├── odata-api ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── sap │ └── core │ └── odata │ └── api │ ├── ODataCallback.java │ ├── ODataDebugCallback.java │ ├── ODataService.java │ ├── ODataServiceFactory.java │ ├── ODataServiceVersion.java │ ├── batch │ ├── BatchException.java │ ├── BatchHandler.java │ ├── BatchRequestPart.java │ └── BatchResponsePart.java │ ├── client │ └── batch │ │ ├── BatchChangeSet.java │ │ ├── BatchChangeSetPart.java │ │ ├── BatchPart.java │ │ ├── BatchQueryPart.java │ │ └── BatchSingleResponse.java │ ├── commons │ ├── HttpContentType.java │ ├── HttpHeaders.java │ ├── HttpStatusCodes.java │ ├── InlineCount.java │ ├── ODataHttpHeaders.java │ ├── ODataHttpMethod.java │ └── package-info.java │ ├── edm │ ├── Edm.java │ ├── EdmAction.java │ ├── EdmAnnotatable.java │ ├── EdmAnnotationAttribute.java │ ├── EdmAnnotationElement.java │ ├── EdmAnnotations.java │ ├── EdmAssociation.java │ ├── EdmAssociationEnd.java │ ├── EdmAssociationSet.java │ ├── EdmAssociationSetEnd.java │ ├── EdmComplexType.java │ ├── EdmConcurrencyMode.java │ ├── EdmContentKind.java │ ├── EdmCustomizableFeedMappings.java │ ├── EdmElement.java │ ├── EdmEntityContainer.java │ ├── EdmEntitySet.java │ ├── EdmEntitySetInfo.java │ ├── EdmEntityType.java │ ├── EdmException.java │ ├── EdmFacets.java │ ├── EdmFunctionImport.java │ ├── EdmLiteral.java │ ├── EdmLiteralException.java │ ├── EdmLiteralKind.java │ ├── EdmMappable.java │ ├── EdmMapping.java │ ├── EdmMultiplicity.java │ ├── EdmNamed.java │ ├── EdmNavigationProperty.java │ ├── EdmParameter.java │ ├── EdmProperty.java │ ├── EdmServiceMetadata.java │ ├── EdmSimpleType.java │ ├── EdmSimpleTypeException.java │ ├── EdmSimpleTypeFacade.java │ ├── EdmSimpleTypeKind.java │ ├── EdmStructuralType.java │ ├── EdmTargetPath.java │ ├── EdmType.java │ ├── EdmTypeKind.java │ ├── EdmTyped.java │ ├── FullQualifiedName.java │ ├── package-info.java │ └── provider │ │ ├── AnnotationAttribute.java │ │ ├── AnnotationElement.java │ │ ├── Association.java │ │ ├── AssociationEnd.java │ │ ├── AssociationSet.java │ │ ├── AssociationSetEnd.java │ │ ├── ComplexProperty.java │ │ ├── ComplexType.java │ │ ├── CustomizableFeedMappings.java │ │ ├── DataServices.java │ │ ├── Documentation.java │ │ ├── EdmProvider.java │ │ ├── EdmProviderAccessor.java │ │ ├── EdmProviderFactory.java │ │ ├── EntityContainer.java │ │ ├── EntityContainerInfo.java │ │ ├── EntitySet.java │ │ ├── EntityType.java │ │ ├── Facets.java │ │ ├── FunctionImport.java │ │ ├── FunctionImportParameter.java │ │ ├── Key.java │ │ ├── Mapping.java │ │ ├── NavigationProperty.java │ │ ├── OnDelete.java │ │ ├── Property.java │ │ ├── PropertyRef.java │ │ ├── ReferentialConstraint.java │ │ ├── ReferentialConstraintRole.java │ │ ├── ReturnType.java │ │ ├── Schema.java │ │ ├── SimpleProperty.java │ │ ├── Using.java │ │ └── package-info.java │ ├── ep │ ├── EntityProvider.java │ ├── EntityProviderBatchProperties.java │ ├── EntityProviderException.java │ ├── EntityProviderReadProperties.java │ ├── EntityProviderWriteProperties.java │ ├── callback │ │ ├── OnReadInlineContent.java │ │ ├── OnWriteEntryContent.java │ │ ├── OnWriteFeedContent.java │ │ ├── ReadEntryResult.java │ │ ├── ReadFeedResult.java │ │ ├── ReadResult.java │ │ ├── TombstoneCallback.java │ │ ├── TombstoneCallbackResult.java │ │ ├── WriteCallbackContext.java │ │ ├── WriteEntryCallbackContext.java │ │ ├── WriteEntryCallbackResult.java │ │ ├── WriteFeedCallbackContext.java │ │ ├── WriteFeedCallbackResult.java │ │ └── package-info.java │ ├── entry │ │ ├── EntryMetadata.java │ │ ├── MediaMetadata.java │ │ ├── ODataEntry.java │ │ └── package-info.java │ ├── feed │ │ ├── FeedMetadata.java │ │ ├── ODataFeed.java │ │ └── package-info.java │ └── package-info.java │ ├── exception │ ├── MessageReference.java │ ├── ODataApplicationException.java │ ├── ODataBadRequestException.java │ ├── ODataConflictException.java │ ├── ODataException.java │ ├── ODataForbiddenException.java │ ├── ODataHttpException.java │ ├── ODataMessageException.java │ ├── ODataMethodNotAllowedException.java │ ├── ODataNotAcceptableException.java │ ├── ODataNotFoundException.java │ ├── ODataNotImplementedException.java │ ├── ODataPreconditionFailedException.java │ ├── ODataPreconditionRequiredException.java │ ├── ODataServiceUnavailableException.java │ ├── ODataUnsupportedMediaTypeException.java │ └── package-info.java │ ├── package-info.java │ ├── processor │ ├── ODataContext.java │ ├── ODataErrorCallback.java │ ├── ODataErrorContext.java │ ├── ODataProcessor.java │ ├── ODataRequest.java │ ├── ODataResponse.java │ ├── ODataSingleProcessor.java │ ├── feature │ │ ├── CustomContentType.java │ │ ├── ODataProcessorFeature.java │ │ └── package-info.java │ ├── package-info.java │ └── part │ │ ├── BatchProcessor.java │ │ ├── EntityComplexPropertyProcessor.java │ │ ├── EntityLinkProcessor.java │ │ ├── EntityLinksProcessor.java │ │ ├── EntityMediaProcessor.java │ │ ├── EntityProcessor.java │ │ ├── EntitySetProcessor.java │ │ ├── EntitySimplePropertyProcessor.java │ │ ├── EntitySimplePropertyValueProcessor.java │ │ ├── FunctionImportProcessor.java │ │ ├── FunctionImportValueProcessor.java │ │ ├── MetadataProcessor.java │ │ ├── ServiceDocumentProcessor.java │ │ └── package-info.java │ ├── rt │ ├── RuntimeDelegate.java │ └── package-info.java │ ├── servicedocument │ ├── Accept.java │ ├── AtomInfo.java │ ├── Categories.java │ ├── Category.java │ ├── Collection.java │ ├── CommonAttributes.java │ ├── ExtensionAttribute.java │ ├── ExtensionElement.java │ ├── Fixed.java │ ├── ServiceDocument.java │ ├── ServiceDocumentParser.java │ ├── ServiceDocumentParserException.java │ ├── Title.java │ └── Workspace.java │ └── uri │ ├── ExpandSelectTreeNode.java │ ├── KeyPredicate.java │ ├── NavigationPropertySegment.java │ ├── NavigationSegment.java │ ├── PathInfo.java │ ├── PathSegment.java │ ├── SelectItem.java │ ├── UriInfo.java │ ├── UriNotMatchingException.java │ ├── UriParser.java │ ├── UriSyntaxException.java │ ├── expression │ ├── BinaryExpression.java │ ├── BinaryOperator.java │ ├── CommonExpression.java │ ├── ExceptionVisitExpression.java │ ├── ExpressionKind.java │ ├── ExpressionParserException.java │ ├── ExpressionVisitor.java │ ├── FilterExpression.java │ ├── LiteralExpression.java │ ├── MemberExpression.java │ ├── MethodExpression.java │ ├── MethodOperator.java │ ├── OrderByExpression.java │ ├── OrderExpression.java │ ├── PropertyExpression.java │ ├── SortOrder.java │ ├── UnaryExpression.java │ ├── UnaryOperator.java │ ├── Visitable.java │ └── package-info.java │ ├── info │ ├── DeleteUriInfo.java │ ├── GetComplexPropertyUriInfo.java │ ├── GetEntityCountUriInfo.java │ ├── GetEntityLinkCountUriInfo.java │ ├── GetEntityLinkUriInfo.java │ ├── GetEntitySetCountUriInfo.java │ ├── GetEntitySetLinksCountUriInfo.java │ ├── GetEntitySetLinksUriInfo.java │ ├── GetEntitySetUriInfo.java │ ├── GetEntityUriInfo.java │ ├── GetFunctionImportUriInfo.java │ ├── GetMediaResourceUriInfo.java │ ├── GetMetadataUriInfo.java │ ├── GetServiceDocumentUriInfo.java │ ├── GetSimplePropertyUriInfo.java │ ├── PostUriInfo.java │ ├── PutMergePatchUriInfo.java │ └── package-info.java │ └── package-info.java ├── odata-core ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── sap │ │ │ └── core │ │ │ └── odata │ │ │ └── core │ │ │ ├── ContentNegotiator.java │ │ │ ├── Dispatcher.java │ │ │ ├── ODataContextImpl.java │ │ │ ├── ODataExceptionWrapper.java │ │ │ ├── ODataPathSegmentImpl.java │ │ │ ├── ODataRequestHandler.java │ │ │ ├── ODataRequestImpl.java │ │ │ ├── ODataResponseImpl.java │ │ │ ├── PathInfoImpl.java │ │ │ ├── batch │ │ │ ├── AcceptParser.java │ │ │ ├── BatchChangeSetImpl.java │ │ │ ├── BatchChangeSetPartImpl.java │ │ │ ├── BatchHandlerImpl.java │ │ │ ├── BatchHelper.java │ │ │ ├── BatchQueryPartImpl.java │ │ │ ├── BatchRequestParser.java │ │ │ ├── BatchRequestPartImpl.java │ │ │ ├── BatchRequestWriter.java │ │ │ ├── BatchResponseParser.java │ │ │ ├── BatchResponsePartImpl.java │ │ │ ├── BatchResponseWriter.java │ │ │ └── BatchSingleResponseImpl.java │ │ │ ├── commons │ │ │ ├── ContentType.java │ │ │ ├── Decoder.java │ │ │ └── Encoder.java │ │ │ ├── debug │ │ │ ├── DebugInfo.java │ │ │ ├── DebugInfoBody.java │ │ │ ├── DebugInfoException.java │ │ │ ├── DebugInfoRequest.java │ │ │ ├── DebugInfoResponse.java │ │ │ ├── DebugInfoRuntime.java │ │ │ ├── DebugInfoUri.java │ │ │ └── ODataDebugResponseWrapper.java │ │ │ ├── edm │ │ │ ├── AbstractSimpleType.java │ │ │ ├── Bit.java │ │ │ ├── EdmBinary.java │ │ │ ├── EdmBoolean.java │ │ │ ├── EdmByte.java │ │ │ ├── EdmDateTime.java │ │ │ ├── EdmDateTimeOffset.java │ │ │ ├── EdmDecimal.java │ │ │ ├── EdmDouble.java │ │ │ ├── EdmGuid.java │ │ │ ├── EdmImpl.java │ │ │ ├── EdmInt16.java │ │ │ ├── EdmInt32.java │ │ │ ├── EdmInt64.java │ │ │ ├── EdmNull.java │ │ │ ├── EdmSByte.java │ │ │ ├── EdmSimpleTypeFacadeImpl.java │ │ │ ├── EdmSingle.java │ │ │ ├── EdmString.java │ │ │ ├── EdmTime.java │ │ │ ├── Uint7.java │ │ │ ├── parser │ │ │ │ ├── EdmParser.java │ │ │ │ ├── EdmParserConstants.java │ │ │ │ └── EdmxProvider.java │ │ │ └── provider │ │ │ │ ├── EdmAnnotationsImplProv.java │ │ │ │ ├── EdmAssociationEndImplProv.java │ │ │ │ ├── EdmAssociationImplProv.java │ │ │ │ ├── EdmAssociationSetEndImplProv.java │ │ │ │ ├── EdmAssociationSetImplProv.java │ │ │ │ ├── EdmComplexPropertyImplProv.java │ │ │ │ ├── EdmComplexTypeImplProv.java │ │ │ │ ├── EdmElementImplProv.java │ │ │ │ ├── EdmEntityContainerImplProv.java │ │ │ │ ├── EdmEntitySetImplProv.java │ │ │ │ ├── EdmEntitySetInfoImplProv.java │ │ │ │ ├── EdmEntityTypeImplProv.java │ │ │ │ ├── EdmFunctionImportImplProv.java │ │ │ │ ├── EdmImplProv.java │ │ │ │ ├── EdmNamedImplProv.java │ │ │ │ ├── EdmNavigationPropertyImplProv.java │ │ │ │ ├── EdmParameterImplProv.java │ │ │ │ ├── EdmPropertyImplProv.java │ │ │ │ ├── EdmServiceMetadataImplProv.java │ │ │ │ ├── EdmSimplePropertyImplProv.java │ │ │ │ ├── EdmStructuralTypeImplProv.java │ │ │ │ └── EdmTypedImplProv.java │ │ │ ├── ep │ │ │ ├── AtomEntityProvider.java │ │ │ ├── BasicEntityProvider.java │ │ │ ├── ContentTypeBasedEntityProvider.java │ │ │ ├── JsonEntityProvider.java │ │ │ ├── ProviderFacadeImpl.java │ │ │ ├── aggregator │ │ │ │ ├── EntityComplexPropertyInfo.java │ │ │ │ ├── EntityInfoAggregator.java │ │ │ │ ├── EntityPropertyInfo.java │ │ │ │ ├── EntityTypeMapping.java │ │ │ │ └── NavigationPropertyInfo.java │ │ │ ├── consumer │ │ │ │ ├── AtomServiceDocumentConsumer.java │ │ │ │ ├── JsonEntityConsumer.java │ │ │ │ ├── JsonEntryConsumer.java │ │ │ │ ├── JsonFeedConsumer.java │ │ │ │ ├── JsonLinkConsumer.java │ │ │ │ ├── JsonPropertyConsumer.java │ │ │ │ ├── JsonServiceDocumentConsumer.java │ │ │ │ ├── XmlEntityConsumer.java │ │ │ │ ├── XmlEntryConsumer.java │ │ │ │ ├── XmlFeedConsumer.java │ │ │ │ ├── XmlLinkConsumer.java │ │ │ │ └── XmlPropertyConsumer.java │ │ │ ├── entry │ │ │ │ ├── EntryMetadataImpl.java │ │ │ │ ├── MediaMetadataImpl.java │ │ │ │ └── ODataEntryImpl.java │ │ │ ├── feed │ │ │ │ ├── FeedMetadataImpl.java │ │ │ │ └── ODataFeedImpl.java │ │ │ ├── producer │ │ │ │ ├── AtomEntryEntityProducer.java │ │ │ │ ├── AtomFeedProducer.java │ │ │ │ ├── AtomServiceDocumentProducer.java │ │ │ │ ├── JsonCollectionEntityProducer.java │ │ │ │ ├── JsonEntryEntityProducer.java │ │ │ │ ├── JsonErrorDocumentProducer.java │ │ │ │ ├── JsonFeedEntityProducer.java │ │ │ │ ├── JsonLinkEntityProducer.java │ │ │ │ ├── JsonLinksEntityProducer.java │ │ │ │ ├── JsonPropertyEntityProducer.java │ │ │ │ ├── JsonServiceDocumentProducer.java │ │ │ │ ├── TombstoneProducer.java │ │ │ │ ├── XmlCollectionEntityProducer.java │ │ │ │ ├── XmlErrorDocumentProducer.java │ │ │ │ ├── XmlLinkEntityProducer.java │ │ │ │ ├── XmlLinksEntityProducer.java │ │ │ │ ├── XmlMetadataProducer.java │ │ │ │ └── XmlPropertyEntityProducer.java │ │ │ └── util │ │ │ │ ├── CircleStreamBuffer.java │ │ │ │ ├── FormatJson.java │ │ │ │ ├── FormatXml.java │ │ │ │ ├── JsonStreamWriter.java │ │ │ │ └── JsonUtils.java │ │ │ ├── exception │ │ │ ├── MessageService.java │ │ │ └── ODataRuntimeException.java │ │ │ ├── processor │ │ │ └── ODataSingleProcessorService.java │ │ │ ├── rest │ │ │ ├── MERGE.java │ │ │ ├── ODataExceptionMapperImpl.java │ │ │ ├── ODataRedirectLocator.java │ │ │ ├── ODataRootLocator.java │ │ │ ├── ODataSubLocator.java │ │ │ ├── PATCH.java │ │ │ ├── RestUtil.java │ │ │ ├── SubLocatorParameter.java │ │ │ └── app │ │ │ │ └── ODataApplication.java │ │ │ ├── rt │ │ │ └── RuntimeDelegateImpl.java │ │ │ ├── servicedocument │ │ │ ├── AcceptImpl.java │ │ │ ├── AtomInfoImpl.java │ │ │ ├── CategoriesImpl.java │ │ │ ├── CategoryImpl.java │ │ │ ├── CollectionImpl.java │ │ │ ├── CommonAttributesImpl.java │ │ │ ├── ExtensionAttributeImpl.java │ │ │ ├── ExtensionElementImpl.java │ │ │ ├── ServiceDocumentImpl.java │ │ │ ├── TitleImpl.java │ │ │ └── WorkspaceImpl.java │ │ │ └── uri │ │ │ ├── ExpandSelectTreeCreator.java │ │ │ ├── ExpandSelectTreeNodeImpl.java │ │ │ ├── KeyPredicateImpl.java │ │ │ ├── NavigationPropertySegmentImpl.java │ │ │ ├── NavigationSegmentImpl.java │ │ │ ├── SelectItemImpl.java │ │ │ ├── SystemQueryOption.java │ │ │ ├── UriInfoImpl.java │ │ │ ├── UriParserImpl.java │ │ │ ├── UriType.java │ │ │ └── expression │ │ │ ├── ActualBinaryOperator.java │ │ │ ├── BinaryExpressionImpl.java │ │ │ ├── ExpressionParserInternalError.java │ │ │ ├── FilterExpressionImpl.java │ │ │ ├── FilterParser.java │ │ │ ├── FilterParserExceptionImpl.java │ │ │ ├── FilterParserImpl.java │ │ │ ├── InfoBinaryOperator.java │ │ │ ├── InfoMethod.java │ │ │ ├── InfoUnaryOperator.java │ │ │ ├── InputTypeValidator.java │ │ │ ├── JsonVisitor.java │ │ │ ├── LiteralExpressionImpl.java │ │ │ ├── MemberExpressionImpl.java │ │ │ ├── MethodExpressionImpl.java │ │ │ ├── OrderByExpressionImpl.java │ │ │ ├── OrderByParser.java │ │ │ ├── OrderByParserImpl.java │ │ │ ├── OrderExpressionImpl.java │ │ │ ├── ParameterSet.java │ │ │ ├── ParameterSetCombination.java │ │ │ ├── PropertyExpressionImpl.java │ │ │ ├── Token.java │ │ │ ├── TokenKind.java │ │ │ ├── TokenList.java │ │ │ ├── Tokenizer.java │ │ │ ├── TokenizerException.java │ │ │ ├── TokenizerExpectError.java │ │ │ ├── TokenizerRTException.java │ │ │ └── UnaryExpressionImpl.java │ └── resources │ │ ├── i18n.properties │ │ ├── i18n_de.properties │ │ ├── i18n_de_DE.properties │ │ ├── i18n_en.properties │ │ └── i18n_en_US.properties │ └── test │ ├── java │ ├── META-INF │ │ └── MANIFEST.MF │ └── com │ │ └── sap │ │ └── core │ │ └── odata │ │ └── core │ │ ├── ContentNegotiatorTest.java │ │ ├── DispatcherTest.java │ │ ├── ODataContextImplTest.java │ │ ├── ODataExceptionWrapperTest.java │ │ ├── ODataRequestHandlerValidationTest.java │ │ ├── ODataResponseTest.java │ │ ├── PathSegmentTest.java │ │ ├── batch │ │ ├── AcceptParserTest.java │ │ ├── BatchRequestParserTest.java │ │ ├── BatchRequestWriterTest.java │ │ ├── BatchResponseParserTest.java │ │ └── BatchResponseWriterTest.java │ │ ├── commons │ │ ├── ContentTypeTest.java │ │ ├── DecoderTest.java │ │ └── EncoderTest.java │ │ ├── debug │ │ ├── DebugInfoBodyTest.java │ │ └── ODataDebugResponseWrapperTest.java │ │ ├── edm │ │ ├── EdmImplTest.java │ │ ├── EdmSimpleTypeFacadeTest.java │ │ ├── EdmSimpleTypeTest.java │ │ ├── parser │ │ │ ├── EdmParserTest.java │ │ │ └── EdmxProviderTest.java │ │ └── provider │ │ │ ├── EdmAnnotationsImplProvTest.java │ │ │ ├── EdmAssociationEndImplProvTest.java │ │ │ ├── EdmAssociationImplProvTest.java │ │ │ ├── EdmAssociationSetEndImplProvTest.java │ │ │ ├── EdmAssociationSetImplProvTest.java │ │ │ ├── EdmComplexTypeImplProvTest.java │ │ │ ├── EdmEntityContainerImplProvTest.java │ │ │ ├── EdmEntitySetInfoImplProvTest.java │ │ │ ├── EdmEntitySetProvTest.java │ │ │ ├── EdmEntityTypeImplProvTest.java │ │ │ ├── EdmFunctionImportImplProvTest.java │ │ │ ├── EdmImplProvTest.java │ │ │ ├── EdmMappingTest.java │ │ │ ├── EdmNamedImplProvTest.java │ │ │ ├── EdmNavigationPropertyImplProvTest.java │ │ │ ├── EdmPropertyImplProvTest.java │ │ │ └── EdmServiceMetadataImplProvTest.java │ │ ├── ep │ │ ├── AbstractProviderTest.java │ │ ├── AbstractXmlProducerTestHelper.java │ │ ├── BasicProviderTest.java │ │ ├── LoadXMLFactoryTest.java │ │ ├── ODataEntityProviderPropertiesTest.java │ │ ├── PerformanceTest.java │ │ ├── ProviderFacadeImplTest.java │ │ ├── aggregator │ │ │ └── EntityInfoAggregatorTest.java │ │ ├── consumer │ │ │ ├── AbstractConsumerTest.java │ │ │ ├── AtomServiceDocumentConsumerTest.java │ │ │ ├── JsonEntryConsumerTest.java │ │ │ ├── JsonEntryDeepInsertEntryTest.java │ │ │ ├── JsonEntryDeepInsertFeedTest.java │ │ │ ├── JsonFeedConsumerTest.java │ │ │ ├── JsonLinkConsumerTest.java │ │ │ ├── JsonPropertyConsumerTest.java │ │ │ ├── JsonServiceDocumentConsumerTest.java │ │ │ ├── ServiceDocumentConsumerTest.java │ │ │ ├── XmlEntityConsumerTest.java │ │ │ ├── XmlFeedConsumerTest.java │ │ │ ├── XmlLinkConsumerTest.java │ │ │ └── XmlPropertyConsumerTest.java │ │ ├── producer │ │ │ ├── AtomEntryProducerTest.java │ │ │ ├── AtomFeedProducerTest.java │ │ │ ├── AtomServiceDocumentProducerTest.java │ │ │ ├── JsonEntryEntityProducerTest.java │ │ │ ├── JsonErrorProducerTest.java │ │ │ ├── JsonFeedEntityProducerTest.java │ │ │ ├── JsonFunctionImportTest.java │ │ │ ├── JsonLinkEntityProducerTest.java │ │ │ ├── JsonLinksEntityProducerTest.java │ │ │ ├── JsonPropertyProducerTest.java │ │ │ ├── JsonServiceDocumentProducerTest.java │ │ │ ├── MyCallback.java │ │ │ ├── ServiceDocumentProducerTest.java │ │ │ ├── TombstoneCallbackImpl.java │ │ │ ├── TombstoneProducerTest.java │ │ │ ├── XmlErrorProducerTest.java │ │ │ ├── XmlExpandProducerTest.java │ │ │ ├── XmlFeedWithTombstonesProducerTest.java │ │ │ ├── XmlFunctionImportTest.java │ │ │ ├── XmlLinkEntityProducerTest.java │ │ │ ├── XmlLinksEntityProducerTest.java │ │ │ ├── XmlMetadataProducerTest.java │ │ │ ├── XmlPropertyProducerTest.java │ │ │ └── XmlSelectProducerTest.java │ │ └── util │ │ │ ├── CircleStreamBufferTest.java │ │ │ └── JsonStreamWriterTest.java │ │ ├── exception │ │ ├── MessageReferenceTest.java │ │ ├── MessageServiceTest.java │ │ ├── ODataExceptionTest.java │ │ └── ODataMessageTextVerifierTest.java │ │ ├── processor │ │ └── ODataSingleProcessorServiceTest.java │ │ ├── rest │ │ ├── ODataErrorHandlerCallbackImpl.java │ │ ├── ODataExceptionMapperImplTest.java │ │ └── ODataServiceFactoryImpl.java │ │ ├── rt │ │ └── RuntimeDelegateTest.java │ │ └── uri │ │ ├── ExpandSelectTreeCreatorImplTest.java │ │ ├── QueryOptionsEnumTest.java │ │ ├── UriInfoTest.java │ │ ├── UriParserFacadeTest.java │ │ ├── UriParserTest.java │ │ └── expression │ │ ├── FilterParserImplTool.java │ │ ├── FilterToJsonTest.java │ │ ├── ParserTool.java │ │ ├── TestAbapCompatibility.java │ │ ├── TestBase.java │ │ ├── TestExceptionTexts.java │ │ ├── TestParser.java │ │ ├── TestParserExceptions.java │ │ ├── TestSpec.java │ │ ├── TestTokenizer.java │ │ ├── TokenTool.java │ │ └── VisitorTool.java │ └── resources │ ├── InvalidSvcDocJson2.txt │ ├── JsonBuilding │ ├── JsonBuildingWithInlineRooms │ ├── JsonBuildingWithInlineRoomsAndNextLinkAndCount │ ├── JsonBuildingWithoutD │ ├── JsonEmployee │ ├── JsonEmployeeWithInlineTeam │ ├── JsonInlineRoomWithInlineBuilding │ ├── JsonInvalidTeamDoubleNameProperty │ ├── JsonTeam │ ├── JsonTeams │ ├── JsonTeamsWithCount │ ├── JsonTeamsWithCountWithoutD │ ├── JsonTeamsWithInlineEmployees │ ├── JsonTeamsWithoutD │ ├── batchRequest.txt │ ├── batchResponse.txt │ ├── batchWithContent.txt │ ├── batchWithPost.txt │ ├── double_expanded_team.xml │ ├── employee_empty_room.xml │ ├── expandedBuilding.xml │ ├── expanded_team.xml │ ├── feed_employees.xml │ ├── feed_employees_full.xml │ ├── feed_with_delta_link.xml │ ├── i18n_test_SAP.properties │ ├── invalidSvcDocJson.txt │ ├── invalidSvcExample.xml │ ├── refScenario.edmx │ ├── serviceDocExample.xml │ ├── serviceDocument.xml │ ├── svcAtomExample.xml │ ├── svcDocJson.txt │ ├── svcDocWithoutTitle.xml │ └── svcExample.xml ├── odata-fit ├── pom.xml └── src │ └── test │ ├── java │ └── com │ │ └── sap │ │ └── core │ │ └── odata │ │ └── fit │ │ ├── basic │ │ ├── AbstractBasicTest.java │ │ ├── AcceptHeaderTypeTest.java │ │ ├── BasicBatchTest.java │ │ ├── BasicHttpTest.java │ │ ├── ContentNegotiationDollarFormatTest.java │ │ ├── ContextTest.java │ │ ├── ErrorResponseTest.java │ │ ├── ExceptionsTest.java │ │ ├── FitLoadTest.java │ │ ├── HttpExceptionResponseTest.java │ │ ├── LanguageNegotiationTest.java │ │ ├── MetadataTest.java │ │ ├── RequestContentTypeTest.java │ │ ├── ServiceResolutionTest.java │ │ ├── UrlRewriteTest.java │ │ └── issues │ │ │ └── TestIssue105.java │ │ ├── client │ │ └── ClientBatchTest.java │ │ ├── mapping │ │ ├── MapFactory.java │ │ ├── MapProcessor.java │ │ ├── MapProvider.java │ │ └── MappingTest.java │ │ └── ref │ │ ├── AbstractRefJsonTest.java │ │ ├── AbstractRefTest.java │ │ ├── AbstractRefXmlTest.java │ │ ├── BatchTest.java │ │ ├── ContentNegotiationTest.java │ │ ├── DataServiceVersionTest.java │ │ ├── EntryJsonChangeTest.java │ │ ├── EntryJsonCreateInlineTest.java │ │ ├── EntryJsonCreateTest.java │ │ ├── EntryJsonReadOnlyTest.java │ │ ├── EntryXmlChangeTest.java │ │ ├── EntryXmlCreateTest.java │ │ ├── EntryXmlReadOnlyTest.java │ │ ├── FeedJsonReadOnlyTest.java │ │ ├── FeedXmlReadOnlyTest.java │ │ ├── FunctionImportJsonTest.java │ │ ├── FunctionImportXmlTest.java │ │ ├── LinksJsonChangeTest.java │ │ ├── LinksJsonReadOnlyTest.java │ │ ├── LinksXmlChangeTest.java │ │ ├── LinksXmlReadOnlyTest.java │ │ ├── MetadataTest.java │ │ ├── MiscChangeTest.java │ │ ├── MiscReadOnlyTest.java │ │ ├── PropertyJsonChangeTest.java │ │ ├── PropertyJsonReadOnlyTest.java │ │ ├── PropertyXmlChangeTest.java │ │ ├── PropertyXmlReadOnlyTest.java │ │ ├── ServiceJsonTest.java │ │ ├── ServiceXmlTest.java │ │ └── contentnegotiation │ │ ├── AbstractContentNegotiationTest.java │ │ ├── ContentNegotiationGetRequestTest.java │ │ └── ContentNegotiationPostRequestTest.java │ └── resources │ ├── batchWithContentId.batch │ ├── changeset.batch │ ├── error.batch │ ├── i18n.properties │ ├── i18n_it.properties │ ├── room_w_four_inlined_employees.xml │ └── simple.batch ├── odata-ref ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── sap │ │ │ └── core │ │ │ └── odata │ │ │ └── ref │ │ │ ├── edm │ │ │ └── ScenarioEdmProvider.java │ │ │ ├── model │ │ │ ├── Building.java │ │ │ ├── City.java │ │ │ ├── DataContainer.java │ │ │ ├── Employee.java │ │ │ ├── Location.java │ │ │ ├── Manager.java │ │ │ ├── ModelException.java │ │ │ ├── Photo.java │ │ │ ├── Room.java │ │ │ └── Team.java │ │ │ └── processor │ │ │ ├── ListsDataSource.java │ │ │ ├── ListsProcessor.java │ │ │ ├── ScenarioDataSource.java │ │ │ ├── ScenarioErrorCallback.java │ │ │ └── ScenarioServiceFactory.java │ └── 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 │ └── test │ └── java │ └── com │ └── sap │ └── core │ └── odata │ └── ref │ ├── model │ ├── BuildingTest.java │ ├── DataContainerTest.java │ ├── EmployeeTest.java │ ├── ManagerTest.java │ ├── RoomTest.java │ └── TeamTest.java │ └── read │ ├── EntitySetTest.java │ └── EntityTest.java ├── odata-testutil ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── sap │ │ └── core │ │ └── odata │ │ └── testutil │ │ ├── TestUtilRuntimeException.java │ │ ├── fit │ │ ├── AbstractFitTest.java │ │ ├── BaseTest.java │ │ ├── FitErrorCallback.java │ │ ├── FitStaticServiceFactory.java │ │ └── Log4JConfigurationTest.java │ │ ├── helper │ │ ├── ClassHelper.java │ │ ├── HttpMerge.java │ │ ├── HttpSomethingUnsupported.java │ │ ├── ODataMessageTextVerifier.java │ │ ├── ProcessLocker.java │ │ ├── StringHelper.java │ │ └── XMLUnitHelper.java │ │ ├── mock │ │ ├── EdmMock.java │ │ ├── EdmTestProvider.java │ │ ├── MockFacade.java │ │ ├── SampleClassForInvalidMessageReferences.java │ │ ├── TecEdmInfo.java │ │ └── TechnicalScenarioEdmProvider.java │ │ └── server │ │ ├── ServerRuntimeException.java │ │ └── TestServer.java │ └── resources │ └── log4j.xml ├── odata-web ├── pom.xml └── src │ └── main │ ├── resources │ └── log4j.xml │ ├── version │ └── version.html │ └── webapp │ ├── WEB-INF │ └── web.xml │ └── index.jsp ├── pom.xml └── src ├── checkstyle └── config.xml ├── doc └── EnablingJPAModelsAsODataServicesV1.0_en.pdf ├── eclipse ├── codetemplates.xml ├── eclipse-cleanup-profile.xml ├── eclipse-codestyle-formatter.xml ├── eclipse-codetemplates.xml └── org.eclipse.jdt.core.prefs ├── etc └── header.txt └── git └── hooks └── pre-commit /.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 | -------------------------------------------------------------------------------- /.reuse/dep5: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: OData Library (Java) 3 | Upstream-Contact: Michael Bolz 4 | Source: https://github.com/SAP/cloud-odata-java 5 | 6 | Files: * 7 | Copyright: 2020 SAP SE or an SAP affiliate company and OData library contributors 8 | License: Apache-2.0 9 | 10 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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.api.annotation/src/main/java/com/sap/core/odata/api/annotation/edm/Documentation.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 Documentation { 26 | String summary() default ""; 27 | 28 | String longDescription() default ""; 29 | } 30 | -------------------------------------------------------------------------------- /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/edm/FunctionImport.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 | import com.sap.core.odata.api.annotation.edmx.HttpMethod; 24 | import com.sap.core.odata.api.annotation.edmx.HttpMethod.Name; 25 | 26 | @Retention(RetentionPolicy.RUNTIME) 27 | @Target(ElementType.METHOD) 28 | public @interface FunctionImport { 29 | 30 | enum ReturnType { 31 | SCALAR, ENTITY_TYPE, COMPLEX_TYPE, NONE 32 | } 33 | 34 | enum Multiplicity { 35 | MANY, ONE 36 | } 37 | 38 | String name() default ""; 39 | 40 | String entitySet() default ""; 41 | 42 | ReturnType returnType(); 43 | 44 | Multiplicity multiplicity() default Multiplicity.ONE; 45 | 46 | HttpMethod httpMethod() default @HttpMethod(name = Name.GET); 47 | 48 | Documentation documentation() default @Documentation; 49 | } 50 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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.api/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /com.sap.core.odata.processor.api/src/main/java/com/sap/core/odata/processor/api/jpa/access/JPAMethodContextView.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.List; 19 | 20 | /** 21 | * The interface provides view on JPA Method Context. JPA Method context can be 22 | * used to access custom operations or JPA Entity property access methods. 23 | * 24 | * @author SAP AG 25 | * 26 | */ 27 | public interface JPAMethodContextView { 28 | /** 29 | * The method returns an instance of Object on which the methods/custom 30 | * operations can be executed. 31 | * 32 | * @return instance of enclosing object for the method 33 | */ 34 | public Object getEnclosingObject(); 35 | 36 | /** 37 | * The method returns list of JPA functions that can be executed on the 38 | * enclosing object. 39 | * 40 | * @return an instance of list of JPA Function 41 | */ 42 | public List getJPAFunctionList(); 43 | } 44 | -------------------------------------------------------------------------------- /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> operationEntityMap; 25 | 26 | public JPAProcessor getJpaProcessor() { 27 | return jpaProcessor; 28 | } 29 | 30 | public void setJpaProcessor(final JPAProcessor jpaProcessor) { 31 | this.jpaProcessor = jpaProcessor; 32 | } 33 | 34 | public HashMap> getOperationEntityMap() { 35 | return operationEntityMap; 36 | } 37 | 38 | public void setOperationEntityMap(final HashMap> operationEntityMap) { 39 | this.operationEntityMap = operationEntityMap; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /com.sap.core.odata.processor.api/src/main/java/com/sap/core/odata/processor/api/jpa/access/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | *

OData JPA Processor API Library - Java Persistence Access

3 | * The library provides a set of APIs to access Java Persistence Models and Data. 4 | * 5 | * @author SAP AG 6 | */ 7 | package com.sap.core.odata.processor.api.jpa.access; 8 | 9 | -------------------------------------------------------------------------------- /com.sap.core.odata.processor.api/src/main/java/com/sap/core/odata/processor/api/jpa/exception/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | *

OData JPA Processor API Library - Exceptions

3 | * There are two main types of exceptions thrown from the library 4 | *
  1. Model Exception
  2. 5 | *
  3. Runtime Exception
6 | *
7 | * The Model Exception is thrown while processing JPA metamodels and 8 | * runtime exception is thrown while processing persistence data. 9 | * 10 | * @author SAP AG 11 | */ 12 | package com.sap.core.odata.processor.api.jpa.exception; 13 | 14 | -------------------------------------------------------------------------------- /com.sap.core.odata.processor.api/src/main/java/com/sap/core/odata/processor/api/jpa/factory/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | *

OData JPA Processor API Library - Factory

3 | * The library provides different types of factories for creating instances for 4 | *
    5 | *
  • Accessing Java Persistence Model/Data
  • 6 | *
  • Building different types of JPQL statements
  • 7 | *
  • Accessing OData EDM provider and processor
  • 8 | *
9 | * 10 | * The instances of these factories can be obtained from an abstract ODataJPAFactory. 11 | * 12 | * @author SAP AG 13 | */ 14 | package com.sap.core.odata.processor.api.jpa.factory; 15 | 16 | -------------------------------------------------------------------------------- /com.sap.core.odata.processor.api/src/main/java/com/sap/core/odata/processor/api/jpa/jpql/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | *

OData JPA Processor API Library - Java Persistence Query Language

3 | * The library provides set of APIs for building JPQL contexts from OData Requests. 4 | * The JPQL contexts thus built can be used for building JPQL Statements. 5 | * 6 | * @author SAP AG 7 | */ 8 | package com.sap.core.odata.processor.api.jpa.jpql; 9 | 10 | -------------------------------------------------------------------------------- /com.sap.core.odata.processor.api/src/main/java/com/sap/core/odata/processor/api/jpa/model/mapping/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | *

OData JPA Processor API Library - Mapping Model

3 | * The JPA EDM Mapping model (XML document) is represented as JAXB annotated Java Classes. 4 | * 5 | * @author SAP AG 6 | */ 7 | @javax.xml.bind.annotation.XmlSchema(namespace = "http://www.sap.com/core/odata/processor/api/jpa/model/mapping", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) 8 | package com.sap.core.odata.processor.api.jpa.model.mapping; 9 | 10 | -------------------------------------------------------------------------------- /com.sap.core.odata.processor.api/src/main/java/com/sap/core/odata/processor/api/jpa/model/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | *

OData JPA Processor API Library - JPA EDM Model

3 | * The library provides a set of views over the JPA/EDM element containers. 4 | * The views can used to access the elements that form EDM. 5 | * 6 | * @author SAP AG 7 | */ 8 | package com.sap.core.odata.processor.api.jpa.model; 9 | 10 | -------------------------------------------------------------------------------- /com.sap.core.odata.processor.api/src/main/java/com/sap/core/odata/processor/api/jpa/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | *

OData 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 | *
  1. extend the service factory class {@link com.sap.core.odata.processor.api.jpa.ODataJPAServiceFactory} 8 | * and implement the methods
  2. 9 | *
  3. define a JAX-RS servlet in web.xml and configure the service factory as servlet init parameter. 10 | *

    See Also:{@link com.sap.core.odata.processor.api.jpa.ODataJPAServiceFactory}

11 | * 12 | * @author SAP AG 13 | */ 14 | package com.sap.core.odata.processor.api.jpa; 15 | 16 | -------------------------------------------------------------------------------- /com.sap.core.odata.processor.core/.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | .classpath 3 | .settings 4 | target 5 | bin 6 | *.bak 7 | classes 8 | .DS_Store -------------------------------------------------------------------------------- /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/main/java/com/sap/core/odata/processor/core/jpa/model/JPAEdmMappingImpl.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.core.jpa.model; 17 | 18 | import com.sap.core.odata.api.edm.provider.Mapping; 19 | import com.sap.core.odata.processor.api.jpa.model.JPAEdmMapping; 20 | 21 | public class JPAEdmMappingImpl extends Mapping implements JPAEdmMapping { 22 | 23 | private String columnName = null; 24 | private Class type = null; 25 | 26 | @Override 27 | public void setJPAColumnName(final String name) { 28 | columnName = name; 29 | 30 | } 31 | 32 | @Override 33 | public String getJPAColumnName() { 34 | return columnName; 35 | } 36 | 37 | @Override 38 | public void setJPAType(final Class type) { 39 | this.type = type; 40 | 41 | } 42 | 43 | @Override 44 | public Class getJPAType() { 45 | return type; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /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.core/src/test/java/com/sap/core/odata/processor/core/jpa/common/ODataJPATestConstants.java: -------------------------------------------------------------------------------- 1 | package com.sap.core.odata.processor.core.jpa.common; 2 | 3 | public final class ODataJPATestConstants { 4 | 5 | public static final String EXCEPTION_MSG_PART_1 = "Exception [ "; 6 | public static final String EXCEPTION_MSG_PART_2 = " ] not expected"; 7 | public static final String EMPTY_STRING = "gwt1"; 8 | public static final String EXCEPTION_EXPECTED = "Exception expected"; 9 | } 10 | -------------------------------------------------------------------------------- /com.sap.core.odata.processor.core/src/test/java/com/sap/core/odata/processor/core/jpa/mock/data/SalesOrderHeader.java: -------------------------------------------------------------------------------- 1 | package com.sap.core.odata.processor.core.jpa.mock.data; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class SalesOrderHeader { 7 | 8 | private int id; 9 | private String description; 10 | 11 | public SalesOrderHeader() 12 | {} 13 | 14 | public SalesOrderHeader(final int id, final String description) { 15 | super(); 16 | this.id = id; 17 | this.description = description; 18 | } 19 | 20 | private List salesOrderLineItems = new ArrayList(); 21 | 22 | public String getDescription() { 23 | return description; 24 | } 25 | 26 | public void setDescription(final String description) { 27 | this.description = description; 28 | } 29 | 30 | public int getId() { 31 | return id; 32 | } 33 | 34 | public void setId(final int id) { 35 | this.id = id; 36 | } 37 | 38 | public List getSalesOrderLineItems() { 39 | return salesOrderLineItems; 40 | } 41 | 42 | public void setSalesOrderLineItems(final List salesOrderLineItems) { 43 | this.salesOrderLineItems = salesOrderLineItems; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /com.sap.core.odata.processor.core/src/test/java/com/sap/core/odata/processor/core/jpa/mock/data/SalesOrderLineItem.java: -------------------------------------------------------------------------------- 1 | package com.sap.core.odata.processor.core.jpa.mock.data; 2 | 3 | public class SalesOrderLineItem { 4 | 5 | private int price; 6 | 7 | public SalesOrderLineItem(final int price) { 8 | super(); 9 | this.price = price; 10 | } 11 | 12 | public int getPrice() { 13 | return price; 14 | } 15 | 16 | public void setPrice(final int price) { 17 | this.price = price; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /com.sap.core.odata.processor.core/src/test/java/com/sap/core/odata/processor/core/jpa/mock/data/SalesOrderLineItemKey.java: -------------------------------------------------------------------------------- 1 | package com.sap.core.odata.processor.core.jpa.mock.data; 2 | 3 | public class SalesOrderLineItemKey { 4 | 5 | private int soId; 6 | private int liId; 7 | 8 | public SalesOrderLineItemKey() { 9 | 10 | } 11 | 12 | public SalesOrderLineItemKey(final int soId, final int liId) { 13 | super(); 14 | this.soId = soId; 15 | this.liId = liId; 16 | } 17 | 18 | public int getSoId() { 19 | return soId; 20 | } 21 | 22 | public void setSoId(final int soId) { 23 | this.soId = soId; 24 | } 25 | 26 | public int getLiId() { 27 | return liId; 28 | } 29 | 30 | public void setLiId(final int liId) { 31 | this.liId = liId; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /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/ODataDebugCallback.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 | * @author SAP AG 20 | * 21 | */ 22 | public interface ODataDebugCallback extends ODataCallback { 23 | 24 | /** 25 | * Determines whether additional debug information can be retrieved 26 | * from this OData service for the current request. 27 | * @return 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/batch/BatchRequestPart.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.batch; 17 | 18 | import java.util.List; 19 | 20 | import com.sap.core.odata.api.processor.ODataRequest; 21 | 22 | /** 23 | * A BatchPart 24 | *

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 getRequests(); 40 | } 41 | -------------------------------------------------------------------------------- /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 | *

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 getChangeSetParts(); 26 | 27 | /** 28 | * Get new builder instance 29 | * @return {@link BatchChangeSetBuilder} 30 | */ 31 | public static BatchChangeSetBuilder newBuilder() { 32 | return BatchChangeSetBuilder.newInstance(); 33 | } 34 | 35 | public static abstract class BatchChangeSetBuilder { 36 | 37 | protected BatchChangeSetBuilder() {} 38 | 39 | private static BatchChangeSetBuilder newInstance() { 40 | return RuntimeDelegate.createBatchChangeSetBuilder(); 41 | } 42 | 43 | public abstract BatchChangeSet build(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/client/batch/BatchPart.java: -------------------------------------------------------------------------------- 1 | package com.sap.core.odata.api.client.batch; 2 | 3 | /** 4 | * A BatchPartRequest 5 | *

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-api/src/main/java/com/sap/core/odata/api/client/batch/BatchSingleResponse.java: -------------------------------------------------------------------------------- 1 | package com.sap.core.odata.api.client.batch; 2 | 3 | import java.util.Map; 4 | import java.util.Set; 5 | 6 | /** 7 | * A BatchSingleResponse 8 | *

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 getHeaders(); 36 | 37 | /** 38 | * @param name HTTP response header name 39 | * @return a header value or null if not set 40 | */ 41 | public String getHeader(final String name); 42 | 43 | /** 44 | * @return a set of all available header names 45 | */ 46 | public Set getHeaderNames(); 47 | 48 | } 49 | -------------------------------------------------------------------------------- /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-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/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 | -------------------------------------------------------------------------------- /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/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/EdmAnnotatable.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 | * EdmAnnotatable can be applied to CSDL elements as described in the Conceptual Schema Definition Language. 21 | * @author SAP AG 22 | */ 23 | public interface EdmAnnotatable { 24 | 25 | /** 26 | * Get all annotations applied to an EDM element 27 | * 28 | * @return {@link EdmAnnotations} 29 | * @throws EdmException 30 | */ 31 | EdmAnnotations getAnnotations() throws EdmException; 32 | } 33 | -------------------------------------------------------------------------------- /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 | *

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 | -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/edm/EdmAssociation.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 Association element 21 | * 22 | *

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/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/edm/EdmAssociationSet.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 AssociationSet element 21 | * 22 | *

EdmAssociationSet defines the relationship of two entity sets. 23 | * @author SAP AG 24 | */ 25 | public interface EdmAssociationSet extends EdmNamed { 26 | 27 | /** 28 | * Get the association 29 | * 30 | * @return {@link EdmAssociation} 31 | * @throws EdmException 32 | */ 33 | EdmAssociation getAssociation() throws EdmException; 34 | 35 | /** 36 | * Get the association set end 37 | * 38 | * @param role 39 | * @return {@link EdmAssociationSetEnd} 40 | * @throws EdmException 41 | */ 42 | EdmAssociationSetEnd getEnd(String role) throws EdmException; 43 | 44 | /** 45 | * Get the entity container the association set is located in 46 | * 47 | * @return {@link EdmEntityContainer} 48 | * @throws EdmException 49 | */ 50 | EdmEntityContainer getEntityContainer() throws EdmException; 51 | } 52 | -------------------------------------------------------------------------------- /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-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.

20 | *

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-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/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-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/edm/EdmEntitySetInfo.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 | import java.net.URI; 19 | 20 | /** 21 | * @com.sap.core.odata.DoNotImplement 22 | * Objects of this class contain information about one entity set inside the EntityDataModel. 23 | * @author SAP AG 24 | * 25 | */ 26 | public interface EdmEntitySetInfo { 27 | 28 | /** 29 | * @return the entity container name which contains this entity set. 30 | */ 31 | public String getEntityContainerName(); 32 | 33 | /** 34 | * @return the entity set name 35 | */ 36 | public String getEntitySetName(); 37 | 38 | /** 39 | * @return true if this entity set is contained inside the default container 40 | */ 41 | public boolean isDefaultEntityContainer(); 42 | 43 | /** 44 | * We use a {@link URI} object here to ensure the right encoding. If a string representation is needed the toASCIIString() method can be used. 45 | * @return the uri to this entity set e.g. "Employees" 46 | */ 47 | public URI getEntitySetUri(); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /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/edm/EdmMappable.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 | * EdmMappable can be applied to CSDL elements to associate additional information. 21 | * @author SAP AG 22 | */ 23 | public interface EdmMappable { 24 | 25 | /** 26 | * Get mapping information applied to an EDM element 27 | * 28 | * @return {@link EdmMapping} 29 | * @throws EdmException 30 | */ 31 | EdmMapping getMapping() throws EdmException; 32 | } 33 | -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/edm/EdmMapping.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 | * EdmMapping holds custom mapping information which can be applied to a CSDL element. 21 | * @author SAP AG 22 | */ 23 | public interface EdmMapping { 24 | 25 | /** 26 | * Get the mapping value 27 | * 28 | * @return mapping name as String 29 | */ 30 | String getInternalName(); 31 | 32 | /** 33 | * Get the mapping name for mime type lookup 34 | * 35 | * @return mapping name as String 36 | */ 37 | String getMimeType(); 38 | 39 | /** 40 | * Get the set object for this mapping 41 | * 42 | * @return {@link Object} object 43 | */ 44 | Object getObject(); 45 | } 46 | -------------------------------------------------------------------------------- /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/edm/EdmNavigationProperty.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 NavigationProperty element 21 | * 22 | *

EdmNavigationProperty allows navigation from one entity type to another via a relationship. 23 | * @author SAP AG 24 | */ 25 | public interface EdmNavigationProperty extends EdmTyped, EdmMappable { 26 | 27 | /** 28 | * Get the relationship of the navigation property 29 | * 30 | * @return {@link EdmAssociation} 31 | * @throws EdmException 32 | */ 33 | EdmAssociation getRelationship() throws EdmException; 34 | 35 | /** 36 | * Get the from role of the navigation property 37 | * 38 | * @return from role as String 39 | * @throws EdmException 40 | */ 41 | String getFromRole() throws EdmException; 42 | 43 | /** 44 | * Get the to role of the navigation property 45 | * 46 | * @return to role as String 47 | * @throws EdmException 48 | */ 49 | String getToRole() throws EdmException; 50 | } 51 | -------------------------------------------------------------------------------- /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-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 | *

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-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 | -------------------------------------------------------------------------------- /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/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/edm/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | *

Entity Data Model API

3 | *

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-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-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/ep/callback/OnWriteFeedContent.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 com.sap.core.odata.api.ODataCallback; 19 | import com.sap.core.odata.api.exception.ODataApplicationException; 20 | 21 | /** 22 | * Callback interface for the $expand query option. 23 | *

If an expand clause for a navigation property which points to a feed is found this callback will be called. 24 | *
Pointing to an feed means the navigation property has a multiplicity of 0..* or 1..*. 25 | * 26 | * @author SAP AG 27 | * 28 | */ 29 | public interface OnWriteFeedContent extends ODataCallback { 30 | 31 | /** 32 | * Retrieves the data for a feed. See {@link WriteFeedCallbackContext} for details on the context and {@link WriteFeedCallbackResult} for details on the result of this method. 33 | * @param context of this entry 34 | * @return result - must not be null. 35 | * @throws ODataApplicationException 36 | */ 37 | WriteFeedCallbackResult retrieveFeedResult(WriteFeedCallbackContext context) throws ODataApplicationException; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /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-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/ep/callback/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Entity Provider Callbacks

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 and will only be called if a matching $expand clause is found. 8 | */ 9 | package com.sap.core.odata.api.ep.callback; -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/ep/entry/EntryMetadata.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.entry; 17 | 18 | import java.util.List; 19 | 20 | /** 21 | * {@link EntryMetadata} contains all metadata for an {@link ODataEntry}. 22 | */ 23 | public interface EntryMetadata { 24 | 25 | /** 26 | * Gets the URI of this entry. 27 | * 28 | * @return the URI 29 | */ 30 | public abstract String getUri(); 31 | 32 | /** 33 | * Gets the association URIs for a given navigation property. 34 | * 35 | * @param navigationPropertyName the name of the navigation property 36 | * @return the list of URIs for the given navigation property 37 | */ 38 | public abstract List getAssociationUris(String navigationPropertyName); 39 | 40 | /** 41 | * Gets the entity tag for this entry. 42 | * 43 | * @return the entity tag 44 | */ 45 | public abstract String getEtag(); 46 | 47 | /** 48 | * Gets the ID of this entry. 49 | * 50 | * @return the ID 51 | */ 52 | public abstract String getId(); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/ep/entry/MediaMetadata.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.entry; 17 | 18 | /** 19 | * {@link MediaMetadata} contains all metadata for media related entries. 20 | */ 21 | public interface MediaMetadata { 22 | 23 | /** 24 | * Get 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/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/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-api/src/main/java/com/sap/core/odata/api/ep/feed/ODataFeed.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 | import java.util.List; 19 | 20 | import com.sap.core.odata.api.ep.entry.ODataEntry; 21 | 22 | /** 23 | * An {@link ODataFeed} object contains a list of {@link ODataEntry}s and the metadata associated with this feed. 24 | * @author SAP AG 25 | * 26 | */ 27 | public interface ODataFeed { 28 | 29 | /** 30 | * The returned list may be empty but never null. 31 | * @return list of {@link ODataEntry}s 32 | */ 33 | public List getEntries(); 34 | 35 | /** 36 | * @return {@link FeedMetadata} object 37 | */ 38 | public FeedMetadata getFeedMetadata(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /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/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Entity Provider

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 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 | *

11 | * For support of additional formats it is recommended to handle those directly within an implementation of a 12 | * 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-api/src/main/java/com/sap/core/odata/api/processor/ODataProcessor.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; 17 | 18 | import com.sap.core.odata.api.exception.ODataException; 19 | 20 | /** 21 | * An ODataProcessor 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/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/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-api/src/main/java/com/sap/core/odata/api/processor/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Data Processor

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 | * ODataSingleService default implementation. 20 | * 21 | */ 22 | package com.sap.core.odata.api.processor; -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/processor/part/FunctionImportProcessor.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.GetFunctionImportUriInfo; 22 | 23 | /** 24 | * Execute an OData function import request. 25 | * @author SAP AG 26 | */ 27 | public interface FunctionImportProcessor extends ODataProcessor { 28 | /** 29 | * Executes a function import and returns the result. 30 | * @param uriInfo information about the request URI 31 | * @param contentType the content type of the response 32 | * @return an {@link ODataResponse} object 33 | * @throws ODataException 34 | */ 35 | ODataResponse executeFunctionImport(GetFunctionImportUriInfo uriInfo, String contentType) throws ODataException; 36 | } 37 | -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/processor/part/FunctionImportValueProcessor.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.GetFunctionImportUriInfo; 22 | 23 | /** 24 | * Execute an OData function import value request. 25 | * @author SAP AG 26 | */ 27 | public interface FunctionImportValueProcessor extends ODataProcessor { 28 | /** 29 | * Returns the unformatted value of a function import. 30 | * @param uriInfo information about the request URI 31 | * @param contentType the content type of the response 32 | * @return an {@link ODataResponse} object 33 | * @throws ODataException 34 | */ 35 | ODataResponse executeFunctionImportValue(GetFunctionImportUriInfo uriInfo, String contentType) throws ODataException; 36 | } 37 | -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/processor/part/MetadataProcessor.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.GetMetadataUriInfo; 22 | 23 | /** 24 | * Execute a OData metadata request. 25 | * 26 | * @author SAP AG 27 | */ 28 | public interface MetadataProcessor extends ODataProcessor { 29 | 30 | /** 31 | * @param contentType 32 | * @return a {@link ODataResponse} object 33 | * @throws ODataException 34 | */ 35 | ODataResponse readMetadata(GetMetadataUriInfo uriInfo, String contentType) throws ODataException; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /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/processor/part/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Processor Parts

3 | */ 4 | package com.sap.core.odata.api.processor.part; -------------------------------------------------------------------------------- /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/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/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 getWorkspaces(); 33 | 34 | /** 35 | * Get common attributes 36 | * 37 | * @return {@link CommonAttributes} 38 | */ 39 | public CommonAttributes getCommonAttributes(); 40 | 41 | /** 42 | * Get the list of extension elements 43 | * 44 | * @return a list of {@link ExtensionElement} 45 | */ 46 | public List getExtesionElements(); 47 | } 48 | -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/servicedocument/Category.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 Category element 20 | *

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/servicedocument/CommonAttributes.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 CommonAttributes 22 | * @author SAP AG 23 | */ 24 | public interface CommonAttributes { 25 | /** 26 | * Get the a base URI 27 | * 28 | * @return base as String 29 | */ 30 | public String getBase(); 31 | 32 | /** 33 | * Get the natural language for the element 34 | * 35 | * @return language as String 36 | */ 37 | public String getLang(); 38 | 39 | /** 40 | * Get the list of any attributes 41 | * 42 | * @return list of {@link ExtensionAttribute} 43 | */ 44 | public List getAttributes(); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/servicedocument/ExtensionAttribute.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 ExtensionAttribute 20 | *

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/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 | *

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-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 getEntitySetsInfo() throws EntityProviderException; 35 | 36 | /** 37 | * Get additional information if the service document is in atom format 38 | * 39 | * @return {@link AtomInfo} or null 40 | */ 41 | public AtomInfo getAtomInfo(); 42 | } 43 | -------------------------------------------------------------------------------- /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/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/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-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 | *

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 List getCollections(); 39 | 40 | /** 41 | * Get common attributes 42 | * 43 | * @return {@link CommonAttributes} 44 | */ 45 | public CommonAttributes getCommonAttributes(); 46 | 47 | /** 48 | * Get the list of extension elements 49 | * 50 | * @return a list of {@link ExtensionElement} 51 | */ 52 | public List getExtesionElements(); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/uri/KeyPredicate.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.EdmProperty; 19 | 20 | /** 21 | * Key predicate, consisting of a simple-type property and its value as String literal 22 | * @com.sap.core.odata.DoNotImplement 23 | * @author SAP AG 24 | */ 25 | public interface KeyPredicate { 26 | 27 | /** 28 | *

Gets the literal String in default representation.

29 | *

The description for {@link com.sap.core.odata.api.edm.EdmLiteral} has some motivation for using 30 | * this representation.

31 | * @return String literal in default (not URI) representation 32 | * @see com.sap.core.odata.api.edm.EdmLiteralKind 33 | */ 34 | public String getLiteral(); 35 | 36 | /** 37 | * Gets the key property. 38 | * @return {@link EdmProperty} simple-type property 39 | */ 40 | public EdmProperty getProperty(); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /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/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 getPrecedingSegments(); 33 | 34 | /** 35 | * Gets OData path segments as immutable list. 36 | * @return List of path segments 37 | */ 38 | List getODataSegments(); 39 | 40 | /** 41 | * Gets the root URI of this service. 42 | * @return absolute base URI of the request 43 | */ 44 | URI getServiceRoot(); 45 | 46 | /** 47 | * Get the absolute request URI including any query parameters. 48 | * @return the absolute request URI 49 | */ 50 | URI getRequestUri(); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/uri/SelectItem.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.util.List; 19 | 20 | import com.sap.core.odata.api.edm.EdmProperty; 21 | 22 | /** 23 | * An item of a $select system query option. 24 | * @com.sap.core.odata.DoNotImplement 25 | * @author SAP AG 26 | */ 27 | public interface SelectItem { 28 | 29 | /** 30 | * 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 List getNavigationPropertySegments(); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/uri/expression/FilterExpression.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 | * Represents a $filter expression in the expression tree returned by {@link com.sap.core.odata.api.uri.UriParser#parseFilterString(com.sap.core.odata.api.edm.EdmEntityType, String)} 20 | * Used to define the root expression node in an $filter expression tree. 21 | * 22 | * @author SAP AG 23 | */ 24 | public interface FilterExpression extends CommonExpression { 25 | 26 | /** 27 | * @return Returns the $filter expression string used to build the expression tree 28 | */ 29 | String getExpressionString(); 30 | 31 | /** 32 | * @return Returns the expression node representing the first operator,method,literal or property of the expression tree 33 | */ 34 | CommonExpression getExpression(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/uri/expression/LiteralExpression.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 | * Represents a literal expression node in the expression tree returned by the methods: 20 | *
  • {@link com.sap.core.odata.api.uri.UriParser#parseFilterString(com.sap.core.odata.api.edm.EdmEntityType, String) }
  • 21 | *
  • {@link com.sap.core.odata.api.uri.UriParser#parseOrderByString(com.sap.core.odata.api.edm.EdmEntityType, String) }
  • 22 | *
    23 | *
    24 | *

    A literal expression node is inserted in the expression tree for any token witch is no 25 | * valid operator, method or property. 26 | *
    27 | *
    28 | *

    For example the filter "$filter=age eq 12" will result in an expression tree 29 | * with a literal expression node for "12". 30 | *
    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/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-api/src/main/java/com/sap/core/odata/api/uri/expression/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Expression Parser 3 | *

    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/uri/info/GetMetadataUriInfo.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 metadata document. 23 | * @com.sap.core.odata.DoNotImplement 24 | * @author SAP AG 25 | */ 26 | public interface GetMetadataUriInfo { 27 | /** 28 | * Gets the custom query options as Map from option names to their 29 | * corresponding String values, or an empty list if no custom query options 30 | * are given in the URI. 31 | * @return Map of {@literal } custom query options 32 | */ 33 | public Map getCustomQueryOptions(); 34 | } 35 | -------------------------------------------------------------------------------- /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 } custom query options 38 | */ 39 | public Map getCustomQueryOptions(); 40 | } 41 | -------------------------------------------------------------------------------- /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; -------------------------------------------------------------------------------- /odata-api/src/main/java/com/sap/core/odata/api/uri/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.

    7 | */ 8 | package com.sap.core.odata.api.uri; -------------------------------------------------------------------------------- /odata-core/src/main/java/com/sap/core/odata/core/batch/BatchChangeSetImpl.java: -------------------------------------------------------------------------------- 1 | package com.sap.core.odata.core.batch; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collections; 5 | import java.util.List; 6 | 7 | import com.sap.core.odata.api.client.batch.BatchChangeSet; 8 | import com.sap.core.odata.api.client.batch.BatchChangeSetPart; 9 | 10 | public class BatchChangeSetImpl extends BatchChangeSet { 11 | private List requests = new ArrayList(); 12 | 13 | @Override 14 | public void add(final BatchChangeSetPart request) { 15 | requests.add(request); 16 | } 17 | 18 | @Override 19 | public List getChangeSetParts() { 20 | return Collections.unmodifiableList(requests); 21 | } 22 | 23 | public class BatchChangeSetBuilderImpl extends BatchChangeSetBuilder { 24 | 25 | @Override 26 | public BatchChangeSet build() { 27 | return BatchChangeSetImpl.this; 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /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-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 headers = new HashMap(); 15 | private String contentId; 16 | 17 | @Override 18 | public String getStatusCode() { 19 | return statusCode; 20 | } 21 | 22 | @Override 23 | public String getStatusInfo() { 24 | return statusInfo; 25 | } 26 | 27 | @Override 28 | public String getBody() { 29 | return body; 30 | } 31 | 32 | @Override 33 | public Map getHeaders() { 34 | return headers; 35 | } 36 | 37 | @Override 38 | public String getContentId() { 39 | return contentId; 40 | } 41 | 42 | @Override 43 | public String getHeader(final String name) { 44 | return headers.get(name); 45 | } 46 | 47 | @Override 48 | public Set getHeaderNames() { 49 | return headers.keySet(); 50 | } 51 | 52 | public void setStatusCode(final String statusCode) { 53 | this.statusCode = statusCode; 54 | } 55 | 56 | public void setStatusInfo(final String statusInfo) { 57 | this.statusInfo = statusInfo; 58 | } 59 | 60 | public void setBody(final String body) { 61 | this.body = body; 62 | } 63 | 64 | public void setHeaders(final Map headers) { 65 | this.headers = headers; 66 | } 67 | 68 | public void setContentId(final String contentId) { 69 | this.contentId = contentId; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /odata-core/src/main/java/com/sap/core/odata/core/debug/DebugInfo.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.debug; 17 | 18 | import java.io.IOException; 19 | 20 | import com.sap.core.odata.core.ep.util.JsonStreamWriter; 21 | 22 | /** 23 | * @author SAP AG 24 | */ 25 | public interface DebugInfo { 26 | 27 | /** 28 | * Gets the name of this debug information part, useful as title. 29 | * @return the name 30 | */ 31 | public String getName(); 32 | 33 | /** 34 | * Appends the content of this debug information part 35 | * to the given JSON stream writer. 36 | * @param jsonStreamWriter a JSON stream writer 37 | */ 38 | public void appendJson(JsonStreamWriter jsonStreamWriter) throws IOException; 39 | } 40 | -------------------------------------------------------------------------------- /odata-core/src/main/java/com/sap/core/odata/core/edm/provider/EdmComplexTypeImplProv.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 com.sap.core.odata.api.edm.EdmAnnotations; 19 | import com.sap.core.odata.api.edm.EdmComplexType; 20 | import com.sap.core.odata.api.edm.EdmException; 21 | import com.sap.core.odata.api.edm.EdmTypeKind; 22 | import com.sap.core.odata.api.edm.provider.ComplexType; 23 | 24 | public class EdmComplexTypeImplProv extends EdmStructuralTypeImplProv implements EdmComplexType { 25 | 26 | public EdmComplexTypeImplProv(final EdmImplProv edm, final ComplexType complexType, final String namespace) throws EdmException { 27 | super(edm, complexType, EdmTypeKind.COMPLEX, namespace); 28 | } 29 | 30 | @Override 31 | public EdmComplexType getBaseType() throws EdmException { 32 | return (EdmComplexType) edmBaseType; 33 | } 34 | 35 | @Override 36 | public EdmAnnotations getAnnotations() throws EdmException { 37 | return new EdmAnnotationsImplProv(structuralType.getAnnotationAttributes(), structuralType.getAnnotationElements()); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /odata-core/src/main/java/com/sap/core/odata/core/ep/aggregator/NavigationPropertyInfo.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.aggregator; 17 | 18 | import com.sap.core.odata.api.edm.EdmException; 19 | import com.sap.core.odata.api.edm.EdmMultiplicity; 20 | import com.sap.core.odata.api.edm.EdmNavigationProperty; 21 | 22 | public final class NavigationPropertyInfo { 23 | private String name; 24 | private EdmMultiplicity multiplicity; 25 | 26 | static NavigationPropertyInfo create(final EdmNavigationProperty property) throws EdmException { 27 | NavigationPropertyInfo info = new NavigationPropertyInfo(); 28 | info.name = property.getName(); 29 | info.multiplicity = property.getMultiplicity(); 30 | return info; 31 | } 32 | 33 | @Override 34 | public String toString() { 35 | return name + "; multiplicity=" + multiplicity; 36 | } 37 | 38 | public EdmMultiplicity getMultiplicity() { 39 | return multiplicity; 40 | } 41 | 42 | public String getName() { 43 | return name; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /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-core/src/main/java/com/sap/core/odata/core/ep/feed/ODataFeedImpl.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 java.util.List; 19 | 20 | import com.sap.core.odata.api.ep.entry.ODataEntry; 21 | import com.sap.core.odata.api.ep.feed.FeedMetadata; 22 | import com.sap.core.odata.api.ep.feed.ODataFeed; 23 | 24 | public class ODataFeedImpl implements ODataFeed { 25 | 26 | private final List entries; 27 | private final FeedMetadata feedMetadata; 28 | 29 | public ODataFeedImpl(final List entries, final FeedMetadata feedMetadata) { 30 | this.entries = entries; 31 | this.feedMetadata = feedMetadata; 32 | 33 | } 34 | 35 | @Override 36 | public List getEntries() { 37 | return entries; 38 | } 39 | 40 | @Override 41 | public FeedMetadata getFeedMetadata() { 42 | return feedMetadata; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /odata-core/src/main/java/com/sap/core/odata/core/exception/ODataRuntimeException.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.exception; 17 | 18 | /** 19 | * Common un-checked exception for the 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-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-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-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/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-core/src/main/java/com/sap/core/odata/core/uri/expression/ActualBinaryOperator.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 | public class ActualBinaryOperator { 19 | final protected InfoBinaryOperator operator; 20 | final protected Token token; 21 | 22 | public ActualBinaryOperator(final InfoBinaryOperator operatorInfo, final Token token) { 23 | if (operatorInfo == null) { 24 | throw new IllegalArgumentException("operatorInfo parameter must not be null"); 25 | } 26 | 27 | operator = operatorInfo; 28 | this.token = token; 29 | } 30 | 31 | public Token getToken() { 32 | return token; 33 | } 34 | 35 | public InfoBinaryOperator getOP() { 36 | return operator; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /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-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-core/src/main/resources/i18n_de_DE.properties: -------------------------------------------------------------------------------- 1 | # German translations 2 | # 3 | com.sap.core.odata.api.exception.ODataMessageException.COMMON=Allgemeiner Fehler -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/test/java/com/sap/core/odata/core/ep/producer/TombstoneCallbackImpl.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.producer; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Map; 20 | 21 | import com.sap.core.odata.api.ep.callback.TombstoneCallback; 22 | import com.sap.core.odata.api.ep.callback.TombstoneCallbackResult; 23 | 24 | public class TombstoneCallbackImpl implements TombstoneCallback { 25 | 26 | private ArrayList> deletedEntriesData; 27 | private String deltaLink = null; 28 | 29 | public TombstoneCallbackImpl(final ArrayList> deletedEntriesData, final String deltaLink) { 30 | this.deletedEntriesData = deletedEntriesData; 31 | this.deltaLink = deltaLink; 32 | } 33 | 34 | @Override 35 | public TombstoneCallbackResult getTombstoneCallbackResult() { 36 | TombstoneCallbackResult result = new TombstoneCallbackResult(); 37 | result.setDeletedEntriesData(deletedEntriesData); 38 | result.setDeltaLink(deltaLink); 39 | return result; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /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-core/src/test/java/com/sap/core/odata/core/uri/UriParserFacadeTest.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 | import java.util.Arrays; 19 | import java.util.Collections; 20 | 21 | import org.junit.Test; 22 | 23 | import com.sap.core.odata.api.uri.UriParser; 24 | import com.sap.core.odata.testutil.fit.BaseTest; 25 | import com.sap.core.odata.testutil.mock.MockFacade; 26 | 27 | /** 28 | * @author SAP AG 29 | */ 30 | public class UriParserFacadeTest extends BaseTest { 31 | 32 | @Test 33 | public void parseWithFacade() throws Exception { 34 | UriParser.parse(MockFacade.getMockEdm(), 35 | MockFacade.getPathSegmentsAsODataPathSegmentMock(Arrays.asList("$metadata")), 36 | Collections. emptyMap()); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /odata-core/src/test/resources/InvalidSvcDocJson2.txt: -------------------------------------------------------------------------------- 1 | {"d":{"EntitySets":["Employees","Teams","Rooms","Managers","Buildings","Container2.Photos"]}}} -------------------------------------------------------------------------------- /odata-core/src/test/resources/JsonBuilding: -------------------------------------------------------------------------------- 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 | "__deferred" : { 13 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Buildings('1')/nb_Rooms" 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /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-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-core/src/test/resources/JsonBuildingWithoutD: -------------------------------------------------------------------------------- 1 | { 2 | "__metadata" : { 3 | "id" : "http://localhost:8080/ReferenceScenario.svc/Buildings('1')", 4 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Buildings('1')", 5 | "type" : "RefScenario.Building" 6 | }, 7 | "Id" : "1", 8 | "Name" : "Building 1", 9 | "Image" : null, 10 | "nb_Rooms" : { 11 | "__deferred" : { 12 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Buildings('1')/nb_Rooms" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /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-core/src/test/resources/JsonEmployeeWithInlineTeam: -------------------------------------------------------------------------------- 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 | "__metadata" : { 39 | "id" : "http://localhost:8080/ReferenceScenario.svc/Teams('1')", 40 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('1')", 41 | "type" : "RefScenario.Team" 42 | }, 43 | "Id" : "1", 44 | "Name" : "Team 1", 45 | "isScrumTeam" : false, 46 | "nt_Employees" : { 47 | "__deferred" : { 48 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('1')/nt_Employees" 49 | } 50 | } 51 | }, 52 | "ne_Room" : { 53 | "__deferred" : { 54 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Employees('1')/ne_Room" 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /odata-core/src/test/resources/JsonTeam: -------------------------------------------------------------------------------- 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 | "isScrumTeam" : false, 11 | "nt_Employees" : { 12 | "__deferred" : { 13 | "uri" : "http://localhost:8080/ReferenceScenario.svc/Teams('1')/nt_Employees" 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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-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/batchRequest.txt: -------------------------------------------------------------------------------- 1 | POST http://some.host.com/service.root/$batch HTTP/1.1 2 | Host: some.host.com 3 | Content-Length:1117 4 | Content-Type: multipart/mixed; boundary=batch_36522ad7-fc75-4b56-8c71-56071383e77b 5 | 6 | --batch_36522ad7-fc75-4b56-8c71-56071383e77b 7 | Content-Type: application/http 8 | Content-Transfer-Encoding:binary 9 | 10 | GET /service/Customers('ALFKI') HTTP/1.1 11 | 12 | 13 | --batch_36522ad7-fc75-4b56-8c71-56071383e77b 14 | Content-Type: multipart/mixed; boundary=changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621 15 | Content-Length: ### 16 | 17 | --changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621 18 | Content-Type: application/http 19 | Content-Transfer-Encoding: binary 20 | 21 | POST /service/Customers HTTP/1.1 22 | Host: host 23 | Content-Type: application/atom+xml;type=entry 24 | Content-Length: ### 25 | 26 | 27 | 28 | 29 | --changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621 30 | Content-Type: application/http 31 | Content-Transfer-Encoding:binary 32 | 33 | PUT /service/Customers('ALFKI') HTTP/1.1 34 | Host: host 35 | Content-Type: application/json 36 | If-Match: xxxxx 37 | Content-Length: ### 38 | 39 | 40 | 41 | --changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621-- 42 | 43 | --batch_36522ad7-fc75-4b56-8c71-56071383e77b 44 | Content-Type: application/http 45 | Content-Transfer-Encoding:binary 46 | 47 | GET service/Products HTTP/1.1 48 | Host: host 49 | 50 | 51 | --batch_36522ad7-fc75-4b56-8c71-56071383e77b-- -------------------------------------------------------------------------------- /odata-core/src/test/resources/batchResponse.txt: -------------------------------------------------------------------------------- 1 | --batch_123 2 | Content-Type: multipart/mixed;boundary=changeset_12ks93js84d 3 | 4 | --changeset_12ks93js84d 5 | Content-Type: application/http 6 | Content-Transfer-Encoding: binary 7 | Content-Id: 1 8 | 9 | HTTP/1.1 204 No Content 10 | 11 | 12 | --changeset_12ks93js84d 13 | Content-Type: application/http 14 | Content-Transfer-Encoding: binary 15 | 16 | HTTP/1.1 201 Created 17 | DataServiceVersion: 2.0 18 | Content-Id: 2 19 | Location: http://localhost:19000/ClientBatchTest/Employees('7') 20 | Content-Type: application/json 21 | Content-Length: 918 22 | 23 | {"d":{"__metadata":{"id":"http://localhost:19000/ClientBatchTest/Employees('7')","uri":"http://localhost:19000/ClientBatchTest/Employees('7')","type":"RefScenario.Employee","content_type":"application/octet-stream","media_src":"Employees('7')/$value","edit_media":"http://localhost:19000/ClientBatchTest/Employees('7')/$value"},"EmployeeId":"7","EmployeeName":"Employee 7","ManagerId":null,"RoomId":null,"TeamId":null,"Location":{"__metadata":{"type":"RefScenario.c_Location"},"City":{"__metadata":{"type":"RefScenario.c_City"},"PostalCode":null,"CityName":null},"Country":null},"Age":0,"EntryDate":null,"ImageUrl":null,"ne_Manager":{"__deferred":{"uri":"http://localhost:19000/ClientBatchTest/Employees('7')/ne_Manager"}},"ne_Team":{"__deferred":{"uri":"http://localhost:19000/ClientBatchTest/Employees('7')/ne_Team"}},"ne_Room":{"__deferred":{"uri":"http://localhost:19000/ClientBatchTest/Employees('7')/ne_Room"}}}} 24 | 25 | --changeset_12ks93js84d-- 26 | 27 | --batch_123 28 | Content-Type: application/http 29 | Content-Transfer-Encoding: binary 30 | Content-ID: 2 31 | 32 | HTTP/1.1 200 OK 33 | DataServiceVersion: 2.0 34 | Content-Type: text/plain;charset=utf-8 35 | Content-length: 13 36 | 37 | Frederic Fall 38 | 39 | --batch_123-- -------------------------------------------------------------------------------- /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-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]! -------------------------------------------------------------------------------- /odata-core/src/test/resources/invalidSvcDocJson.txt: -------------------------------------------------------------------------------- 1 | {"d":{"EntitySets":"Employees","Teams","Rooms","Managers","Buildings","Container2.Photos"]}} -------------------------------------------------------------------------------- /odata-core/src/test/resources/invalidSvcExample.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | Teams 8 | 9 | 10 | Employees 11 | 12 | 14 | 16 | -------------------------------------------------------------------------------- /odata-core/src/test/resources/serviceDocument.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | Default 6 | 7 | Employees 8 | 9 | 10 | Teams 11 | 12 | 13 | Rooms 14 | 15 | 16 | Managers 17 | 18 | 19 | Buildings 20 | 21 | 22 | Photos 23 | 24 | 25 | -------------------------------------------------------------------------------- /odata-core/src/test/resources/svcAtomExample.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Main Site 5 | 6 | My Blog Entries 7 | 8 | 9 | 10 | Pictures 11 | image/png 12 | image/jpeg 13 | image/gif 14 | 15 | 16 | 17 | Sidebar Blog 18 | 19 | Remaindered Links 20 | application/atom+xml;type=entry 21 | 22 | 24 | 26 | 27 | 28 | 29 | 30 | 31 | value 32 | text 33 | 34 | -------------------------------------------------------------------------------- /odata-core/src/test/resources/svcDocJson.txt: -------------------------------------------------------------------------------- 1 | {"d":{"EntitySets":["Container.Nr1.Employees","Teams","Rooms","Managers","Buildings","Container2.Photos"]}} -------------------------------------------------------------------------------- /odata-core/src/test/resources/svcDocWithoutTitle.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Employees 7 | 8 | 9 | Teams 10 | 11 | 12 | Rooms 13 | 14 | 15 | Managers 16 | 17 | 18 | Buildings 19 | 20 | 21 | Photos 22 | 23 | 24 | -------------------------------------------------------------------------------- /odata-fit/src/test/java/com/sap/core/odata/fit/mapping/MapFactory.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.mapping; 17 | 18 | import com.sap.core.odata.api.ODataService; 19 | import com.sap.core.odata.api.ODataServiceFactory; 20 | import com.sap.core.odata.api.exception.ODataException; 21 | import com.sap.core.odata.api.processor.ODataContext; 22 | 23 | /** 24 | * @author SAP AG 25 | */ 26 | public class MapFactory extends ODataServiceFactory { 27 | 28 | @Override 29 | public ODataService createService(final ODataContext ctx) throws ODataException { 30 | final MapProvider provider = new MapProvider(); 31 | final MapProcessor processor = new MapProcessor(); 32 | 33 | return createODataSingleProcessorService(provider, processor); 34 | } 35 | 36 | public static ODataService create() throws ODataException { 37 | return new MapFactory().createService(null); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /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>() {}.getType()); 29 | if (map.get("d") instanceof StringMap) { 30 | return (StringMap) map.get("d"); 31 | } else { 32 | return map; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /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-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-fit/src/test/resources/error.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 9 | Content-Type: application/http 10 | Content-Transfer-Encoding: binary 11 | 12 | GET nonsens HTTP/1.1 13 | Accept: application/atomsvc+xml;q=0.8, application/json;odata=verbose;q=0.5, */*;q=0.1 14 | MaxDataServiceVersion: 2.0 15 | 16 | 17 | --batch_123-- -------------------------------------------------------------------------------- /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-- -------------------------------------------------------------------------------- /odata-ref/src/main/java/com/sap/core/odata/ref/model/City.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 City { 22 | 23 | private String postalCode; 24 | private String cityName; 25 | 26 | public City(final String postalCode, final String name) { 27 | this.postalCode = postalCode; 28 | cityName = name; 29 | } 30 | 31 | public void setPostalCode(final String postalCode) { 32 | this.postalCode = postalCode; 33 | } 34 | 35 | public String getPostalCode() { 36 | return postalCode; 37 | } 38 | 39 | public void setCityName(final String cityName) { 40 | this.cityName = cityName; 41 | } 42 | 43 | public String getCityName() { 44 | return cityName; 45 | } 46 | 47 | @Override 48 | public String toString() { 49 | return String.format("%s, %s", cityName, postalCode); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /odata-ref/src/main/java/com/sap/core/odata/ref/model/Location.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 Location { 22 | private String country; 23 | private City city; 24 | 25 | public Location(final String country, final String postalCode, final String cityName) { 26 | this.country = country; 27 | city = new City(postalCode, cityName); 28 | } 29 | 30 | public void setCountry(final String country) { 31 | this.country = country; 32 | } 33 | 34 | public String getCountry() { 35 | return country; 36 | } 37 | 38 | public void setCity(final City city) { 39 | this.city = city; 40 | } 41 | 42 | public City getCity() { 43 | return city; 44 | } 45 | 46 | @Override 47 | public String toString() { 48 | return String.format("%s, %s", country, city.toString()); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /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 employees = new ArrayList(); 27 | 28 | public Manager(final int id, final String name) { 29 | super(id, name); 30 | } 31 | 32 | public List getEmployees() { 33 | return employees; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /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-ref/src/main/resources/female_6_BaySu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-archive/cloud-odata-java/24e2a2a68af98ba0e9923a7898b070fc9cec192c/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/24e2a2a68af98ba0e9923a7898b070fc9cec192c/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/24e2a2a68af98ba0e9923a7898b070fc9cec192c/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/24e2a2a68af98ba0e9923a7898b070fc9cec192c/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/24e2a2a68af98ba0e9923a7898b070fc9cec192c/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/24e2a2a68af98ba0e9923a7898b070fc9cec192c/odata-ref/src/main/resources/male_5_FieldJ.jpg -------------------------------------------------------------------------------- /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-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-testutil/src/main/java/com/sap/core/odata/testutil/helper/HttpMerge.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.helper; 17 | 18 | import java.net.URI; 19 | 20 | import org.apache.http.annotation.NotThreadSafe; 21 | import org.apache.http.client.methods.HttpRequestBase; 22 | 23 | @NotThreadSafe 24 | public class HttpMerge extends HttpRequestBase { 25 | 26 | public final static String METHOD_NAME = "MERGE"; 27 | 28 | public HttpMerge() { 29 | super(); 30 | } 31 | 32 | public HttpMerge(final URI uri) { 33 | super(); 34 | setURI(uri); 35 | } 36 | 37 | /** 38 | * @throws IllegalArgumentException if the uri is invalid. 39 | */ 40 | public HttpMerge(final String uri) { 41 | super(); 42 | setURI(URI.create(uri)); 43 | } 44 | 45 | @Override 46 | public String getMethod() { 47 | return METHOD_NAME; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /odata-testutil/src/main/java/com/sap/core/odata/testutil/helper/HttpSomethingUnsupported.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.helper; 17 | 18 | import java.net.URI; 19 | 20 | import org.apache.http.annotation.NotThreadSafe; 21 | import org.apache.http.client.methods.HttpRequestBase; 22 | 23 | @NotThreadSafe 24 | public class HttpSomethingUnsupported extends HttpRequestBase { 25 | 26 | public final static String METHOD_NAME = "SOMETHING_UNSUPPORTED"; 27 | 28 | public HttpSomethingUnsupported() { 29 | super(); 30 | } 31 | 32 | public HttpSomethingUnsupported(final URI uri) { 33 | super(); 34 | setURI(uri); 35 | } 36 | 37 | /** 38 | * @throws IllegalArgumentException if the uri is invalid. 39 | */ 40 | public HttpSomethingUnsupported(final String uri) { 41 | super(); 42 | setURI(URI.create(uri)); 43 | } 44 | 45 | @Override 46 | public String getMethod() { 47 | return METHOD_NAME; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /odata-testutil/src/main/java/com/sap/core/odata/testutil/mock/TecEdmInfo.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.mock; 17 | 18 | import static org.junit.Assert.fail; 19 | 20 | import com.sap.core.odata.api.edm.Edm; 21 | import com.sap.core.odata.api.edm.EdmEntityType; 22 | import com.sap.core.odata.api.edm.EdmException; 23 | 24 | /** 25 | * Helper for the entity data model used as technical reference scenario. 26 | * @author SAP AG 27 | */ 28 | public class TecEdmInfo { 29 | private final Edm edm; 30 | 31 | public TecEdmInfo(final Edm edm) { 32 | this.edm = edm; 33 | } 34 | 35 | public EdmEntityType getTypeEtAllTypes() { 36 | try { 37 | return edm 38 | .getEntityContainer(TechnicalScenarioEdmProvider.ENTITY_CONTAINER_1) 39 | .getEntitySet(TechnicalScenarioEdmProvider.ES_ALL_TYPES) 40 | .getEntityType(); 41 | } catch (final EdmException e) { 42 | fail("Error in test setup" + e.getLocalizedMessage()); 43 | } 44 | return null; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /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-testutil/src/main/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /odata-web/src/main/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /odata-web/src/main/version/version.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
    name${name}
    version${version}
    timestamp${timestamp}
    basedir${basedir}
    project.build.finalName${project.build.finalName}
    build server${env.HOSTNAME}
    user${env.USER}
    -------------------------------------------------------------------------------- /odata-web/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | com.sap.core.odata.ref.web 7 | 8 | index.jsp 9 | 10 | 11 | 12 | ReferenceScenarioServlet 13 | org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet 14 | 15 | javax.ws.rs.Application 16 | com.sap.core.odata.core.rest.app.ODataApplication 17 | 18 | 19 | com.sap.core.odata.service.factory 20 | com.sap.core.odata.ref.processor.ScenarioServiceFactory 21 | 22 | 1 23 | 24 | 25 | 26 | ReferenceScenarioServlet 27 | /ReferenceScenario.svc/* 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/doc/EnablingJPAModelsAsODataServicesV1.0_en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-archive/cloud-odata-java/24e2a2a68af98ba0e9923a7898b070fc9cec192c/src/doc/EnablingJPAModelsAsODataServicesV1.0_en.pdf -------------------------------------------------------------------------------- /src/eclipse/codetemplates.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | -------------------------------------------------------------------------------- /src/eclipse/eclipse-codetemplates.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 |