Class: Puppet_X::Coi::Jboss::Internal::LogicCreator

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet_x/coi/jboss/internal/logic_creator.rb

Overview

Class that will decide what cammands should be send to cli to set up security domain

Instance Method Summary collapse

Constructor Details

#initialize(auditor, resource, provider, compilator) ⇒ LogicCreator

securitydomain configuration we need to use diffrent paths to setup securitydomain

Parameters:

  • state (Puppet_X::Coi::Jboss::Internal::JbossSecurityDomainState)

    current state of

  • provider (Puppet_X::Coi::Jboss::Provider::SecurityDomain::Provider)

    that indicates if



7
8
9
10
11
12
# File 'lib/puppet_x/coi/jboss/internal/logic_creator.rb', line 7

def initialize(auditor, resource, provider, compilator)
  @auditor = auditor
  @resource = resource
  @provider = provider
  @compilator = compilator
end

Instance Method Details

#decideHash

Method that will return list of commands based on current state be displayed and value is command

Parameters:

Returns:

  • (Hash)

    commands Hash with commands that will be executed, key is message that will



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/puppet_x/coi/jboss/internal/logic_creator.rb', line 18

def decide
  state = @auditor.fetch_securtydomain_state
  commands = []
  unless state.cache_default?
    command = @compilator.compile(@resource[:runasdomain],
                                  @resource[:profile], "/subsystem=security/security-domain=#{@resource[:name]}:add(cache-type=default)")

    commands.push(['Security Domain Cache Type', command])
  end
  provided_commands = @provider.get_commands(state, @resource)
  provided_commands = [] if provided_commands.nil?
  commands + provided_commands
end