new-exporter #5
|
@ -123,7 +123,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>eu.dnetlib</groupId>
|
<groupId>eu.dnetlib</groupId>
|
||||||
<artifactId>dnet-datasource-manager-common</artifactId>
|
<artifactId>dnet-datasource-manager-common</artifactId>
|
||||||
<version>[1.1.0,2.0.0)</version>
|
<version>1.2.0-EOSC-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -111,6 +111,11 @@ public class DatasourceDaoImpl implements DatasourceDao<DatasourceDbEntry, ApiDb
|
||||||
return dsRepository.findById(dsId).orElseThrow(() -> new DsmException("Datasource not found. ID: " + dsId));
|
return dsRepository.findById(dsId).orElseThrow(() -> new DsmException("Datasource not found. ID: " + dsId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DatasourceDbEntry getDsByNsPrefix(final String prefix) throws DsmException {
|
||||||
|
return dsRepository.findByNamespaceprefix(prefix).orElseThrow(() -> new DsmException("Datasource not found. NS Prefix: " + prefix));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setManaged(final String id, final boolean managed) {
|
public void setManaged(final String id, final boolean managed) {
|
||||||
log.info(String.format("setting managed = '%s' for ds '%s'", managed, id));
|
log.info(String.format("setting managed = '%s' for ds '%s'", managed, id));
|
||||||
|
@ -163,7 +168,6 @@ public class DatasourceDaoImpl implements DatasourceDao<DatasourceDbEntry, ApiDb
|
||||||
|
|
||||||
final DatasourceDbEntry datasource = dsRepository.save(d);
|
final DatasourceDbEntry datasource = dsRepository.save(d);
|
||||||
log.info(String.format("saved datasource '%s'", datasource.getId()));
|
log.info(String.format("saved datasource '%s'", datasource.getId()));
|
||||||
|
|
||||||
ensureRegistrationDate(d.getId());
|
ensureRegistrationDate(d.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package eu.dnetlib.openaire.dsm.dao;
|
package eu.dnetlib.openaire.dsm.dao;
|
||||||
|
|
||||||
import java.sql.Date;
|
import java.sql.Date;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
|
@ -20,6 +21,8 @@ import eu.dnetlib.openaire.dsm.domain.db.DatasourceDbEntry;
|
||||||
@ConditionalOnProperty(value = "openaire.exporter.enable.dsm", havingValue = "true")
|
@ConditionalOnProperty(value = "openaire.exporter.enable.dsm", havingValue = "true")
|
||||||
public interface DatasourceDbEntryRepository extends JpaRepository<DatasourceDbEntry, String>, JpaSpecificationExecutor<DatasourceDbEntry> {
|
public interface DatasourceDbEntryRepository extends JpaRepository<DatasourceDbEntry, String>, JpaSpecificationExecutor<DatasourceDbEntry> {
|
||||||
|
|
||||||
|
Optional<DatasourceDbEntry> findByNamespaceprefix(String namespaceprefix);
|
||||||
|
|
||||||
@Query("select d.managed from #{#entityName} d where d.id = ?1")
|
@Query("select d.managed from #{#entityName} d where d.id = ?1")
|
||||||
boolean isManaged(String id);
|
boolean isManaged(String id);
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import io.swagger.annotations.ApiModel;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@JsonAutoDetect
|
@JsonAutoDetect
|
||||||
@Table(name = "dsm_service_api")
|
@Table(name = "dsm_datasource_api")
|
||||||
@ApiModel(value = "DatasourceApi model", description = "describes a joint view between datasources and their API (1:N)")
|
@ApiModel(value = "DatasourceApi model", description = "describes a joint view between datasources and their API (1:N)")
|
||||||
public class DatasourceApiDbEntry {
|
public class DatasourceApiDbEntry {
|
||||||
|
|
||||||
|
|
|
@ -31,4 +31,5 @@ openaire.exporter.enable.info = true
|
||||||
# CACHE TTL, 12h
|
# CACHE TTL, 12h
|
||||||
openaire.exporter.cache.ttl = 43200000
|
openaire.exporter.cache.ttl = 43200000
|
||||||
|
|
||||||
|
maven.pom.path = /META-INF/maven/eu.dnetlib.dhp/dnet-exporter-api/effective-pom.xml
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ openaire.exporter.cxfClientConnectTimeout = 60000
|
||||||
openaire.exporter.cxfClientReceiveTimeout = 120000
|
openaire.exporter.cxfClientReceiveTimeout = 120000
|
||||||
|
|
||||||
# JDBC
|
# JDBC
|
||||||
openaire.exporter.jdbc.url = jdbc:postgresql://localhost:5432/dnet_openaire
|
openaire.exporter.jdbc.url = jdbc:postgresql://localhost:5432/dnet_openaireplus
|
||||||
openaire.exporter.jdbc.user = dnetapi
|
openaire.exporter.jdbc.user = dnetapi
|
||||||
openaire.exporter.jdbc.pwd = dnetPwd
|
openaire.exporter.jdbc.pwd = dnetPwd
|
||||||
openaire.exporter.jdbc.minIdle = 1
|
openaire.exporter.jdbc.minIdle = 1
|
||||||
|
|
Loading…
Reference in New Issue