Search in sources :

Example 1 with UpdateRequestProvider

use of com.atomgraph.core.io.UpdateRequestProvider in project Core by AtomGraph.

the class Application method getClient.

public static Client getClient(ClientConfig clientConfig) {
    clientConfig.register(new ModelProvider());
    clientConfig.register(new DatasetProvider());
    clientConfig.register(new ResultSetProvider());
    clientConfig.register(new QueryProvider());
    // TO-DO: UpdateRequestProvider
    clientConfig.register(new UpdateRequestProvider());
    Client client = ClientBuilder.newClient(clientConfig);
    return client;
}
Also used : QueryProvider(com.atomgraph.core.io.QueryProvider) ModelProvider(com.atomgraph.core.io.ModelProvider) Client(javax.ws.rs.client.Client) UpdateRequestProvider(com.atomgraph.core.io.UpdateRequestProvider) DatasetProvider(com.atomgraph.core.io.DatasetProvider) ResultSetProvider(com.atomgraph.core.io.ResultSetProvider)

Example 2 with UpdateRequestProvider

use of com.atomgraph.core.io.UpdateRequestProvider in project Core by AtomGraph.

the class Application method init.

@PostConstruct
public void init() {
    // handles all
    register(QueriedResourceBase.class);
    // handles /sparql queries
    register(SPARQLEndpointImpl.class);
    // handles /service requests
    register(GraphStoreImpl.class);
    register(new ModelProvider());
    register(new DatasetProvider());
    register(new ResultSetProvider());
    register(QueryParamProvider.class);
    register(new QueryProvider());
    register(new UpdateRequestProvider());
    register(new BadGatewayExceptionMapper());
    register(new NoReaderForLangExceptionMapper());
    register(new RiotExceptionMapper());
    register(new AbstractBinder() {

        @Override
        protected void configure() {
            bind(new MediaTypes()).to(MediaTypes.class);
        }
    });
    register(new AbstractBinder() {

        @Override
        protected void configure() {
            bind(service).to(Service.class);
        }
    });
}
Also used : NoReaderForLangExceptionMapper(com.atomgraph.core.mapper.NoReaderForLangExceptionMapper) QueryProvider(com.atomgraph.core.io.QueryProvider) ModelProvider(com.atomgraph.core.io.ModelProvider) BadGatewayExceptionMapper(com.atomgraph.core.mapper.BadGatewayExceptionMapper) AbstractBinder(org.glassfish.hk2.utilities.binding.AbstractBinder) RiotExceptionMapper(com.atomgraph.core.mapper.RiotExceptionMapper) Service(com.atomgraph.core.model.Service) UpdateRequestProvider(com.atomgraph.core.io.UpdateRequestProvider) DatasetProvider(com.atomgraph.core.io.DatasetProvider) ResultSetProvider(com.atomgraph.core.io.ResultSetProvider) PostConstruct(javax.annotation.PostConstruct)

Example 3 with UpdateRequestProvider

use of com.atomgraph.core.io.UpdateRequestProvider in project Processor by AtomGraph.

the class Application method init.

/**
 * Initializes JAX-RS resource classes and providers.
 */
