001// Generated from: ../../../../../../../../oscal/src/metaschema/oscal_ssp_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.model.IBoundObject;
007import dev.metaschema.core.model.IMetaschemaData;
008import dev.metaschema.core.model.constraint.IConstraint;
009import dev.metaschema.core.util.ObjectUtils;
010import dev.metaschema.databind.model.annotations.AssemblyConstraints;
011import dev.metaschema.databind.model.annotations.BoundAssembly;
012import dev.metaschema.databind.model.annotations.BoundFlag;
013import dev.metaschema.databind.model.annotations.Index;
014import dev.metaschema.databind.model.annotations.IsUnique;
015import dev.metaschema.databind.model.annotations.KeyField;
016import dev.metaschema.databind.model.annotations.Let;
017import dev.metaschema.databind.model.annotations.MetaschemaAssembly;
018import dev.metaschema.databind.model.annotations.ValueConstraints;
019import edu.umd.cs.findbugs.annotations.NonNull;
020import edu.umd.cs.findbugs.annotations.Nullable;
021import java.util.UUID;
022import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
023import org.apache.commons.lang3.builder.ToStringStyle;
024
025/**
026 * A system security plan, such as those described in NIST SP 800-18.
027 */
028@MetaschemaAssembly(
029    formalName = "System Security Plan (SSP)",
030    description = "A system security plan, such as those described in NIST SP 800-18.",
031    name = "system-security-plan",
032    moduleClass = OscalSspModule.class,
033    rootName = "system-security-plan",
034    valueConstraints = @ValueConstraints(lets = @Let(name = "all-imports", target = "resolve-profile(doc(resolve-uri(Q{http://csrc.nist.gov/ns/oscal/1.0}resolve-reference(import-profile/@href))))/catalog")),
035    modelConstraints = @AssemblyConstraints(index = {@Index(id = "oscal-ssp-by-component-uuid-index", level = IConstraint.Level.ERROR, target = "control-implementation/implemented-requirement//by-component|doc(system-implementation/leveraged-authorization/link[@rel='system-security-plan']/@href)/system-security-plan/control-implementation/implemented-requirement//by-component", name = "by-component-uuid", keyFields = @KeyField(target = "@uuid")), @Index(id = "oscal-ssp-index-metadata-scoped-role-id", formalName = "In-Scope Role Identifiers", description = "An index of role identifiers that are in-scope for the system-securtity-plan model. Roles are collected from imported 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-ssp-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-ssp-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-ssp-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-ssp-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.")})
036)
037public class SystemSecurityPlan extends AbstractOscalInstance implements IBoundObject {
038  private final IMetaschemaData __metaschemaData;
039
040  /**
041   * 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 system security plan (SSP) elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#ssp-identifiers">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>SSP</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.
042   */
043  @BoundFlag(
044      formalName = "System Security Plan Universally Unique Identifier",
045      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 system security plan (SSP) elsewhere in [this or other OSCAL instances](https://pages.nist.gov/OSCAL/concepts/identifier-use/#ssp-identifiers). The locally defined *UUID* of the `SSP` 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.",
046      name = "uuid",
047      required = true,
048      typeAdapter = UuidAdapter.class
049  )
050  private UUID _uuid;
051
052  /**
053   * Provides information about the containing document, and defines concepts that are shared across the document.
054   */
055  @BoundAssembly(
056      formalName = "Document Metadata",
057      description = "Provides information about the containing document, and defines concepts that are shared across the document.",
058      useName = "metadata",
059      minOccurs = 1
060  )
061  private Metadata _metadata;
062
063  /**
064   * Used to import the OSCAL profile representing the system's control baseline.
065   */
066  @BoundAssembly(
067      formalName = "Import Profile",
068      description = "Used to import the OSCAL profile representing the system's control baseline.",
069      useName = "import-profile",
070      minOccurs = 1
071  )
072  private ImportProfile _importProfile;
073
074  /**
075   * Contains the characteristics of the system, such as its name, purpose, and security impact level.
076   */
077  @BoundAssembly(
078      formalName = "System Characteristics",
079      description = "Contains the characteristics of the system, such as its name, purpose, and security impact level.",
080      useName = "system-characteristics",
081      minOccurs = 1
082  )
083  private SystemCharacteristics _systemCharacteristics;
084
085  /**
086   * Provides information as to how the system is implemented.
087   */
088  @BoundAssembly(
089      formalName = "System Implementation",
090      description = "Provides information as to how the system is implemented.",
091      useName = "system-implementation",
092      minOccurs = 1
093  )
094  private SystemImplementation _systemImplementation;
095
096  /**
097   * Describes how the system satisfies a set of controls.
098   */
099  @BoundAssembly(
100      formalName = "Control Implementation",
101      description = "Describes how the system satisfies a set of controls.",
102      useName = "control-implementation",
103      minOccurs = 1
104  )
105  private ControlImplementation _controlImplementation;
106
107  /**
108   * A collection of resources that may be referenced from within the OSCAL document instance.
109   */
110  @BoundAssembly(
111      formalName = "Back matter",
112      description = "A collection of resources that may be referenced from within the OSCAL document instance.",
113      useName = "back-matter"
114  )
115  private BackMatter _backMatter;
116
117  /**
118   * Constructs a new {@code dev.metaschema.oscal.lib.model.SystemSecurityPlan} instance with no metadata.
119   */
120  public SystemSecurityPlan() {
121    this(null);
122  }
123
124  /**
125   * Constructs a new {@code dev.metaschema.oscal.lib.model.SystemSecurityPlan} instance with the specified metadata.
126   *
127   * @param data
128   *           the metaschema data, or {@code null} if none
129   */
130  public SystemSecurityPlan(IMetaschemaData data) {
131    this.__metaschemaData = data;
132  }
133
134  @Override
135  public IMetaschemaData getMetaschemaData() {
136    return __metaschemaData;
137  }
138
139  /**
140   * Get the "{@literal System Security Plan Universally Unique Identifier}".
141   *
142   * <p>
143   * 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 system security plan (SSP) elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#ssp-identifiers">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>SSP</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.
144   *
145   * @return the uuid value
146   */
147  @NonNull
148  public UUID getUuid() {
149    return _uuid;
150  }
151
152  /**
153   * Set the "{@literal System Security Plan 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 system security plan (SSP) elsewhere in <a href="https://pages.nist.gov/OSCAL/concepts/identifier-use/#ssp-identifiers">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>SSP</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   * @param value
159   *           the uuid value to set
160   */
161  public void setUuid(@NonNull UUID value) {
162    _uuid = value;
163  }
164
165  /**
166   * Get the "{@literal Document Metadata}".
167   *
168   * <p>
169   * Provides information about the containing document, and defines concepts that are shared across the document.
170   *
171   * @return the metadata value
172   */
173  @NonNull
174  public Metadata getMetadata() {
175    return _metadata;
176  }
177
178  /**
179   * Set the "{@literal Document Metadata}".
180   *
181   * <p>
182   * Provides information about the containing document, and defines concepts that are shared across the document.
183   *
184   * @param value
185   *           the metadata value to set
186   */
187  public void setMetadata(@NonNull Metadata value) {
188    _metadata = value;
189  }
190
191  /**
192   * Get the "{@literal Import Profile}".
193   *
194   * <p>
195   * Used to import the OSCAL profile representing the system's control baseline.
196   *
197   * @return the import-profile value
198   */
199  @NonNull
200  public ImportProfile getImportProfile() {
201    return _importProfile;
202  }
203
204  /**
205   * Set the "{@literal Import Profile}".
206   *
207   * <p>
208   * Used to import the OSCAL profile representing the system's control baseline.
209   *
210   * @param value
211   *           the import-profile value to set
212   */
213  public void setImportProfile(@NonNull ImportProfile value) {
214    _importProfile = value;
215  }
216
217  /**
218   * Get the "{@literal System Characteristics}".
219   *
220   * <p>
221   * Contains the characteristics of the system, such as its name, purpose, and security impact level.
222   *
223   * @return the system-characteristics value
224   */
225  @NonNull
226  public SystemCharacteristics getSystemCharacteristics() {
227    return _systemCharacteristics;
228  }
229
230  /**
231   * Set the "{@literal System Characteristics}".
232   *
233   * <p>
234   * Contains the characteristics of the system, such as its name, purpose, and security impact level.
235   *
236   * @param value
237   *           the system-characteristics value to set
238   */
239  public void setSystemCharacteristics(@NonNull SystemCharacteristics value) {
240    _systemCharacteristics = value;
241  }
242
243  /**
244   * Get the "{@literal System Implementation}".
245   *
246   * <p>
247   * Provides information as to how the system is implemented.
248   *
249   * @return the system-implementation value
250   */
251  @NonNull
252  public SystemImplementation getSystemImplementation() {
253    return _systemImplementation;
254  }
255
256  /**
257   * Set the "{@literal System Implementation}".
258   *
259   * <p>
260   * Provides information as to how the system is implemented.
261   *
262   * @param value
263   *           the system-implementation value to set
264   */
265  public void setSystemImplementation(@NonNull SystemImplementation value) {
266    _systemImplementation = value;
267  }
268
269  /**
270   * Get the "{@literal Control Implementation}".
271   *
272   * <p>
273   * Describes how the system satisfies a set of controls.
274   *
275   * @return the control-implementation value
276   */
277  @NonNull
278  public ControlImplementation getControlImplementation() {
279    return _controlImplementation;
280  }
281
282  /**
283   * Set the "{@literal Control Implementation}".
284   *
285   * <p>
286   * Describes how the system satisfies a set of controls.
287   *
288   * @param value
289   *           the control-implementation value to set
290   */
291  public void setControlImplementation(@NonNull ControlImplementation value) {
292    _controlImplementation = value;
293  }
294
295  /**
296   * Get the "{@literal Back matter}".
297   *
298   * <p>
299   * A collection of resources that may be referenced from within the OSCAL document instance.
300   *
301   * @return the back-matter value, or {@code null} if not set
302   */
303  @Nullable
304  public BackMatter getBackMatter() {
305    return _backMatter;
306  }
307
308  /**
309   * Set the "{@literal Back matter}".
310   *
311   * <p>
312   * A collection of resources that may be referenced from within the OSCAL document instance.
313   *
314   * @param value
315   *           the back-matter value to set, or {@code null} to clear
316   */
317  public void setBackMatter(@Nullable BackMatter value) {
318    _backMatter = value;
319  }
320
321  @Override
322  public String toString() {
323    return ObjectUtils.notNull(new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString());
324  }
325}