001package gov.nist.secauto.oscal.lib.model;
002
003import gov.nist.secauto.metaschema.binding.model.annotations.AllowedValue;
004import gov.nist.secauto.metaschema.binding.model.annotations.AllowedValues;
005import gov.nist.secauto.metaschema.binding.model.annotations.AssemblyConstraints;
006import gov.nist.secauto.metaschema.binding.model.annotations.BoundAssembly;
007import gov.nist.secauto.metaschema.binding.model.annotations.BoundField;
008import gov.nist.secauto.metaschema.binding.model.annotations.BoundFieldValue;
009import gov.nist.secauto.metaschema.binding.model.annotations.BoundFlag;
010import gov.nist.secauto.metaschema.binding.model.annotations.Expect;
011import gov.nist.secauto.metaschema.binding.model.annotations.GroupAs;
012import gov.nist.secauto.metaschema.binding.model.annotations.IndexHasKey;
013import gov.nist.secauto.metaschema.binding.model.annotations.IsUnique;
014import gov.nist.secauto.metaschema.binding.model.annotations.KeyField;
015import gov.nist.secauto.metaschema.binding.model.annotations.Matches;
016import gov.nist.secauto.metaschema.binding.model.annotations.MetaschemaAssembly;
017import gov.nist.secauto.metaschema.binding.model.annotations.ValueConstraints;
018import gov.nist.secauto.metaschema.model.common.JsonGroupAsBehavior;
019import gov.nist.secauto.metaschema.model.common.constraint.IConstraint;
020import gov.nist.secauto.metaschema.model.common.datatype.adapter.DateAdapter;
021import gov.nist.secauto.metaschema.model.common.datatype.adapter.DateTimeAdapter;
022import gov.nist.secauto.metaschema.model.common.datatype.adapter.IPv4AddressAdapter;
023import gov.nist.secauto.metaschema.model.common.datatype.adapter.IPv6AddressAdapter;
024import gov.nist.secauto.metaschema.model.common.datatype.adapter.StringAdapter;
025import gov.nist.secauto.metaschema.model.common.datatype.adapter.TokenAdapter;
026import gov.nist.secauto.metaschema.model.common.datatype.adapter.UuidAdapter;
027import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupLine;
028import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupLineAdapter;
029import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupMultiline;
030import gov.nist.secauto.metaschema.model.common.datatype.markup.MarkupMultilineAdapter;
031import gov.nist.secauto.metaschema.model.common.util.ObjectUtils;
032import java.lang.Override;
033import java.lang.String;
034import java.util.LinkedList;
035import java.util.List;
036import java.util.UUID;
037import org.apache.commons.lang3.builder.MultilineRecursiveToStringStyle;
038import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
039
040/**
041 * A defined component that can be part of an implemented system.
042 */
043@MetaschemaAssembly(
044    formalName = "Component",
045    description = "A defined component that can be part of an implemented system.",
046    name = "system-component",
047    metaschema = OscalImplementationCommonMetaschema.class,
048    remarks = "Components may be products, services, application programming interface (APIs), policies, processes, plans, guidance, standards, or other tangible items that enable security and/or privacy.\n"
049            + "\n"
050            + "The `type` indicates which of these component types is represented.\n"
051            + "\n"
052            + "When defining a `service` component where are relationship to other components is known, one or more `link` entries with rel values of provided-by and used-by can be used to link to the specific component identifier(s) that provide and use the service respectively."
053)
054@ValueConstraints(
055    allowedValues = {
056        @AllowedValues(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name", values = {@AllowedValue(value = "implementation-point", description = "Relative placement of component ('internal' or 'external') to the system."), @AllowedValue(value = "leveraged-authorization-uuid", description = "UUID of the related leveraged-authorization assembly in this SSP."), @AllowedValue(value = "inherited-uuid", description = "UUID of the component as it was assigned in the leveraged system's SSP."), @AllowedValue(value = "asset-type", description = "Simple indication of the asset's function, such as Router, Storage Array, DNS Server."), @AllowedValue(value = "asset-id", description = "An organizationally specific identifier that is used to uniquely identify a logical or tangible item by the organization that owns the item."), @AllowedValue(value = "asset-tag", description = "An asset tag assigned by the organization responsible for maintaining the logical or tangible item."), @AllowedValue(value = "public", description = "Identifies whether the asset is publicly accessible (yes/no)"), @AllowedValue(value = "virtual", description = "Identifies whether the asset is virtualized (yes/no)"), @AllowedValue(value = "vlan-id", description = "Virtual LAN identifier of the asset."), @AllowedValue(value = "network-id", description = "The network identifier of the asset."), @AllowedValue(value = "label", description = "A human-readable label for the parent context."), @AllowedValue(value = "sort-id", description = "An alternative identifier, whose value is easily sortable among other such values in the document."), @AllowedValue(value = "baseline-configuration-name", description = "The name of the baseline configuration for the asset."), @AllowedValue(value = "allows-authenticated-scan", description = "Can the asset be check with an authenticated scan? (yes/no)"), @AllowedValue(value = "function", description = "The function provided by the asset for the system."), @AllowedValue(value = "version", description = "The version of the component."), @AllowedValue(value = "patch-level", description = "The specific patch level of the component."), @AllowedValue(value = "model", description = "The model of the component."), @AllowedValue(value = "release-date", description = "The date the component was released, such as a software release date or policy publication date."), @AllowedValue(value = "validation-type", description = "Used with component-type='validation' to provide a well-known name for a kind of validation."), @AllowedValue(value = "validation-reference", description = "Used with component-type='validation' to indicate the validating body's assigned identifier for their validation of this component.")}),
057        @AllowedValues(level = IConstraint.Level.ERROR, target = "link/@rel", allowOthers = true, values = {@AllowedValue(value = "depends-on", description = "A reference to another component that this component has a dependency on."), @AllowedValue(value = "validation", description = "A reference to another component of component-type=validation, that is a validation (e.g., FIPS 140-2) for this component"), @AllowedValue(value = "proof-of-compliance", description = "A pointer to a validation record (e.g., FIPS 140-2) or other compliance information."), @AllowedValue(value = "baseline-template", description = "A reference to the baseline template used to configure the asset."), @AllowedValue(value = "uses-service", description = "This service is used by the referenced component identifier."), @AllowedValue(value = "system-security-plan", description = "A link to the system security plan of the external system."), @AllowedValue(value = "uses-network", description = "This component uses the network provided by the identified network component."), @AllowedValue(value = "imported-from", description = "The hyperlink identifies a URI pointing to the `component` in a `component-definition` that originally defined the `component`.")}),
058        @AllowedValues(level = IConstraint.Level.ERROR, target = "responsible-role/@role-id", allowOthers = true, values = {@AllowedValue(value = "asset-owner", description = "Accountable for ensuring the asset is managed in accordance with organizational policies and procedures."), @AllowedValue(value = "asset-administrator", description = "Responsible for administering a set of assets."), @AllowedValue(value = "security-operations", description = "Members of the security operations center (SOC)."), @AllowedValue(value = "network-operations", description = "Members of the network operations center (NOC)."), @AllowedValue(value = "incident-response", description = "Responsible for responding to an event that could lead to loss of, or disruption to, an organization's operations, services or functions."), @AllowedValue(value = "help-desk", description = "Responsible for providing information and support to users."), @AllowedValue(value = "configuration-management", description = "Responsible for the configuration management processes governing changes to the asset."), @AllowedValue(value = "maintainer", description = "Responsible for the creation and maintenance of a component."), @AllowedValue(value = "provider", description = "Organization responsible for providing the component, if this is different from the \"maintainer\" (e.g., a reseller).")}),
059        @AllowedValues(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='asset-type']/@value", allowOthers = true, values = {@AllowedValue(value = "operating-system", description = "System software that manages computer hardware, software resources, and provides common services for computer programs."), @AllowedValue(value = "database", description = "An electronic collection of data, or information, that is specially organized for rapid search and retrieval."), @AllowedValue(value = "web-server", description = "A system that delivers content or services to end users over the Internet or an intranet."), @AllowedValue(value = "dns-server", description = "A system that resolves domain names to internet protocol (IP) addresses."), @AllowedValue(value = "email-server", description = "A computer system that sends and receives electronic mail messages."), @AllowedValue(value = "directory-server", description = "A system that stores, organizes and provides access to directory information in order to unify network resources."), @AllowedValue(value = "pbx", description = "A private branch exchange (PBX) provides a a private telephone switchboard."), @AllowedValue(value = "firewall", description = "A network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules."), @AllowedValue(value = "router", description = "A physical or virtual networking device that forwards data packets between computer networks."), @AllowedValue(value = "switch", description = "A physical or virtual networking device that connects devices within a computer network by using packet switching to receive and forward data to the destination device."), @AllowedValue(value = "storage-array", description = "A consolidated, block-level data storage capability."), @AllowedValue(value = "appliance", description = "A physical or virtual machine that centralizes hardware, software, or services for a specific purpose.")}),
060        @AllowedValues(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='allows-authenticated-scan']/@value", values = {@AllowedValue(value = "yes", description = "The component allows an authenticated scan."), @AllowedValue(value = "no", description = "The component does not allow an authenticated scan.")}),
061        @AllowedValues(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='public']/@value", values = {@AllowedValue(value = "yes", description = "The component is publicly accessible."), @AllowedValue(value = "no", description = "The component is not publicly accessible.")}),
062        @AllowedValues(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='virtual']/@value", values = {@AllowedValue(value = "yes", description = "The component is virtualized."), @AllowedValue(value = "no", description = "The component is not virtualized.")}),
063        @AllowedValues(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='implementation-point']/@value", values = {@AllowedValue(value = "internal", description = "The component is implemented within the system boundary."), @AllowedValue(value = "external", description = "The component is implemented outside the system boundary.")}),
064        @AllowedValues(level = IConstraint.Level.ERROR, target = "(.)[@type=('software', 'hardware', 'service')]/prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name", values = @AllowedValue(value = "vendor-name", description = "The name of the company or organization")),
065        @AllowedValues(level = IConstraint.Level.ERROR, target = "(.)[@type='validation']/link/@rel", allowOthers = true, values = @AllowedValue(value = "validation-details", description = "A link to an online information provided by the authorizing body.")),
066        @AllowedValues(level = IConstraint.Level.ERROR, target = "(.)[@type='software']/prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name", values = @AllowedValue(value = "software-identifier", description = "If a \"software\" component-type, the identifier, such as a SWID tag, for the software component.")),
067        @AllowedValues(level = IConstraint.Level.ERROR, target = "(.)[@type='service']/link/@rel", allowOthers = true, values = {@AllowedValue(value = "provided-by", description = "This service is provided by the referenced component identifier."), @AllowedValue(value = "used-by", description = "This service is used by the referenced component identifier.")}),
068        @AllowedValues(level = IConstraint.Level.ERROR, target = "(.)[@type='interconnection']/prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name", values = {@AllowedValue(value = "isa-title", description = "Title of the Interconnection Security Agreement (ISA)."), @AllowedValue(value = "isa-date", description = "Date of the Interconnection Security Agreement (ISA)."), @AllowedValue(value = "isa-remote-system-name", description = "The name of the remote interconnected system."), @AllowedValue(value = "ipv4-address", description = "An Internet Protocol Version 4 interconnection address"), @AllowedValue(value = "ipv6-address", description = "An Internet Protocol Version 6 interconnection address"), @AllowedValue(value = "direction", description = "An Internet Protocol Version 6 interconnection address")}),
069        @AllowedValues(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name=('ipv4-address','ipv6-address')]/@class", values = {@AllowedValue(value = "local", description = "The identified IP address is for this system."), @AllowedValue(value = "remote", description = "The identified IP address is for the remote system to which this system is connected.")}),
070        @AllowedValues(level = IConstraint.Level.ERROR, target = "(.)[@type='interconnection']/link/@rel", allowOthers = true, values = @AllowedValue(value = "isa-agreement", description = "A link to the system interconnection agreement.")),
071        @AllowedValues(level = IConstraint.Level.ERROR, target = "(.)[@type='interconnection']/responsible-role/@role-id", allowOthers = true, values = {@AllowedValue(value = "isa-poc-local", description = "Interconnection Security Agreement (ISA) point of contact (POC) for this system."), @AllowedValue(value = "isa-poc-remote", description = "Interconnection Security Agreement (ISA) point of contact (POC) for the remote interconnected system."), @AllowedValue(value = "isa-authorizing-official-local", description = "Interconnection Security Agreement (ISA) authorizing official for this system."), @AllowedValue(value = "isa-authorizing-official-remote", description = "Interconnection Security Agreement (ISA) authorizing official for the remote interconnected system.")}),
072        @AllowedValues(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='direction']/@value", values = {@AllowedValue(value = "incoming", description = "Data from the remote system flows into this system."), @AllowedValue(value = "outgoing", description = "Data from this system flows to the remote system.")})
073    },
074    indexHasKey = @IndexHasKey(level = IConstraint.Level.ERROR, target = "prop[@name='physical-location']", indexName = "index-metadata-location-uuid", keyFields = @KeyField(target = "@value")),
075    matches = {
076        @Matches(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='inherited-uuid']/@value", typeAdapter = UuidAdapter.class),
077        @Matches(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='release-date']/@value", typeAdapter = DateAdapter.class),
078        @Matches(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='isa-date']/@value", typeAdapter = DateTimeAdapter.class),
079        @Matches(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='ipv4-address']/@value", typeAdapter = IPv4AddressAdapter.class),
080        @Matches(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='ipv6-address']/@value", typeAdapter = IPv6AddressAdapter.class)
081    },
082    expect = @Expect(level = IConstraint.Level.ERROR, test = "not(exists((.)[not(@type='service')]/protocol))")
083)
084@AssemblyConstraints(
085    isUnique = @IsUnique(id = "unique-system-component-responsible-role", level = IConstraint.Level.ERROR, target = "responsible-role", keyFields = @KeyField(target = "@role-id"), remarks = "Since `responsible-role` associates multiple `party-uuid` entries with a single `role-id`, each role-id must be referenced only once.")
086)
087public class SystemComponent {
088  @BoundFlag(
089      formalName = "Component Identifier",
090      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 component elsewhere in [this or other OSCAL instances](https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope). The locally defined *UUID* of the `component` 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.",
091      useName = "uuid",
092      required = true,
093      typeAdapter = UuidAdapter.class
094  )
095  private UUID _uuid;
096
097  @BoundFlag(
098      formalName = "Component Type",
099      description = "A category describing the purpose of the component.",
100      useName = "type",
101      required = true,
102      typeAdapter = StringAdapter.class
103  )
104  @ValueConstraints(
105      allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, allowOthers = true, values = {@AllowedValue(value = "this-system", description = "The system as a whole."), @AllowedValue(value = "system", description = "An external system, which may be a leveraged system or the other side of an interconnection."), @AllowedValue(value = "interconnection", description = "A connection to something outside this system."), @AllowedValue(value = "software", description = "Any software, operating system, or firmware."), @AllowedValue(value = "hardware", description = "A physical device."), @AllowedValue(value = "service", description = "A service that may provide APIs."), @AllowedValue(value = "policy", description = "An enforceable policy."), @AllowedValue(value = "physical", description = "A tangible asset used to provide physical protections or countermeasures."), @AllowedValue(value = "process-procedure", description = "A list of steps or actions to take to achieve some end result."), @AllowedValue(value = "plan", description = "An applicable plan."), @AllowedValue(value = "guidance", description = "Any guideline or recommendation."), @AllowedValue(value = "standard", description = "Any organizational or industry standard."), @AllowedValue(value = "validation", description = "An external assessment performed on some other component, that has been validated by a third-party."), @AllowedValue(value = "network", description = "A physical or virtual network.")})
106  )
107  private String _type;
108
109  /**
110   * "A human readable name for the system component."
111   */
112  @BoundField(
113      formalName = "Component Title",
114      description = "A human readable name for the system component.",
115      useName = "title",
116      minOccurs = 1
117  )
118  @BoundFieldValue(
119      typeAdapter = MarkupLineAdapter.class
120  )
121  private MarkupLine _title;
122
123  /**
124   * "A description of the component, including information about its function."
125   */
126  @BoundField(
127      formalName = "Component Description",
128      description = "A description of the component, including information about its function.",
129      useName = "description",
130      minOccurs = 1
131  )
132  @BoundFieldValue(
133      typeAdapter = MarkupMultilineAdapter.class
134  )
135  private MarkupMultiline _description;
136
137  /**
138   * "A summary of the technological or business purpose of the component."
139   */
140  @BoundField(
141      formalName = "Purpose",
142      description = "A summary of the technological or business purpose of the component.",
143      useName = "purpose"
144  )
145  @BoundFieldValue(
146      typeAdapter = MarkupLineAdapter.class
147  )
148  private MarkupLine _purpose;
149
150  @BoundAssembly(
151      formalName = "Property",
152      description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.",
153      useName = "prop",
154      maxOccurs = -1
155  )
156  @GroupAs(
157      name = "props",
158      inJson = JsonGroupAsBehavior.LIST
159  )
160  private List<Property> _props;
161
162  @BoundAssembly(
163      formalName = "Link",
164      description = "A reference to a local or remote resource, that has a specific relation to the containing object.",
165      useName = "link",
166      maxOccurs = -1
167  )
168  @GroupAs(
169      name = "links",
170      inJson = JsonGroupAsBehavior.LIST
171  )
172  private List<Link> _links;
173
174  /**
175   * "Describes the operational status of the system component."
176   */
177  @BoundAssembly(
178      formalName = "Status",
179      description = "Describes the operational status of the system component.",
180      useName = "status",
181      minOccurs = 1
182  )
183  private Status _status;
184
185  @BoundAssembly(
186      formalName = "Responsible Role",
187      description = "A reference to a role with responsibility for performing a function relative to the containing object, optionally associated with a set of persons and/or organizations that perform that role.",
188      useName = "responsible-role",
189      maxOccurs = -1
190  )
191  @GroupAs(
192      name = "responsible-roles",
193      inJson = JsonGroupAsBehavior.LIST
194  )
195  private List<ResponsibleRole> _responsibleRoles;
196
197  @BoundAssembly(
198      formalName = "Service Protocol Information",
199      description = "Information about the protocol used to provide a service.",
200      useName = "protocol",
201      maxOccurs = -1,
202      remarks = "Used for `service` components to define the protocols supported by the service."
203  )
204  @GroupAs(
205      name = "protocols",
206      inJson = JsonGroupAsBehavior.LIST
207  )
208  private List<Protocol> _protocols;
209
210  @BoundField(
211      formalName = "Remarks",
212      description = "Additional commentary about the containing object.",
213      useName = "remarks"
214  )
215  @BoundFieldValue(
216      typeAdapter = MarkupMultilineAdapter.class
217  )
218  private MarkupMultiline _remarks;
219
220  public SystemComponent() {
221  }
222
223  public UUID getUuid() {
224    return _uuid;
225  }
226
227  public void setUuid(UUID value) {
228    _uuid = value;
229  }
230
231  public String getType() {
232    return _type;
233  }
234
235  public void setType(String value) {
236    _type = value;
237  }
238
239  public MarkupLine getTitle() {
240    return _title;
241  }
242
243  public void setTitle(MarkupLine value) {
244    _title = value;
245  }
246
247  public MarkupMultiline getDescription() {
248    return _description;
249  }
250
251  public void setDescription(MarkupMultiline value) {
252    _description = value;
253  }
254
255  public MarkupLine getPurpose() {
256    return _purpose;
257  }
258
259  public void setPurpose(MarkupLine value) {
260    _purpose = value;
261  }
262
263  public List<Property> getProps() {
264    return _props;
265  }
266
267  public void setProps(List<Property> value) {
268    _props = value;
269  }
270
271  /**
272   * Add a new {@link Property} item to the underlying collection.
273   * @param item the item to add
274   * @return {@code true}
275   */
276  public boolean addProp(Property item) {
277    Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
278    if (_props == null) {
279      _props = new LinkedList<>();
280    }
281    return _props.add(value);
282  }
283
284  /**
285   * Remove the first matching {@link Property} 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 removeProp(Property item) {
290    Property value = ObjectUtils.requireNonNull(item,"item cannot be null");
291    return _props == null ? false : _props.remove(value);
292  }
293
294  public List<Link> getLinks() {
295    return _links;
296  }
297
298  public void setLinks(List<Link> value) {
299    _links = value;
300  }
301
302  /**
303   * Add a new {@link Link} item to the underlying collection.
304   * @param item the item to add
305   * @return {@code true}
306   */
307  public boolean addLink(Link item) {
308    Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
309    if (_links == null) {
310      _links = new LinkedList<>();
311    }
312    return _links.add(value);
313  }
314
315  /**
316   * Remove the first matching {@link Link} item from the underlying collection.
317   * @param item the item to remove
318   * @return {@code true} if the item was removed or {@code false} otherwise
319   */
320  public boolean removeLink(Link item) {
321    Link value = ObjectUtils.requireNonNull(item,"item cannot be null");
322    return _links == null ? false : _links.remove(value);
323  }
324
325  public Status getStatus() {
326    return _status;
327  }
328
329  public void setStatus(Status value) {
330    _status = value;
331  }
332
333  public List<ResponsibleRole> getResponsibleRoles() {
334    return _responsibleRoles;
335  }
336
337  public void setResponsibleRoles(List<ResponsibleRole> value) {
338    _responsibleRoles = value;
339  }
340
341  /**
342   * Add a new {@link ResponsibleRole} item to the underlying collection.
343   * @param item the item to add
344   * @return {@code true}
345   */
346  public boolean addResponsibleRole(ResponsibleRole item) {
347    ResponsibleRole value = ObjectUtils.requireNonNull(item,"item cannot be null");
348    if (_responsibleRoles == null) {
349      _responsibleRoles = new LinkedList<>();
350    }
351    return _responsibleRoles.add(value);
352  }
353
354  /**
355   * Remove the first matching {@link ResponsibleRole} item from the underlying collection.
356   * @param item the item to remove
357   * @return {@code true} if the item was removed or {@code false} otherwise
358   */
359  public boolean removeResponsibleRole(ResponsibleRole item) {
360    ResponsibleRole value = ObjectUtils.requireNonNull(item,"item cannot be null");
361    return _responsibleRoles == null ? false : _responsibleRoles.remove(value);
362  }
363
364  public List<Protocol> getProtocols() {
365    return _protocols;
366  }
367
368  public void setProtocols(List<Protocol> value) {
369    _protocols = value;
370  }
371
372  /**
373   * Add a new {@link Protocol} item to the underlying collection.
374   * @param item the item to add
375   * @return {@code true}
376   */
377  public boolean addProtocol(Protocol item) {
378    Protocol value = ObjectUtils.requireNonNull(item,"item cannot be null");
379    if (_protocols == null) {
380      _protocols = new LinkedList<>();
381    }
382    return _protocols.add(value);
383  }
384
385  /**
386   * Remove the first matching {@link Protocol} item from the underlying collection.
387   * @param item the item to remove
388   * @return {@code true} if the item was removed or {@code false} otherwise
389   */
390  public boolean removeProtocol(Protocol item) {
391    Protocol value = ObjectUtils.requireNonNull(item,"item cannot be null");
392    return _protocols == null ? false : _protocols.remove(value);
393  }
394
395  public MarkupMultiline getRemarks() {
396    return _remarks;
397  }
398
399  public void setRemarks(MarkupMultiline value) {
400    _remarks = value;
401  }
402
403  @Override
404  public String toString() {
405    return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString();
406  }
407
408  /**
409   * Describes the operational status of the system component.
410   */
411  @MetaschemaAssembly(
412      formalName = "Status",
413      description = "Describes the operational status of the system component.",
414      name = "status",
415      metaschema = OscalImplementationCommonMetaschema.class
416  )
417  public static class Status {
418    @BoundFlag(
419        formalName = "State",
420        description = "The operational status.",
421        useName = "state",
422        required = true,
423        typeAdapter = TokenAdapter.class
424    )
425    @ValueConstraints(
426        allowedValues = @AllowedValues(level = IConstraint.Level.ERROR, values = {@AllowedValue(value = "under-development", description = "The component is being designed, developed, or implemented."), @AllowedValue(value = "operational", description = "The component is currently operational and is available for use in the system."), @AllowedValue(value = "disposition", description = "The component is no longer operational."), @AllowedValue(value = "other", description = "Some other state.")})
427    )
428    private String _state;
429
430    @BoundField(
431        formalName = "Remarks",
432        description = "Additional commentary about the containing object.",
433        useName = "remarks"
434    )
435    @BoundFieldValue(
436        typeAdapter = MarkupMultilineAdapter.class
437    )
438    private MarkupMultiline _remarks;
439
440    public Status() {
441    }
442
443    public String getState() {
444      return _state;
445    }
446
447    public void setState(String value) {
448      _state = value;
449    }
450
451    public MarkupMultiline getRemarks() {
452      return _remarks;
453    }
454
455    public void setRemarks(MarkupMultiline value) {
456      _remarks = value;
457    }
458
459    @Override
460    public String toString() {
461      return new ReflectionToStringBuilder(this, MultilineRecursiveToStringStyle.MULTI_LINE_STYLE).toString();
462    }
463  }
464}