Package gov.nist.secauto.oscal.lib.model
Class Metadata
- java.lang.Object
-
- gov.nist.secauto.oscal.lib.model.metadata.AbstractMetadata
-
- gov.nist.secauto.oscal.lib.model.Metadata
-
- All Implemented Interfaces:
IMetadata
@MetaschemaAssembly(formalName="Document Metadata", description="Provides information about the containing document, and defines concepts that are shared across the document.", name="metadata", metaschema=OscalMetadataMetaschema.class, remarks="All OSCAL documents use the same metadata structure, that provides a consistent way of expressing OSCAL document metadata across all OSCAL models. The metadata section also includes declarations of individual objects (i.e., roles, location, parties) that may be referenced within and across linked OSCAL documents.\n\nThe metadata in an OSCAL document has few required fields, representing only the bare minimum data needed to differentiate one instance from another. Tools and users creating OSCAL documents may choose to use any of the optional fields, as well as extension mechanisms (e.g., properties, links) to go beyond this minimum to suit their use cases.\n\nA publisher of OSCAL content can use the `published`, `last-modified`, and `version` fields to establish information about an individual in a sequence of successive revisions of a given OSCAL-based publication. The metadata for a previous revision can be represented as a `revision` within this object. Links may also be provided using the `predecessor-version` and `successor-version` link relations to provide for direct access to the related resource. These relations can be provided as a link child of this object or as `link` within a given `revision`.\n\nA `responsible-party` entry in this context refers to roles and parties that have responsibility relative to the production, review, publication, and use of the containing document.") @AllowedValues(id="allowed-metadata-responsibe-party-role-ids",level=ERROR,target="responsible-party/@role-id",allowOthers=true,values={@AllowedValue(value="creator",description="Indicates the person or organization that created this content."),@AllowedValue(value="prepared-by",description="Indicates the person or organization that prepared this content."),@AllowedValue(value="prepared-for",description="Indicates the person or organization for which this content was created."),@AllowedValue(value="content-approver",description="Indicates the person or organization responsible for all content represented in the \"document\"."),@AllowedValue(value="contact",description="Indicates the person or organization to contact for questions or support related to this content.")}) @AllowedValues(level=ERROR,target="prop[has-oscal-namespace(\'http://csrc.nist.gov/ns/oscal\')]/@name",values=@AllowedValue(value="keywords",description="The value identifies a comma-seperated listing of keywords associated with this content. These keywords may be used as search terms for indexing and other applications.")) @AllowedValues(level=ERROR,target="link/@rel",allowOthers=true,values={@AllowedValue(value="canonical",description="The link identifies the authoritative location for this resource. Defined by [RFC 6596](https://tools.ietf.org/html/rfc6596)."),@AllowedValue(value="alternate",description="The link identifies an alternative location or format for this resource. Defined by [the HTML Living Standard](https://html.spec.whatwg.org/multipage/links.html#linkTypes)"),@AllowedValue(value="latest-version",description="This link identifies a resource containing the latest version in the version history. Defined by [RFC 5829](https://tools.ietf.org/html/rfc5829)."),@AllowedValue(value="predecessor-version",description="This link identifies a resource containing the predecessor version in the version history. Defined by [RFC 5829](https://tools.ietf.org/html/rfc5829)."),@AllowedValue(value="successor-version",description="This link identifies a resource containing the predecessor version in the version history. Defined by [RFC 5829](https://tools.ietf.org/html/rfc5829).")}) @AssemblyConstraints(index={@Index(id="index-metadata-roles",level=ERROR,target="role",name="index-metadata-role-ids",keyFields=@KeyField(target="@id")),@Index(id="index-metadata-property-uuid",level=ERROR,target=".//prop",name="index-metadata-property-uuid",keyFields=@KeyField(target="@uuid")),@Index(id="index-metadata-role-id",level=ERROR,target="role",name="index-metadata-role-id",keyFields=@KeyField(target="@id")),@Index(id="index-metadata-location-uuid",level=ERROR,target="location",name="index-metadata-location-uuid",keyFields=@KeyField(target="@uuid")),@Index(id="index-metadata-party-uuid",level=ERROR,target="party",name="index-metadata-party-uuid",keyFields=@KeyField(target="@uuid")),@Index(id="index-metadata-party-organizations-uuid",level=ERROR,target="party[@type=\'organization\']",name="index-metadata-party-organizations-uuid",keyFields=@KeyField(target="@uuid"))},isUnique={@IsUnique(id="unique-metadata-doc-id",level=ERROR,target="document-id",keyFields={@KeyField(target="@scheme"),@KeyField}),@IsUnique(id="unique-metadata-property",level=ERROR,target="prop",keyFields={@KeyField(target="@name"),@KeyField(target="@ns"),@KeyField(target="@class"),@KeyField(target="@group"),@KeyField(target="@value")}),@IsUnique(id="unique-metadata-link",level=ERROR,target="link",keyFields={@KeyField(target="@href"),@KeyField(target="@rel"),@KeyField(target="@media-type")}),@IsUnique(id="unique-metadata-responsible-party",level=ERROR,target="responsible-party",keyFields=@KeyField(target="@role-id"),remarks="Since `responsible-party` associates multiple `party-uuid` entries with a single `role-id`, each role-id must be referenced only once."),@IsUnique(level=ERROR,target="document-id",keyFields={@KeyField(target="@scheme"),@KeyField},remarks="The combination of `scheme` and the field value must be unique.")}) public class Metadata extends AbstractMetadataProvides information about the containing document, and defines concepts that are shared across the document.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMetadata.LocationA physical point of presence, which may be associated with people, organizations, or other concepts within the current or linked OSCAL document.static classMetadata.PartyAn organization or person, which may be associated with roles or other concepts within the current or linked OSCAL document.static classMetadata.RevisionAn entry in a sequential list of revisions to the containing document, expected to be in reverse chronological order (i.e.static classMetadata.RoleDefines a function, which might be assigned to a party in a specific situation.
-
Constructor Summary
Constructors Constructor Description Metadata()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddAction(Action item)Add a newActionitem to the underlying collection.booleanaddDocumentId(DocumentId item)Add a newDocumentIditem to the underlying collection.booleanaddLink(Link item)Add a newLinkitem to the underlying collection.booleanaddLocation(Metadata.Location item)Add a newMetadata.Locationitem to the underlying collection.booleanaddParty(Metadata.Party item)Add a newMetadata.Partyitem to the underlying collection.booleanaddProp(Property item)Add a newPropertyitem to the underlying collection.booleanaddResponsibleParty(ResponsibleParty item)Add a newResponsiblePartyitem to the underlying collection.booleanaddRevision(Metadata.Revision item)Add a newMetadata.Revisionitem to the underlying collection.booleanaddRole(Metadata.Role item)Add a newMetadata.Roleitem to the underlying collection.List<Action>getActions()List<DocumentId>getDocumentIds()ZonedDateTimegetLastModified()List<Link>getLinks()List<Metadata.Location>getLocations()StringgetOscalVersion()List<Metadata.Party>getParties()List<Property>getProps()ZonedDateTimegetPublished()gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupMultilinegetRemarks()List<ResponsibleParty>getResponsibleParties()List<Metadata.Revision>getRevisions()List<Metadata.Role>getRoles()gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupLinegetTitle()StringgetVersion()booleanremoveAction(Action item)Remove the first matchingActionitem from the underlying collection.booleanremoveDocumentId(DocumentId item)Remove the first matchingDocumentIditem from the underlying collection.booleanremoveLink(Link item)Remove the first matchingLinkitem from the underlying collection.booleanremoveLocation(Metadata.Location item)Remove the first matchingMetadata.Locationitem from the underlying collection.booleanremoveParty(Metadata.Party item)Remove the first matchingMetadata.Partyitem from the underlying collection.booleanremoveProp(Property item)Remove the first matchingPropertyitem from the underlying collection.booleanremoveResponsibleParty(ResponsibleParty item)Remove the first matchingResponsiblePartyitem from the underlying collection.booleanremoveRevision(Metadata.Revision item)Remove the first matchingMetadata.Revisionitem from the underlying collection.booleanremoveRole(Metadata.Role item)Remove the first matchingMetadata.Roleitem from the underlying collection.voidsetActions(List<Action> value)voidsetDocumentIds(List<DocumentId> value)voidsetLastModified(ZonedDateTime value)voidsetLinks(List<Link> value)voidsetLocations(List<Metadata.Location> value)voidsetOscalVersion(String value)voidsetParties(List<Metadata.Party> value)voidsetProps(List<Property> value)voidsetPublished(ZonedDateTime value)voidsetRemarks(gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupMultiline value)voidsetResponsibleParties(List<ResponsibleParty> value)voidsetRevisions(List<Metadata.Revision> value)voidsetRoles(List<Metadata.Role> value)voidsetTitle(gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupLine value)voidsetVersion(String value)StringtoString()-
Methods inherited from class gov.nist.secauto.oscal.lib.model.metadata.AbstractMetadata
getPartyByUuid
-
-
-
-
Constructor Detail
-
Metadata
public Metadata()
-
-
Method Detail
-
getTitle
public gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupLine getTitle()
-
setTitle
public void setTitle(gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupLine value)
-
getPublished
public ZonedDateTime getPublished()
-
setPublished
public void setPublished(ZonedDateTime value)
-
getLastModified
public ZonedDateTime getLastModified()
-
setLastModified
public void setLastModified(ZonedDateTime value)
-
getVersion
public String getVersion()
-
setVersion
public void setVersion(String value)
-
getOscalVersion
public String getOscalVersion()
-
setOscalVersion
public void setOscalVersion(String value)
-
getRevisions
public List<Metadata.Revision> getRevisions()
-
setRevisions
public void setRevisions(List<Metadata.Revision> value)
-
addRevision
public boolean addRevision(Metadata.Revision item)
Add a newMetadata.Revisionitem to the underlying collection.- Parameters:
item- the item to add- Returns:
true
-
removeRevision
public boolean removeRevision(Metadata.Revision item)
Remove the first matchingMetadata.Revisionitem from the underlying collection.- Parameters:
item- the item to remove- Returns:
trueif the item was removed orfalseotherwise
-
getDocumentIds
public List<DocumentId> getDocumentIds()
-
setDocumentIds
public void setDocumentIds(List<DocumentId> value)
-
addDocumentId
public boolean addDocumentId(DocumentId item)
Add a newDocumentIditem to the underlying collection.- Parameters:
item- the item to add- Returns:
true
-
removeDocumentId
public boolean removeDocumentId(DocumentId item)
Remove the first matchingDocumentIditem from the underlying collection.- Parameters:
item- the item to remove- Returns:
trueif the item was removed orfalseotherwise
-
addProp
public boolean addProp(Property item)
Add a newPropertyitem to the underlying collection.- Parameters:
item- the item to add- Returns:
true
-
removeProp
public boolean removeProp(Property item)
Remove the first matchingPropertyitem from the underlying collection.- Parameters:
item- the item to remove- Returns:
trueif the item was removed orfalseotherwise
-
addLink
public boolean addLink(Link item)
Add a newLinkitem to the underlying collection.- Parameters:
item- the item to add- Returns:
true
-
removeLink
public boolean removeLink(Link item)
Remove the first matchingLinkitem from the underlying collection.- Parameters:
item- the item to remove- Returns:
trueif the item was removed orfalseotherwise
-
getRoles
public List<Metadata.Role> getRoles()
-
setRoles
public void setRoles(List<Metadata.Role> value)
-
addRole
public boolean addRole(Metadata.Role item)
Add a newMetadata.Roleitem to the underlying collection.- Parameters:
item- the item to add- Returns:
true
-
removeRole
public boolean removeRole(Metadata.Role item)
Remove the first matchingMetadata.Roleitem from the underlying collection.- Parameters:
item- the item to remove- Returns:
trueif the item was removed orfalseotherwise
-
getLocations
public List<Metadata.Location> getLocations()
-
setLocations
public void setLocations(List<Metadata.Location> value)
-
addLocation
public boolean addLocation(Metadata.Location item)
Add a newMetadata.Locationitem to the underlying collection.- Parameters:
item- the item to add- Returns:
true
-
removeLocation
public boolean removeLocation(Metadata.Location item)
Remove the first matchingMetadata.Locationitem from the underlying collection.- Parameters:
item- the item to remove- Returns:
trueif the item was removed orfalseotherwise
-
getParties
public List<Metadata.Party> getParties()
-
setParties
public void setParties(List<Metadata.Party> value)
-
addParty
public boolean addParty(Metadata.Party item)
Add a newMetadata.Partyitem to the underlying collection.- Parameters:
item- the item to add- Returns:
true
-
removeParty
public boolean removeParty(Metadata.Party item)
Remove the first matchingMetadata.Partyitem from the underlying collection.- Parameters:
item- the item to remove- Returns:
trueif the item was removed orfalseotherwise
-
getResponsibleParties
public List<ResponsibleParty> getResponsibleParties()
-
setResponsibleParties
public void setResponsibleParties(List<ResponsibleParty> value)
-
addResponsibleParty
public boolean addResponsibleParty(ResponsibleParty item)
Add a newResponsiblePartyitem to the underlying collection.- Parameters:
item- the item to add- Returns:
true
-
removeResponsibleParty
public boolean removeResponsibleParty(ResponsibleParty item)
Remove the first matchingResponsiblePartyitem from the underlying collection.- Parameters:
item- the item to remove- Returns:
trueif the item was removed orfalseotherwise
-
getActions
public List<Action> getActions()
-
setActions
public void setActions(List<Action> value)
-
addAction
public boolean addAction(Action item)
Add a newActionitem to the underlying collection.- Parameters:
item- the item to add- Returns:
true
-
removeAction
public boolean removeAction(Action item)
Remove the first matchingActionitem from the underlying collection.- Parameters:
item- the item to remove- Returns:
trueif the item was removed orfalseotherwise
-
getRemarks
public gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupMultiline getRemarks()
-
setRemarks
public void setRemarks(gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupMultiline value)
-
-