001 /**
002 *
003 * $Revision: 14766 $ $Date: 2009-02-19 10:49:52 +0100 (Thu, 19 Feb 2009) $
004 *
005 * This file is part of ** M y C o R e **
006 * Visit our homepage at http://www.mycore.de/ for details.
007 *
008 * This program is free software; you can use it, redistribute it
009 * and / or modify it under the terms of the GNU General Public License
010 * (GPL) as published by the Free Software Foundation; either version 2
011 * of the License or (at your option) any later version.
012 *
013 * This program is distributed in the hope that it will be useful, but
014 * WITHOUT ANY WARRANTY; without even the implied warranty of
015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016 * GNU General Public License for more details.
017 *
018 * You should have received a copy of the GNU General Public License
019 * along with this program, normally in the file license.txt.
020 * If not, write to the Free Software Foundation Inc.,
021 * 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA
022 *
023 **/
024 package org.mycore.services.urn;
025
026 /**
027 * Stores the data of URNs and the document IDs assigned to them.
028 *
029 * @author Frank Lützenkirchen
030 */
031 public interface MCRURNStore {
032 /** Returns true if the given urn is assigned to a document ID */
033 public boolean isAssigned(String urn);
034
035 /** Assigns the given urn to the given document ID */
036 public void assignURN(String urn, String documentID);
037
038 /** Assigns the given urn to the given derivate ID */
039 public void assignURN(String urn, String derivate, String path, String filename);
040
041 /**
042 * Retrieves the URN that is assigned to the given document ID
043 *
044 * @return the urn, or null if no urn is assigned to this ID
045 */
046 public String getURNforDocument(String documentID);
047
048 /**
049 * Retrieves the document ID that is assigned to the given urn
050 *
051 * @return the ID, or null if no ID is assigned to this urn
052 */
053 public String getDocumentIDforURN(String urn);
054
055 /**
056 * Removes the urn (and assigned document ID) from the persistent store
057 */
058 public void removeURN(String urn);
059
060 /**
061 * Removes the urn (and assigned document ID) from the persistent store by the
062 * given object id
063 */
064 public void removeURNByObjectID(String objID);
065
066 /**Checks wether an object or derivate has an urn assigned*/
067 public boolean hasURNAssigned(String objId);
068 }