Class: Puppet_X::Coi::Jboss::Provider::Datasource::PostWildFlyProvider
- Inherits:
-
Object
- Object
- Puppet_X::Coi::Jboss::Provider::Datasource::PostWildFlyProvider
- Defined in:
- lib/puppet_x/coi/jboss/provider/datasource/post_wildfly_provider.rb
Overview
A class for JBoss post WildFly datasource provider
Instance Method Summary collapse
-
#initialize(provider) ⇒ PostWildFlyProvider
constructor
Standard constructor.
-
#jta ⇒ String|String
Method that return true if we need xa r else returns value of jta attribute.
-
#jta=(value) ⇒ Object
Method that sets value of jta.
-
#jta_opt(cmd) ⇒ String
Method that adds jta options to command.
-
#xa_datasource_properties_wrapper(parameters) ⇒ String
Method that wraps given parameter in curly braces.
Constructor Details
#initialize(provider) ⇒ PostWildFlyProvider
Standard constructor
5 6 7 |
# File 'lib/puppet_x/coi/jboss/provider/datasource/post_wildfly_provider.rb', line 5 def initialize(provider) @provider = provider end |
Instance Method Details
#jta ⇒ String|String
Method that return true if we need xa r else returns value of jta attribute
18 19 20 21 22 23 24 |
# File 'lib/puppet_x/coi/jboss/provider/datasource/post_wildfly_provider.rb', line 18 def jta if @provider.xa? true.to_s else @provider.getattrib('jta').to_s end end |
#jta=(value) ⇒ Object
Method that sets value of jta
28 29 30 31 |
# File 'lib/puppet_x/coi/jboss/provider/datasource/post_wildfly_provider.rb', line 28 def jta= value Puppet.warning 'JTA does not make sense in XA Datasource as distributed transaction is being used' if @provider.xa? @provider.setattrib('jta', value.to_s) unless @provider.xa? end |
#jta_opt(cmd) ⇒ String
Method that adds jta options to command
36 37 38 |
# File 'lib/puppet_x/coi/jboss/provider/datasource/post_wildfly_provider.rb', line 36 def jta_opt(cmd) cmd.push "--jta=#{@provider.resource[:jta].inspect}" unless @provider.xa? end |
#xa_datasource_properties_wrapper(parameters) ⇒ String
Method that wraps given parameter in curly braces
12 13 14 |
# File 'lib/puppet_x/coi/jboss/provider/datasource/post_wildfly_provider.rb', line 12 def xa_datasource_properties_wrapper(parameters) "{#{parameters}}" end |