mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-19 04:58:00 +00:00
Missed the checkstyle errors previously and adding
ComponentResultManager as a bean.
This commit is contained in:
parent
e6d304542c
commit
632927786a
@ -5,6 +5,7 @@ import hirs.persist.AppraiserManager;
|
||||
import hirs.persist.CrudManager;
|
||||
import hirs.persist.DBAppraiserManager;
|
||||
import hirs.persist.DBCertificateManager;
|
||||
import hirs.persist.DBComponentResultManager;
|
||||
import hirs.persist.DBDeviceGroupManager;
|
||||
import hirs.persist.DBDeviceManager;
|
||||
import hirs.persist.DBManager;
|
||||
@ -53,6 +54,16 @@ public class PersistenceConfiguration {
|
||||
return new DBDeviceManager(sessionFactory.getObject());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link DBComponentResultManager} ready to use.
|
||||
*
|
||||
* @return {@link DBComponentResultManager}
|
||||
*/
|
||||
@Bean
|
||||
public DBComponentResultManager componentResultManager() {
|
||||
return new DBComponentResultManager(sessionFactory.getObject());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link DBCertificateManager} ready to use.
|
||||
*
|
||||
|
@ -7,7 +7,8 @@ import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* A custom class that merges the result of the validation attribute components and allows for
|
||||
* the matching of what was expected to actual and display this information to the portal.
|
||||
*/
|
||||
@Entity
|
||||
public class ComponentResult extends AbstractEntity {
|
||||
@ -19,7 +20,7 @@ public class ComponentResult extends AbstractEntity {
|
||||
private boolean mismatched;
|
||||
|
||||
/**
|
||||
* Hibernate default constructor
|
||||
* Hibernate default constructor.
|
||||
*/
|
||||
protected ComponentResult() {
|
||||
}
|
||||
@ -82,10 +83,16 @@ public class ComponentResult extends AbstractEntity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (!super.equals(o)) return false;
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
if (!super.equals(o)) {
|
||||
return false;
|
||||
}
|
||||
ComponentResult that = (ComponentResult) o;
|
||||
return componentHash == that.componentHash
|
||||
&& mismatched == that.mismatched
|
||||
|
@ -45,8 +45,9 @@ public interface ComponentResultManager extends OrderedListQuerier<ComponentResu
|
||||
|
||||
/**
|
||||
* Returns a list of all <code>ComponentResult</code>s that are
|
||||
* associated with the certificate
|
||||
* associated with the certificate.
|
||||
*
|
||||
* @param certificateId the certificate id
|
||||
* @return FilteredRecordsList object with fields for DataTables
|
||||
*/
|
||||
Set<ComponentResult> getComponentResultsByCertificate(UUID certificateId);
|
||||
|
@ -14,7 +14,8 @@ import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* This class is used to persist and retrieve {@link hirs.data.persist.certificate.ComponentResult}s into
|
||||
* This class is used to persist and retrieve
|
||||
* {@link hirs.data.persist.certificate.ComponentResult}s into
|
||||
* and from the database.
|
||||
*/
|
||||
public class DBComponentResultManager extends DBManager<ComponentResult>
|
||||
@ -150,7 +151,7 @@ public class DBComponentResultManager extends DBManager<ComponentResult>
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteResult(ComponentResult componentResult) {
|
||||
public boolean deleteResult(final ComponentResult componentResult) {
|
||||
boolean result;
|
||||
LOGGER.info(String.format("Deleting component result to %s",
|
||||
componentResult.getId()));
|
||||
|
@ -601,6 +601,7 @@ public final class SupplyChainCredentialValidator implements CredentialValidator
|
||||
* pick out the changes that lead to the delta cert and make sure the changes
|
||||
* are valid.
|
||||
*
|
||||
* @param certificateId the certificate id
|
||||
* @param deviceInfoReport The paccor profile of device being validated against.
|
||||
* @param deltaMapping map of delta certificates to their validated status
|
||||
* @param origPcComponents The component identifier list associated with the
|
||||
@ -782,7 +783,8 @@ public final class SupplyChainCredentialValidator implements CredentialValidator
|
||||
subCompIdList.remove(cId);
|
||||
subCompInfoList.remove(cInfo);
|
||||
}
|
||||
} // I have to get the unmatched from here, maybe create a list of component result and use that TDM
|
||||
} // I have to get the unmatched from here,
|
||||
// maybe create a list of component result and use that
|
||||
}
|
||||
|
||||
if (subCompIdList.isEmpty()) {
|
||||
@ -1073,6 +1075,8 @@ public final class SupplyChainCredentialValidator implements CredentialValidator
|
||||
/**
|
||||
* Checks if the fields in the potentialMatch match the fields in the pcComponent,
|
||||
* or if the relevant field in the pcComponent is empty.
|
||||
*
|
||||
* @param certificateId the certificate id
|
||||
* @param pcComponent the platform credential component
|
||||
* @param potentialMatch the component info from a device info report
|
||||
* @return true if the fields match exactly (null is considered the same as an empty string)
|
||||
|
Loading…
Reference in New Issue
Block a user