Merge branch 'release/4.5.0'
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / MetadataServiceImpl.java
1 /**
2 * Copyright (C) 2015 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9 package eu.etaxonomy.cdm.api.service;
10
11 import java.util.Map;
12
13 import org.springframework.beans.factory.annotation.Autowired;
14 import org.springframework.stereotype.Service;
15 import org.springframework.transaction.annotation.Transactional;
16
17 import eu.etaxonomy.cdm.config.CdmSourceException;
18 import eu.etaxonomy.cdm.model.metadata.CdmMetaData.MetaDataPropertyName;
19
20 /**
21 * Provides metadata information corresponding ti the underlying CDM Datasource.
22 *
23 * @author cmathew
24 * @date 20 Nov 2015
25 *
26 */
27 @Service
28 @Transactional(readOnly = true)
29 public class MetadataServiceImpl implements IMetadataService {
30
31
32 private IDatabaseService databaseService;
33
34 @Autowired
35 public void setDatabaseService(IDatabaseService databaseService) {
36 this.databaseService = databaseService;
37 }
38
39 /**
40 * {@inheritDoc}
41 */
42 @Override
43 public String getDbSchemaVersion() throws CdmSourceException {
44 return databaseService.getDbSchemaVersion();
45
46 }
47
48 /**
49 * {@inheritDoc}
50 */
51 @Override
52 public boolean isDbEmpty() throws CdmSourceException {
53 return databaseService.isDbEmpty();
54 }
55
56 /**
57 * {@inheritDoc}
58 */
59 @Override
60 public Map<MetaDataPropertyName, String> getCdmMetadataMap() throws CdmSourceException {
61 return databaseService.getCdmMetadataMap();
62 }
63
64 }