Module: AssMaintainer::InfoBase::ServerIb
- Defined in:
- lib/ass_maintainer/info_base/server_ib.rb,
lib/ass_maintainer/info_base/server_ib/enterprise_servers.rb,
lib/ass_maintainer/info_base/server_ib/enterprise_servers/cluster.rb,
lib/ass_maintainer/info_base/server_ib/enterprise_servers/support.rb,
lib/ass_maintainer/info_base/server_ib/enterprise_servers/server_agent.rb,
lib/ass_maintainer/info_base/server_ib/enterprise_servers/wp_connection.rb
Overview
Mixins for infobase deployed on 1C:Eneterprise server
Defined Under Namespace
Modules: EnterpriseServers Classes: InfoBaseWrapper, ServerBaseDestroyer, ServerBaseMaker
Instance Method Summary collapse
-
#exists? ⇒ Object
True if infobase exists.
-
#lock(from: Time.now, to: Time.now + 3600, message: '') ⇒ Object
Locking infobase if it possible.
-
#lock_schjobs ⇒ Object
Lock schedule jobs.
-
#locked? ⇒ Object
Return
trueif on server flagSessionsDenied == true. -
#sessions ⇒ Array <InfoBase::Session>
Returns array of infobase sessions exclude AssMaintainer::InfoBase::Session::EXCLUDE_APP_IDS application types.
-
#unlock ⇒ Object
Soft unlocking infobase if it possible.
-
#unlock! ⇒ Object
Force unlock infobase.
-
#unlock_schjobs ⇒ Object
Unlock schedule jobs.
Instance Method Details
#exists? ⇒ Object
True if infobase exists
190 191 192 |
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 190 def exists? infobase_wrapper.exists? end |
#lock(from: Time.now, to: Time.now + 3600, message: '') ⇒ Object
It must work for AssMaintainer::InfoBase::ServerIb only. For FileIb it must do nothing
Locking infobase if it possible. Be careful it terminate all
sessions! Before do it should set InfoBase#unlock_code!
Schedule jobs will be locked to!
147 148 149 150 151 152 153 154 155 156 |
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 147 def lock(from: Time.now, to: Time.now + 3600, message: '') fail LockError, '#unlock_code is required' if unlock_code.to_s.empty? unlock wp_connection.lock_sessions!(from, to, unlock_code, ) lock_schjobs sessions.each do |sess| sess.terminate end nil end |
#lock_schjobs ⇒ Object
It must work for AssMaintainer::InfoBase::ServerIb only. For FileIb it must do nothing
Lock schedule jobs
173 174 175 176 |
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 173 def lock_schjobs wp_connection.lock_schjobs! nil end |
#locked? ⇒ Object
For FileIb it must always return false
It work for AssMaintainer::InfoBase::ServerIb only.
Return true if on server flag SessionsDenied == true
185 186 187 |
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 185 def locked? wp_connection.locked? end |
#sessions ⇒ Array <InfoBase::Session>
For FileIb must returns empty array
Returns array of infobase sessions exclude AssMaintainer::InfoBase::Session::EXCLUDE_APP_IDS application types
140 141 142 143 144 |
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 140 def sessions infobase_wrapper.sessions.map do |s| s.to_session(self) unless Session::EXCLUDE_APP_IDS.include? s.AppId end.compact end |
#unlock ⇒ Object
It must work for AssMaintainer::InfoBase::ServerIb only. For FileIb it must do nothing
Soft unlocking infobase if it possible. For force unlocking exec ##unlock!
159 160 161 162 163 |
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 159 def unlock wp_connection.raise_unless_unlock_possable UnlockError, unlock_code unlock! nil end |
#unlock! ⇒ Object
It must work for AssMaintainer::InfoBase::ServerIb only. For FileIb it must do nothing
Force unlock infobase.
166 167 168 169 170 |
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 166 def unlock! wp_connection.unlock_schjobs! wp_connection.unlock_sessions! nil end |
#unlock_schjobs ⇒ Object
It must work for AssMaintainer::InfoBase::ServerIb only. For FileIb it must do nothing
Unlock schedule jobs
179 180 181 182 |
# File 'lib/ass_maintainer/info_base/server_ib.rb', line 179 def unlock_schjobs wp_connection.unlock_schjobs! nil end |