com.qwazr.database.TableServiceInterface Maven / Gradle / Ivy
/*
* Copyright 2015-2018 Emmanuel Keller / QWAZR
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.qwazr.database;
import com.qwazr.database.model.ColumnDefinition;
import com.qwazr.database.model.TableDefinition;
import com.qwazr.database.model.TableRequest;
import com.qwazr.database.model.TableRequestResult;
import com.qwazr.database.model.TableStatus;
import com.qwazr.database.store.KeyStore;
import com.qwazr.server.ServiceInterface;
import javax.annotation.security.RolesAllowed;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.GenericType;
import javax.ws.rs.core.MediaType;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
@RolesAllowed(TableServiceInterface.SERVICE_NAME)
@Path("/" + TableServiceInterface.SERVICE_NAME)
public interface TableServiceInterface extends ServiceInterface {
String SERVICE_NAME = "table";
@GET
@Path("/")
@Produces(ServiceInterface.APPLICATION_JSON_UTF8)
SortedSet list();
@POST
@Path("/{table_name}")
@Consumes(ServiceInterface.APPLICATION_JSON_UTF8)
@Produces(ServiceInterface.APPLICATION_JSON_UTF8)
TableDefinition createTable(@PathParam("table_name") String table_name,
@QueryParam("implementation") KeyStore.Impl storeImplementation);
@GET
@Path("/{table_name}")
@Produces(ServiceInterface.APPLICATION_JSON_UTF8)
TableStatus getTableStatus(@PathParam("table_name") String table_name);
@DELETE
@Path("/{table_name}")
@Produces(ServiceInterface.APPLICATION_JSON_UTF8)
Boolean deleteTable(@PathParam("table_name") String table_name);
@GET
@Path("/{table_name}/column")
@Produces(ServiceInterface.APPLICATION_JSON_UTF8)
Map getColumns(@PathParam("table_name") String table_name);
@GET
@Path("/{table_name}/column/{column_name}")
@Produces(ServiceInterface.APPLICATION_JSON_UTF8)
ColumnDefinition getColumn(@PathParam("table_name") String table_name,
@PathParam("column_name") String column_name);
@GET
@Path("/{table_name}/column/{column_name}/term")
@Produces(ServiceInterface.APPLICATION_JSON_UTF8)
List