@PostConstruct
@Override
public void init() {
    // handles /
    register(ResourceBase.class);
    register(new AbstractBinder() {

        @Override
        protected void configure() {
            bind(application).to(com.atomgraph.processor.model.Application.class);
        }
    });
    register(new AbstractBinder() {

        @Override
        protected void configure() {
            bindFactory(new OntologyFactory(ontology)).to(new TypeLiteral<Optional<Ontology>>() {
            });
        }
    });
    register(new AbstractBinder() {

        @Override
        protected void configure() {
            bind(service).to(Service.class);
        }
    });
    register(new AbstractBinder() {

        @Override
        protected void configure() {
            bindFactory(TemplateCallFactory.class).to(new TypeLiteral<Optional<TemplateCall>>() {
            }).in(RequestScoped.class);
        }
    });
    register(new AbstractBinder() {

        @Override
        protected void configure() {
            bind(new MediaTypes()).to(MediaTypes.class);
        }
    });
    register(new SkolemizingModelProvider());
    register(new ResultSetProvider());
    register(new QueryParamProvider());
    register(new QueryProvider());
    register(new UpdateRequestProvider());
    register(new DataManagerFactory(getDataManager()));
    register(RiotExceptionMapper.class);
    register(ModelExceptionMapper.class);
    register(SPINConstraintViolationExceptionMapper.class);
    register(SHACLConstraintViolationExceptionMapper.class);
    register(DatatypeFormatExceptionMapper.class);
    register(NotFoundExceptionMapper.class);
    register(NoReaderForLangExceptionMapper.class);
    register(NotSupportedExceptionMapper.class);
    register(NotAcceptableExceptionMapper.class);
    register(BadGatewayExceptionMapper.class);
    register(ConfigurationExceptionMapper.class);
    register(OntologyExceptionMapper.class);
    register(ParameterExceptionMapper.class);
    register(QueryParseExceptionMapper.class);
    register(new ResponseHeaderFilter());
// if (log.isTraceEnabled()) log.trace("Application.init() with Classes: {} and Singletons: {}", classes, singletons);
}
Also used : DataManagerFactory(com.atomgraph.core.factory.DataManagerFactory) Ontology(org.apache.jena.ontology.Ontology) Optional(java.util.Optional) SkolemizingModelProvider(com.atomgraph.server.io.SkolemizingModelProvider) AbstractBinder(org.glassfish.hk2.utilities.binding.AbstractBinder) TemplateCallFactory(com.atomgraph.server.factory.TemplateCallFactory) Service(com.atomgraph.core.model.Service) RequestScoped(org.glassfish.jersey.process.internal.RequestScoped) ResponseHeaderFilter(com.atomgraph.server.filter.response.ResponseHeaderFilter) MediaTypes(com.atomgraph.core.MediaTypes) OntologyFactory(com.atomgraph.server.factory.OntologyFactory) UpdateRequestProvider(com.atomgraph.core.io.UpdateRequestProvider) QueryProvider(com.atomgraph.core.io.QueryProvider) TypeLiteral(org.glassfish.hk2.api.TypeLiteral) QueryParamProvider(com.atomgraph.core.provider.QueryParamProvider) ResultSetProvider(com.atomgraph.core.io.ResultSetProvider) PostConstruct(javax.annotation.PostConstruct)

Aggregations

QueryProvider (com.atomgraph.core.io.QueryProvider)3 ResultSetProvider (com.atomgraph.core.io.ResultSetProvider)3 UpdateRequestProvider (com.atomgraph.core.io.UpdateRequestProvider)3 DatasetProvider (com.atomgraph.core.io.DatasetProvider)2 ModelProvider (com.atomgraph.core.io.ModelProvider)2 Service (com.atomgraph.core.model.Service)2 PostConstruct (javax.annotation.PostConstruct)2 AbstractBinder (org.glassfish.hk2.utilities.binding.AbstractBinder)2 MediaTypes (com.atomgraph.core.MediaTypes)1 DataManagerFactory (com.atomgraph.core.factory.DataManagerFactory)1 BadGatewayExceptionMapper (com.atomgraph.core.mapper.BadGatewayExceptionMapper)1 NoReaderForLangExceptionMapper (com.atomgraph.core.mapper.NoReaderForLangExceptionMapper)1 RiotExceptionMapper (com.atomgraph.core.mapper.RiotExceptionMapper)1 QueryParamProvider (com.atomgraph.core.provider.QueryParamProvider)1 OntologyFactory (com.atomgraph.server.factory.OntologyFactory)1 TemplateCallFactory (com.atomgraph.server.factory.TemplateCallFactory)1 ResponseHeaderFilter (com.atomgraph.server.filter.response.ResponseHeaderFilter)1 SkolemizingModelProvider (com.atomgraph.server.io.SkolemizingModelProvider)1 Optional (java.util.Optional)1 Client (javax.ws.rs.client.Client)1