Class: AssMaintainer::InfoBase::ServerIb::EnterpriseServers::Cluster Private
- Inherits:
-
Object
- Object
- AssMaintainer::InfoBase::ServerIb::EnterpriseServers::Cluster
- Defined in:
- lib/ass_maintainer/info_base/server_ib/enterprise_servers/cluster.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Object descrbed 1C cluster
Constant Summary collapse
- DEF_PORT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Deafult 1C:Enterprise cluster TCP port
'1541'
Instance Attribute Summary
Attributes included from Support::ServerConnection
#host, #password, #port, #user
Instance Method Summary collapse
- #alive_wprocess_get ⇒ Object private
-
#attach(agent) ⇒ Object
private
Attache cluster into server agent.
-
#authenticate ⇒ Object
private
Authenticate cluster user.
- #default_port ⇒ String private
-
#drop_infobase!(infobase_wrapper, mode) ⇒ Object
private
Delete infobase.
-
#infobase_sessions(ib_name) ⇒ nil Array<Wrappers::Session>
private
runned in cluster.
-
#infobases ⇒ Array<WIN32OLE>
private
registred in cluster.
-
#ole ⇒ Object
private
IClusterInfoole object. -
#sagent ⇒ ServerAgent
private
Which cluster attached.
-
#wp_connection(infobase_wrapper) ⇒ WpConnection
private
Connect to working process.
-
#wprocesses ⇒ Array<Wrappers::WorkingProcessInfo]
private
All Working processes in cluster.
Methods included from Support::InfoBaseFind
#infobase_find, #infobase_include?
Methods included from Support::SendToOle
Methods included from Support::ServerConnection
#eql?, #host_port, #initialize, #ping?, #tcp_ping
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class AssMaintainer::InfoBase::ServerIb::EnterpriseServers::Support::SendToOle
Instance Method Details
#alive_wprocess_get ⇒ 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.
96 97 98 99 100 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/cluster.rb', line 96 def alive_wprocess_get wp_info = wprocesses.select{|p| p.Running == 1 && p.ping?}[0] fail 'No alive working processes found' unless wp_info wp_info end |
#attach(agent) ⇒ 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.
Attache cluster into server agent
23 24 25 26 27 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/cluster.rb', line 23 def attach(agent) @sagent = agent unless @sagent ole_set authenticate end |
#authenticate ⇒ 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.
Authenticate cluster user
46 47 48 49 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/cluster.rb', line 46 def authenticate sagent.Authenticate(ole, user.to_s, password.to_s) self end |
#default_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.
Returns DEF_PORT.
16 17 18 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/cluster.rb', line 16 def default_port DEF_PORT end |
#drop_infobase!(infobase_wrapper, mode) ⇒ 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.
Delete infobase
106 107 108 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/cluster.rb', line 106 def drop_infobase!(infobase_wrapper, mode) wp_connection(infobase_wrapper).drop_infobase!(mode) end |
#infobase_sessions(ib_name) ⇒ nil Array<Wrappers::Session>
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.
runned in cluster. nil if infobase ib_name not registred in
cluster.
70 71 72 73 74 75 76 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/cluster.rb', line 70 def infobase_sessions(ib_name) ib = infobase_find(ib_name) return unless ib sagent.GetInfoBaseSessions(ole, ib).map do |s| Wrappers::Session.new(s, self) end end |
#infobases ⇒ Array<WIN32OLE>
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.
registred in cluster
61 62 63 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/cluster.rb', line 61 def infobases sagent.GetInfoBases(ole) end |
#ole ⇒ 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.
Returns IClusterInfo ole object.
38 39 40 41 42 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/cluster.rb', line 38 def ole fail ArgumentError, "Cluster `#{host_port}'"\ " not found on server `#{sagent.host_port}'" unless @ole @ole end |
#sagent ⇒ ServerAgent
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 which cluster attached.
31 32 33 34 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/cluster.rb', line 31 def sagent fail 'Cluster must be attachet to ServerAgent' unless @sagent @sagent end |
#wp_connection(infobase_wrapper) ⇒ WpConnection
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.
Connect to working process
89 90 91 92 93 94 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/cluster.rb', line 89 def wp_connection(infobase_wrapper) if !@wp_connection.nil? && !@wp_connection.ping? @wp_connection = nil end @wp_connection ||= alive_wprocess_get.connect(infobase_wrapper) end |
#wprocesses ⇒ Array<Wrappers::WorkingProcessInfo]
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.
All Working processes in cluster
80 81 82 83 84 |
# File 'lib/ass_maintainer/info_base/server_ib/enterprise_servers/cluster.rb', line 80 def wprocesses sagent.GetWorkingProcesses(ole).map do |wpi| Wrappers::WorkingProcessInfo.new(wpi, self) end end |