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 AbstractMetadata
Provides 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 class
Metadata.Location
A physical point of presence, which may be associated with people, organizations, or other concepts within the current or linked OSCAL document.static class
Metadata.Party
An organization or person, which may be associated with roles or other concepts within the current or linked OSCAL document.static class
Metadata.Revision
An entry in a sequential list of revisions to the containing document, expected to be in reverse chronological order (i.e.static class
Metadata.Role
Defines 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 boolean
addAction(Action item)
Add a newAction
item to the underlying collection.boolean
addDocumentId(DocumentId item)
Add a newDocumentId
item to the underlying collection.boolean
addLink(Link item)
Add a newLink
item to the underlying collection.boolean
addLocation(Metadata.Location item)
Add a newMetadata.Location
item to the underlying collection.boolean
addParty(Metadata.Party item)
Add a newMetadata.Party
item to the underlying collection.boolean
addProp(Property item)
Add a newProperty
item to the underlying collection.boolean
addResponsibleParty(ResponsibleParty item)
Add a newResponsibleParty
item to the underlying collection.boolean
addRevision(Metadata.Revision item)
Add a newMetadata.Revision
item to the underlying collection.boolean
addRole(Metadata.Role item)
Add a newMetadata.Role
item to the underlying collection.List<Action>
getActions()
List<DocumentId>
getDocumentIds()
ZonedDateTime
getLastModified()
List<Link>
getLinks()
List<Metadata.Location>
getLocations()
String
getOscalVersion()
List<Metadata.Party>
getParties()
List<Property>
getProps()
ZonedDateTime
getPublished()
gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupMultiline
getRemarks()
List<ResponsibleParty>
getResponsibleParties()
List<Metadata.Revision>
getRevisions()
List<Metadata.Role>
getRoles()
gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupLine
getTitle()
String
getVersion()
boolean
removeAction(Action item)
Remove the first matchingAction
item from the underlying collection.boolean
removeDocumentId(DocumentId item)
Remove the first matchingDocumentId
item from the underlying collection.boolean
removeLink(Link item)
Remove the first matchingLink
item from the underlying collection.boolean
removeLocation(Metadata.Location item)
Remove the first matchingMetadata.Location
item from the underlying collection.boolean
removeParty(Metadata.Party item)
Remove the first matchingMetadata.Party
item from the underlying collection.boolean
removeProp(Property item)
Remove the first matchingProperty
item from the underlying collection.boolean
removeResponsibleParty(ResponsibleParty item)
Remove the first matchingResponsibleParty
item from the underlying collection.boolean
removeRevision(Metadata.Revision item)
Remove the first matchingMetadata.Revision
item from the underlying collection.boolean
removeRole(Metadata.Role item)
Remove the first matchingMetadata.Role
item from the underlying collection.void
setActions(List<Action> value)
void
setDocumentIds(List<DocumentId> value)
void
setLastModified(ZonedDateTime value)
void
setLinks(List<Link> value)
void
setLocations(List<Metadata.Location> value)
void
setOscalVersion(String value)
void
setParties(List<Metadata.Party> value)
void
setProps(List<Property> value)
void
setPublished(ZonedDateTime value)
void
setRemarks(gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupMultiline value)
void
setResponsibleParties(List<ResponsibleParty> value)
void
setRevisions(List<Metadata.Revision> value)
void
setRoles(List<Metadata.Role> value)
void
setTitle(gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupLine value)
void
setVersion(String value)
String
toString()
-
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.Revision
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeRevision
public boolean removeRevision(Metadata.Revision item)
Remove the first matchingMetadata.Revision
item from the underlying collection.- Parameters:
item
- the item to remove- Returns:
true
if the item was removed orfalse
otherwise
-
getDocumentIds
public List<DocumentId> getDocumentIds()
-
setDocumentIds
public void setDocumentIds(List<DocumentId> value)
-
addDocumentId
public boolean addDocumentId(DocumentId item)
Add a newDocumentId
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeDocumentId
public boolean removeDocumentId(DocumentId item)
Remove the first matchingDocumentId
item from the underlying collection.- Parameters:
item
- the item to remove- Returns:
true
if the item was removed orfalse
otherwise
-
addProp
public boolean addProp(Property item)
Add a newProperty
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeProp
public boolean removeProp(Property item)
Remove the first matchingProperty
item from the underlying collection.- Parameters:
item
- the item to remove- Returns:
true
if the item was removed orfalse
otherwise
-
addLink
public boolean addLink(Link item)
Add a newLink
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeLink
public boolean removeLink(Link item)
Remove the first matchingLink
item from the underlying collection.- Parameters:
item
- the item to remove- Returns:
true
if the item was removed orfalse
otherwise
-
getRoles
public List<Metadata.Role> getRoles()
-
setRoles
public void setRoles(List<Metadata.Role> value)
-
addRole
public boolean addRole(Metadata.Role item)
Add a newMetadata.Role
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeRole
public boolean removeRole(Metadata.Role item)
Remove the first matchingMetadata.Role
item from the underlying collection.- Parameters:
item
- the item to remove- Returns:
true
if the item was removed orfalse
otherwise
-
getLocations
public List<Metadata.Location> getLocations()
-
setLocations
public void setLocations(List<Metadata.Location> value)
-
addLocation
public boolean addLocation(Metadata.Location item)
Add a newMetadata.Location
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeLocation
public boolean removeLocation(Metadata.Location item)
Remove the first matchingMetadata.Location
item from the underlying collection.- Parameters:
item
- the item to remove- Returns:
true
if the item was removed orfalse
otherwise
-
getParties
public List<Metadata.Party> getParties()
-
setParties
public void setParties(List<Metadata.Party> value)
-
addParty
public boolean addParty(Metadata.Party item)
Add a newMetadata.Party
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeParty
public boolean removeParty(Metadata.Party item)
Remove the first matchingMetadata.Party
item from the underlying collection.- Parameters:
item
- the item to remove- Returns:
true
if the item was removed orfalse
otherwise
-
getResponsibleParties
public List<ResponsibleParty> getResponsibleParties()
-
setResponsibleParties
public void setResponsibleParties(List<ResponsibleParty> value)
-
addResponsibleParty
public boolean addResponsibleParty(ResponsibleParty item)
Add a newResponsibleParty
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeResponsibleParty
public boolean removeResponsibleParty(ResponsibleParty item)
Remove the first matchingResponsibleParty
item from the underlying collection.- Parameters:
item
- the item to remove- Returns:
true
if the item was removed orfalse
otherwise
-
getActions
public List<Action> getActions()
-
setActions
public void setActions(List<Action> value)
-
addAction
public boolean addAction(Action item)
Add a newAction
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeAction
public boolean removeAction(Action item)
Remove the first matchingAction
item from the underlying collection.- Parameters:
item
- the item to remove- Returns:
true
if the item was removed orfalse
otherwise
-
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)
-
-