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:
gov.nist.secauto.metaschema.core.model.IBoundObject
,IMetadata
@MetaschemaAssembly(formalName="Document Metadata",
description="Provides information about the containing document, and defines concepts that are shared across the document.",
name="metadata",
moduleClass=OscalMetadataModule.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.",
valueConstraints=@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).")}),
modelConstraints=@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"))},unique={@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
implements gov.nist.secauto.metaschema.core.model.IBoundObject
Provides information about the containing document, and defines concepts that are shared across the document.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A physical point of presence, which may be associated with people, organizations, or other concepts within the current or linked OSCAL document.static class
An organization or person, which may be associated with roles or other concepts within the current or linked OSCAL document.static class
An entry in a sequential list of revisions to the containing document, expected to be in reverse chronological order (i.e. latest first).static class
Defines a function, which might be assigned to a party in a specific situation. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Add a newAction
item to the underlying collection.boolean
addDocumentId
(DocumentId item) Add a newDocumentId
item to the underlying collection.boolean
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
Add a newProperty
item to the underlying collection.boolean
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.getLinks()
gov.nist.secauto.metaschema.core.model.IMetaschemaData
getProps()
gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline
getRoles()
gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine
getTitle()
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
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
Remove the first matchingResponsibleParty
item from the underlying collection.boolean
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
void
setLocations
(List<Metadata.Location> value) void
setOscalVersion
(String value) void
setParties
(List<Metadata.Party> value) void
void
setPublished
(ZonedDateTime value) void
setRemarks
(gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline value) void
void
setRevisions
(List<Metadata.Revision> value) void
setRoles
(List<Metadata.Role> value) void
setTitle
(gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine value) void
setVersion
(String value) toString()
Methods inherited from class gov.nist.secauto.oscal.lib.model.metadata.AbstractMetadata
getPartyByUuid
-
Constructor Details
-
Metadata
public Metadata() -
Metadata
-
-
Method Details
-
getMetaschemaData
- Specified by:
getMetaschemaData
in interfacegov.nist.secauto.metaschema.core.model.IBoundObject
-
getTitle
-
setTitle
-
getPublished
-
setPublished
-
getLastModified
-
setLastModified
-
getVersion
-
setVersion
-
getOscalVersion
-
setOscalVersion
-
getRevisions
-
setRevisions
-
addRevision
Add a newMetadata.Revision
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeRevision
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
-
setDocumentIds
-
addDocumentId
Add a newDocumentId
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeDocumentId
Remove the first matchingDocumentId
item from the underlying collection.- Parameters:
item
- the item to remove- Returns:
true
if the item was removed orfalse
otherwise
-
getProps
-
setProps
-
addProp
Add a newProperty
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeProp
Remove the first matchingProperty
item from the underlying collection.- Parameters:
item
- the item to remove- Returns:
true
if the item was removed orfalse
otherwise
-
getLinks
-
setLinks
-
addLink
Add a newLink
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeLink
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
-
setRoles
-
addRole
Add a newMetadata.Role
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeRole
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
- Specified by:
getLocations
in interfaceIMetadata
-
setLocations
-
addLocation
Add a newMetadata.Location
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeLocation
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
- Specified by:
getParties
in interfaceIMetadata
-
setParties
-
addParty
Add a newMetadata.Party
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeParty
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
-
setResponsibleParties
-
addResponsibleParty
Add a newResponsibleParty
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeResponsibleParty
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
-
setActions
-
addAction
Add a newAction
item to the underlying collection.- Parameters:
item
- the item to add- Returns:
true
-
removeAction
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
-
setRemarks
-
toString
-