mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-03-11 15:04:15 +00:00
minor changes
This commit is contained in:
parent
2971459f32
commit
1df40473bd
@ -1,7 +1,7 @@
|
|||||||
package hirs.attestationca.portal.page;
|
package hirs.attestationca.portal.page;
|
||||||
|
|
||||||
import hirs.attestationca.portal.datatables.DataTableView;
|
import hirs.attestationca.portal.datatables.DataTableView;
|
||||||
import hirs.attestationca.portal.persistence.PersistenceConfiguration;
|
import hirs.persist.PersistenceConfiguration;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
@ -1,118 +0,0 @@
|
|||||||
package hirs.attestationca.portal.persistence;
|
|
||||||
|
|
||||||
import hirs.data.persist.SupplyChainValidationSummary;
|
|
||||||
import hirs.persist.AppraiserManager;
|
|
||||||
import hirs.persist.CrudManager;
|
|
||||||
import hirs.persist.DBAppraiserManager;
|
|
||||||
import hirs.persist.DBCertificateManager;
|
|
||||||
import hirs.persist.DBDeviceGroupManager;
|
|
||||||
import hirs.persist.DBDeviceManager;
|
|
||||||
import hirs.persist.DBManager;
|
|
||||||
import hirs.persist.DBPolicyManager;
|
|
||||||
import hirs.persist.DBReferenceEventManager;
|
|
||||||
import hirs.persist.DBReferenceManifestManager;
|
|
||||||
import hirs.persist.DeviceGroupManager;
|
|
||||||
import hirs.persist.DeviceManager;
|
|
||||||
import hirs.persist.HibernateConfiguration;
|
|
||||||
import hirs.persist.PolicyManager;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.context.annotation.Import;
|
|
||||||
import org.springframework.orm.hibernate5.LocalSessionFactoryBean;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Spring configuration class for persistence beans used by the Attestation CA Portal.
|
|
||||||
*/
|
|
||||||
@Repository
|
|
||||||
@Configuration
|
|
||||||
@EnableTransactionManagement
|
|
||||||
@Import({ HibernateConfiguration.class })
|
|
||||||
public class PersistenceConfiguration {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private LocalSessionFactoryBean sessionFactory;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a {@link PolicyManager} ready to use.
|
|
||||||
*
|
|
||||||
* @return {@link PolicyManager}
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
public PolicyManager policyManager() {
|
|
||||||
return new DBPolicyManager(sessionFactory.getObject());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a {@link DeviceManager} ready to use.
|
|
||||||
*
|
|
||||||
* @return {@link DeviceManager}
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
public DeviceManager deviceManager() {
|
|
||||||
return new DBDeviceManager(sessionFactory.getObject());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a {@link DBCertificateManager} ready to use.
|
|
||||||
*
|
|
||||||
* @return {@link DBCertificateManager}
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
public DBCertificateManager certificateManager() {
|
|
||||||
return new DBCertificateManager(sessionFactory.getObject());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a {@link DBReferenceManifestManager} ready to use.
|
|
||||||
*
|
|
||||||
* @return {@link DBReferenceManifestManager}
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
public DBReferenceManifestManager referenceManifestManager() {
|
|
||||||
return new DBReferenceManifestManager(sessionFactory.getObject());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a {@link DBReferenceEventManager} ready to use.
|
|
||||||
*
|
|
||||||
* @return {@link DBReferenceEventManager}
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
public DBReferenceEventManager referenceEventManager() {
|
|
||||||
return new DBReferenceEventManager(sessionFactory.getObject());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a {@link AppraiserManager} ready to use.
|
|
||||||
*
|
|
||||||
* @return {@link AppraiserManager}
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
public AppraiserManager appraiserManager() {
|
|
||||||
return new DBAppraiserManager(sessionFactory.getObject());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a {@link DeviceGroupManager} ready to use.
|
|
||||||
*
|
|
||||||
* @return {@link DeviceGroupManager}
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
public DeviceGroupManager deviceGroupManager() {
|
|
||||||
return new DBDeviceGroupManager(sessionFactory.getObject());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a {@link DBManager} for SupplyChainValidationSummary persistence, ready for use.
|
|
||||||
*
|
|
||||||
* @return {@link DBManager}
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
public CrudManager<SupplyChainValidationSummary> supplyChainValidationSummaryManager() {
|
|
||||||
return new DBManager<>(SupplyChainValidationSummary.class, sessionFactory.getObject());
|
|
||||||
}
|
|
||||||
}
|
|
@ -47,9 +47,9 @@ public abstract class RepoPackage {
|
|||||||
@Column
|
@Column
|
||||||
private String architecture;
|
private String architecture;
|
||||||
|
|
||||||
@ManyToOne
|
// @ManyToOne
|
||||||
@JoinColumn(name = "sourceRepository")
|
// @JoinColumn(name = "sourceRepository")
|
||||||
private Repository<?> sourceRepository;
|
// private Repository<?> sourceRepository;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
private boolean measured = false;
|
private boolean measured = false;
|
||||||
@ -105,7 +105,7 @@ public abstract class RepoPackage {
|
|||||||
this.version = version;
|
this.version = version;
|
||||||
this.release = release;
|
this.release = release;
|
||||||
this.architecture = architecture;
|
this.architecture = architecture;
|
||||||
this.sourceRepository = sourceRepository;
|
// this.sourceRepository = sourceRepository;
|
||||||
this.id = UUID.randomUUID();
|
this.id = UUID.randomUUID();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,9 +157,9 @@ public abstract class RepoPackage {
|
|||||||
*
|
*
|
||||||
* @return this package's source repository
|
* @return this package's source repository
|
||||||
*/
|
*/
|
||||||
public final Repository<?> getSourceRepository() {
|
// public final Repository<?> getSourceRepository() {
|
||||||
return sourceRepository;
|
// return sourceRepository;
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the measurements of the package. Must be only called on a package that has not yet
|
* Sets the measurements of the package. Must be only called on a package that has not yet
|
||||||
@ -270,9 +270,9 @@ public abstract class RepoPackage {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sourceRepository.equals(that.sourceRepository)) {
|
// if (!sourceRepository.equals(that.sourceRepository)) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -284,14 +284,13 @@ public abstract class RepoPackage {
|
|||||||
result = prime * result + version.hashCode();
|
result = prime * result + version.hashCode();
|
||||||
result = prime * result + release.hashCode();
|
result = prime * result + release.hashCode();
|
||||||
result = prime * result + architecture.hashCode();
|
result = prime * result + architecture.hashCode();
|
||||||
result = prime * result + sourceRepository.hashCode();
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final String toString() {
|
public final String toString() {
|
||||||
return String.format(
|
return String.format(
|
||||||
"RepoPackage{name=%s, version=%s, release=%s, architecture=%s, sourceRepository=%s",
|
"RepoPackage{name=%s, version=%s, release=%s, architecture=%s",
|
||||||
name, version, release, architecture, sourceRepository);
|
name, version, release, architecture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,9 +106,10 @@ subprojects {
|
|||||||
findbugs: 'com.google.code.findbugs:findbugs:3.0.0',
|
findbugs: 'com.google.code.findbugs:findbugs:3.0.0',
|
||||||
gson: 'com.google.code.gson:gson:2.9.0',
|
gson: 'com.google.code.gson:gson:2.9.0',
|
||||||
guava: 'com.google.guava:guava:31.1-jre',
|
guava: 'com.google.guava:guava:31.1-jre',
|
||||||
hibernate: [ 'org.hibernate.common:hibernate-commons-annotations:5.1.1.Final',
|
hibernate: [ 'org.hibernate:hibernate-core:5.4.24.Final',
|
||||||
'org.hibernate:hibernate-core:5.2.4.Final',
|
'org.hibernate.common:hibernate-commons-annotations:5.1.1.Final',
|
||||||
'org.hibernate:hibernate-hikaricp:5.2.4.Final'],
|
'org.hibernate:hibernate-hikaricp:5.2.4.Final'],
|
||||||
|
hikari: 'com.zaxxer:HikariCP:3.4.5',
|
||||||
hsqldb: 'org.hsqldb:hsqldb:2.6.1',
|
hsqldb: 'org.hsqldb:hsqldb:2.6.1',
|
||||||
http: 'org.apache.httpcomponents:httpclient:4.5.13',
|
http: 'org.apache.httpcomponents:httpclient:4.5.13',
|
||||||
jackson: [ 'com.fasterxml.jackson.core:jackson-core:2.13.2',
|
jackson: [ 'com.fasterxml.jackson.core:jackson-core:2.13.2',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user