public class SystemMetadataValidator extends Object
| Constructor and Description |
|---|
SystemMetadataValidator(org.dataone.service.types.v2.SystemMetadata referenceSystemMetadata)
Creates a new instance of a SystemMetadataValidator with the reference
SystemMetadata (the sysmeta to validate against) as the required parameter.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
customSerializationCompareComplexFields(org.dataone.service.types.v2.SystemMetadata newSysMeta) |
org.dataone.service.types.v2.SystemMetadata |
getReferenceSystemMetadata() |
boolean |
hasValidUpdates(org.dataone.service.types.v2.SystemMetadata proposedSystemMetadata)
Compares the passed in SystemMetadata to the reference SystemMetadata to
determine if the new SystemMetadata represents valid updates of the
reference sysmeta.
|
static void |
schemaValidateSystemMetadata(org.dataone.service.types.v2.SystemMetadata sysmeta)
Makes sure the system metadata is valid against the schema.
|
static void |
validateCNRequiredNonNullFields(org.dataone.service.types.v2.SystemMetadata sysmeta)
Checks to make sure that the properties that need to be set prior to
initial synchronization are not null.
|
void |
validateEssentialProperties(org.dataone.service.types.v2.SystemMetadata newSysMeta,
Object authoritativeNodeReadImpl)
Validates the essential properties of the system metadata that determine
whether or not the two are describing the same object.
|
public SystemMetadataValidator(org.dataone.service.types.v2.SystemMetadata referenceSystemMetadata)
throws org.dataone.service.exceptions.InvalidSystemMetadata
referenceSystemMetadata - - the systemMetadata to validate changes againstorg.dataone.service.exceptions.InvalidSystemMetadatapublic org.dataone.service.types.v2.SystemMetadata getReferenceSystemMetadata()
public static void schemaValidateSystemMetadata(org.dataone.service.types.v2.SystemMetadata sysmeta)
throws org.dataone.service.exceptions.InvalidSystemMetadata
sysmeta - org.dataone.service.exceptions.InvalidSystemMetadata - - with pid from sysmeta if it can get itpublic static void validateCNRequiredNonNullFields(org.dataone.service.types.v2.SystemMetadata sysmeta)
throws org.dataone.service.exceptions.InvalidSystemMetadata
sysmeta - org.dataone.service.exceptions.InvalidSystemMetadatapublic void validateEssentialProperties(org.dataone.service.types.v2.SystemMetadata newSysMeta,
Object authoritativeNodeReadImpl)
throws org.dataone.service.exceptions.IdentifierNotUnique,
org.dataone.service.exceptions.ServiceFailure,
org.dataone.service.exceptions.InvalidRequest,
org.dataone.service.exceptions.InvalidToken,
org.dataone.service.exceptions.NotAuthorized,
org.dataone.service.exceptions.NotImplemented,
org.dataone.service.exceptions.NotFound
newSysMeta - authoritativeNodeReadImpl - org.dataone.service.exceptions.IdentifierNotUnique - - if the newSysMeta's identifier or checksum doesn't matchorg.dataone.service.exceptions.ServiceFailure - - if the reference sysMeta's checksum is nullorg.dataone.service.exceptions.NotFound - - if authMNImpl is used and the pid was not foundorg.dataone.service.exceptions.NotImplemented - - if the getChecksum method was not availableorg.dataone.service.exceptions.NotAuthorized - - if the client couldn't access getChecksumorg.dataone.service.exceptions.InvalidToken - - if the client couldn't access getChecksumorg.dataone.service.exceptions.InvalidRequest - - if the checksum algorithm requested wasn't availabe.public boolean hasValidUpdates(org.dataone.service.types.v2.SystemMetadata proposedSystemMetadata)
throws org.dataone.service.exceptions.InvalidRequest,
org.dataone.service.exceptions.ServiceFailure
proposedSystemMetadata - - the systemMetadata to validateorg.dataone.service.exceptions.InvalidRequest - - if changes do not validateorg.dataone.service.exceptions.ServiceFailure - - if an AccessPolicy or ReplicationPolicy couldn't be re-serialized for comparisonfor specification on ownership and editability of properties.protected boolean customSerializationCompareComplexFields(org.dataone.service.types.v2.SystemMetadata newSysMeta)
throws org.dataone.service.exceptions.ServiceFailure
newSysMeta - org.dataone.service.exceptions.ServiceFailureCopyright © 2018. All rights reserved.