Package org.apache.olingo.odata2.annotation.processor.core.datasource

Examples of org.apache.olingo.odata2.annotation.processor.core.datasource.AnnotationInMemoryDs


   * {@inheritDoc}
   */
  @Override
  public ODataService createAnnotationService(final String modelPackage) throws ODataException {
    AnnotationEdmProvider edmProvider = new AnnotationEdmProvider(modelPackage);
    AnnotationInMemoryDs dataSource = new AnnotationInMemoryDs(modelPackage);
    AnnotationValueAccess valueAccess = new AnnotationValueAccess();

    // Edm via Annotations and ListProcessor via AnnotationDS with AnnotationsValueAccess
    return RuntimeDelegate.createODataSingleProcessorService(edmProvider,
        new ListsProcessor(dataSource, valueAccess));
View Full Code Here


   * {@inheritDoc}
   */
  @Override
  public ODataService createAnnotationService(final Collection<Class<?>> annotatedClasses) throws ODataException {
    AnnotationEdmProvider edmProvider = new AnnotationEdmProvider(annotatedClasses);
    AnnotationInMemoryDs dataSource = new AnnotationInMemoryDs(annotatedClasses);
    AnnotationValueAccess valueAccess = new AnnotationValueAccess();

    // Edm via Annotations and ListProcessor via AnnotationDS with AnnotationsValueAccess
    return RuntimeDelegate.createODataSingleProcessorService(edmProvider,
        new ListsProcessor(dataSource, valueAccess));
View Full Code Here

  private DataSource mockedDataSource = Mockito.mock(DataSource.class);
  private ValueAccess mockedValueAccess = Mockito.mock(ValueAccess.class);

  @Test
  public void init() throws ODataException {
    DataSource dataSource = new AnnotationInMemoryDs(Building.class.getPackage().getName());
    ValueAccess valueAccess = new AnnotationValueAccess();
    ListsProcessor lp = new ListsProcessor(dataSource, valueAccess);

    Assert.assertNotNull(lp);
  }
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public ODataService createAnnotationService(final String modelPackage) throws ODataException {
    AnnotationEdmProvider edmProvider = new AnnotationEdmProvider(modelPackage);
    AnnotationInMemoryDs dataSource = new AnnotationInMemoryDs(modelPackage);
    AnnotationValueAccess valueAccess = new AnnotationValueAccess();

    // Edm via Annotations and ListProcessor via AnnotationDS with AnnotationsValueAccess
    return RuntimeDelegate.createODataSingleProcessorService(edmProvider,
        new ListsProcessor(dataSource, valueAccess));
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public ODataService createAnnotationService(final Collection<Class<?>> annotatedClasses) throws ODataException {
    AnnotationEdmProvider edmProvider = new AnnotationEdmProvider(annotatedClasses);
    AnnotationInMemoryDs dataSource = new AnnotationInMemoryDs(annotatedClasses);
    AnnotationValueAccess valueAccess = new AnnotationValueAccess();

    // Edm via Annotations and ListProcessor via AnnotationDS with AnnotationsValueAccess
    return RuntimeDelegate.createODataSingleProcessorService(edmProvider,
        new ListsProcessor(dataSource, valueAccess));
View Full Code Here

        final String contentHeader = ContentType.create(BATCH_CONTENT_TYPE, BOUNDARY_PARAMETER, boundary).toString();
        return ODataResponse.entity(batchRequest).contentHeader(contentHeader).build();
    }

    private void addChangeSetParts(ArrayList<BatchPart> parts, ArrayList<BatchChangeSetPart> changeSetParts) {
        final BatchChangeSet changeSet = BatchChangeSet.newBuilder().build();
        for (BatchChangeSetPart changeSetPart : changeSetParts) {
            changeSet.add(changeSetPart);
        }
        parts.add(changeSet);
    }
View Full Code Here

                parts.add(createBatchQueryPart(uriInfo, (Olingo2BatchQueryRequest) batchPart));

            } else {

                // add to change set parts
                final BatchChangeSetPart changeSetPart = createBatchChangeSetPart(
                    edm, contentIdMap, (Olingo2BatchChangeRequest) batchPart);
                changeSetParts.add(changeSetPart);
            }
        }
View Full Code Here

                @Override
                public void onCompleted(HttpResponse result)
                    throws IOException, EntityProviderException, BatchException, ODataApplicationException {

                    // if a entity is created (via POST request) the response body contains the new created entity
                    HttpStatusCodes statusCode = HttpStatusCodes.fromStatusCode(result.getStatusLine().getStatusCode());

                    // look for no content, or no response body!!!
                    final boolean noEntity = result.getEntity() == null || result.getEntity().getContentLength() == 0;
                    if (statusCode == HttpStatusCodes.NO_CONTENT || noEntity) {
                        responseHandler.onResponse(
View Full Code Here

        LOG.info("Updated Entry successfully:  {}", prettyPrint(updatedEntry));

        statusHandler.reset();
        olingoApp.delete(TEST_CREATE_MANUFACTURER,  statusHandler);

        HttpStatusCodes statusCode = statusHandler.await();
        LOG.info("Deletion of Entry was successful:  {}: {}", statusCode.getStatusCode(), statusCode.getInfo());

        try {
            LOG.info("Verify Delete Entry");

            entryHandler.reset();
View Full Code Here

  }

  @Override
  public EdmAssociationSet getAssociationSet(final EdmEntitySet sourceEntitySet,
      final EdmNavigationProperty navigationProperty) throws EdmException {
    EdmAssociation edmAssociation = navigationProperty.getRelationship();
    String association = edmAssociation.getNamespace() + "." + edmAssociation.getName();
    String entitySetName = sourceEntitySet.getName();
    String entitySetFromRole = navigationProperty.getFromRole();

    String key = entitySetName + ">>" + association + ">>" + entitySetFromRole;

    EdmAssociationSet edmAssociationSet = edmAssociationSets.get(key);
    if (edmAssociationSet != null) {
      return edmAssociationSet;
    }

    AssociationSet associationSet;
    FullQualifiedName associationFQName =
        new FullQualifiedName(edmAssociation.getNamespace(), edmAssociation.getName());
    try {
      associationSet =
          edm.edmProvider.getAssociationSet(entityContainerInfo.getName(), associationFQName, entitySetName,
              entitySetFromRole);
    } catch (ODataException e) {
View Full Code Here

TOP

Related Classes of org.apache.olingo.odata2.annotation.processor.core.datasource.AnnotationInMemoryDs

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.