public class DuplicationValidator extends Object implements MetacardValidator, ReportingMetacardValidator, Describable, Describable
Constructor and Description |
---|
DuplicationValidator(CatalogFramework catalogFramework,
FilterBuilder filterBuilder) |
Modifier and Type | Method and Description |
---|---|
String |
getDescription()
Returns a description of the describable item.
|
String |
getId()
Returns the name, aka ID, of the describable item.
|
String |
getOrganization()
Returns the organization associated with the describable item.
|
String |
getTitle()
Returns the title of the describable item.
|
String |
getVersion()
Retrieve the version.
|
void |
setErrorOnDuplicateAttributes(String[] attributeStrings)
Setter for the list of attributes to test for duplication in the local catalog.
|
void |
setWarnOnDuplicateAttributes(String[] attributeStrings)
Setter for the list of attributes to test for duplication in the local catalog.
|
void |
validate(Metacard metacard)
Validates a
Metacard |
Optional<MetacardValidationReport> |
validateMetacard(Metacard metacard)
Validates a
Metacard . |
public DuplicationValidator(CatalogFramework catalogFramework, FilterBuilder filterBuilder)
public void setErrorOnDuplicateAttributes(String[] attributeStrings)
Validation.VALIDATION_ERRORS
attribute
to be set on the metacard.attributeStrings
- public void setWarnOnDuplicateAttributes(String[] attributeStrings)
Validation.VALIDATION_WARNINGS
attribute to be set on the metacard.attributeStrings
- public Optional<MetacardValidationReport> validateMetacard(Metacard metacard)
ReportingMetacardValidator
Metacard
.validateMetacard
in interface ReportingMetacardValidator
metacard
- the Metacard
to validate, cannot be nullOptional
containing a MetacardValidationReport
if there are
violations, or an empty Optional
if there are no violationspublic void validate(Metacard metacard) throws ValidationException
MetacardValidator
Metacard
validate
in interface MetacardValidator
metacard
- Metacard
to validateValidationException
- if any validation error occurspublic String getVersion()
Describable
getVersion
in interface Describable
public String getId()
Describable
html for a MetacardTransformer
that transforms Metacard
s to HTML
getId
in interface Describable
public String getTitle()
Describable
getTitle
in interface Describable
public String getDescription()
Describable
getDescription
in interface Describable
public String getOrganization()
Describable
getOrganization
in interface Describable
This work is licensed under a Creative Commons Attribution 4.0 International License.