001package gov.nist.secauto.oscal.lib.model; 002 003import gov.nist.secauto.metaschema.core.datatype.adapter.DateTimeWithTZAdapter; 004import gov.nist.secauto.metaschema.core.datatype.adapter.UuidAdapter; 005import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; 006import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; 007import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; 008import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultilineAdapter; 009import gov.nist.secauto.metaschema.core.model.IBoundObject; 010import gov.nist.secauto.metaschema.core.model.IMetaschemaData; 011import gov.nist.secauto.metaschema.core.model.JsonGroupAsBehavior; 012import gov.nist.secauto.metaschema.core.model.constraint.IConstraint; 013import gov.nist.secauto.metaschema.core.util.ObjectUtils; 014import gov.nist.secauto.metaschema.databind.model.annotations.AssemblyConstraints; 015import gov.nist.secauto.metaschema.databind.model.annotations.BoundAssembly; 016import gov.nist.secauto.metaschema.databind.model.annotations.BoundField; 017import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag; 018import gov.nist.secauto.metaschema.databind.model.annotations.GroupAs; 019import gov.nist.secauto.metaschema.databind.model.annotations.IsUnique; 020import gov.nist.secauto.metaschema.databind.model.annotations.KeyField; 021import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaAssembly; 022import java.lang.Override; 023import java.lang.String; 024import java.time.ZonedDateTime; 025import java.util.LinkedList; 026import java.util.List; 027import java.util.UUID; 028import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 029import org.apache.commons.lang3.builder.ToStringStyle; 030 031/** 032 * Used by the assessment results and POA&M. In the assessment results, this identifies all of the assessment observations and findings, initial and residual risks, deviations, and disposition. In the POA&M, this identifies initial and residual risks, deviations, and disposition. 033 */ 034@MetaschemaAssembly( 035 formalName = "Assessment Result", 036 description = "Used by the assessment results and POA\\&M. In the assessment results, this identifies all of the assessment observations and findings, initial and residual risks, deviations, and disposition. In the POA\\&M, this identifies initial and residual risks, deviations, and disposition.", 037 name = "result", 038 moduleClass = OscalArModule.class 039) 040public class Result implements IBoundObject { 041 private final IMetaschemaData __metaschemaData; 042 043 /** 044 * "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 set of results in <a href=\"https://pages.nist.gov/OSCAL/concepts/identifier-use/#ar-identifiers\">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>assessment result</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." 045 */ 046 @BoundFlag( 047 formalName = "Results Universally Unique Identifier", 048 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 set of results in [this or other OSCAL instances](https://pages.nist.gov/OSCAL/concepts/identifier-use/#ar-identifiers). The locally defined *UUID* of the `assessment result` 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.", 049 name = "uuid", 050 required = true, 051 typeAdapter = UuidAdapter.class 052 ) 053 private UUID _uuid; 054 055 @BoundField( 056 formalName = "Results Title", 057 description = "The title for this set of results.", 058 useName = "title", 059 minOccurs = 1, 060 typeAdapter = MarkupLineAdapter.class 061 ) 062 private MarkupLine _title; 063 064 @BoundField( 065 formalName = "Results Description", 066 description = "A human-readable description of this set of test results.", 067 useName = "description", 068 minOccurs = 1, 069 typeAdapter = MarkupMultilineAdapter.class 070 ) 071 private MarkupMultiline _description; 072 073 @BoundField( 074 formalName = "start field", 075 description = "Date/time stamp identifying the start of the evidence collection reflected in these results.", 076 useName = "start", 077 minOccurs = 1, 078 typeAdapter = DateTimeWithTZAdapter.class 079 ) 080 private ZonedDateTime _start; 081 082 @BoundField( 083 formalName = "end field", 084 description = "Date/time stamp identifying the end of the evidence collection reflected in these results. In a continuous motoring scenario, this may contain the same value as start if appropriate.", 085 useName = "end", 086 typeAdapter = DateTimeWithTZAdapter.class 087 ) 088 private ZonedDateTime _end; 089 090 @BoundAssembly( 091 formalName = "Property", 092 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 093 useName = "prop", 094 maxOccurs = -1, 095 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 096 ) 097 private List<Property> _props; 098 099 @BoundAssembly( 100 formalName = "Link", 101 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 102 useName = "link", 103 maxOccurs = -1, 104 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 105 ) 106 private List<Link> _links; 107 108 @BoundAssembly( 109 formalName = "Local Definitions", 110 description = "Used to define data objects that are used in the assessment plan, that do not appear in the referenced SSP.", 111 useName = "local-definitions" 112 ) 113 private LocalDefinitions _localDefinitions; 114 115 @BoundAssembly( 116 formalName = "Reviewed Controls and Control Objectives", 117 description = "Identifies the controls being assessed and their control objectives.", 118 useName = "reviewed-controls", 119 remarks = "The Assessment Results `control-selection` ignores any control selection in the Assessment Plan and re-selects controls from the baseline identified by the SSP.\n" 120 + "\n" 121 + "The Assessment Results `control-objective-selection` ignores any control objective selection in the Assessment Plan and re-selects control objectives from the baseline identified by the SSP.\n" 122 + "\n" 123 + "Any additional control objectives defined in the Assessment Plan `local-definitions` do not need to be re-defined in the Assessment Results `local-definitions`; however, if they were explicitly referenced with an Assessment Plan `control-objective-selection`, they need to be selected again in the Assessment Results `control-objective-selection`.", 124 minOccurs = 1 125 ) 126 private ReviewedControls _reviewedControls; 127 128 @BoundAssembly( 129 formalName = "Attestation Statements", 130 description = "A set of textual statements, typically written by the assessor.", 131 useName = "attestation", 132 maxOccurs = -1, 133 groupAs = @GroupAs(name = "attestations", inJson = JsonGroupAsBehavior.LIST) 134 ) 135 private List<Attestation> _attestations; 136 137 @BoundAssembly( 138 formalName = "Assessment Log", 139 description = "A log of all assessment-related actions taken.", 140 useName = "assessment-log" 141 ) 142 private AssessmentLog _assessmentLog; 143 144 @BoundAssembly( 145 formalName = "Observation", 146 description = "Describes an individual observation.", 147 useName = "observation", 148 maxOccurs = -1, 149 groupAs = @GroupAs(name = "observations", inJson = JsonGroupAsBehavior.LIST) 150 ) 151 private List<Observation> _observations; 152 153 @BoundAssembly( 154 formalName = "Identified Risk", 155 description = "An identified risk.", 156 useName = "risk", 157 maxOccurs = -1, 158 groupAs = @GroupAs(name = "risks", inJson = JsonGroupAsBehavior.LIST) 159 ) 160 private List<Risk> _risks; 161 162 @BoundAssembly( 163 formalName = "Finding", 164 description = "Describes an individual finding.", 165 useName = "finding", 166 maxOccurs = -1, 167 groupAs = @GroupAs(name = "findings", inJson = JsonGroupAsBehavior.LIST) 168 ) 169 private List<Finding> _findings; 170 171 @BoundField( 172 formalName = "Remarks", 173 description = "Additional commentary about the containing object.", 174 useName = "remarks", 175 typeAdapter = MarkupMultilineAdapter.class 176 ) 177 private MarkupMultiline _remarks; 178 179 public Result() { 180 this(null); 181 } 182 183 public Result(IMetaschemaData data) { 184 this.__metaschemaData = data; 185 } 186 187 @Override 188 public IMetaschemaData getMetaschemaData() { 189 return __metaschemaData; 190 } 191 192 public UUID getUuid() { 193 return _uuid; 194 } 195 196 public void setUuid(UUID value) { 197 _uuid = value; 198 } 199 200 public MarkupLine getTitle() { 201 return _title; 202 } 203 204 public void setTitle(MarkupLine value) { 205 _title = value; 206 } 207 208 public MarkupMultiline getDescription() { 209 return _description; 210 } 211 212 public void setDescription(MarkupMultiline value) { 213 _description = value; 214 } 215 216 public ZonedDateTime getStart() { 217 return _start; 218 } 219 220 public void setStart(ZonedDateTime value) { 221 _start = value; 222 } 223 224 public ZonedDateTime getEnd() { 225 return _end; 226 } 227 228 public void setEnd(ZonedDateTime value) { 229 _end = value; 230 } 231 232 public List<Property> getProps() { 233 return _props; 234 } 235 236 public void setProps(List<Property> value) { 237 _props = value; 238 } 239 240 /** 241 * Add a new {@link Property} item to the underlying collection. 242 * @param item the item to add 243 * @return {@code true} 244 */ 245 public boolean addProp(Property item) { 246 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 247 if (_props == null) { 248 _props = new LinkedList<>(); 249 } 250 return _props.add(value); 251 } 252 253 /** 254 * Remove the first matching {@link Property} item from the underlying collection. 255 * @param item the item to remove 256 * @return {@code true} if the item was removed or {@code false} otherwise 257 */ 258 public boolean removeProp(Property item) { 259 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 260 return _props != null && _props.remove(value); 261 } 262 263 public List<Link> getLinks() { 264 return _links; 265 } 266 267 public void setLinks(List<Link> value) { 268 _links = value; 269 } 270 271 /** 272 * Add a new {@link Link} item to the underlying collection. 273 * @param item the item to add 274 * @return {@code true} 275 */ 276 public boolean addLink(Link item) { 277 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 278 if (_links == null) { 279 _links = new LinkedList<>(); 280 } 281 return _links.add(value); 282 } 283 284 /** 285 * Remove the first matching {@link Link} item from the underlying collection. 286 * @param item the item to remove 287 * @return {@code true} if the item was removed or {@code false} otherwise 288 */ 289 public boolean removeLink(Link item) { 290 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 291 return _links != null && _links.remove(value); 292 } 293 294 public LocalDefinitions getLocalDefinitions() { 295 return _localDefinitions; 296 } 297 298 public void setLocalDefinitions(LocalDefinitions value) { 299 _localDefinitions = value; 300 } 301 302 public ReviewedControls getReviewedControls() { 303 return _reviewedControls; 304 } 305 306 public void setReviewedControls(ReviewedControls value) { 307 _reviewedControls = value; 308 } 309 310 public List<Attestation> getAttestations() { 311 return _attestations; 312 } 313 314 public void setAttestations(List<Attestation> value) { 315 _attestations = value; 316 } 317 318 /** 319 * Add a new {@link Attestation} item to the underlying collection. 320 * @param item the item to add 321 * @return {@code true} 322 */ 323 public boolean addAttestation(Attestation item) { 324 Attestation value = ObjectUtils.requireNonNull(item,"item cannot be null"); 325 if (_attestations == null) { 326 _attestations = new LinkedList<>(); 327 } 328 return _attestations.add(value); 329 } 330 331 /** 332 * Remove the first matching {@link Attestation} item from the underlying collection. 333 * @param item the item to remove 334 * @return {@code true} if the item was removed or {@code false} otherwise 335 */ 336 public boolean removeAttestation(Attestation item) { 337 Attestation value = ObjectUtils.requireNonNull(item,"item cannot be null"); 338 return _attestations != null && _attestations.remove(value); 339 } 340 341 public AssessmentLog getAssessmentLog() { 342 return _assessmentLog; 343 } 344 345 public void setAssessmentLog(AssessmentLog value) { 346 _assessmentLog = value; 347 } 348 349 public List<Observation> getObservations() { 350 return _observations; 351 } 352 353 public void setObservations(List<Observation> value) { 354 _observations = value; 355 } 356 357 /** 358 * Add a new {@link Observation} item to the underlying collection. 359 * @param item the item to add 360 * @return {@code true} 361 */ 362 public boolean addObservation(Observation item) { 363 Observation value = ObjectUtils.requireNonNull(item,"item cannot be null"); 364 if (_observations == null) { 365 _observations = new LinkedList<>(); 366 } 367 return _observations.add(value); 368 } 369 370 /** 371 * Remove the first matching {@link Observation} item from the underlying collection. 372 * @param item the item to remove 373 * @return {@code true} if the item was removed or {@code false} otherwise 374 */ 375 public boolean removeObservation(Observation item) { 376 Observation value = ObjectUtils.requireNonNull(item,"item cannot be null"); 377 return _observations != null && _observations.remove(value); 378 } 379 380 public List<Risk> getRisks() { 381 return _risks; 382 } 383 384 public void setRisks(List<Risk> value) { 385 _risks = value; 386 } 387 388 /** 389 * Add a new {@link Risk} item to the underlying collection. 390 * @param item the item to add 391 * @return {@code true} 392 */ 393 public boolean addRisk(Risk item) { 394 Risk value = ObjectUtils.requireNonNull(item,"item cannot be null"); 395 if (_risks == null) { 396 _risks = new LinkedList<>(); 397 } 398 return _risks.add(value); 399 } 400 401 /** 402 * Remove the first matching {@link Risk} item from the underlying collection. 403 * @param item the item to remove 404 * @return {@code true} if the item was removed or {@code false} otherwise 405 */ 406 public boolean removeRisk(Risk item) { 407 Risk value = ObjectUtils.requireNonNull(item,"item cannot be null"); 408 return _risks != null && _risks.remove(value); 409 } 410 411 public List<Finding> getFindings() { 412 return _findings; 413 } 414 415 public void setFindings(List<Finding> value) { 416 _findings = value; 417 } 418 419 /** 420 * Add a new {@link Finding} item to the underlying collection. 421 * @param item the item to add 422 * @return {@code true} 423 */ 424 public boolean addFinding(Finding item) { 425 Finding value = ObjectUtils.requireNonNull(item,"item cannot be null"); 426 if (_findings == null) { 427 _findings = new LinkedList<>(); 428 } 429 return _findings.add(value); 430 } 431 432 /** 433 * Remove the first matching {@link Finding} item from the underlying collection. 434 * @param item the item to remove 435 * @return {@code true} if the item was removed or {@code false} otherwise 436 */ 437 public boolean removeFinding(Finding item) { 438 Finding value = ObjectUtils.requireNonNull(item,"item cannot be null"); 439 return _findings != null && _findings.remove(value); 440 } 441 442 public MarkupMultiline getRemarks() { 443 return _remarks; 444 } 445 446 public void setRemarks(MarkupMultiline value) { 447 _remarks = value; 448 } 449 450 @Override 451 public String toString() { 452 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 453 } 454 455 /** 456 * Used to define data objects that are used in the assessment plan, that do not appear in the referenced SSP. 457 */ 458 @MetaschemaAssembly( 459 formalName = "Local Definitions", 460 description = "Used to define data objects that are used in the assessment plan, that do not appear in the referenced SSP.", 461 name = "local-definitions", 462 moduleClass = OscalArModule.class, 463 modelConstraints = @AssemblyConstraints(unique = {@IsUnique(id = "unique-ar-local-definitions-component", level = IConstraint.Level.ERROR, target = "component", keyFields = @KeyField(target = "@uuid"), remarks = "Since multiple `component` entries can be provided, each component must have a unique `uuid`."), @IsUnique(id = "unique-ar-local-definitions-user", level = IConstraint.Level.ERROR, target = "user", keyFields = @KeyField(target = "@uuid"), remarks = "A given `uuid` must be assigned only once to a user.")}) 464 ) 465 public static class LocalDefinitions implements IBoundObject { 466 private final IMetaschemaData __metaschemaData; 467 468 @BoundAssembly( 469 formalName = "Component", 470 description = "A defined component that can be part of an implemented system.", 471 useName = "component", 472 remarks = "Used to add any components, not defined via the System Security Plan (AR-\\>AP-\\>SSP)", 473 maxOccurs = -1, 474 groupAs = @GroupAs(name = "components", inJson = JsonGroupAsBehavior.LIST) 475 ) 476 private List<SystemComponent> _components; 477 478 @BoundAssembly( 479 formalName = "Inventory Item", 480 description = "A single managed inventory item within the system.", 481 useName = "inventory-item", 482 remarks = "Used to add any inventory-items, not defined via the System Security Plan (AR-\\>AP-\\>SSP)", 483 maxOccurs = -1, 484 groupAs = @GroupAs(name = "inventory-items", inJson = JsonGroupAsBehavior.LIST) 485 ) 486 private List<InventoryItem> _inventoryItems; 487 488 @BoundAssembly( 489 formalName = "System User", 490 description = "A type of user that interacts with the system based on an associated role.", 491 useName = "user", 492 remarks = "Used to add any users, not defined via the System Security Plan (AR-\\>AP-\\>SSP)", 493 maxOccurs = -1, 494 groupAs = @GroupAs(name = "users", inJson = JsonGroupAsBehavior.LIST) 495 ) 496 private List<SystemUser> _users; 497 498 @BoundAssembly( 499 formalName = "Assessment Assets", 500 description = "Identifies the assets used to perform this assessment, such as the assessment team, scanning tools, and assumptions.", 501 useName = "assessment-assets", 502 remarks = "This needs to be defined in the results if an assessment platform used is different from the one described in the assessment plan. Else the platform(s) defined in the plan may be referenced within the results." 503 ) 504 private AssessmentAssets _assessmentAssets; 505 506 @BoundAssembly( 507 formalName = "Task", 508 description = "Represents a scheduled event or milestone, which may be associated with a series of assessment actions.", 509 useName = "assessment-task", 510 maxOccurs = -1, 511 groupAs = @GroupAs(name = "tasks", inJson = JsonGroupAsBehavior.LIST) 512 ) 513 private List<Task> _tasks; 514 515 public LocalDefinitions() { 516 this(null); 517 } 518 519 public LocalDefinitions(IMetaschemaData data) { 520 this.__metaschemaData = data; 521 } 522 523 @Override 524 public IMetaschemaData getMetaschemaData() { 525 return __metaschemaData; 526 } 527 528 public List<SystemComponent> getComponents() { 529 return _components; 530 } 531 532 public void setComponents(List<SystemComponent> value) { 533 _components = value; 534 } 535 536 /** 537 * Add a new {@link SystemComponent} item to the underlying collection. 538 * @param item the item to add 539 * @return {@code true} 540 */ 541 public boolean addComponent(SystemComponent item) { 542 SystemComponent value = ObjectUtils.requireNonNull(item,"item cannot be null"); 543 if (_components == null) { 544 _components = new LinkedList<>(); 545 } 546 return _components.add(value); 547 } 548 549 /** 550 * Remove the first matching {@link SystemComponent} item from the underlying collection. 551 * @param item the item to remove 552 * @return {@code true} if the item was removed or {@code false} otherwise 553 */ 554 public boolean removeComponent(SystemComponent item) { 555 SystemComponent value = ObjectUtils.requireNonNull(item,"item cannot be null"); 556 return _components != null && _components.remove(value); 557 } 558 559 public List<InventoryItem> getInventoryItems() { 560 return _inventoryItems; 561 } 562 563 public void setInventoryItems(List<InventoryItem> value) { 564 _inventoryItems = value; 565 } 566 567 /** 568 * Add a new {@link InventoryItem} item to the underlying collection. 569 * @param item the item to add 570 * @return {@code true} 571 */ 572 public boolean addInventoryItem(InventoryItem item) { 573 InventoryItem value = ObjectUtils.requireNonNull(item,"item cannot be null"); 574 if (_inventoryItems == null) { 575 _inventoryItems = new LinkedList<>(); 576 } 577 return _inventoryItems.add(value); 578 } 579 580 /** 581 * Remove the first matching {@link InventoryItem} item from the underlying collection. 582 * @param item the item to remove 583 * @return {@code true} if the item was removed or {@code false} otherwise 584 */ 585 public boolean removeInventoryItem(InventoryItem item) { 586 InventoryItem value = ObjectUtils.requireNonNull(item,"item cannot be null"); 587 return _inventoryItems != null && _inventoryItems.remove(value); 588 } 589 590 public List<SystemUser> getUsers() { 591 return _users; 592 } 593 594 public void setUsers(List<SystemUser> value) { 595 _users = value; 596 } 597 598 /** 599 * Add a new {@link SystemUser} item to the underlying collection. 600 * @param item the item to add 601 * @return {@code true} 602 */ 603 public boolean addUser(SystemUser item) { 604 SystemUser value = ObjectUtils.requireNonNull(item,"item cannot be null"); 605 if (_users == null) { 606 _users = new LinkedList<>(); 607 } 608 return _users.add(value); 609 } 610 611 /** 612 * Remove the first matching {@link SystemUser} item from the underlying collection. 613 * @param item the item to remove 614 * @return {@code true} if the item was removed or {@code false} otherwise 615 */ 616 public boolean removeUser(SystemUser item) { 617 SystemUser value = ObjectUtils.requireNonNull(item,"item cannot be null"); 618 return _users != null && _users.remove(value); 619 } 620 621 public AssessmentAssets getAssessmentAssets() { 622 return _assessmentAssets; 623 } 624 625 public void setAssessmentAssets(AssessmentAssets value) { 626 _assessmentAssets = value; 627 } 628 629 public List<Task> getTasks() { 630 return _tasks; 631 } 632 633 public void setTasks(List<Task> value) { 634 _tasks = value; 635 } 636 637 /** 638 * Add a new {@link Task} item to the underlying collection. 639 * @param item the item to add 640 * @return {@code true} 641 */ 642 public boolean addAssessmentTask(Task item) { 643 Task value = ObjectUtils.requireNonNull(item,"item cannot be null"); 644 if (_tasks == null) { 645 _tasks = new LinkedList<>(); 646 } 647 return _tasks.add(value); 648 } 649 650 /** 651 * Remove the first matching {@link Task} item from the underlying collection. 652 * @param item the item to remove 653 * @return {@code true} if the item was removed or {@code false} otherwise 654 */ 655 public boolean removeAssessmentTask(Task item) { 656 Task value = ObjectUtils.requireNonNull(item,"item cannot be null"); 657 return _tasks != null && _tasks.remove(value); 658 } 659 660 @Override 661 public String toString() { 662 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 663 } 664 } 665 666 /** 667 * A set of textual statements, typically written by the assessor. 668 */ 669 @MetaschemaAssembly( 670 formalName = "Attestation Statements", 671 description = "A set of textual statements, typically written by the assessor.", 672 name = "attestation", 673 moduleClass = OscalArModule.class, 674 modelConstraints = @AssemblyConstraints(unique = @IsUnique(id = "unique-ar-attestation-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.")) 675 ) 676 public static class Attestation implements IBoundObject { 677 private final IMetaschemaData __metaschemaData; 678 679 @BoundAssembly( 680 formalName = "Responsible Party", 681 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.", 682 useName = "responsible-party", 683 maxOccurs = -1, 684 groupAs = @GroupAs(name = "responsible-parties", inJson = JsonGroupAsBehavior.LIST) 685 ) 686 private List<ResponsibleParty> _responsibleParties; 687 688 @BoundAssembly( 689 formalName = "Assessment Part", 690 description = "A partition of an assessment plan or results or a child of another part.", 691 useName = "part", 692 minOccurs = 1, 693 maxOccurs = -1, 694 groupAs = @GroupAs(name = "parts", inJson = JsonGroupAsBehavior.LIST) 695 ) 696 private List<AssessmentPart> _parts; 697 698 public Attestation() { 699 this(null); 700 } 701 702 public Attestation(IMetaschemaData data) { 703 this.__metaschemaData = data; 704 } 705 706 @Override 707 public IMetaschemaData getMetaschemaData() { 708 return __metaschemaData; 709 } 710 711 public List<ResponsibleParty> getResponsibleParties() { 712 return _responsibleParties; 713 } 714 715 public void setResponsibleParties(List<ResponsibleParty> value) { 716 _responsibleParties = value; 717 } 718 719 /** 720 * Add a new {@link ResponsibleParty} item to the underlying collection. 721 * @param item the item to add 722 * @return {@code true} 723 */ 724 public boolean addResponsibleParty(ResponsibleParty item) { 725 ResponsibleParty value = ObjectUtils.requireNonNull(item,"item cannot be null"); 726 if (_responsibleParties == null) { 727 _responsibleParties = new LinkedList<>(); 728 } 729 return _responsibleParties.add(value); 730 } 731 732 /** 733 * Remove the first matching {@link ResponsibleParty} item from the underlying collection. 734 * @param item the item to remove 735 * @return {@code true} if the item was removed or {@code false} otherwise 736 */ 737 public boolean removeResponsibleParty(ResponsibleParty item) { 738 ResponsibleParty value = ObjectUtils.requireNonNull(item,"item cannot be null"); 739 return _responsibleParties != null && _responsibleParties.remove(value); 740 } 741 742 public List<AssessmentPart> getParts() { 743 return _parts; 744 } 745 746 public void setParts(List<AssessmentPart> value) { 747 _parts = value; 748 } 749 750 /** 751 * Add a new {@link AssessmentPart} item to the underlying collection. 752 * @param item the item to add 753 * @return {@code true} 754 */ 755 public boolean addPart(AssessmentPart item) { 756 AssessmentPart value = ObjectUtils.requireNonNull(item,"item cannot be null"); 757 if (_parts == null) { 758 _parts = new LinkedList<>(); 759 } 760 return _parts.add(value); 761 } 762 763 /** 764 * Remove the first matching {@link AssessmentPart} item from the underlying collection. 765 * @param item the item to remove 766 * @return {@code true} if the item was removed or {@code false} otherwise 767 */ 768 public boolean removePart(AssessmentPart item) { 769 AssessmentPart value = ObjectUtils.requireNonNull(item,"item cannot be null"); 770 return _parts != null && _parts.remove(value); 771 } 772 773 @Override 774 public String toString() { 775 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 776 } 777 } 778 779 /** 780 * A log of all assessment-related actions taken. 781 */ 782 @MetaschemaAssembly( 783 formalName = "Assessment Log", 784 description = "A log of all assessment-related actions taken.", 785 name = "assessment-log", 786 moduleClass = OscalArModule.class 787 ) 788 public static class AssessmentLog implements IBoundObject { 789 private final IMetaschemaData __metaschemaData; 790 791 @BoundAssembly( 792 formalName = "Assessment Log Entry", 793 description = "Identifies the result of an action and/or task that occurred as part of executing an assessment plan or an assessment event that occurred in producing the assessment results.", 794 useName = "entry", 795 minOccurs = 1, 796 maxOccurs = -1, 797 groupAs = @GroupAs(name = "entries", inJson = JsonGroupAsBehavior.LIST) 798 ) 799 private List<Entry> _entries; 800 801 public AssessmentLog() { 802 this(null); 803 } 804 805 public AssessmentLog(IMetaschemaData data) { 806 this.__metaschemaData = data; 807 } 808 809 @Override 810 public IMetaschemaData getMetaschemaData() { 811 return __metaschemaData; 812 } 813 814 public List<Entry> getEntries() { 815 return _entries; 816 } 817 818 public void setEntries(List<Entry> value) { 819 _entries = value; 820 } 821 822 /** 823 * Add a new {@link Entry} item to the underlying collection. 824 * @param item the item to add 825 * @return {@code true} 826 */ 827 public boolean addEntry(Entry item) { 828 Entry value = ObjectUtils.requireNonNull(item,"item cannot be null"); 829 if (_entries == null) { 830 _entries = new LinkedList<>(); 831 } 832 return _entries.add(value); 833 } 834 835 /** 836 * Remove the first matching {@link Entry} item from the underlying collection. 837 * @param item the item to remove 838 * @return {@code true} if the item was removed or {@code false} otherwise 839 */ 840 public boolean removeEntry(Entry item) { 841 Entry value = ObjectUtils.requireNonNull(item,"item cannot be null"); 842 return _entries != null && _entries.remove(value); 843 } 844 845 @Override 846 public String toString() { 847 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 848 } 849 850 /** 851 * Identifies the result of an action and/or task that occurred as part of executing an assessment plan or an assessment event that occurred in producing the assessment results. 852 */ 853 @MetaschemaAssembly( 854 formalName = "Assessment Log Entry", 855 description = "Identifies the result of an action and/or task that occurred as part of executing an assessment plan or an assessment event that occurred in producing the assessment results.", 856 name = "entry", 857 moduleClass = OscalArModule.class 858 ) 859 public static class Entry implements IBoundObject { 860 private final IMetaschemaData __metaschemaData; 861 862 /** 863 * "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 an assessment event in <a href=\"https://pages.nist.gov/OSCAL/concepts/identifier-use/#ar-identifiers\">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>assessment log entry</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." 864 */ 865 @BoundFlag( 866 formalName = "Assessment Log Entry Universally Unique Identifier", 867 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 an assessment event in [this or other OSCAL instances](https://pages.nist.gov/OSCAL/concepts/identifier-use/#ar-identifiers). The locally defined *UUID* of the `assessment log entry` 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.", 868 name = "uuid", 869 required = true, 870 typeAdapter = UuidAdapter.class 871 ) 872 private UUID _uuid; 873 874 @BoundField( 875 formalName = "Action Title", 876 description = "The title for this event.", 877 useName = "title", 878 typeAdapter = MarkupLineAdapter.class 879 ) 880 private MarkupLine _title; 881 882 @BoundField( 883 formalName = "Action Description", 884 description = "A human-readable description of this event.", 885 useName = "description", 886 typeAdapter = MarkupMultilineAdapter.class 887 ) 888 private MarkupMultiline _description; 889 890 @BoundField( 891 formalName = "Start", 892 description = "Identifies the start date and time of an event.", 893 useName = "start", 894 minOccurs = 1, 895 typeAdapter = DateTimeWithTZAdapter.class 896 ) 897 private ZonedDateTime _start; 898 899 @BoundField( 900 formalName = "End", 901 description = "Identifies the end date and time of an event. If the event is a point in time, the start and end will be the same date and time.", 902 useName = "end", 903 typeAdapter = DateTimeWithTZAdapter.class 904 ) 905 private ZonedDateTime _end; 906 907 @BoundAssembly( 908 formalName = "Property", 909 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 910 useName = "prop", 911 maxOccurs = -1, 912 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 913 ) 914 private List<Property> _props; 915 916 @BoundAssembly( 917 formalName = "Link", 918 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 919 useName = "link", 920 maxOccurs = -1, 921 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 922 ) 923 private List<Link> _links; 924 925 @BoundAssembly( 926 formalName = "Logged By", 927 description = "Used to indicate who created a log entry in what role.", 928 useName = "logged-by", 929 maxOccurs = -1, 930 groupAs = @GroupAs(name = "logged-by", inJson = JsonGroupAsBehavior.LIST) 931 ) 932 private List<LoggedBy> _loggedBy; 933 934 @BoundAssembly( 935 formalName = "Task Reference", 936 description = "Identifies an individual task for which the containing object is a consequence of.", 937 useName = "related-task", 938 maxOccurs = -1, 939 groupAs = @GroupAs(name = "related-tasks", inJson = JsonGroupAsBehavior.LIST) 940 ) 941 private List<RelatedTask> _relatedTasks; 942 943 @BoundField( 944 formalName = "Remarks", 945 description = "Additional commentary about the containing object.", 946 useName = "remarks", 947 typeAdapter = MarkupMultilineAdapter.class 948 ) 949 private MarkupMultiline _remarks; 950 951 public Entry() { 952 this(null); 953 } 954 955 public Entry(IMetaschemaData data) { 956 this.__metaschemaData = data; 957 } 958 959 @Override 960 public IMetaschemaData getMetaschemaData() { 961 return __metaschemaData; 962 } 963 964 public UUID getUuid() { 965 return _uuid; 966 } 967 968 public void setUuid(UUID value) { 969 _uuid = value; 970 } 971 972 public MarkupLine getTitle() { 973 return _title; 974 } 975 976 public void setTitle(MarkupLine value) { 977 _title = value; 978 } 979 980 public MarkupMultiline getDescription() { 981 return _description; 982 } 983 984 public void setDescription(MarkupMultiline value) { 985 _description = value; 986 } 987 988 public ZonedDateTime getStart() { 989 return _start; 990 } 991 992 public void setStart(ZonedDateTime value) { 993 _start = value; 994 } 995 996 public ZonedDateTime getEnd() { 997 return _end; 998 } 999 1000 public void setEnd(ZonedDateTime value) { 1001 _end = value; 1002 } 1003 1004 public List<Property> getProps() { 1005 return _props; 1006 } 1007 1008 public void setProps(List<Property> value) { 1009 _props = value; 1010 } 1011 1012 /** 1013 * Add a new {@link Property} item to the underlying collection. 1014 * @param item the item to add 1015 * @return {@code true} 1016 */ 1017 public boolean addProp(Property item) { 1018 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1019 if (_props == null) { 1020 _props = new LinkedList<>(); 1021 } 1022 return _props.add(value); 1023 } 1024 1025 /** 1026 * Remove the first matching {@link Property} item from the underlying collection. 1027 * @param item the item to remove 1028 * @return {@code true} if the item was removed or {@code false} otherwise 1029 */ 1030 public boolean removeProp(Property item) { 1031 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1032 return _props != null && _props.remove(value); 1033 } 1034 1035 public List<Link> getLinks() { 1036 return _links; 1037 } 1038 1039 public void setLinks(List<Link> value) { 1040 _links = value; 1041 } 1042 1043 /** 1044 * Add a new {@link Link} item to the underlying collection. 1045 * @param item the item to add 1046 * @return {@code true} 1047 */ 1048 public boolean addLink(Link item) { 1049 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1050 if (_links == null) { 1051 _links = new LinkedList<>(); 1052 } 1053 return _links.add(value); 1054 } 1055 1056 /** 1057 * Remove the first matching {@link Link} item from the underlying collection. 1058 * @param item the item to remove 1059 * @return {@code true} if the item was removed or {@code false} otherwise 1060 */ 1061 public boolean removeLink(Link item) { 1062 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1063 return _links != null && _links.remove(value); 1064 } 1065 1066 public List<LoggedBy> getLoggedBy() { 1067 return _loggedBy; 1068 } 1069 1070 public void setLoggedBy(List<LoggedBy> value) { 1071 _loggedBy = value; 1072 } 1073 1074 /** 1075 * Add a new {@link LoggedBy} item to the underlying collection. 1076 * @param item the item to add 1077 * @return {@code true} 1078 */ 1079 public boolean addLoggedBy(LoggedBy item) { 1080 LoggedBy value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1081 if (_loggedBy == null) { 1082 _loggedBy = new LinkedList<>(); 1083 } 1084 return _loggedBy.add(value); 1085 } 1086 1087 /** 1088 * Remove the first matching {@link LoggedBy} item from the underlying collection. 1089 * @param item the item to remove 1090 * @return {@code true} if the item was removed or {@code false} otherwise 1091 */ 1092 public boolean removeLoggedBy(LoggedBy item) { 1093 LoggedBy value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1094 return _loggedBy != null && _loggedBy.remove(value); 1095 } 1096 1097 public List<RelatedTask> getRelatedTasks() { 1098 return _relatedTasks; 1099 } 1100 1101 public void setRelatedTasks(List<RelatedTask> value) { 1102 _relatedTasks = value; 1103 } 1104 1105 /** 1106 * Add a new {@link RelatedTask} item to the underlying collection. 1107 * @param item the item to add 1108 * @return {@code true} 1109 */ 1110 public boolean addRelatedTask(RelatedTask item) { 1111 RelatedTask value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1112 if (_relatedTasks == null) { 1113 _relatedTasks = new LinkedList<>(); 1114 } 1115 return _relatedTasks.add(value); 1116 } 1117 1118 /** 1119 * Remove the first matching {@link RelatedTask} item from the underlying collection. 1120 * @param item the item to remove 1121 * @return {@code true} if the item was removed or {@code false} otherwise 1122 */ 1123 public boolean removeRelatedTask(RelatedTask item) { 1124 RelatedTask value = ObjectUtils.requireNonNull(item,"item cannot be null"); 1125 return _relatedTasks != null && _relatedTasks.remove(value); 1126 } 1127 1128 public MarkupMultiline getRemarks() { 1129 return _remarks; 1130 } 1131 1132 public void setRemarks(MarkupMultiline value) { 1133 _remarks = value; 1134 } 1135 1136 @Override 1137 public String toString() { 1138 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 1139 } 1140 } 1141 } 1142}