1 Example: Reset Axional Studio users cache

Copy
<xsql-script name='ws_nodes_clear_cache'>
	<body>	      
        <set name='m_connection'>
            <java.jmx.JMXConnector host='my_ip4' port='8006' />
        </set>	
	
	    <!-- The cleaning cache operation of webStudio is executed. -->
	    <java.jmx.MBeanServer.invoke object='deister.axional.studio.boot.mbean:type=StudioCache' method='clear'>
	        <connection>
	            <java.jmx.JMXConnector.getMBeanServerConnection>
	                <m_connection />
	            </java.jmx.JMXConnector.getMBeanServerConnection>
	        </connection>
	    </java.jmx.MBeanServer.invoke>
	
	    <!-- A garbage collector of the JVM is executed -->
	    <java.jmx.MBeanServer.invoke object='java.lang:type=Memory' method='gc'>
	        <connection>
	            <java.jmx.JMXConnector.getMBeanServerConnection>
	                <m_connection />
	            </java.jmx.JMXConnector.getMBeanServerConnection>
	        </connection>
	    </java.jmx.MBeanServer.invoke>
	</body>
</xsql-script>

This chapter shows the functions which provides Axional Studio for the use and the keystore management. The following example uses all the available functions in this package, for that reason, examples of particular form for each of the functions are not indicated.

Copy
<xsql-script name='keystore_sample'>
    <body>

        <!-- ================================================================== -->
        <!-- KeyStore                                                           -->
        <!-- ================================================================== -->

        <!-- instance and load a keystore -->
        <set name='ks'>
            <java.security.KeyStore.load
                password='changeit'
                >
                <java.security.KeyStore.getInstance type='jks' />
                <file type='absolute' name='keystore.ks' />
            </java.security.KeyStore.load>
        </set>

        <!-- get list of aliases contained in loaded keystore -->
        <iterator name='a'>
            <in>
                <java.security.KeyStore.aliases>
                    <ks />
                </java.security.KeyStore.aliases>
            </in>
            <do>
                <println><a/></println>

                <println/>
                <print>    Creation date: </print>
                <println><java.security.KeyStore.getCreationDate name='#a'>
                        <ks />
                    </java.security.KeyStore.getCreationDate>
                </println>

                <println>
                    <if>
                        <expr>
                            <java.security.KeyStore.isKeyEntry name='#a'>
                                <ks />
                            </java.security.KeyStore.isKeyEntry>
                        </expr>
                        <then>
                            <java.security.KeyStore.getKey name='#a' password='mykeypass'>
                                <ks />
                            </java.security.KeyStore.getKey>
                        </then>
                        <else>
                            <if>
                                <expr>
                                    <java.security.KeyStore.isCertificateEntry name='#a'>
                                        <ks />
                                    </java.security.KeyStore.isCertificateEntry>
                                </expr>
                                <then>
                                    <java.security.KeyStore.getCertificate name='#a'>
                                        <ks />
                                    </java.security.KeyStore.getCertificate>
                                </then>
                            </if>
                        </else>
                    </if>
                </println>
            </do>
        </iterator>

        <!-- ================================================================== -->
        <!-- Provider                                                           -->
        <!-- ================================================================== -->

        <println/>
        <println>********</println>
        <println>PROVIDER</println>
        <println>********</println>

        <set name='prov'>
            <java.security.KeyStore.getProvider>
                <ks />
            </java.security.KeyStore.getProvider>
        </set>

        <print>    Name: </print>
        <println><java.security.Provider.getName>
                <prov />
            </java.security.Provider.getName>
        </println>

        <print>    Info: </print>
        <println><java.security.Provider.getName>
                <prov />
            </java.security.Provider.getName>
        </println>

        <print>    Version: </print>
        <println><java.security.Provider.getVersion>
                <prov />
            </java.security.Provider.getVersion>
        </println>

        <!-- get list content entries in provider -->
        <iterator name='it_key'>
            <in>
                <java.security.Provider.keySet>
                    <prov />
                </java.security.Provider.keySet>
            </in>
            <do>
                <print><it_key/>: </print>

                <println><java.security.Provider.get key='#it_key'>
                        <prov />
                    </java.security.Provider.get>
                </println>
            </do>
        </iterator>

    </body>
</xsql-script>