1 /*******************************************************************************
2 * Copyright (c) 2012-2013 University of Stuttgart.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * and the Apache License 2.0 which both accompany this distribution,
6 * and are available at http://www.eclipse.org/legal/epl-v10.html
7 * and http://www.apache.org/licenses/LICENSE-2.0
10 * Oliver Kopp - initial API and implementation
11 *******************************************************************************/
12 package org.eclipse.winery.repository.resources.admin;
14 import javax.ws.rs.DELETE;
15 import javax.ws.rs.core.Response;
17 import org.apache.commons.configuration.Configuration;
18 import org.eclipse.winery.repository.backend.BackendUtils;
19 import org.eclipse.winery.repository.backend.Repository;
20 import org.eclipse.winery.repository.datatypes.ids.admin.AdminId;
23 * Instance of one admin resource
25 * Offers a configuration object to store data
27 public abstract class AbstractAdminResource {
29 protected final AdminId id;
30 protected Configuration configuration;
34 * @param id the id of the element rendered by this resource
36 public AbstractAdminResource(AdminId id) {
38 this.configuration = Repository.INSTANCE.getConfiguration(id);
42 public Response onDelete() {
43 return BackendUtils.delete(this.id);