All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hevelian.olastic.core.ElasticServiceMetadata Maven / Gradle / Ivy

There is a newer version: 1.1.3
Show newest version
package com.hevelian.olastic.core;

import java.util.Collections;
import java.util.List;

import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
import org.apache.olingo.commons.api.edmx.EdmxReference;
import org.apache.olingo.server.api.ServiceMetadata;
import org.apache.olingo.server.api.etag.ServiceMetadataETagSupport;

import com.hevelian.olastic.core.api.edm.provider.ElasticCsdlEdmProvider;
import com.hevelian.olastic.core.edm.ElasticEdmProvider;

/**
 * Custom implementation of {@link ServiceMetadata} to provide own
 * implementation of Edm.
 * 
 * @author rdidyk
 */
public class ElasticServiceMetadata implements ServiceMetadata {

    private ElasticEdmProvider edm;
    private final List references;
    private final ServiceMetadataETagSupport serviceMetadataETagSupport;

    public ElasticServiceMetadata(ElasticCsdlEdmProvider edmProvider,
            List references, ServiceMetadataETagSupport serviceMetadataETagSupport) {
        this.edm = new ElasticEdmProvider(edmProvider);
        this.references = references;
        this.serviceMetadataETagSupport = serviceMetadataETagSupport;
    }

    @Override
    public ElasticEdmProvider getEdm() {
        return edm;
    }

    @Override
    public ODataServiceVersion getDataServiceVersion() {
        return ODataServiceVersion.V40;
    }

    @Override
    public List getReferences() {
        return Collections.unmodifiableList(references);
    }

    @Override
    public ServiceMetadataETagSupport getServiceMetadataETagSupport() {
        return serviceMetadataETagSupport;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy