001package gov.nist.secauto.oscal.lib.model; 002 003import gov.nist.secauto.metaschema.core.datatype.adapter.DateAdapter; 004import gov.nist.secauto.metaschema.core.datatype.adapter.DateTimeAdapter; 005import gov.nist.secauto.metaschema.core.datatype.adapter.IPv4AddressAdapter; 006import gov.nist.secauto.metaschema.core.datatype.adapter.IPv6AddressAdapter; 007import gov.nist.secauto.metaschema.core.datatype.adapter.StringAdapter; 008import gov.nist.secauto.metaschema.core.datatype.adapter.TokenAdapter; 009import gov.nist.secauto.metaschema.core.datatype.adapter.UuidAdapter; 010import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLine; 011import gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter; 012import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultiline; 013import gov.nist.secauto.metaschema.core.datatype.markup.MarkupMultilineAdapter; 014import gov.nist.secauto.metaschema.core.model.IBoundObject; 015import gov.nist.secauto.metaschema.core.model.IMetaschemaData; 016import gov.nist.secauto.metaschema.core.model.JsonGroupAsBehavior; 017import gov.nist.secauto.metaschema.core.model.constraint.IConstraint; 018import gov.nist.secauto.metaschema.core.util.ObjectUtils; 019import gov.nist.secauto.metaschema.databind.model.annotations.AllowedValue; 020import gov.nist.secauto.metaschema.databind.model.annotations.AllowedValues; 021import gov.nist.secauto.metaschema.databind.model.annotations.AssemblyConstraints; 022import gov.nist.secauto.metaschema.databind.model.annotations.BoundAssembly; 023import gov.nist.secauto.metaschema.databind.model.annotations.BoundField; 024import gov.nist.secauto.metaschema.databind.model.annotations.BoundFlag; 025import gov.nist.secauto.metaschema.databind.model.annotations.Expect; 026import gov.nist.secauto.metaschema.databind.model.annotations.GroupAs; 027import gov.nist.secauto.metaschema.databind.model.annotations.IndexHasKey; 028import gov.nist.secauto.metaschema.databind.model.annotations.IsUnique; 029import gov.nist.secauto.metaschema.databind.model.annotations.KeyField; 030import gov.nist.secauto.metaschema.databind.model.annotations.Matches; 031import gov.nist.secauto.metaschema.databind.model.annotations.MetaschemaAssembly; 032import gov.nist.secauto.metaschema.databind.model.annotations.ValueConstraints; 033import java.lang.Override; 034import java.lang.String; 035import java.util.LinkedList; 036import java.util.List; 037import java.util.UUID; 038import org.apache.commons.lang3.builder.ReflectionToStringBuilder; 039import org.apache.commons.lang3.builder.ToStringStyle; 040 041/** 042 * A defined component that can be part of an implemented system. 043 */ 044@MetaschemaAssembly( 045 formalName = "Component", 046 description = "A defined component that can be part of an implemented system.", 047 name = "system-component", 048 moduleClass = OscalImplementationCommonModule.class, 049 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" 050 + "\n" 051 + "The `type` indicates which of these component types is represented.\n" 052 + "\n" 053 + "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.", 054 valueConstraints = @ValueConstraints(allowedValues = {@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.")}), @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`.")}), @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).")}), @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.")}), @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.")}), @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.")}), @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.")}), @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.")}), @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")), @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.")), @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.")), @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.")}), @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")}), @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.")}), @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.")), @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.")}), @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.")})}, indexHasKey = @IndexHasKey(level = IConstraint.Level.ERROR, target = "prop[@name='physical-location']", indexName = "index-metadata-location-uuid", keyFields = @KeyField(target = "@value")), matches = {@Matches(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='inherited-uuid']/@value", typeAdapter = UuidAdapter.class), @Matches(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='release-date']/@value", typeAdapter = DateAdapter.class), @Matches(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='isa-date']/@value", typeAdapter = DateTimeAdapter.class), @Matches(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='ipv4-address']/@value", typeAdapter = IPv4AddressAdapter.class), @Matches(level = IConstraint.Level.ERROR, target = "prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='ipv6-address']/@value", typeAdapter = IPv6AddressAdapter.class)}, expect = @Expect(level = IConstraint.Level.ERROR, test = "not(exists((.)[not(@type='service')]/protocol))")), 055 modelConstraints = @AssemblyConstraints(unique = @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.")) 056) 057public class SystemComponent implements IBoundObject { 058 private final IMetaschemaData __metaschemaData; 059 060 /** 061 * "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 component elsewhere in <a href=\"https://pages.nist.gov/OSCAL/concepts/identifier-use/#scope\">this or other OSCAL instances</a>. The locally defined <em>UUID</em> of the <code>component</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." 062 */ 063 @BoundFlag( 064 formalName = "Component Identifier", 065 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.", 066 name = "uuid", 067 required = true, 068 typeAdapter = UuidAdapter.class 069 ) 070 private UUID _uuid; 071 072 /** 073 * "A category describing the purpose of the component." 074 */ 075 @BoundFlag( 076 formalName = "Component Type", 077 description = "A category describing the purpose of the component.", 078 name = "type", 079 required = true, 080 typeAdapter = StringAdapter.class, 081 valueConstraints = @ValueConstraints(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.")})) 082 ) 083 private String _type; 084 085 @BoundField( 086 formalName = "Component Title", 087 description = "A human readable name for the system component.", 088 useName = "title", 089 minOccurs = 1, 090 typeAdapter = MarkupLineAdapter.class 091 ) 092 private MarkupLine _title; 093 094 @BoundField( 095 formalName = "Component Description", 096 description = "A description of the component, including information about its function.", 097 useName = "description", 098 minOccurs = 1, 099 typeAdapter = MarkupMultilineAdapter.class 100 ) 101 private MarkupMultiline _description; 102 103 @BoundField( 104 formalName = "Purpose", 105 description = "A summary of the technological or business purpose of the component.", 106 useName = "purpose", 107 typeAdapter = MarkupLineAdapter.class 108 ) 109 private MarkupLine _purpose; 110 111 @BoundAssembly( 112 formalName = "Property", 113 description = "An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.", 114 useName = "prop", 115 maxOccurs = -1, 116 groupAs = @GroupAs(name = "props", inJson = JsonGroupAsBehavior.LIST) 117 ) 118 private List<Property> _props; 119 120 @BoundAssembly( 121 formalName = "Link", 122 description = "A reference to a local or remote resource, that has a specific relation to the containing object.", 123 useName = "link", 124 maxOccurs = -1, 125 groupAs = @GroupAs(name = "links", inJson = JsonGroupAsBehavior.LIST) 126 ) 127 private List<Link> _links; 128 129 @BoundAssembly( 130 formalName = "Status", 131 description = "Describes the operational status of the system component.", 132 useName = "status", 133 minOccurs = 1 134 ) 135 private Status _status; 136 137 @BoundAssembly( 138 formalName = "Responsible Role", 139 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.", 140 useName = "responsible-role", 141 maxOccurs = -1, 142 groupAs = @GroupAs(name = "responsible-roles", inJson = JsonGroupAsBehavior.LIST) 143 ) 144 private List<ResponsibleRole> _responsibleRoles; 145 146 @BoundAssembly( 147 formalName = "Service Protocol Information", 148 description = "Information about the protocol used to provide a service.", 149 useName = "protocol", 150 remarks = "Used for `service` components to define the protocols supported by the service.", 151 maxOccurs = -1, 152 groupAs = @GroupAs(name = "protocols", inJson = JsonGroupAsBehavior.LIST) 153 ) 154 private List<Protocol> _protocols; 155 156 @BoundField( 157 formalName = "Remarks", 158 description = "Additional commentary about the containing object.", 159 useName = "remarks", 160 typeAdapter = MarkupMultilineAdapter.class 161 ) 162 private MarkupMultiline _remarks; 163 164 public SystemComponent() { 165 this(null); 166 } 167 168 public SystemComponent(IMetaschemaData data) { 169 this.__metaschemaData = data; 170 } 171 172 @Override 173 public IMetaschemaData getMetaschemaData() { 174 return __metaschemaData; 175 } 176 177 public UUID getUuid() { 178 return _uuid; 179 } 180 181 public void setUuid(UUID value) { 182 _uuid = value; 183 } 184 185 public String getType() { 186 return _type; 187 } 188 189 public void setType(String value) { 190 _type = value; 191 } 192 193 public MarkupLine getTitle() { 194 return _title; 195 } 196 197 public void setTitle(MarkupLine value) { 198 _title = value; 199 } 200 201 public MarkupMultiline getDescription() { 202 return _description; 203 } 204 205 public void setDescription(MarkupMultiline value) { 206 _description = value; 207 } 208 209 public MarkupLine getPurpose() { 210 return _purpose; 211 } 212 213 public void setPurpose(MarkupLine value) { 214 _purpose = value; 215 } 216 217 public List<Property> getProps() { 218 return _props; 219 } 220 221 public void setProps(List<Property> value) { 222 _props = value; 223 } 224 225 /** 226 * Add a new {@link Property} item to the underlying collection. 227 * @param item the item to add 228 * @return {@code true} 229 */ 230 public boolean addProp(Property item) { 231 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 232 if (_props == null) { 233 _props = new LinkedList<>(); 234 } 235 return _props.add(value); 236 } 237 238 /** 239 * Remove the first matching {@link Property} item from the underlying collection. 240 * @param item the item to remove 241 * @return {@code true} if the item was removed or {@code false} otherwise 242 */ 243 public boolean removeProp(Property item) { 244 Property value = ObjectUtils.requireNonNull(item,"item cannot be null"); 245 return _props != null && _props.remove(value); 246 } 247 248 public List<Link> getLinks() { 249 return _links; 250 } 251 252 public void setLinks(List<Link> value) { 253 _links = value; 254 } 255 256 /** 257 * Add a new {@link Link} item to the underlying collection. 258 * @param item the item to add 259 * @return {@code true} 260 */ 261 public boolean addLink(Link item) { 262 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 263 if (_links == null) { 264 _links = new LinkedList<>(); 265 } 266 return _links.add(value); 267 } 268 269 /** 270 * Remove the first matching {@link Link} item from the underlying collection. 271 * @param item the item to remove 272 * @return {@code true} if the item was removed or {@code false} otherwise 273 */ 274 public boolean removeLink(Link item) { 275 Link value = ObjectUtils.requireNonNull(item,"item cannot be null"); 276 return _links != null && _links.remove(value); 277 } 278 279 public Status getStatus() { 280 return _status; 281 } 282 283 public void setStatus(Status value) { 284 _status = value; 285 } 286 287 public List<ResponsibleRole> getResponsibleRoles() { 288 return _responsibleRoles; 289 } 290 291 public void setResponsibleRoles(List<ResponsibleRole> value) { 292 _responsibleRoles = value; 293 } 294 295 /** 296 * Add a new {@link ResponsibleRole} item to the underlying collection. 297 * @param item the item to add 298 * @return {@code true} 299 */ 300 public boolean addResponsibleRole(ResponsibleRole item) { 301 ResponsibleRole value = ObjectUtils.requireNonNull(item,"item cannot be null"); 302 if (_responsibleRoles == null) { 303 _responsibleRoles = new LinkedList<>(); 304 } 305 return _responsibleRoles.add(value); 306 } 307 308 /** 309 * Remove the first matching {@link ResponsibleRole} item from the underlying collection. 310 * @param item the item to remove 311 * @return {@code true} if the item was removed or {@code false} otherwise 312 */ 313 public boolean removeResponsibleRole(ResponsibleRole item) { 314 ResponsibleRole value = ObjectUtils.requireNonNull(item,"item cannot be null"); 315 return _responsibleRoles != null && _responsibleRoles.remove(value); 316 } 317 318 public List<Protocol> getProtocols() { 319 return _protocols; 320 } 321 322 public void setProtocols(List<Protocol> value) { 323 _protocols = value; 324 } 325 326 /** 327 * Add a new {@link Protocol} item to the underlying collection. 328 * @param item the item to add 329 * @return {@code true} 330 */ 331 public boolean addProtocol(Protocol item) { 332 Protocol value = ObjectUtils.requireNonNull(item,"item cannot be null"); 333 if (_protocols == null) { 334 _protocols = new LinkedList<>(); 335 } 336 return _protocols.add(value); 337 } 338 339 /** 340 * Remove the first matching {@link Protocol} item from the underlying collection. 341 * @param item the item to remove 342 * @return {@code true} if the item was removed or {@code false} otherwise 343 */ 344 public boolean removeProtocol(Protocol item) { 345 Protocol value = ObjectUtils.requireNonNull(item,"item cannot be null"); 346 return _protocols != null && _protocols.remove(value); 347 } 348 349 public MarkupMultiline getRemarks() { 350 return _remarks; 351 } 352 353 public void setRemarks(MarkupMultiline value) { 354 _remarks = value; 355 } 356 357 @Override 358 public String toString() { 359 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 360 } 361 362 /** 363 * Describes the operational status of the system component. 364 */ 365 @MetaschemaAssembly( 366 formalName = "Status", 367 description = "Describes the operational status of the system component.", 368 name = "status", 369 moduleClass = OscalImplementationCommonModule.class 370 ) 371 public static class Status implements IBoundObject { 372 private final IMetaschemaData __metaschemaData; 373 374 /** 375 * "The operational status." 376 */ 377 @BoundFlag( 378 formalName = "State", 379 description = "The operational status.", 380 name = "state", 381 required = true, 382 typeAdapter = TokenAdapter.class, 383 valueConstraints = @ValueConstraints(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.")})) 384 ) 385 private String _state; 386 387 @BoundField( 388 formalName = "Remarks", 389 description = "Additional commentary about the containing object.", 390 useName = "remarks", 391 typeAdapter = MarkupMultilineAdapter.class 392 ) 393 private MarkupMultiline _remarks; 394 395 public Status() { 396 this(null); 397 } 398 399 public Status(IMetaschemaData data) { 400 this.__metaschemaData = data; 401 } 402 403 @Override 404 public IMetaschemaData getMetaschemaData() { 405 return __metaschemaData; 406 } 407 408 public String getState() { 409 return _state; 410 } 411 412 public void setState(String value) { 413 _state = value; 414 } 415 416 public MarkupMultiline getRemarks() { 417 return _remarks; 418 } 419 420 public void setRemarks(MarkupMultiline value) { 421 _remarks = value; 422 } 423 424 @Override 425 public String toString() { 426 return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).toString(); 427 } 428 } 429}