/*
* Created on Apr 7, 2004
*
* This file is part of Thingamablog. ( http://thingamablog.sf.net )
*
* Copyright (c) 2004, Bob Tantlinger All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
package net.sf.thingamablog.blog;
/**
* An interface for an CategoryStore.
* A CategoryStore is a backend which maintains category data for a weblog
*
* @author Bob Tantlinger
*
*/
public interface CategoryStore
{
/**
* Adds a category to the store
* @param blogKey The key of the weblog to add the category to
* @param cat The category
* @throws BackendException If an error occurs while adding the category
*/
public void addCategory(String blogKey, String cat) throws BackendException;
/**
* Removes a category from the store
* @param blogKey The key of the weblog from which to remove the category
* @param cat The category
* @throws BackendException If an error occurs while removing the category
*/
public void removeCategory(String blogKey, String cat) throws BackendException;
/**
* Renames a category in the store
* @param blogKey The key of the category's weblog
* @param oldCat The old category to rename
* @param newCat The new name of the category
* @throws BackendException If an error occurs while renaming the category
*/
public void renameCategory(String blogKey, String oldCat, String newCat) throws BackendException;
/**
* Gets the categories in this store
* @param blogKey The key of the weblog from which to retrieve the categories
* @param sortAsc true to sort the categories ascending, false descending
* @return An array of category names
* @throws BackendException If an error occurs while getting the categories
*/
public String[] getCategories(String blogKey, boolean sortAsc) throws BackendException;
}