001// Generated from: ../../../../../../../../oscal/src/metaschema/oscal_implementation-common_metaschema.xml 002// Do not edit - changes will be lost when regenerated. 003package dev.metaschema.oscal.lib.model; 004 005import dev.metaschema.core.datatype.adapter.UuidAdapter; 006import dev.metaschema.core.datatype.markup.MarkupMultiline; 007import dev.metaschema.core.datatype.markup.MarkupMultilineAdapter; 008import dev.metaschema.core.model.IBoundObject; 009import dev.metaschema.core.model.IMetaschemaData; 010import dev.metaschema.core.model.JsonGroupAsBehavior; 011import dev.metaschema.core.model.constraint.IConstraint; 012import dev.metaschema.core.util.ObjectUtils; 013import dev.metaschema.databind.model.annotations.AllowedValue; 014import dev.metaschema.databind.model.annotations.AllowedValues; 015import dev.metaschema.databind.model.annotations.AssemblyConstraints; 016import dev.metaschema.databind.model.annotations.BoundAssembly; 017import dev.metaschema.databind.model.annotations.BoundField; 018import dev.metaschema.databind.model.annotations.BoundFlag; 019import dev.metaschema.databind.model.annotations.GroupAs; 020import dev.metaschema.databind.model.annotations.IndexHasKey; 021import dev.metaschema.databind.model.annotations.IsUnique; 022import dev.metaschema.databind.model.annotations.KeyField; 023import dev.metaschema.databind.model.annotations.MetaschemaAssembly; 024import dev.metaschema.databind.model.annotations.ValueConstraints; 025import edu.umd.cs.findbugs.annotations.NonNull; 026import edu.umd.cs.findbugs.annotations.Nullable; 027import java.util.LinkedList; 028import java.util.List; 029import java.util.UUID; 030import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 031import org.apache.commons.lang3.builder.ToStringStyle; 032 033/** 034 * A single managed inventory item within the system. 035 */ 036@MetaschemaAssembly( 037 formalName = "Inventory Item", 038 description = "A single managed inventory item within the system.", 039 name = "inventory-item", 040 moduleClass = OscalImplementationCommonModule.class, 041 valueConstraints = @ValueConstraints(allowedValues = {@AllowedValues(id = "oscal-inventory-item-prop-name-values", level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name", values = {@AllowedValue(value = "ipv4-address", description = "The Internet Protocol v4 Address of the asset."), @AllowedValue(value = "ipv6-address", description = "The Internet Protocol v6 Address of the asset."), @AllowedValue(value = "fqdn", description = "The full-qualified domain name (FQDN) of the asset."), @AllowedValue(value = "uri", description = "A Uniform Resource Identifier (URI) for the asset."), @AllowedValue(value = "serial-number", description = "A serial number for the asset."), @AllowedValue(value = "netbios-name", description = "The NetBIOS name for the asset."), @AllowedValue(value = "mac-address", description = "The media access control (MAC) address for the asset."), @AllowedValue(value = "physical-location", description = "The physical location of the asset's hardware (e.g., Data Center ID, Cage#, Rack#, or other meaningful location identifiers)."), @AllowedValue(value = "is-scanned", description = "is the asset subjected to network scans? (yes/no)"), @AllowedValue(value = "asset-type", description = "Simple indication of the asset's function, such as Router, Storage Array, DNS Server."), @AllowedValue(value = "asset-id", description = "An organizationally specific identifier that is used to uniquely identify a logical or tangible item by the organization that owns the item."), @AllowedValue(value = "asset-tag", description = "An asset tag assigned by the organization responsible for maintaining the logical or tangible item."), @AllowedValue(value = "public", description = "Identifies whether the asset is publicly accessible (yes/no)"), @AllowedValue(value = "virtual", description = "Identifies whether the asset is virtualized (yes/no)"), @AllowedValue(value = "vlan-id", description = "Virtual LAN identifier of the asset."), @AllowedValue(value = "network-id", description = "The network identifier of the asset."), @AllowedValue(value = "label", description = "A human-readable label for the parent context."), @AllowedValue(value = "sort-id", description = "An alternative identifier, whose value is easily sortable among other such values in the document."), @AllowedValue(value = "baseline-configuration-name", description = "The name of the baseline configuration for the asset."), @AllowedValue(value = "allows-authenticated-scan", description = "Can the asset be check with an authenticated scan? (yes/no)"), @AllowedValue(value = "function", description = "The function provided by the asset for the system."), @AllowedValue(value = "hardware-model", description = "\\*\\*(deprecated)\\*\\* Use 'model' instead.", deprecatedVersion = "1.2.0"), @AllowedValue(value = "model", description = "The model of system used by the asset."), @AllowedValue(value = "os-name", description = "The name of the operating system used by the asset."), @AllowedValue(value = "os-version", description = "The version of the operating system used by the asset."), @AllowedValue(value = "software-name", description = "The software product name used by the asset."), @AllowedValue(value = "software-version", description = "The software product version used by the asset."), @AllowedValue(value = "software-patch-level", description = "The software product patch level used by the asset.")}), @AllowedValues(id = "oscal-inventory-item-prop-asset-type-values", level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='asset-type']/@value", allowOthers = true, values = {@AllowedValue(value = "operating-system", description = "System software that manages computer hardware, software resources, and provides common services for computer programs."), @AllowedValue(value = "database", description = "An electronic collection of data, or information, that is specially organized for rapid search and retrieval."), @AllowedValue(value = "web-server", description = "A system that delivers content or services to end users over the Internet or an intranet."), @AllowedValue(value = "dns-server", description = "A system that resolves domain names to internet protocol (IP) addresses."), @AllowedValue(value = "email-server", description = "A computer system that sends and receives electronic mail messages."), @AllowedValue(value = "directory-server", description = "A system that stores, organizes and provides access to directory information in order to unify network resources."), @AllowedValue(value = "pbx", description = "A private branch exchange (PBX) provides a a private telephone switchboard."), @AllowedValue(value = "firewall", description = "A network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules."), @AllowedValue(value = "router", description = "A physical or virtual networking device that forwards data packets between computer networks."), @AllowedValue(value = "switch", description = "A physical or virtual networking device that connects devices within a computer network by using packet switching to receive and forward data to the destination device."), @AllowedValue(value = "storage-array", description = "A consolidated, block-level data storage capability."), @AllowedValue(value = "appliance", description = "A physical or virtual machine that centralizes hardware, software, or services for a specific purpose.")}), @AllowedValues(id = "oscal-inventory-item-hardware-service-software-prop-name-values", level = IConstraint.Level.ERROR, target = "(.)[@type=('software', 'hardware', 'service')]/prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name", values = @AllowedValue(value = "vendor-name", description = "The name of the company or organization")), @AllowedValues(id = "oscal-inventory-item-prop-is-scanned-values", level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='is-scanned']/@value", values = {@AllowedValue(value = "yes", description = "The asset is included in periodic vulnerability scanning."), @AllowedValue(value = "no", description = "The asset is not included in periodic vulnerability scanning.")}), @AllowedValues(id = "oscal-inventory-item-link-rel-values", level = IConstraint.Level.ERROR, target = "link/@rel", allowOthers = true, values = @AllowedValue(value = "baseline-template", description = "A reference to the baseline template used to configure the asset.")), @AllowedValues(id = "oscal-inventory-item-responsible-party-role-id-values", level = IConstraint.Level.ERROR, target = "responsible-party/@role-id", allowOthers = true, values = {@AllowedValue(value = "asset-owner", description = "Accountable for ensuring the asset is managed in accordance with organizational policies and procedures."), @AllowedValue(value = "asset-administrator", description = "Responsible for administering a set of assets."), @AllowedValue(value = "security-operations", description = "Members of the security operations center (SOC)."), @AllowedValue(value = "network-operations", description = "Members of the network operations center (NOC)."), @AllowedValue(value = "incident-response", description = "Responsible for responding to an event that could lead to loss of, or disruption to, an organization's operations, services or functions."), @AllowedValue(value = "help-desk", description = "Responsible for providing information and support to users."), @AllowedValue(value = "configuration-management", description = "Responsible for the configuration management processes governing changes to the asset."), @AllowedValue(value = "maintainer", description = "Responsible for the creation and maintenance of a component."), @AllowedValue(value = "provider", description = "Organization responsible for providing the component, if this is different from the \"maintainer\" (e.g., a reseller).")})}, indexHasKey = {@IndexHasKey(id = "oscal-index-inventory-item-responsible-party-role-id", level = IConstraint.Level.ERROR, target = "responsible-party", indexName = "index-metadata-role-id", keyFields = @KeyField(target = "@role-id")), @IndexHasKey(id = "oscal-index-inventory-item-responsible-party-party-uuid", level = IConstraint.Level.ERROR, target = "responsible-party", indexName = "index-metadata-party-uuid", keyFields = @KeyField(target = "party-uuid"))}), 042 modelConstraints = @AssemblyConstraints(unique = @IsUnique(id = "oscal-unique-inventory-item-responsible-party", level = IConstraint.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.")) 043) 044public class InventoryItem implements IBoundObject { 045 private final IMetaschemaData __metaschemaData; 046 047 /** 048 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a>, <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#globally-unique">globally unique</a> identifier with <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#cross-instance">cross-instance</a> scope that can be used to reference this inventory item elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>inventory item</code> can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#consistency">per-subject</a>, which means it should be consistently used to identify the same subject across revisions of the document. 049 */ 050 @BoundFlag( 051 formalName = "Inventory Item Universally Unique Identifier", 052 description = "A [machine-oriented](https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented), [globally unique](https://pages.nist.gov/OSCAL/concepts/identifier-use/#globally-unique) identifier with [cross-instance](https://pages.nist.gov/OSCAL/concepts/identifier-use/#cross-instance) scope that can be used to reference this inventory item elsewhere in [this or other OSCAL instances](https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope). The locally defined *UUID* of the `inventory item` can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned [per-subject](https://pages.nist.gov/OSCAL/concepts/identifier-use/#consistency), which means it should be consistently used to identify the same subject across revisions of the document.", 053 name = "uuid", 054 required = true, 055 typeAdapter = UuidAdapter.class 056 ) 057 private UUID _uuid; 058 059 /** 060 * A summary of the inventory item stating its purpose within the system. 061 */ 062 @BoundField( 063 formalName = "Inventory Item Description", 064 description = "A summary of the inventory item stating its purpose within the system.", 065 useName = "description", 066 minOccurs = 1, 067 typeAdapter = MarkupMultilineAdapter.class 068 ) 069 private MarkupMultiline _description; 070 071 /** 072 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 073 */ 074 @BoundAssembly( 075 formalName = "Property", 076 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 077 useName = "prop", 078 maxOccurs = -1, 079 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 080 ) 081 private List<Property> _props; 082 083 /** 084 * A reference to a local or remote resource, that has a specific relation to the containing object. 085 */ 086 @BoundAssembly( 087 formalName = "Link", 088 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 089 useName = "link", 090 maxOccurs = -1, 091 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 092 ) 093 private List<Link> _links; 094 095 /** 096 * A reference to a set of persons and/or organizations that have responsibility for performing the referenced role in the context of the containing object. 097 */ 098 @BoundAssembly( 099 formalName = "Responsible Party", 100 description = "A reference to a set of persons and/or organizations that have responsibility for performing the referenced role in the context of the containing object.", 101 useName = "responsible-party", 102 maxOccurs = -1, 103 groupAs = @GroupAs(name = "responsible-parties", inJson = JsonGroupAsBehavior.LIST) 104 ) 105 private List<ResponsibleParty> _responsibleParties; 106 107 /** 108 * The set of components that are implemented in a given system inventory item. 109 */ 110 @BoundAssembly( 111 formalName = "Implemented Component", 112 description = "The set of components that are implemented in a given system inventory item.", 113 useName = "implemented-component", 114 maxOccurs = -1, 115 groupAs = @GroupAs(name = "implemented-components", inJson = JsonGroupAsBehavior.LIST) 116 ) 117 private List<ImplementedComponent> _implementedComponents; 118 119 /** 120 * Additional commentary about the containing object. 121 */ 122 @BoundField( 123 formalName = "Remarks", 124 description = "Additional commentary about the containing object.", 125 useName = "remarks", 126 typeAdapter = MarkupMultilineAdapter.class 127 ) 128 private MarkupMultiline _remarks; 129 130 /** 131 * Constructs a new {@code dev.metaschema.oscal.lib.model.InventoryItem} instance with no metadata. 132 */ 133 public InventoryItem() { 134 this(null); 135 } 136 137 /** 138 * Constructs a new {@code dev.metaschema.oscal.lib.model.InventoryItem} instance with the specified metadata. 139 * 140 * @param data 141 * the metaschema data, or {@code null} if none 142 */ 143 public InventoryItem(IMetaschemaData data) { 144 this.__metaschemaData = data; 145 } 146 147 @Override 148 public IMetaschemaData getMetaschemaData() { 149 return __metaschemaData; 150 } 151 152 /** 153 * Get the "{@literal Inventory Item Universally Unique Identifier}". 154 * 155 * <p> 156 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a>, <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#globally-unique">globally unique</a> identifier with <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#cross-instance">cross-instance</a> scope that can be used to reference this inventory item elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>inventory item</code> can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#consistency">per-subject</a>, which means it should be consistently used to identify the same subject across revisions of the document. 157 * 158 * @return the uuid value 159 */ 160 @NonNull 161 public UUID getUuid() { 162 return _uuid; 163 } 164 165 /** 166 * Set the "{@literal Inventory Item Universally Unique Identifier}". 167 * 168 * <p> 169 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a>, <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#globally-unique">globally unique</a> identifier with <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#cross-instance">cross-instance</a> scope that can be used to reference this inventory item elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>inventory item</code> can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#consistency">per-subject</a>, which means it should be consistently used to identify the same subject across revisions of the document. 170 * 171 * @param value 172 * the uuid value to set 173 */ 174 public void setUuid(@NonNull UUID value) { 175 _uuid = value; 176 } 177 178 /** 179 * Get the "{@literal Inventory Item Description}". 180 * 181 * <p> 182 * A summary of the inventory item stating its purpose within the system. 183 * 184 * @return the description value 185 */ 186 @NonNull 187 public MarkupMultiline getDescription() { 188 return _description; 189 } 190 191 /** 192 * Set the "{@literal Inventory Item Description}". 193 * 194 * <p> 195 * A summary of the inventory item stating its purpose within the system. 196 * 197 * @param value 198 * the description value to set 199 */ 200 public void setDescription(@NonNull MarkupMultiline value) { 201 _description = value; 202 } 203 204 /** 205 * Get the "{@literal Property}". 206 * 207 * <p> 208 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 209 * 210 * @return the prop value 211 */ 212 @NonNull 213 public List<Property> getProps() { 214 if (_props == null) { 215 _props = new LinkedList<>(); 216 } 217 return ObjectUtils.notNull(_props); 218 } 219 220 /** 221 * Set the "{@literal Property}". 222 * 223 * <p> 224 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 225 * 226 * @param value 227 * the prop value to set 228 */ 229 public void setProps(@NonNull List<Property> value) { 230 _props = value; 231 } 232 233 /** 234 * Add a new {@link Property} item to the underlying collection. 235 * @param item the item to add 236 * @return {@code true} 237 */ 238 public boolean addProp(Property item) { 239 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 240 if (_props == null) { 241 _props = new LinkedList<>(); 242 } 243 return _props.add(value); 244 } 245 246 /** 247 * Remove the first matching {@link Property} item from the underlying collection. 248 * @param item the item to remove 249 * @return {@code true} if the item was removed or {@code false} otherwise 250 */ 251 public boolean removeProp(Property item) { 252 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 253 return _props != null && _props.remove(value); 254 } 255 256 /** 257 * Get the "{@literal Link}". 258 * 259 * <p> 260 * A reference to a local or remote resource, that has a specific relation to the containing object. 261 * 262 * @return the link value 263 */ 264 @NonNull 265 public List<Link> getLinks() { 266 if (_links == null) { 267 _links = new LinkedList<>(); 268 } 269 return ObjectUtils.notNull(_links); 270 } 271 272 /** 273 * Set the "{@literal Link}". 274 * 275 * <p> 276 * A reference to a local or remote resource, that has a specific relation to the containing object. 277 * 278 * @param value 279 * the link value to set 280 */ 281 public void setLinks(@NonNull List<Link> value) { 282 _links = value; 283 } 284 285 /** 286 * Add a new {@link Link} item to the underlying collection. 287 * @param item the item to add 288 * @return {@code true} 289 */ 290 public boolean addLink(Link item) { 291 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 292 if (_links == null) { 293 _links = new LinkedList<>(); 294 } 295 return _links.add(value); 296 } 297 298 /** 299 * Remove the first matching {@link Link} item from the underlying collection. 300 * @param item the item to remove 301 * @return {@code true} if the item was removed or {@code false} otherwise 302 */ 303 public boolean removeLink(Link item) { 304 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 305 return _links != null && _links.remove(value); 306 } 307 308 /** 309 * Get the "{@literal Responsible Party}". 310 * 311 * <p> 312 * A reference to a set of persons and/or organizations that have responsibility for performing the referenced role in the context of the containing object. 313 * 314 * @return the responsible-party value 315 */ 316 @NonNull 317 public List<ResponsibleParty> getResponsibleParties() { 318 if (_responsibleParties == null) { 319 _responsibleParties = new LinkedList<>(); 320 } 321 return ObjectUtils.notNull(_responsibleParties); 322 } 323 324 /** 325 * Set the "{@literal Responsible Party}". 326 * 327 * <p> 328 * A reference to a set of persons and/or organizations that have responsibility for performing the referenced role in the context of the containing object. 329 * 330 * @param value 331 * the responsible-party value to set 332 */ 333 public void setResponsibleParties(@NonNull List<ResponsibleParty> value) { 334 _responsibleParties = value; 335 } 336 337 /** 338 * Add a new {@link ResponsibleParty} item to the underlying collection. 339 * @param item the item to add 340 * @return {@code true} 341 */ 342 public boolean addResponsibleParty(ResponsibleParty item) { 343 ResponsibleParty value = ObjectUtils.requireNonNull(item,"item cannot be null"); 344 if (_responsibleParties == null) { 345 _responsibleParties = new LinkedList<>(); 346 } 347 return _responsibleParties.add(value); 348 } 349 350 /** 351 * Remove the first matching {@link ResponsibleParty} item from the underlying collection. 352 * @param item the item to remove 353 * @return {@code true} if the item was removed or {@code false} otherwise 354 */ 355 public boolean removeResponsibleParty(ResponsibleParty item) { 356 ResponsibleParty value = ObjectUtils.requireNonNull(item,"item cannot be null"); 357 return _responsibleParties != null && _responsibleParties.remove(value); 358 } 359 360 /** 361 * Get the "{@literal Implemented Component}". 362 * 363 * <p> 364 * The set of components that are implemented in a given system inventory item. 365 * 366 * @return the implemented-component value 367 */ 368 @NonNull 369 public List<ImplementedComponent> getImplementedComponents() { 370 if (_implementedComponents == null) { 371 _implementedComponents = new LinkedList<>(); 372 } 373 return ObjectUtils.notNull(_implementedComponents); 374 } 375 376 /** 377 * Set the "{@literal Implemented Component}". 378 * 379 * <p> 380 * The set of components that are implemented in a given system inventory item. 381 * 382 * @param value 383 * the implemented-component value to set 384 */ 385 public void setImplementedComponents(@NonNull List<ImplementedComponent> value) { 386 _implementedComponents = value; 387 } 388 389 /** 390 * Add a new {@link ImplementedComponent} item to the underlying collection. 391 * @param item the item to add 392 * @return {@code true} 393 */ 394 public boolean addImplementedComponent(ImplementedComponent item) { 395 ImplementedComponent value = ObjectUtils.requireNonNull(item,"item cannot be null"); 396 if (_implementedComponents == null) { 397 _implementedComponents = new LinkedList<>(); 398 } 399 return _implementedComponents.add(value); 400 } 401 402 /** 403 * Remove the first matching {@link ImplementedComponent} item from the underlying collection. 404 * @param item the item to remove 405 * @return {@code true} if the item was removed or {@code false} otherwise 406 */ 407 public boolean removeImplementedComponent(ImplementedComponent item) { 408 ImplementedComponent value = ObjectUtils.requireNonNull(item,"item cannot be null"); 409 return _implementedComponents != null && _implementedComponents.remove(value); 410 } 411 412 /** 413 * Get the "{@literal Remarks}". 414 * 415 * <p> 416 * Additional commentary about the containing object. 417 * 418 * @return the remarks value, or {@code null} if not set 419 */ 420 @Nullable 421 public MarkupMultiline getRemarks() { 422 return _remarks; 423 } 424 425 /** 426 * Set the "{@literal Remarks}". 427 * 428 * <p> 429 * Additional commentary about the containing object. 430 * 431 * @param value 432 * the remarks value to set, or {@code null} to clear 433 */ 434 public void setRemarks(@Nullable MarkupMultiline value) { 435 _remarks = value; 436 } 437 438 @Override 439 public String toString() { 440 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 441 } 442 443 /** 444 * The set of components that are implemented in a given system inventory item. 445 */ 446 @MetaschemaAssembly( 447 formalName = "Implemented Component", 448 description = "The set of components that are implemented in a given system inventory item.", 449 name = "implemented-component", 450 moduleClass = OscalImplementationCommonModule.class, 451 valueConstraints = @ValueConstraints(allowedValues = {@AllowedValues(id = "oscal-implemented-component-prop-name-values", level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name", values = {@AllowedValue(value = "version", description = "The version of the component."), @AllowedValue(value = "patch-level", description = "The specific patch level of the component."), @AllowedValue(value = "model", description = "The model of system used by the asset."), @AllowedValue(value = "release-date", description = "The date the component was released, such as a software release date or policy publication date."), @AllowedValue(value = "validation-type", description = "Used with component-type='validation' to provide a well-known name for a kind of validation."), @AllowedValue(value = "validation-reference", description = "Used with component-type='validation' to indicate the validating body's assigned identifier for their validation of this component."), @AllowedValue(value = "asset-type", description = "Simple indication of the asset's function, such as Router, Storage Array, DNS Server."), @AllowedValue(value = "asset-id", description = "An organizationally specific identifier that is used to uniquely identify a logical or tangible item by the organization that owns the item."), @AllowedValue(value = "asset-tag", description = "An asset tag assigned by the organization responsible for maintaining the logical or tangible item."), @AllowedValue(value = "public", description = "Identifies whether the asset is publicly accessible (yes/no)"), @AllowedValue(value = "virtual", description = "Identifies whether the asset is virtualized (yes/no)"), @AllowedValue(value = "vlan-id", description = "Virtual LAN identifier of the asset."), @AllowedValue(value = "network-id", description = "The network identifier of the asset."), @AllowedValue(value = "label", description = "A human-readable label for the parent context."), @AllowedValue(value = "sort-id", description = "An alternative identifier, whose value is easily sortable among other such values in the document."), @AllowedValue(value = "baseline-configuration-name", description = "The name of the baseline configuration for the asset."), @AllowedValue(value = "allows-authenticated-scan", description = "Can the asset be check with an authenticated scan? (yes/no)"), @AllowedValue(value = "function", description = "The function provided by the asset for the system."), @AllowedValue(value = "hardware-model", description = "\\*\\*(deprecated)\\*\\* Use 'model' instead.", deprecatedVersion = "1.2.0"), @AllowedValue(value = "os-name", description = "The name of the operating system used by the asset."), @AllowedValue(value = "os-version", description = "The version of the operating system used by the asset."), @AllowedValue(value = "software-name", description = "The software product name used by the asset."), @AllowedValue(value = "software-version", description = "The software product version used by the asset."), @AllowedValue(value = "software-patch-level", description = "The software product patch level used by the asset.")}), @AllowedValues(id = "oscal-implemented-component-responsible-party-role-id-values", level = IConstraint.Level.ERROR, target = "responsible-party/@role-id", allowOthers = true, values = {@AllowedValue(value = "asset-owner", description = "Accountable for ensuring the asset is managed in accordance with organizational policies and procedures."), @AllowedValue(value = "asset-administrator", description = "Responsible for administering a set of assets."), @AllowedValue(value = "security-operations", description = "Members of the security operations center (SOC)."), @AllowedValue(value = "network-operations", description = "Members of the network operations center (NOC)."), @AllowedValue(value = "incident-response", description = "Responsible for responding to an event that could lead to loss of, or disruption to, an organization's operations, services or functions."), @AllowedValue(value = "help-desk", description = "Responsible for providing information and support to users."), @AllowedValue(value = "configuration-management", description = "Responsible for the configuration management processes governing changes to the asset.")})}), 452 modelConstraints = @AssemblyConstraints(unique = @IsUnique(id = "oscal-unique-implemented-component-responsible-party", level = IConstraint.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.")) 453 ) 454 public static class ImplementedComponent implements IBoundObject { 455 private final IMetaschemaData __metaschemaData; 456 457 /** 458 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a> identifier reference to a <code>component</code> that is implemented as part of an inventory item. 459 */ 460 @BoundFlag( 461 formalName = "Component Universally Unique Identifier Reference", 462 description = "A [machine-oriented](https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented) identifier reference to a `component` that is implemented as part of an inventory item.", 463 name = "component-uuid", 464 required = true, 465 typeAdapter = UuidAdapter.class 466 ) 467 private UUID _componentUuid; 468 469 /** 470 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 471 */ 472 @BoundAssembly( 473 formalName = "Property", 474 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 475 useName = "prop", 476 maxOccurs = -1, 477 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 478 ) 479 private List<Property> _props; 480 481 /** 482 * A reference to a local or remote resource, that has a specific relation to the containing object. 483 */ 484 @BoundAssembly( 485 formalName = "Link", 486 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 487 useName = "link", 488 maxOccurs = -1, 489 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 490 ) 491 private List<Link> _links; 492 493 /** 494 * A reference to a set of persons and/or organizations that have responsibility for performing the referenced role in the context of the containing object. 495 */ 496 @BoundAssembly( 497 formalName = "Responsible Party", 498 description = "A reference to a set of persons and/or organizations that have responsibility for performing the referenced role in the context of the containing object.", 499 useName = "responsible-party", 500 remarks = "This construct is used to either: 1) associate a party or parties to a role defined on the component using the `responsible-role` construct, or 2) to define a party or parties that are responsible for a role defined within the context of the containing `inventory-item`.", 501 maxOccurs = -1, 502 groupAs = @GroupAs(name = "responsible-parties", inJson = JsonGroupAsBehavior.LIST) 503 ) 504 private List<ResponsibleParty> _responsibleParties; 505 506 /** 507 * Additional commentary about the containing object. 508 */ 509 @BoundField( 510 formalName = "Remarks", 511 description = "Additional commentary about the containing object.", 512 useName = "remarks", 513 typeAdapter = MarkupMultilineAdapter.class 514 ) 515 private MarkupMultiline _remarks; 516 517 /** 518 * Constructs a new {@code dev.metaschema.oscal.lib.model.InventoryItem.ImplementedComponent} instance with no metadata. 519 */ 520 public ImplementedComponent() { 521 this(null); 522 } 523 524 /** 525 * Constructs a new {@code dev.metaschema.oscal.lib.model.InventoryItem.ImplementedComponent} instance with the specified metadata. 526 * 527 * @param data 528 * the metaschema data, or {@code null} if none 529 */ 530 public ImplementedComponent(IMetaschemaData data) { 531 this.__metaschemaData = data; 532 } 533 534 @Override 535 public IMetaschemaData getMetaschemaData() { 536 return __metaschemaData; 537 } 538 539 /** 540 * Get the "{@literal Component Universally Unique Identifier Reference}". 541 * 542 * <p> 543 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a> identifier reference to a <code>component</code> that is implemented as part of an inventory item. 544 * 545 * @return the component-uuid value 546 */ 547 @NonNull 548 public UUID getComponentUuid() { 549 return _componentUuid; 550 } 551 552 /** 553 * Set the "{@literal Component Universally Unique Identifier Reference}". 554 * 555 * <p> 556 * A <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#machine-oriented">machine-oriented</a> identifier reference to a <code>component</code> that is implemented as part of an inventory item. 557 * 558 * @param value 559 * the component-uuid value to set 560 */ 561 public void setComponentUuid(@NonNull UUID value) { 562 _componentUuid = value; 563 } 564 565 /** 566 * Get the "{@literal Property}". 567 * 568 * <p> 569 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 570 * 571 * @return the prop value 572 */ 573 @NonNull 574 public List<Property> getProps() { 575 if (_props == null) { 576 _props = new LinkedList<>(); 577 } 578 return ObjectUtils.notNull(_props); 579 } 580 581 /** 582 * Set the "{@literal Property}". 583 * 584 * <p> 585 * An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair. 586 * 587 * @param value 588 * the prop value to set 589 */ 590 public void setProps(@NonNull List<Property> value) { 591 _props = value; 592 } 593 594 /** 595 * Add a new {@link Property} item to the underlying collection. 596 * @param item the item to add 597 * @return {@code true} 598 */ 599 public boolean addProp(Property item) { 600 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 601 if (_props == null) { 602 _props = new LinkedList<>(); 603 } 604 return _props.add(value); 605 } 606 607 /** 608 * Remove the first matching {@link Property} item from the underlying collection. 609 * @param item the item to remove 610 * @return {@code true} if the item was removed or {@code false} otherwise 611 */ 612 public boolean removeProp(Property item) { 613 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 614 return _props != null && _props.remove(value); 615 } 616 617 /** 618 * Get the "{@literal Link}". 619 * 620 * <p> 621 * A reference to a local or remote resource, that has a specific relation to the containing object. 622 * 623 * @return the link value 624 */ 625 @NonNull 626 public List<Link> getLinks() { 627 if (_links == null) { 628 _links = new LinkedList<>(); 629 } 630 return ObjectUtils.notNull(_links); 631 } 632 633 /** 634 * Set the "{@literal Link}". 635 * 636 * <p> 637 * A reference to a local or remote resource, that has a specific relation to the containing object. 638 * 639 * @param value 640 * the link value to set 641 */ 642 public void setLinks(@NonNull List<Link> value) { 643 _links = value; 644 } 645 646 /** 647 * Add a new {@link Link} item to the underlying collection. 648 * @param item the item to add 649 * @return {@code true} 650 */ 651 public boolean addLink(Link item) { 652 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 653 if (_links == null) { 654 _links = new LinkedList<>(); 655 } 656 return _links.add(value); 657 } 658 659 /** 660 * Remove the first matching {@link Link} item from the underlying collection. 661 * @param item the item to remove 662 * @return {@code true} if the item was removed or {@code false} otherwise 663 */ 664 public boolean removeLink(Link item) { 665 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 666 return _links != null && _links.remove(value); 667 } 668 669 /** 670 * Get the "{@literal Responsible Party}". 671 * 672 * <p> 673 * A reference to a set of persons and/or organizations that have responsibility for performing the referenced role in the context of the containing object. 674 * 675 * @return the responsible-party value 676 */ 677 @NonNull 678 public List<ResponsibleParty> getResponsibleParties() { 679 if (_responsibleParties == null) { 680 _responsibleParties = new LinkedList<>(); 681 } 682 return ObjectUtils.notNull(_responsibleParties); 683 } 684 685 /** 686 * Set the "{@literal Responsible Party}". 687 * 688 * <p> 689 * A reference to a set of persons and/or organizations that have responsibility for performing the referenced role in the context of the containing object. 690 * 691 * @param value 692 * the responsible-party value to set 693 */ 694 public void setResponsibleParties(@NonNull List<ResponsibleParty> value) { 695 _responsibleParties = value; 696 } 697 698 /** 699 * Add a new {@link ResponsibleParty} item to the underlying collection. 700 * @param item the item to add 701 * @return {@code true} 702 */ 703 public boolean addResponsibleParty(ResponsibleParty item) { 704 ResponsibleParty value = ObjectUtils.requireNonNull(item,"item cannot be null"); 705 if (_responsibleParties == null) { 706 _responsibleParties = new LinkedList<>(); 707 } 708 return _responsibleParties.add(value); 709 } 710 711 /** 712 * Remove the first matching {@link ResponsibleParty} item from the underlying collection. 713 * @param item the item to remove 714 * @return {@code true} if the item was removed or {@code false} otherwise 715 */ 716 public boolean removeResponsibleParty(ResponsibleParty item) { 717 ResponsibleParty value = ObjectUtils.requireNonNull(item,"item cannot be null"); 718 return _responsibleParties != null && _responsibleParties.remove(value); 719 } 720 721 /** 722 * Get the "{@literal Remarks}". 723 * 724 * <p> 725 * Additional commentary about the containing object. 726 * 727 * @return the remarks value, or {@code null} if not set 728 */ 729 @Nullable 730 public MarkupMultiline getRemarks() { 731 return _remarks; 732 } 733 734 /** 735 * Set the "{@literal Remarks}". 736 * 737 * <p> 738 * Additional commentary about the containing object. 739 * 740 * @param value 741 * the remarks value to set, or {@code null} to clear 742 */ 743 public void setRemarks(@Nullable MarkupMultiline value) { 744 _remarks = value; 745 } 746 747 @Override 748 public String toString() { 749 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 750 } 751 } 752}