Class: AssMaintainer::InfoBase::ServerIb::InfoBaseWrapper Private

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#infobaseObject 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

#clustersArray<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

Returns:

Raises:

  • (RuntimeError)

    unsupport multiple servers infobase deployments



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.

Note:

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.

Returns:

  • (Boolean)


214
215
216
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 214

def exists?
  clusters.size > 0
end

#ib_refObject

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

#sagentAssLauncher::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.

Returns:

  • (AssLauncher::Enterprise::Ole::AgentConnection)


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

#sessionsArray<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

Returns:



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.

Parameters:



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_connectionObject

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