View Javadoc
1   /*
2    * This file is part of ***  M y C o R e  ***
3    * See http://www.mycore.de/ for details.
4    *
5    * MyCoRe is free software: you can redistribute it and/or modify
6    * it under the terms of the GNU General Public License as published by
7    * the Free Software Foundation, either version 3 of the License, or
8    * (at your option) any later version.
9    *
10   * MyCoRe is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   * GNU General Public License for more details.
14   *
15   * You should have received a copy of the GNU General Public License
16   * along with MyCoRe.  If not, see <http://www.gnu.org/licenses/>.
17   */
18  
19  package org.mycore.pi.urn;
20  
21  import java.util.Date;
22  
23  import org.apache.logging.log4j.LogManager;
24  import org.apache.logging.log4j.Logger;
25  import org.mycore.datamodel.metadata.MCRBase;
26  import org.mycore.pi.MCRPIService;
27  import org.mycore.pi.exceptions.MCRPersistentIdentifierException;
28  
29  /**
30   * This class registers urn for Metadata.
31   */
32  public class MCRURNOAIService extends MCRPIService<MCRDNBURN> {
33  
34      private static final Logger LOGGER = LogManager.getLogger();
35  
36      public MCRURNOAIService() {
37          super(MCRDNBURN.TYPE);
38      }
39  
40      @Override
41      protected void registerIdentifier(MCRBase obj, String additional, MCRDNBURN urn)
42          throws MCRPersistentIdentifierException {
43          if (!additional.equals("")) {
44              throw new MCRPersistentIdentifierException(
45                  getClass().getName() + " doesn't support additional information! (" + additional + ")");
46          }
47      }
48  
49      @Override
50      protected void delete(MCRDNBURN identifier, MCRBase obj, String additional)
51          throws MCRPersistentIdentifierException {
52          // no user information available
53      }
54  
55      @Override
56      protected void update(MCRDNBURN identifier, MCRBase obj, String additional)
57          throws MCRPersistentIdentifierException {
58          // nothing to do here!
59      }
60  
61      @Override
62      protected Date provideRegisterDate(MCRBase obj, String additional) {
63          return null;
64      }
65  
66  }