<commit_before>jbclipy
=======

#Description
Automation and simplification scripting for managing JBoss AS7/EAP6 instances

#Examples
This section has some basic examples

##Profile Transforms
It is easier to slim a profile versus adding new subsystems.

###standalone-full-ha.xml to standalone.xml

This example slims the standalone-full-ha.xml to standalone.xml. Simply start your JBoss instance using the standalone-full-ha.xml profile (MAKE SURE TO BACK UP THIS FILE FIRST) then run the following script

    import os
    if 'JBOSS_HOME' not in os.environ:
	    print "Environment Variable: JBOSS_HOME must be defined"
        exit(-1)


    import jbclipy

    # Create a JBMod instance
    jbcli = jbclipy.JBCliPy()

    # Build a solution
    # This particular solution slims standalone-full-ha.xml to standalone.xml
    jbcli.remove_clustering()
    jbcli.remove_messaging()
    jbcli.remove_cmp()
    jbcli.remove_jacorb()
    jbcli.remove_jaxr()
    jbcli.remove_jsr77()
    jbcli.add_console_handler('CONSOLE')
    jbcli.add_handler_to_root_logger('CONSOLE')

    # Print the execution string for reference
    jbcli.print_execution()

    # Execute the commands
    jbcli.execute()
<commit_msg>Update the README to add datasources example<commit_after>jbclipy
=======

##Description
Automation and simplification scripting for managing JBoss AS7/EAP6 instances

##Examples
This section has some basic examples

###Datasource Management
Datasources are easy to manage.

    import os
    if 'JBOSS_HOME' not in os.environ:
	    print "Environment Variable: JBOSS_HOME must be defined"
        exit(-1)

    import jbclipy

    jbcli = jbclipy.JBCliPy()

    #Remove the hypersonic database and driver
    jbcli.remove_h2()

    #Add a driver (ironically the hypersonic one back)
    jbcli.add_jdbc_driver('h2','com.h2database.h2','org.h2.jdbcx.JdbcDataSource')

    #Add a datasource (again, ironically the hypersonic one back)
    jbcli.add_datasource('ExampleDS','java:jboss/datasources/ExampleDS','jdbc:h2:mem:test','h2','sa','sa')

    #Enable the datasource
    jbcli.enable_datasource('ExampleDS')

    #Test the datasource connection
    jbcli.test_datasource('ExampleDS')

    #Print execution string for veification
    jbcli.print_execution()

    #Execute the commands
    jbcli.execute()


###Profile Transforms
It is easier to slim a profile versus adding new subsystems.

####standalone-full-ha.xml to standalone.xml

This example slims the standalone-full-ha.xml to standalone.xml. Simply start your JBoss instance using the standalone-full-ha.xml profile (MAKE SURE TO BACK UP THIS FILE FIRST) then run the following script

    import os
    if 'JBOSS_HOME' not in os.environ:
	    print "Environment Variable: JBOSS_HOME must be defined"
        exit(-1)


    import jbclipy

    # Create a JBMod instance
    jbcli = jbclipy.JBCliPy()

    # Build a solution
    # This particular solution slims standalone-full-ha.xml to standalone.xml
    jbcli.remove_clustering()
    jbcli.remove_messaging()
    jbcli.remove_cmp()
    jbcli.remove_jacorb()
    jbcli.remove_jaxr()
    jbcli.remove_jsr77()
    jbcli.add_console_handler('CONSOLE')
    jbcli.add_handler_to_root_logger('CONSOLE')

    # Print the execution string for reference
    jbcli.print_execution()

    # Execute the commands
    jbcli.execute()

{'fraction_non_alphanumeric': 0.08235998802036539, 'fraction_numerical': 0.005390835579514825, 'mean_word_length': 3.757834757834758, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6282324', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1011, 'n_words': 307}