001// Generated from: ../../../../../../../../oscal/src/metaschema/oscal_assessment-plan_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.Index; 021import dev.metaschema.databind.model.annotations.IsUnique; 022import dev.metaschema.databind.model.annotations.KeyField; 023import dev.metaschema.databind.model.annotations.Let; 024import dev.metaschema.databind.model.annotations.MetaschemaAssembly; 025import dev.metaschema.databind.model.annotations.ValueConstraints; 026import edu.umd.cs.findbugs.annotations.NonNull; 027import edu.umd.cs.findbugs.annotations.Nullable; 028import java.util.LinkedList; 029import java.util.List; 030import java.util.UUID; 031import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 032import org.apache.commons.lang3.builder.ToStringStyle; 033 034/** 035 * An assessment plan, such as those provided by a FedRAMP assessor. 036 */ 037@MetaschemaAssembly( 038 formalName = "Security Assessment Plan (SAP)", 039 description = "An assessment plan, such as those provided by a FedRAMP assessor.", 040 name = "assessment-plan", 041 moduleClass = OscalApModule.class, 042 rootName = "assessment-plan", 043 valueConstraints = @ValueConstraints(lets = @Let(name = "all-imports", target = "recurse-depth('.[import-ssp]/doc(resolve-uri(Q{http://csrc.nist.gov/ns/oscal/1.0}resolve-reference(import-ssp/@href)))/system-security-plan|.[import-profile]/resolve-profile(doc(resolve-uri(Q{http://csrc.nist.gov/ns/oscal/1.0}resolve-reference(import-profile/@href))))/catalog')")), 044 modelConstraints = @AssemblyConstraints(index = {@Index(id = "oscal-ap-index-metadata-scoped-role-id", formalName = "In-Scope Role Identifiers", description = "An index of role identifiers that are in-scope for the assessment-plan model. Roles are collected from imported system-securtity-plans, which in turn includes referenced profiles and catalogs. For a given role @id, a locally declared role takes precedence over a role that is imported, the role that was last imported.", level = IConstraint.Level.ERROR, target = "map:merge($all-imports/metadata/role ! map:entry(@id,.))?*", name = "index-imports-metadata-role-id", keyFields = @KeyField(target = "@id")), @Index(id = "oscal-ap-index-metadata-scoped-location-uuid", level = IConstraint.Level.ERROR, target = "map:merge($all-imports/metadata/location ! map:entry(@uuid,.))?*", name = "index-imports-metadata-location-uuid", keyFields = @KeyField(target = "@uuid")), @Index(id = "oscal-ap-index-metadata-scoped-party-uuid", level = IConstraint.Level.ERROR, target = "map:merge($all-imports/metadata/party ! map:entry(@uuid,.))?*", name = "index-imports-metadata-party-uuid", keyFields = @KeyField(target = "@uuid")), @Index(id = "oscal-ap-index-metadata-scoped-party-organization-uuid", level = IConstraint.Level.ERROR, target = "map:merge($all-imports/metadata/party[@type='organization'] ! map:entry(@uuid,.))?*", name = "index-imports-metadata-party-organization-uuid", keyFields = @KeyField(target = "@uuid")), @Index(id = "oscal-ap-index-metadata-scoped-property-uuid", level = IConstraint.Level.ERROR, target = "map:merge($all-imports//prop[@uuid] ! map:entry(@uuid,.))?*", name = "index-imports-metadata-property-uuid", keyFields = @KeyField(target = "@uuid"))}, unique = {@IsUnique(id = "oscal-unique-document-id", formalName = "Unique Document Identifier", description = "Ensure all document identifiers have a unique combination of @scheme and value.", level = IConstraint.Level.ERROR, target = "document-id", keyFields = {@KeyField(target = "@scheme"), @KeyField}), @IsUnique(id = "oscal-unique-property-in-context-location", formalName = "Unique Properties", description = "Ensure all properties are unique for a given location using a unique combination of @ns, @name, @class. @group. and @value.", level = IConstraint.Level.ERROR, target = ".//prop", keyFields = {@KeyField(target = "path(..)"), @KeyField(target = "@name"), @KeyField(target = "@ns"), @KeyField(target = "@class"), @KeyField(target = "@group"), @KeyField(target = "@value")}), @IsUnique(id = "oscal-unique-link-in-context-location", formalName = "Unique Links", description = "Ensure all links are unique for a given location using a unique combination of @href, @rel, and @media-type.", level = IConstraint.Level.ERROR, target = ".//link", keyFields = {@KeyField(target = "path(..)"), @KeyField(target = "@href"), @KeyField(target = "@rel"), @KeyField(target = "@media-type"), @KeyField(target = "@resource-fragment")}), @IsUnique(id = "oscal-unique-responsibility-in-context-location", formalName = "Unique Responsibilities", description = "Ensure all responsible-roles and responsible-parties are unique for a given location using a unique combination of @role-id and the combination of @party-uuid values.", level = IConstraint.Level.ERROR, target = ".//(responsible-party|responsible-role)", keyFields = {@KeyField(target = "path(..)"), @KeyField(target = "@role-id"), @KeyField(target = "@party-uuid")}, remarks = "Since `responsible-party` and `responsible-role` associate multiple `party-uuid` entries with a single `role-id`, each role-id must be referenced only once.")}) 045) 046public class AssessmentPlan extends AbstractOscalInstance implements IBoundObject { 047 private final IMetaschemaData __metaschemaData; 048 049 /** 050 * 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 assessment plan in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#ap-identifiers">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>assessment plan</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. 051 */ 052 @BoundFlag( 053 formalName = "Assessment Plan Universally Unique Identifier", 054 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 assessment plan in [this or other OSCAL instances](https://pages.nist.gov/OSCAL/concepts/identifier-use/#ap-identifiers). The locally defined *UUID* of the `assessment plan` 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.", 055 name = "uuid", 056 required = true, 057 typeAdapter = UuidAdapter.class 058 ) 059 private UUID _uuid; 060 061 /** 062 * Provides information about the containing document, and defines concepts that are shared across the document. 063 */ 064 @BoundAssembly( 065 formalName = "Document Metadata", 066 description = "Provides information about the containing document, and defines concepts that are shared across the document.", 067 useName = "metadata", 068 minOccurs = 1 069 ) 070 private Metadata _metadata; 071 072 /** 073 * Used by the assessment plan and POA&M to import information about the system. 074 */ 075 @BoundAssembly( 076 formalName = "Import System Security Plan", 077 description = "Used by the assessment plan and POA\\&M to import information about the system.", 078 useName = "import-ssp", 079 remarks = "Used by the SAP to import information about the system being assessed.", 080 minOccurs = 1 081 ) 082 private ImportSsp _importSsp; 083 084 /** 085 * Used to define data objects that are used in the assessment plan, that do not appear in the referenced SSP. 086 */ 087 @BoundAssembly( 088 formalName = "Local Definitions", 089 description = "Used to define data objects that are used in the assessment plan, that do not appear in the referenced SSP.", 090 useName = "local-definitions" 091 ) 092 private LocalDefinitions _localDefinitions; 093 094 /** 095 * Used to define various terms and conditions under which an assessment, described by the plan, can be performed. Each child part defines a different type of term or condition. 096 */ 097 @BoundAssembly( 098 formalName = "Assessment Plan Terms and Conditions", 099 description = "Used to define various terms and conditions under which an assessment, described by the plan, can be performed. Each child part defines a different type of term or condition.", 100 useName = "terms-and-conditions" 101 ) 102 private TermsAndConditions _termsAndConditions; 103 104 /** 105 * Identifies the controls being assessed and their control objectives. 106 */ 107 @BoundAssembly( 108 formalName = "Reviewed Controls and Control Objectives", 109 description = "Identifies the controls being assessed and their control objectives.", 110 useName = "reviewed-controls", 111 minOccurs = 1 112 ) 113 private ReviewedControls _reviewedControls; 114 115 /** 116 * Identifies system elements being assessed, such as components, inventory items, and locations. In the assessment plan, this identifies a planned assessment subject. In the assessment results this is an actual assessment subject, and reflects any changes from the plan. exactly what will be the focus of this assessment. Any subjects not identified in this way are out-of-scope. 117 */ 118 @BoundAssembly( 119 formalName = "Subject of Assessment", 120 description = "Identifies system elements being assessed, such as components, inventory items, and locations. In the assessment plan, this identifies a planned assessment subject. In the assessment results this is an actual assessment subject, and reflects any changes from the plan. exactly what will be the focus of this assessment. Any subjects not identified in this way are out-of-scope.", 121 useName = "assessment-subject", 122 maxOccurs = -1, 123 groupAs = @GroupAs(name = "assessment-subjects", inJson = JsonGroupAsBehavior.LIST) 124 ) 125 private List<AssessmentSubject> _assessmentSubjects; 126 127 /** 128 * Identifies the assets used to perform this assessment, such as the assessment team, scanning tools, and assumptions. 129 */ 130 @BoundAssembly( 131 formalName = "Assessment Assets", 132 description = "Identifies the assets used to perform this assessment, such as the assessment team, scanning tools, and assumptions.", 133 useName = "assessment-assets" 134 ) 135 private AssessmentAssets _assessmentAssets; 136 137 /** 138 * Represents a scheduled event or milestone, which may be associated with a series of assessment actions. 139 */ 140 @BoundAssembly( 141 formalName = "Task", 142 description = "Represents a scheduled event or milestone, which may be associated with a series of assessment actions.", 143 useName = "task", 144 maxOccurs = -1, 145 groupAs = @GroupAs(name = "tasks", inJson = JsonGroupAsBehavior.LIST) 146 ) 147 private List<Task> _tasks; 148 149 /** 150 * A collection of resources that may be referenced from within the OSCAL document instance. 151 */ 152 @BoundAssembly( 153 formalName = "Back matter", 154 description = "A collection of resources that may be referenced from within the OSCAL document instance.", 155 useName = "back-matter" 156 ) 157 private BackMatter _backMatter; 158 159 /** 160 * Constructs a new {@code dev.metaschema.oscal.lib.model.AssessmentPlan} instance with no metadata. 161 */ 162 public AssessmentPlan() { 163 this(null); 164 } 165 166 /** 167 * Constructs a new {@code dev.metaschema.oscal.lib.model.AssessmentPlan} instance with the specified metadata. 168 * 169 * @param data 170 * the metaschema data, or {@code null} if none 171 */ 172 public AssessmentPlan(IMetaschemaData data) { 173 this.__metaschemaData = data; 174 } 175 176 @Override 177 public IMetaschemaData getMetaschemaData() { 178 return __metaschemaData; 179 } 180 181 /** 182 * Get the "{@literal Assessment Plan Universally Unique Identifier}". 183 * 184 * <p> 185 * 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 assessment plan in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#ap-identifiers">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>assessment plan</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. 186 * 187 * @return the uuid value 188 */ 189 @NonNull 190 public UUID getUuid() { 191 return _uuid; 192 } 193 194 /** 195 * Set the "{@literal Assessment Plan Universally Unique Identifier}". 196 * 197 * <p> 198 * 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 assessment plan in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#ap-identifiers">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>assessment plan</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. 199 * 200 * @param value 201 * the uuid value to set 202 */ 203 public void setUuid(@NonNull UUID value) { 204 _uuid = value; 205 } 206 207 /** 208 * Get the "{@literal Document Metadata}". 209 * 210 * <p> 211 * Provides information about the containing document, and defines concepts that are shared across the document. 212 * 213 * @return the metadata value 214 */ 215 @NonNull 216 public Metadata getMetadata() { 217 return _metadata; 218 } 219 220 /** 221 * Set the "{@literal Document Metadata}". 222 * 223 * <p> 224 * Provides information about the containing document, and defines concepts that are shared across the document. 225 * 226 * @param value 227 * the metadata value to set 228 */ 229 public void setMetadata(@NonNull Metadata value) { 230 _metadata = value; 231 } 232 233 /** 234 * Get the "{@literal Import System Security Plan}". 235 * 236 * <p> 237 * Used by the assessment plan and POA&M to import information about the system. 238 * 239 * @return the import-ssp value 240 */ 241 @NonNull 242 public ImportSsp getImportSsp() { 243 return _importSsp; 244 } 245 246 /** 247 * Set the "{@literal Import System Security Plan}". 248 * 249 * <p> 250 * Used by the assessment plan and POA&M to import information about the system. 251 * 252 * @param value 253 * the import-ssp value to set 254 */ 255 public void setImportSsp(@NonNull ImportSsp value) { 256 _importSsp = value; 257 } 258 259 /** 260 * Get the "{@literal Local Definitions}". 261 * 262 * <p> 263 * Used to define data objects that are used in the assessment plan, that do not appear in the referenced SSP. 264 * 265 * @return the local-definitions value, or {@code null} if not set 266 */ 267 @Nullable 268 public LocalDefinitions getLocalDefinitions() { 269 return _localDefinitions; 270 } 271 272 /** 273 * Set the "{@literal Local Definitions}". 274 * 275 * <p> 276 * Used to define data objects that are used in the assessment plan, that do not appear in the referenced SSP. 277 * 278 * @param value 279 * the local-definitions value to set, or {@code null} to clear 280 */ 281 public void setLocalDefinitions(@Nullable LocalDefinitions value) { 282 _localDefinitions = value; 283 } 284 285 /** 286 * Get the "{@literal Assessment Plan Terms and Conditions}". 287 * 288 * <p> 289 * Used to define various terms and conditions under which an assessment, described by the plan, can be performed. Each child part defines a different type of term or condition. 290 * 291 * @return the terms-and-conditions value, or {@code null} if not set 292 */ 293 @Nullable 294 public TermsAndConditions getTermsAndConditions() { 295 return _termsAndConditions; 296 } 297 298 /** 299 * Set the "{@literal Assessment Plan Terms and Conditions}". 300 * 301 * <p> 302 * Used to define various terms and conditions under which an assessment, described by the plan, can be performed. Each child part defines a different type of term or condition. 303 * 304 * @param value 305 * the terms-and-conditions value to set, or {@code null} to clear 306 */ 307 public void setTermsAndConditions(@Nullable TermsAndConditions value) { 308 _termsAndConditions = value; 309 } 310 311 /** 312 * Get the "{@literal Reviewed Controls and Control Objectives}". 313 * 314 * <p> 315 * Identifies the controls being assessed and their control objectives. 316 * 317 * @return the reviewed-controls value 318 */ 319 @NonNull 320 public ReviewedControls getReviewedControls() { 321 return _reviewedControls; 322 } 323 324 /** 325 * Set the "{@literal Reviewed Controls and Control Objectives}". 326 * 327 * <p> 328 * Identifies the controls being assessed and their control objectives. 329 * 330 * @param value 331 * the reviewed-controls value to set 332 */ 333 public void setReviewedControls(@NonNull ReviewedControls value) { 334 _reviewedControls = value; 335 } 336 337 /** 338 * Get the "{@literal Subject of Assessment}". 339 * 340 * <p> 341 * Identifies system elements being assessed, such as components, inventory items, and locations. In the assessment plan, this identifies a planned assessment subject. In the assessment results this is an actual assessment subject, and reflects any changes from the plan. exactly what will be the focus of this assessment. Any subjects not identified in this way are out-of-scope. 342 * 343 * @return the assessment-subject value 344 */ 345 @NonNull 346 public List<AssessmentSubject> getAssessmentSubjects() { 347 if (_assessmentSubjects == null) { 348 _assessmentSubjects = new LinkedList<>(); 349 } 350 return ObjectUtils.notNull(_assessmentSubjects); 351 } 352 353 /** 354 * Set the "{@literal Subject of Assessment}". 355 * 356 * <p> 357 * Identifies system elements being assessed, such as components, inventory items, and locations. In the assessment plan, this identifies a planned assessment subject. In the assessment results this is an actual assessment subject, and reflects any changes from the plan. exactly what will be the focus of this assessment. Any subjects not identified in this way are out-of-scope. 358 * 359 * @param value 360 * the assessment-subject value to set 361 */ 362 public void setAssessmentSubjects(@NonNull List<AssessmentSubject> value) { 363 _assessmentSubjects = value; 364 } 365 366 /** 367 * Add a new {@link AssessmentSubject} item to the underlying collection. 368 * @param item the item to add 369 * @return {@code true} 370 */ 371 public boolean addAssessmentSubject(AssessmentSubject item) { 372 AssessmentSubject value = ObjectUtils.requireNonNull(item,"item cannot be null"); 373 if (_assessmentSubjects == null) { 374 _assessmentSubjects = new LinkedList<>(); 375 } 376 return _assessmentSubjects.add(value); 377 } 378 379 /** 380 * Remove the first matching {@link AssessmentSubject} item from the underlying collection. 381 * @param item the item to remove 382 * @return {@code true} if the item was removed or {@code false} otherwise 383 */ 384 public boolean removeAssessmentSubject(AssessmentSubject item) { 385 AssessmentSubject value = ObjectUtils.requireNonNull(item,"item cannot be null"); 386 return _assessmentSubjects != null && _assessmentSubjects.remove(value); 387 } 388 389 /** 390 * Get the "{@literal Assessment Assets}". 391 * 392 * <p> 393 * Identifies the assets used to perform this assessment, such as the assessment team, scanning tools, and assumptions. 394 * 395 * @return the assessment-assets value, or {@code null} if not set 396 */ 397 @Nullable 398 public AssessmentAssets getAssessmentAssets() { 399 return _assessmentAssets; 400 } 401 402 /** 403 * Set the "{@literal Assessment Assets}". 404 * 405 * <p> 406 * Identifies the assets used to perform this assessment, such as the assessment team, scanning tools, and assumptions. 407 * 408 * @param value 409 * the assessment-assets value to set, or {@code null} to clear 410 */ 411 public void setAssessmentAssets(@Nullable AssessmentAssets value) { 412 _assessmentAssets = value; 413 } 414 415 /** 416 * Get the "{@literal Task}". 417 * 418 * <p> 419 * Represents a scheduled event or milestone, which may be associated with a series of assessment actions. 420 * 421 * @return the task value 422 */ 423 @NonNull 424 public List<Task> getTasks() { 425 if (_tasks == null) { 426 _tasks = new LinkedList<>(); 427 } 428 return ObjectUtils.notNull(_tasks); 429 } 430 431 /** 432 * Set the "{@literal Task}". 433 * 434 * <p> 435 * Represents a scheduled event or milestone, which may be associated with a series of assessment actions. 436 * 437 * @param value 438 * the task value to set 439 */ 440 public void setTasks(@NonNull List<Task> value) { 441 _tasks = value; 442 } 443 444 /** 445 * Add a new {@link Task} item to the underlying collection. 446 * @param item the item to add 447 * @return {@code true} 448 */ 449 public boolean addTask(Task item) { 450 Task value = ObjectUtils.requireNonNull(item,"item cannot be null"); 451 if (_tasks == null) { 452 _tasks = new LinkedList<>(); 453 } 454 return _tasks.add(value); 455 } 456 457 /** 458 * Remove the first matching {@link Task} item from the underlying collection. 459 * @param item the item to remove 460 * @return {@code true} if the item was removed or {@code false} otherwise 461 */ 462 public boolean removeTask(Task item) { 463 Task value = ObjectUtils.requireNonNull(item,"item cannot be null"); 464 return _tasks != null && _tasks.remove(value); 465 } 466 467 /** 468 * Get the "{@literal Back matter}". 469 * 470 * <p> 471 * A collection of resources that may be referenced from within the OSCAL document instance. 472 * 473 * @return the back-matter value, or {@code null} if not set 474 */ 475 @Nullable 476 public BackMatter getBackMatter() { 477 return _backMatter; 478 } 479 480 /** 481 * Set the "{@literal Back matter}". 482 * 483 * <p> 484 * A collection of resources that may be referenced from within the OSCAL document instance. 485 * 486 * @param value 487 * the back-matter value to set, or {@code null} to clear 488 */ 489 public void setBackMatter(@Nullable BackMatter value) { 490 _backMatter = value; 491 } 492 493 @Override 494 public String toString() { 495 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 496 } 497 498 /** 499 * Used to define data objects that are used in the assessment plan, that do not appear in the referenced SSP. 500 */ 501 @MetaschemaAssembly( 502 formalName = "Local Definitions", 503 description = "Used to define data objects that are used in the assessment plan, that do not appear in the referenced SSP.", 504 name = "local-definitions", 505 moduleClass = OscalApModule.class, 506 modelConstraints = @AssemblyConstraints(unique = {@IsUnique(id = "oscal-unique-ap-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 = "oscal-unique-ap-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.")}) 507 ) 508 public static class LocalDefinitions implements IBoundObject { 509 private final IMetaschemaData __metaschemaData; 510 511 /** 512 * A defined component that can be part of an implemented system. 513 */ 514 @BoundAssembly( 515 formalName = "Component", 516 description = "A defined component that can be part of an implemented system.", 517 useName = "component", 518 remarks = "Used to add any components, not defined via the System Security Plan (AR-\\>AP-\\>SSP)", 519 maxOccurs = -1, 520 groupAs = @GroupAs(name = "components", inJson = JsonGroupAsBehavior.LIST) 521 ) 522 private List<SystemComponent> _components; 523 524 /** 525 * A single managed inventory item within the system. 526 */ 527 @BoundAssembly( 528 formalName = "Inventory Item", 529 description = "A single managed inventory item within the system.", 530 useName = "inventory-item", 531 remarks = "Used to add any inventory-items, not defined via the System Security Plan (AR-\\>AP-\\>SSP)", 532 maxOccurs = -1, 533 groupAs = @GroupAs(name = "inventory-items", inJson = JsonGroupAsBehavior.LIST) 534 ) 535 private List<InventoryItem> _inventoryItems; 536 537 /** 538 * A type of user that interacts with the system based on an associated role. 539 */ 540 @BoundAssembly( 541 formalName = "System User", 542 description = "A type of user that interacts with the system based on an associated role.", 543 useName = "user", 544 remarks = "Used to add any users, not defined via the System Security Plan (AR-\\>AP-\\>SSP)", 545 maxOccurs = -1, 546 groupAs = @GroupAs(name = "users", inJson = JsonGroupAsBehavior.LIST) 547 ) 548 private List<SystemUser> _users; 549 550 /** 551 * A local definition of a control objective for this assessment. Uses catalog syntax for control objective and assessment actions. 552 */ 553 @BoundAssembly( 554 formalName = "Assessment-Specific Control Objective", 555 description = "A local definition of a control objective for this assessment. Uses catalog syntax for control objective and assessment actions.", 556 useName = "objectives-and-methods", 557 maxOccurs = -1, 558 groupAs = @GroupAs(name = "objectives-and-methods", inJson = JsonGroupAsBehavior.LIST) 559 ) 560 private List<LocalObjective> _objectivesAndMethods; 561 562 /** 563 * Identifies an assessment or related process that can be performed. In the assessment plan, this is an intended activity which may be associated with an assessment task. In the assessment results, this an activity that was actually performed as part of an assessment. 564 */ 565 @BoundAssembly( 566 formalName = "Activity", 567 description = "Identifies an assessment or related process that can be performed. In the assessment plan, this is an intended activity which may be associated with an assessment task. In the assessment results, this an activity that was actually performed as part of an assessment.", 568 useName = "activity", 569 maxOccurs = -1, 570 groupAs = @GroupAs(name = "activities", inJson = JsonGroupAsBehavior.LIST) 571 ) 572 private List<Activity> _activities; 573 574 /** 575 * Additional commentary about the containing object. 576 */ 577 @BoundField( 578 formalName = "Remarks", 579 description = "Additional commentary about the containing object.", 580 useName = "remarks", 581 typeAdapter = MarkupMultilineAdapter.class 582 ) 583 private MarkupMultiline _remarks; 584 585 /** 586 * Constructs a new {@code dev.metaschema.oscal.lib.model.AssessmentPlan.LocalDefinitions} instance with no metadata. 587 */ 588 public LocalDefinitions() { 589 this(null); 590 } 591 592 /** 593 * Constructs a new {@code dev.metaschema.oscal.lib.model.AssessmentPlan.LocalDefinitions} instance with the specified metadata. 594 * 595 * @param data 596 * the metaschema data, or {@code null} if none 597 */ 598 public LocalDefinitions(IMetaschemaData data) { 599 this.__metaschemaData = data; 600 } 601 602 @Override 603 public IMetaschemaData getMetaschemaData() { 604 return __metaschemaData; 605 } 606 607 /** 608 * Get the "{@literal Component}". 609 * 610 * <p> 611 * A defined component that can be part of an implemented system. 612 * 613 * @return the component value 614 */ 615 @NonNull 616 public List<SystemComponent> getComponents() { 617 if (_components == null) { 618 _components = new LinkedList<>(); 619 } 620 return ObjectUtils.notNull(_components); 621 } 622 623 /** 624 * Set the "{@literal Component}". 625 * 626 * <p> 627 * A defined component that can be part of an implemented system. 628 * 629 * @param value 630 * the component value to set 631 */ 632 public void setComponents(@NonNull List<SystemComponent> value) { 633 _components = value; 634 } 635 636 /** 637 * Add a new {@link SystemComponent} item to the underlying collection. 638 * @param item the item to add 639 * @return {@code true} 640 */ 641 public boolean addComponent(SystemComponent item) { 642 SystemComponent value = ObjectUtils.requireNonNull(item,"item cannot be null"); 643 if (_components == null) { 644 _components = new LinkedList<>(); 645 } 646 return _components.add(value); 647 } 648 649 /** 650 * Remove the first matching {@link SystemComponent} item from the underlying collection. 651 * @param item the item to remove 652 * @return {@code true} if the item was removed or {@code false} otherwise 653 */ 654 public boolean removeComponent(SystemComponent item) { 655 SystemComponent value = ObjectUtils.requireNonNull(item,"item cannot be null"); 656 return _components != null && _components.remove(value); 657 } 658 659 /** 660 * Get the "{@literal Inventory Item}". 661 * 662 * <p> 663 * A single managed inventory item within the system. 664 * 665 * @return the inventory-item value 666 */ 667 @NonNull 668 public List<InventoryItem> getInventoryItems() { 669 if (_inventoryItems == null) { 670 _inventoryItems = new LinkedList<>(); 671 } 672 return ObjectUtils.notNull(_inventoryItems); 673 } 674 675 /** 676 * Set the "{@literal Inventory Item}". 677 * 678 * <p> 679 * A single managed inventory item within the system. 680 * 681 * @param value 682 * the inventory-item value to set 683 */ 684 public void setInventoryItems(@NonNull List<InventoryItem> value) { 685 _inventoryItems = value; 686 } 687 688 /** 689 * Add a new {@link InventoryItem} item to the underlying collection. 690 * @param item the item to add 691 * @return {@code true} 692 */ 693 public boolean addInventoryItem(InventoryItem item) { 694 InventoryItem value = ObjectUtils.requireNonNull(item,"item cannot be null"); 695 if (_inventoryItems == null) { 696 _inventoryItems = new LinkedList<>(); 697 } 698 return _inventoryItems.add(value); 699 } 700 701 /** 702 * Remove the first matching {@link InventoryItem} item from the underlying collection. 703 * @param item the item to remove 704 * @return {@code true} if the item was removed or {@code false} otherwise 705 */ 706 public boolean removeInventoryItem(InventoryItem item) { 707 InventoryItem value = ObjectUtils.requireNonNull(item,"item cannot be null"); 708 return _inventoryItems != null && _inventoryItems.remove(value); 709 } 710 711 /** 712 * Get the "{@literal System User}". 713 * 714 * <p> 715 * A type of user that interacts with the system based on an associated role. 716 * 717 * @return the user value 718 */ 719 @NonNull 720 public List<SystemUser> getUsers() { 721 if (_users == null) { 722 _users = new LinkedList<>(); 723 } 724 return ObjectUtils.notNull(_users); 725 } 726 727 /** 728 * Set the "{@literal System User}". 729 * 730 * <p> 731 * A type of user that interacts with the system based on an associated role. 732 * 733 * @param value 734 * the user value to set 735 */ 736 public void setUsers(@NonNull List<SystemUser> value) { 737 _users = value; 738 } 739 740 /** 741 * Add a new {@link SystemUser} item to the underlying collection. 742 * @param item the item to add 743 * @return {@code true} 744 */ 745 public boolean addUser(SystemUser item) { 746 SystemUser value = ObjectUtils.requireNonNull(item,"item cannot be null"); 747 if (_users == null) { 748 _users = new LinkedList<>(); 749 } 750 return _users.add(value); 751 } 752 753 /** 754 * Remove the first matching {@link SystemUser} item from the underlying collection. 755 * @param item the item to remove 756 * @return {@code true} if the item was removed or {@code false} otherwise 757 */ 758 public boolean removeUser(SystemUser item) { 759 SystemUser value = ObjectUtils.requireNonNull(item,"item cannot be null"); 760 return _users != null && _users.remove(value); 761 } 762 763 /** 764 * Get the "{@literal Assessment-Specific Control Objective}". 765 * 766 * <p> 767 * A local definition of a control objective for this assessment. Uses catalog syntax for control objective and assessment actions. 768 * 769 * @return the objectives-and-methods value 770 */ 771 @NonNull 772 public List<LocalObjective> getObjectivesAndMethods() { 773 if (_objectivesAndMethods == null) { 774 _objectivesAndMethods = new LinkedList<>(); 775 } 776 return ObjectUtils.notNull(_objectivesAndMethods); 777 } 778 779 /** 780 * Set the "{@literal Assessment-Specific Control Objective}". 781 * 782 * <p> 783 * A local definition of a control objective for this assessment. Uses catalog syntax for control objective and assessment actions. 784 * 785 * @param value 786 * the objectives-and-methods value to set 787 */ 788 public void setObjectivesAndMethods(@NonNull List<LocalObjective> value) { 789 _objectivesAndMethods = value; 790 } 791 792 /** 793 * Add a new {@link LocalObjective} item to the underlying collection. 794 * @param item the item to add 795 * @return {@code true} 796 */ 797 public boolean addObjectivesAndMethods(LocalObjective item) { 798 LocalObjective value = ObjectUtils.requireNonNull(item,"item cannot be null"); 799 if (_objectivesAndMethods == null) { 800 _objectivesAndMethods = new LinkedList<>(); 801 } 802 return _objectivesAndMethods.add(value); 803 } 804 805 /** 806 * Remove the first matching {@link LocalObjective} item from the underlying collection. 807 * @param item the item to remove 808 * @return {@code true} if the item was removed or {@code false} otherwise 809 */ 810 public boolean removeObjectivesAndMethods(LocalObjective item) { 811 LocalObjective value = ObjectUtils.requireNonNull(item,"item cannot be null"); 812 return _objectivesAndMethods != null && _objectivesAndMethods.remove(value); 813 } 814 815 /** 816 * Get the "{@literal Activity}". 817 * 818 * <p> 819 * Identifies an assessment or related process that can be performed. In the assessment plan, this is an intended activity which may be associated with an assessment task. In the assessment results, this an activity that was actually performed as part of an assessment. 820 * 821 * @return the activity value 822 */ 823 @NonNull 824 public List<Activity> getActivities() { 825 if (_activities == null) { 826 _activities = new LinkedList<>(); 827 } 828 return ObjectUtils.notNull(_activities); 829 } 830 831 /** 832 * Set the "{@literal Activity}". 833 * 834 * <p> 835 * Identifies an assessment or related process that can be performed. In the assessment plan, this is an intended activity which may be associated with an assessment task. In the assessment results, this an activity that was actually performed as part of an assessment. 836 * 837 * @param value 838 * the activity value to set 839 */ 840 public void setActivities(@NonNull List<Activity> value) { 841 _activities = value; 842 } 843 844 /** 845 * Add a new {@link Activity} item to the underlying collection. 846 * @param item the item to add 847 * @return {@code true} 848 */ 849 public boolean addActivity(Activity item) { 850 Activity value = ObjectUtils.requireNonNull(item,"item cannot be null"); 851 if (_activities == null) { 852 _activities = new LinkedList<>(); 853 } 854 return _activities.add(value); 855 } 856 857 /** 858 * Remove the first matching {@link Activity} item from the underlying collection. 859 * @param item the item to remove 860 * @return {@code true} if the item was removed or {@code false} otherwise 861 */ 862 public boolean removeActivity(Activity item) { 863 Activity value = ObjectUtils.requireNonNull(item,"item cannot be null"); 864 return _activities != null && _activities.remove(value); 865 } 866 867 /** 868 * Get the "{@literal Remarks}". 869 * 870 * <p> 871 * Additional commentary about the containing object. 872 * 873 * @return the remarks value, or {@code null} if not set 874 */ 875 @Nullable 876 public MarkupMultiline getRemarks() { 877 return _remarks; 878 } 879 880 /** 881 * Set the "{@literal Remarks}". 882 * 883 * <p> 884 * Additional commentary about the containing object. 885 * 886 * @param value 887 * the remarks value to set, or {@code null} to clear 888 */ 889 public void setRemarks(@Nullable MarkupMultiline value) { 890 _remarks = value; 891 } 892 893 @Override 894 public String toString() { 895 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 896 } 897 } 898 899 /** 900 * Used to define various terms and conditions under which an assessment, described by the plan, can be performed. Each child part defines a different type of term or condition. 901 */ 902 @MetaschemaAssembly( 903 formalName = "Assessment Plan Terms and Conditions", 904 description = "Used to define various terms and conditions under which an assessment, described by the plan, can be performed. Each child part defines a different type of term or condition.", 905 name = "terms-and-conditions", 906 moduleClass = OscalApModule.class, 907 valueConstraints = @ValueConstraints(allowedValues = @AllowedValues(id = "oscal-terms-and-conditions-part-name", level = IConstraint.Level.ERROR, target = "part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name", values = {@AllowedValue(value = "rules-of-engagement", description = "Defines the circumstances, conditions, degree, and manner in which the use of cyber-attack techniques or actions may be applied to the assessment."), @AllowedValue(value = "disclosures", description = "Any information the assessor should make known to the system owner or authorizing official. Has child 'item' parts for each individual disclosure."), @AllowedValue(value = "assessment-inclusions", description = "Defines any assessment activities which the system owner or authorizing official wishes to ensure are performed as part of the assessment."), @AllowedValue(value = "assessment-exclusions", description = "Defines any assessment activities which the system owner or authorizing official explicitly prohibits from being performed as part of the assessment."), @AllowedValue(value = "results-delivery", description = "Defines conditions related to the delivery of the assessment results, such as when to deliver, how, and to whom."), @AllowedValue(value = "assumptions", description = "Defines any supposition made by the assessor. Has child 'item' parts for each assumption."), @AllowedValue(value = "methodology", description = "An explanation of practices, procedures, and rules used in the course of the assessment.")})) 908 ) 909 public static class TermsAndConditions implements IBoundObject { 910 private final IMetaschemaData __metaschemaData; 911 912 /** 913 * A partition of an assessment plan or results or a child of another part. 914 */ 915 @BoundAssembly( 916 formalName = "Assessment Part", 917 description = "A partition of an assessment plan or results or a child of another part.", 918 useName = "part", 919 maxOccurs = -1, 920 groupAs = @GroupAs(name = "parts", inJson = JsonGroupAsBehavior.LIST) 921 ) 922 private List<AssessmentPart> _parts; 923 924 /** 925 * Constructs a new {@code dev.metaschema.oscal.lib.model.AssessmentPlan.TermsAndConditions} instance with no metadata. 926 */ 927 public TermsAndConditions() { 928 this(null); 929 } 930 931 /** 932 * Constructs a new {@code dev.metaschema.oscal.lib.model.AssessmentPlan.TermsAndConditions} instance with the specified metadata. 933 * 934 * @param data 935 * the metaschema data, or {@code null} if none 936 */ 937 public TermsAndConditions(IMetaschemaData data) { 938 this.__metaschemaData = data; 939 } 940 941 @Override 942 public IMetaschemaData getMetaschemaData() { 943 return __metaschemaData; 944 } 945 946 /** 947 * Get the "{@literal Assessment Part}". 948 * 949 * <p> 950 * A partition of an assessment plan or results or a child of another part. 951 * 952 * @return the part value 953 */ 954 @NonNull 955 public List<AssessmentPart> getParts() { 956 if (_parts == null) { 957 _parts = new LinkedList<>(); 958 } 959 return ObjectUtils.notNull(_parts); 960 } 961 962 /** 963 * Set the "{@literal Assessment Part}". 964 * 965 * <p> 966 * A partition of an assessment plan or results or a child of another part. 967 * 968 * @param value 969 * the part value to set 970 */ 971 public void setParts(@NonNull List<AssessmentPart> value) { 972 _parts = value; 973 } 974 975 /** 976 * Add a new {@link AssessmentPart} item to the underlying collection. 977 * @param item the item to add 978 * @return {@code true} 979 */ 980 public boolean addPart(AssessmentPart item) { 981 AssessmentPart value = ObjectUtils.requireNonNull(item,"item cannot be null"); 982 if (_parts == null) { 983 _parts = new LinkedList<>(); 984 } 985 return _parts.add(value); 986 } 987 988 /** 989 * Remove the first matching {@link AssessmentPart} item from the underlying collection. 990 * @param item the item to remove 991 * @return {@code true} if the item was removed or {@code false} otherwise 992 */ 993 public boolean removePart(AssessmentPart item) { 994 AssessmentPart value = ObjectUtils.requireNonNull(item,"item cannot be null"); 995 return _parts != null && _parts.remove(value); 996 } 997 998 @Override 999 public String toString() { 1000 return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString()); 1001 } 1002 } 1003}