Class: AssMaintainer::InfoBase::ServerIb::InfoBaseWrapper Private
- Inherits:
-
Object
- Object
- AssMaintainer::InfoBase::ServerIb::InfoBaseWrapper
- Defined in:
- lib/ass_maintainer/info_base/server_ib.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.
Wrapper for manipulate with real information base deployed in 1C:Enterprise server ower the 1C Ole classes
Instance Attribute Summary collapse
- #infobase ⇒ Object (also: #ib) private
Instance Method Summary collapse
-
#clusters ⇒ Array<EnterpriseServers::Cluster>
private
#infobase.clustersattached into #sagent. -
#drop_infobase!(mode) ⇒ Object
private
Dlete infobase.
- #exists? ⇒ Boolean private
-
#ib_ref ⇒ Object
private
Helper.
-
#initialize(infobase) ⇒ InfoBaseWrapper
constructor
private
A new instance of InfoBaseWrapper.
- #sagent ⇒ AssLauncher::Enterprise::Ole::AgentConnection private
-
#session_get(id) ⇒ Array<EnterpriseServers::Wrappers::Session>
private
Helper select session per
ID. -
#sessions ⇒ Array<EnterpriseServers::Wrappers::Session>
private
sessions.
- #terminate(session) ⇒ Object private
- #wp_connection ⇒ Object private
Constructor Details
#initialize(infobase) ⇒ InfoBaseWrapper
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 a new instance of InfoBaseWrapper.
201 202 203 |
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 201 def initialize(infobase) self.infobase = infobase end |
Instance Attribute Details
#infobase ⇒ Object Also known as: ib
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.
199 200 201 |
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 199 def infobase @infobase end |
Instance Method Details
#clusters ⇒ Array<EnterpriseServers::Cluster>
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.
#infobase.clusters attached into #sagent
246 247 248 249 250 251 |
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 246 def clusters fail_multiple_servers_not_support cs_clusters.select do |cl| cl.attach(sagent).infobase_include? ib_ref end end |
#drop_infobase!(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.
For first item calls EnterpriseServers::Cluster#drop_infobase!
with real mode and uses mode == :alive_db for all other.
Otherwise when mode == :destroy_db raises error
"Не найдена база данных * в SQL-сервере *"
Dlete infobase.
292 293 294 295 296 |
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 292 def drop_infobase!(mode) clusters.each_with_index do |cl, index| cl.drop_infobase!(self, (index == 0 ? mode : :alive_db)) end end |
#exists? ⇒ 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.
214 215 216 |
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 214 def exists? clusters.size > 0 end |
#ib_ref ⇒ 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.
Helper
259 260 261 |
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 259 def ib_ref ib.connection_string.ref end |
#sagent ⇒ AssLauncher::Enterprise::Ole::AgentConnection
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.
219 220 221 |
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 219 def sagent @sagent ||= sagent_get.connect(infobase.platform_require) end |
#session_get(id) ⇒ Array<EnterpriseServers::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.
Helper select session per ID. In normal returns arry with single
element or empty array
273 274 275 |
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 273 def session_get(id) sessions.select {|s| s.SessionId().to_s == id.to_s} end |
#sessions ⇒ Array<EnterpriseServers::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.
sessions
279 280 281 282 283 284 |
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 279 def sessions return [] unless exists? clusters.map do |cl| cl.infobase_sessions(ib_ref) end.flatten end |
#terminate(session) ⇒ 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.
264 265 266 267 268 |
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 264 def terminate(session) session_get(session.id).each do |s| s.terminate end end |
#wp_connection ⇒ 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.
253 254 255 256 |
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 253 def wp_connection fail 'Infobase not exists' unless exists? clusters[0].wp_connection(self) end |