Class: MPI::Messages::FindProfileByIdentifier
- Inherits:
-
Object
- Object
- MPI::Messages::FindProfileByIdentifier
- Defined in:
- lib/mpi/messages/find_profile_by_identifier.rb
Instance Attribute Summary collapse
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#identifier_type ⇒ Object
readonly
Returns the value of attribute identifier_type.
-
#search_type ⇒ Object
readonly
Returns the value of attribute search_type.
Instance Method Summary collapse
- #build_body ⇒ Object private
- #build_parameter_list ⇒ Object private
- #correlation_identifier ⇒ Object private
-
#initialize(identifier:, identifier_type:, search_type: Constants::CORRELATION_WITH_RELATIONSHIP_DATA) ⇒ FindProfileByIdentifier
constructor
A new instance of FindProfileByIdentifier.
- #perform ⇒ Object
- #query_by_parameter ⇒ Object private
- #root ⇒ Object private
- #validate_types ⇒ Object private
Constructor Details
#initialize(identifier:, identifier_type:, search_type: Constants::CORRELATION_WITH_RELATIONSHIP_DATA) ⇒ FindProfileByIdentifier
Returns a new instance of FindProfileByIdentifier.
12 13 14 15 16 |
# File 'lib/mpi/messages/find_profile_by_identifier.rb', line 12 def initialize(identifier:, identifier_type:, search_type: Constants::CORRELATION_WITH_RELATIONSHIP_DATA) @identifier = identifier @identifier_type = identifier_type @search_type = search_type end |
Instance Attribute Details
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
10 11 12 |
# File 'lib/mpi/messages/find_profile_by_identifier.rb', line 10 def identifier @identifier end |
#identifier_type ⇒ Object (readonly)
Returns the value of attribute identifier_type.
10 11 12 |
# File 'lib/mpi/messages/find_profile_by_identifier.rb', line 10 def identifier_type @identifier_type end |
#search_type ⇒ Object (readonly)
Returns the value of attribute search_type.
10 11 12 |
# File 'lib/mpi/messages/find_profile_by_identifier.rb', line 10 def search_type @search_type end |
Instance Method Details
#build_body ⇒ Object (private)
47 48 49 50 51 52 |
# File 'lib/mpi/messages/find_profile_by_identifier.rb', line 47 def build_body body = RequestHelper.build_control_act_process_element body << RequestHelper.build_code(code: Constants::FIND_PROFILE_CONTROL_ACT_PROCESS) body << query_by_parameter body end |
#build_parameter_list ⇒ Object (private)
59 60 61 62 |
# File 'lib/mpi/messages/find_profile_by_identifier.rb', line 59 def build_parameter_list el = RequestHelper.build_parameter_list_element el << RequestHelper.build_identifier(identifier: correlation_identifier, root:) end |
#correlation_identifier ⇒ Object (private)
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/mpi/messages/find_profile_by_identifier.rb', line 34 def correlation_identifier case identifier_type when Constants::ICN identifier when Constants::IDME_UUID "#{identifier}^#{Constants::IDME_FULL_IDENTIFIER}" when Constants::LOGINGOV_UUID "#{identifier}^#{Constants::LOGINGOV_FULL_IDENTIFIER}" when Constants::MHV_UUID "#{identifier}^#{Constants::MHV_FULL_IDENTIFIER}" end end |
#perform ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/mpi/messages/find_profile_by_identifier.rb', line 18 def perform validate_types Messages::RequestBuilder.new(extension: Constants::FIND_PROFILE, body: build_body).perform rescue => e Rails.logger.error "[FindProfileByIdentifier] Failed to build request: #{e.}" raise e end |
#query_by_parameter ⇒ Object (private)
54 55 56 57 |
# File 'lib/mpi/messages/find_profile_by_identifier.rb', line 54 def query_by_parameter query_by_parameter = RequestHelper.build_query_by_parameter(search_type:) query_by_parameter << build_parameter_list end |
#root ⇒ Object (private)
64 65 66 |
# File 'lib/mpi/messages/find_profile_by_identifier.rb', line 64 def root Constants::VA_ROOT_OID end |
#validate_types ⇒ Object (private)
28 29 30 31 32 |
# File 'lib/mpi/messages/find_profile_by_identifier.rb', line 28 def validate_types unless Constants::QUERY_IDENTIFIERS.include?(identifier_type) raise Errors::ArgumentError, "Identifier type is not supported, identifier_type=#{identifier_type}" end end |