Module: AssMaintainer::InfoBase::ServerIb::EnterpriseServers::Support::ServerConnection Private
- Defined in:
- lib/ass_maintainer/info_base/server_ib/enterprise_servers/support.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Abstract server connection. Mixin for Cluster and AssMaintainer::InfoBase::ServerIb::EnterpriseServers::ServerAgent
Instance Attribute Summary collapse
-
#host ⇒ Object
private
Host name.
-
#password ⇒ String
private
Server user password See #initialize
passwordargument. -
#port ⇒ Object
private
TCP port.
-
#user ⇒ String
private
Server user name See #initialize
userargument.
Instance Method Summary collapse
- #default_port ⇒ Object private
- #eql?(other) ⇒ Boolean (also: #==) private
-
#host_port ⇒ String
private
String like a
host_name:port_number. - #initialize(host_port, user = nil, password = nil) ⇒ Object private
-
#ping? ⇒ Boolean
private
Return
trueif TCP port available on server. -
#tcp_ping ⇒ Net::Ping::TCP
private
Instance.
Instance Attribute Details
#host ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Host name
139 140 141 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/support.rb', line 139 def host @host end |
#password ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Server user password
See #initialize password argument.
136 137 138 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/support.rb', line 136 def password @password end |
#port ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
TCP port
142 143 144 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/support.rb', line 142 def port @port end |
#user ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Server user name
See #initialize user argument.
131 132 133 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/support.rb', line 131 def user @user end |
Instance Method Details
#default_port ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
176 177 178 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/support.rb', line 176 def default_port fail 'Abstract method' end |
#eql?(other) ⇒ Boolean Also known as: ==
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
191 192 193 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/support.rb', line 191 def eql?(other) host.upcase == other.host.upcase && port == other.port end |
#host_port ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
String like a host_name:port_number.
158 159 160 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/support.rb', line 158 def host_port "#{host}:#{port}" end |
#initialize(host_port, user = nil, password = nil) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
147 148 149 150 151 152 153 154 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/support.rb', line 147 def initialize(host_port, user = nil, password = nil) fail ArgumentError, 'Host name require' if host_port.to_s.empty? @raw_host_port = host_port @host = parse_host @port = parse_port || default_port @user = user @password = password end |
#ping? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return true if TCP port available on server
181 182 183 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/support.rb', line 181 def ping? tcp_ping.ping? end |
#tcp_ping ⇒ Net::Ping::TCP
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns instance.
187 188 189 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/support.rb', line 187 def tcp_ping @tcp_ping ||= Net::Ping::TCP.new(host, port) end |