Class: Contrast::Agent::Reporting::ArchitectureComponent
- Inherits:
-
ReportableHash
- Object
- ReportableHash
- Contrast::Agent::Reporting::ArchitectureComponent
- Defined in:
- lib/contrast/agent/reporting/reporting_events/architecture_component.rb
Overview
This is the new Architecture Component class which will include all the needed information for the new reporting system to relay this information in the Application Update and Application Activity messages. These components are used by TeamServer to construct the backend/ outbound connection section of the Flow Map feature.
Constant Summary collapse
- AC_TYPE_DB =
TeamServer only treats these specific values as valid for Architecture Components. It does not know how to process a message with a different type.
'db'
- VALID_TYPES =
%w[db ldap ws].cs__freeze
Instance Attribute Summary collapse
-
#remote_host ⇒ Object
optional attributes.
-
#remote_port ⇒ Object
optional attributes.
-
#type ⇒ Object
required attributes.
-
#url ⇒ Object
required attributes.
-
#vendor ⇒ Object
optional attributes.
Class Method Summary collapse
Instance Method Summary collapse
-
#to_controlled_hash ⇒ Hash
Convert the instance variables on the class, and other information, into the identifiers required for TeamServer to process the JSON form of this message.
-
#validate ⇒ Object
Ensure the required fields are present.
Methods inherited from ReportableHash
Methods included from Components::Logger::InstanceMethods
Instance Attribute Details
#remote_host ⇒ Object
optional attributes
19 20 21 |
# File 'lib/contrast/agent/reporting/reporting_events/architecture_component.rb', line 19 def remote_host @remote_host end |
#remote_port ⇒ Object
optional attributes
19 20 21 |
# File 'lib/contrast/agent/reporting/reporting_events/architecture_component.rb', line 19 def remote_port @remote_port end |
#type ⇒ Object
required attributes
19 20 21 |
# File 'lib/contrast/agent/reporting/reporting_events/architecture_component.rb', line 19 def type @type end |
#url ⇒ Object
required attributes
19 20 21 |
# File 'lib/contrast/agent/reporting/reporting_events/architecture_component.rb', line 19 def url @url end |
#vendor ⇒ Object
optional attributes
19 20 21 |
# File 'lib/contrast/agent/reporting/reporting_events/architecture_component.rb', line 19 def vendor @vendor end |
Class Method Details
.build_database ⇒ Object
31 32 33 34 35 |
# File 'lib/contrast/agent/reporting/reporting_events/architecture_component.rb', line 31 def build_database msg = new msg.type = AC_TYPE_DB msg end |
Instance Method Details
#to_controlled_hash ⇒ Hash
Convert the instance variables on the class, and other information, into the identifiers required for TeamServer to process the JSON form of this message.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/contrast/agent/reporting/reporting_events/architecture_component.rb', line 43 def to_controlled_hash validate { remoteHost: remote_host, remotePort: remote_port, type: type, url: url, vendor: vendor } end |
#validate ⇒ Object
Ensure the required fields are present.
57 58 59 60 61 62 63 64 |
# File 'lib/contrast/agent/reporting/reporting_events/architecture_component.rb', line 57 def validate unless VALID_TYPES.include?(type) raise(ArgumentError, "#{ self } did not have a proper type - '#{ type }'. Unable to continue.") end raise(ArgumentError, "#{ self } did not have a proper URL. Unable to continue.") unless url nil end |