What is Security?

Security is about protecting your assets. These assets could be anything in company. In software these assets represent your web resources or website (Web Security), Software application (Application Security), Data (Data Security), Web service (Web service Security) or Network (Network Security).
Security relies on following security properties.
1. Authentication – Authentication is process to verify the identity of visitor to your application or Website. Typically this authentication process is based on visitor’s username and password.

2. Authorization – Authorization is a process to define user access or privilege to resources or system to use. Authorization is user privilege in which they are eligible to access system or resources (e.g. Hours of Access, Access of file or directory, access of resources in website…etc.).

3. Auditing – Auditing is a process of systematic evaluation of the security vulnerability or security weakness of company’s resources or system. Security Audit is typically conducted for the purpose of business risk assessment, Information security and regulatory compliance (e.g. PCI, HIPAA… etc.).

Last three properties of security called CIA of a system. They are very important to implement any security compliances. They are goal for security implementation.

4. Confidentiality – Confidentiality is a process to keep information or resources secret from unauthorized access. Confidentiality is governed by Local/National Legislation or compliances and Provider Policies.

5. Integrity – Integrity in security refers to reliable and protecting information/resources from being tampered or change. Integrity includes Authenticity and Non-repudiation/Accountability.

6. Availability – Information/Resources available to authorize users and application when they need. Information only has value if right user/application can access it at right time.

JBoss Messaging Configuration

1.     Introduction

JBoss Messaging is a high performance JMS provider in the JBoss Enterprise Middleware Stack (JEMS). JBoss Messaging is the default JMS provider in JBoss AS 5.x and later.

2.     Features 

  • A fully compatible and Sun certified JMS 1.1 implementation.
  • A strong focus on performance, reliability and scalability with high output and low latency.
  • Publish-subscribe and point-to-point messaging models.
  • Topics that feed multiple message queues
  • Persistent and non-persistent messages
  • Guaranteed message delivery that ensures that messages arrive once and only once
  • Transactional and reliable – supporting ACID semantics
  • Customizable security framework based on JAAS

3.     JBoss-JMS Configuration

3.1.Configuration-Queue

  • Create queue-destination-service.xml file in \deploy\messaging folder for jboss 5.x
  • Here is sample xml file

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <server>
  3. <mbean code="org.jboss.jms.server.destination.QueueService" name="jboss.messaging.destination:service=Queue,name=testQueue" xmbean-dd="xmdesc/Queue-xmbean.xml">
  4. <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
  5. <depends>jboss.messaging:service=PostOffice</depends>
  6. <attribute name="SecurityConfig">
  7. <security>
  8. <role name="guest" read="true" write="true"/>
  9. <role name="publisher" read="true" write="true" create="false"/>
  10. <role name="noacc" read="false" write="false" create="false"/>
  11. </security>
  12. </attribute>
  13. </mbean>
  14. </server>
  • Restart Jboss server

3.2.Configuration-Topic

  • Create topic-destination-service.xml file in \deploy\messaging folder for jboss 5.x
  • Here is sample xml file

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <server>
  3. <mbean code="org.jboss.jms.server.destination. TopicService" name="jboss.messaging.destination:service=Topic,name= testTopic" xmbean-dd="xmdesc/Queue-xmbean.xml">
  4. <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
  5. <depends>jboss.messaging:service=PostOffice</depends>
  6. <attribute name="SecurityConfig">
  7. <security>
  8. <role name="guest" read="true" write="true"/>
  9. <role name="publisher" read="true" write="true" create="false"/>
  10. <role name="noacc" read="false" write="false" create="false"/>
  11. </security>
  12. </attribute>
  13. </mbean>
  14. </server>
  • Restart Jboss server

4.     JBoss-Oracle configuration for JMS

Create these tables in Oracle database


  1. CREATE TABLE JBM_DUAL (DUMMY INTEGER, PRIMARY KEY (DUMMY))
  2. CREATE TABLE JBM_MSG_REF (MESSAGE_ID INTEGER, CHANNEL_ID INTEGER, TRANSACTION_ID INTEGER, STATE CHAR(1), ORD INTEGER, PAGE_ORD INTEGER, DELIVERY_COUNT INTEGER, SCHED_DELIVERY INTEGER, PRIMARY KEY(MESSAGE_ID, CHANNEL_ID))
  3. CREATE INDEX JBM_MSG_REF_TX ON JBM_MSG_REF (TRANSACTION_ID, STATE)
  4. CREATE TABLE JBM_MSG (MESSAGE_ID INTEGER, RELIABLE CHAR(1), EXPIRATION INTEGER, TIMESTAMP INTEGER, PRIORITY INTEGER, TYPE INTEGER, HEADERS BLOB, PAYLOAD BLOB, PRIMARY KEY (MESSAGE_ID))
  5. CREATE TABLE JBM_TX (NODE_ID INTEGER, TRANSACTION_ID INTEGER, BRANCH_QUAL RAW(254), FORMAT_ID INTEGER, GLOBAL_TXID RAW(254), PRIMARY KEY (TRANSACTION_ID))
  6. CREATE TABLE JBM_COUNTER (NAME VARCHAR2(255), NEXT_ID INTEGER, PRIMARY KEY(NAME))
  7. CREATE TABLE JBM_ID_CACHE (NODE_ID INTEGER, CNTR INTEGER, JBM_ID VARCHAR2(255), PRIMARY KEY(NODE_ID, CNTR))
  8. CREATE TABLE JBM_POSTOFFICE (POSTOFFICE_NAME VARCHAR2(255), NODE_ID INTEGER, QUEUE_NAME VARCHAR2(255), COND VARCHAR2(1023), SELECTOR VARCHAR2(1023), CHANNEL_ID INTEGER, CLUSTERED CHAR(1), ALL_NODES CHAR(1), PRIMARY KEY(POSTOFFICE_NAME, NODE_ID, QUEUE_NAME))
  9. CREATE TABLE JBM_USER (USER_ID VARCHAR2(32) NOT NULL, PASSWD VARCHAR2(32) NOT NULL, CLIENTID VARCHAR2(128), PRIMARY KEY(USER_ID))
  10. CREATE TABLE JBM_ROLE (ROLE_ID VARCHAR2(32) NOT NULL, USER_ID VARCHAR2(32) NOT NULL, PRIMARY KEY(USER_ID, ROLE_ID))

In order to enable support for one of these databases, just replace the default hsqldb-persistence-service.xml configuration file with the Oracle database-specific configuration file in \deploy\messaging folder.

Here is oracle specific persistence file.

oracle-persistence-service.xml


  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Oracle persistence deployment descriptor.
  4. Tested with Oracle 10.2.0.1
  5. $Id$
  6. -->
  7. <server>
  8. <!-- Persistence Manager MBean configuration======================================== -->
  9. <mbean code="org.jboss.messaging.core.jmx.JDBCPersistenceManagerService" name="jboss.messaging:service=PersistenceManager" xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml">
  10. <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
  11. <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
  12. <!-- The datasource to use for the persistence manager -->
  13. <attribute name="DataSource">java:/DefaultDS</attribute>
  14. <!-- If true will attempt to create tables and indexes on every start-up -->
  15. <attribute name="CreateTablesOnStartup">true</attribute>
  16. <!-- If true then we will automatically detect and reject duplicate messages sent during failover -->
  17. <attribute name="DetectDuplicates">true</attribute>
  18. <!-- The size of the id cache to use when detecting duplicate messages -->
  19. <attribute name="IDCacheSize">500</attribute>
  20. <!-- Some databases don't support inserting blobs using INSERT INTO ... SELECT FROM -->
  21. <attribute name="SupportsBlobOnSelect">false</attribute>
  22. <attribute name="SqlProperties"><![CDATA[
  23. CREATE_DUAL=CREATE TABLE JBM_DUAL (DUMMY INTEGER, PRIMARY KEY (DUMMY))
  24. CREATE_MESSAGE_REFERENCE=CREATE TABLE JBM_MSG_REF (MESSAGE_ID INTEGER, CHANNEL_ID INTEGER, TRANSACTION_ID INTEGER, STATE CHAR(1), ORD INTEGER, PAGE_ORD INTEGER, DELIVERY_COUNT INTEGER, SCHED_DELIVERY INTEGER, PRIMARY KEY(MESSAGE_ID, CHANNEL_ID))
  25. CREATE_IDX_MESSAGE_REF_TX=CREATE INDEX JBM_MSG_REF_TX ON JBM_MSG_REF (TRANSACTION_ID, STATE)
  26. CREATE_MESSAGE=CREATE TABLE JBM_MSG (MESSAGE_ID INTEGER, RELIABLE CHAR(1), EXPIRATION INTEGER, TIMESTAMP INTEGER, PRIORITY INTEGER, TYPE INTEGER, HEADERS BLOB, PAYLOAD BLOB, PRIMARY KEY (MESSAGE_ID))
  27. CREATE_TRANSACTION=CREATE TABLE JBM_TX (NODE_ID INTEGER, TRANSACTION_ID INTEGER, BRANCH_QUAL RAW(254), FORMAT_ID INTEGER, GLOBAL_TXID RAW(254), PRIMARY KEY (TRANSACTION_ID))
  28. CREATE_COUNTER=CREATE TABLE JBM_COUNTER (NAME VARCHAR2(255), NEXT_ID INTEGER, PRIMARY KEY(NAME))
  29. CREATE_ID_CACHE=CREATE TABLE JBM_ID_CACHE (NODE_ID INTEGER, CNTR INTEGER, JBM_ID VARCHAR2(255), PRIMARY KEY(NODE_ID, CNTR))
  30. INSERT_DUAL=INSERT INTO JBM_DUAL VALUES (1)
  31. CHECK_DUAL=SELECT 1 FROM JBM_DUAL
  32. INSERT_MESSAGE_REF=INSERT INTO JBM_MSG_REF (CHANNEL_ID, MESSAGE_ID, TRANSACTION_ID, STATE, ORD, PAGE_ORD, DELIVERY_COUNT, SCHED_DELIVERY) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
  33. DELETE_MESSAGE_REF=DELETE FROM JBM_MSG_REF WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
  34. UPDATE_MESSAGE_REF=UPDATE JBM_MSG_REF SET TRANSACTION_ID=?, STATE='-' WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
  35. UPDATE_PAGE_ORDER=UPDATE JBM_MSG_REF SET PAGE_ORD = ? WHERE MESSAGE_ID=? AND CHANNEL_ID=?
  36. COMMIT_MESSAGE_REF1=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='+'
  37. COMMIT_MESSAGE_REF2=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='-'
  38. ROLLBACK_MESSAGE_REF1=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='+'
  39. ROLLBACK_MESSAGE_REF2=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='-'
  40. LOAD_PAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, PAGE_ORD, SCHED_DELIVERY FROM JBM_MSG_REF WHERE CHANNEL_ID = ? AND PAGE_ORD BETWEEN ? AND ? ORDER BY PAGE_ORD
  41. LOAD_UNPAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY, PAGE_ORD FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? ORDER BY ORD
  42. LOAD_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? ORDER BY ORD
  43. UPDATE_REFS_NOT_PAGED=UPDATE JBM_MSG_REF SET PAGE_ORD = NULL WHERE PAGE_ORD BETWEEN ? AND ? AND CHANNEL_ID=?
  44. SELECT_MIN_MAX_PAGE_ORD=SELECT MIN(PAGE_ORD), MAX(PAGE_ORD) FROM JBM_MSG_REF WHERE CHANNEL_ID = ?
  45. UPDATE_DELIVERY_COUNT=UPDATE JBM_MSG_REF SET DELIVERY_COUNT = ? WHERE MESSAGE_ID = ? AND CHANNEL_ID = ?/li>
  46. UPDATE_CHANNEL_ID=UPDATE JBM_MSG_REF SET CHANNEL_ID = ? WHERE CHANNEL_ID = ?
  47. MOVE_REFERENCE=UPDATE JBM_MSG_REF SET CHANNEL_ID = ? WHERE MESSAGE_ID = ? AND CHANNEL_ID = ?
  48. LOAD_MESSAGES=SELECT MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, HEADERS, PAYLOAD, TYPE FROM JBM_MSG
  49. INSERT_MESSAGE=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, HEADERS, PAYLOAD) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
  50. INSERT_MESSAGE_CONDITIONAL=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE) SELECT ?, ?, ?, ?, ?, ? FROM JBM_DUAL WHERE NOT EXISTS (SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ?)
  51. UPDATE_MESSAGE_4CONDITIONAL=UPDATE JBM_MSG SET HEADERS=?, PAYLOAD=? WHERE MESSAGE_ID=?
  52. INSERT_MESSAGE_CONDITIONAL_FULL=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, TYPE, HEADERS, PAYLOAD) SELECT ?, ?, ?, ?, ?, ?, ?, ? FROM JBM_DUAL WHERE NOT EXISTS (SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ?)
  53. MESSAGE_ID_COLUMN=MESSAGE_ID
  54. DELETE_MESSAGE=DELETE FROM JBM_MSG WHERE MESSAGE_ID = ? AND NOT EXISTS (SELECT JBM_MSG_REF.MESSAGE_ID FROM JBM_MSG_REF WHERE JBM_MSG_REF.MESSAGE_ID = ?)
  55. INSERT_TRANSACTION=INSERT INTO JBM_TX (NODE_ID, TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID) VALUES(?, ?, ?, ?, ?)
  56. DELETE_TRANSACTION=DELETE FROM JBM_TX WHERE NODE_ID = ? AND TRANSACTION_ID = ?
  57. SELECT_PREPARED_TRANSACTIONS=SELECT TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID FROM JBM_TX WHERE NODE_ID = ?
  58. SELECT_MESSAGE_ID_FOR_REF=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '+' ORDER BY ORD
  59. SELECT_MESSAGE_ID_FOR_ACK=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '-' ORDER BY ORD
  60. UPDATE_COUNTER=UPDATE JBM_COUNTER SET NEXT_ID = ? WHERE NAME=?
  61. SELECT_COUNTER=SELECT NEXT_ID FROM JBM_COUNTER WHERE NAME=? FOR UPDATE
  62. INSERT_COUNTER=INSERT INTO JBM_COUNTER (NAME, NEXT_ID) VALUES (?, ?)
  63. SELECT_ALL_CHANNELS=SELECT DISTINCT(CHANNEL_ID) FROM JBM_MSG_REF
  64. UPDATE_TX=UPDATE JBM_TX SET NODE_ID=? WHERE NODE_ID=?
  65. UPDATE_ID_IN_CACHE=UPDATE JBM_ID_CACHE SET JBM_ID = ? WHERE NODE_ID = ? AND CNTR = ?
  66. INSERT_ID_IN_CACHE=INSERT INTO JBM_ID_CACHE (NODE_ID, CNTR, JBM_ID) VALUES (?, ?, ?)
  67. LOAD_ID_CACHE=SELECT CNTR, JBM_ID FROM JBM_ID_CACHE WHERE NODE_ID = ?
  68. ]]></attribute>
  69. <!-- The maximum number of parameters to include in a prepared statement -->
  70. <attribute name="MaxParams">500</attribute>
  71. </mbean>
  72. <!-- Messaging Post Office MBean configuration========================================= -->
  73. <mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService" name="jboss.messaging:service=PostOffice" xmbean-dd="xmdesc/MessagingPostOffice-xmbean.xml">
  74. <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
  75. <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
  76. <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
  77. <!-- The name of the post office -->
  78. <attribute name="PostOfficeName">JMS post office</attribute>
  79. <!-- The datasource used by the post office to access it's binding information -->
  80. <attribute name="DataSource">java:/DefaultDS</attribute>
  81. <!-- If true will attempt to create tables and indexes on every start-up -->
  82. <attribute name="CreateTablesOnStartup">true</attribute>
  83. <attribute name="SqlProperties"><![CDATA[
  84. CREATE_POSTOFFICE_TABLE=CREATE TABLE JBM_POSTOFFICE (POSTOFFICE_NAME VARCHAR2(255), NODE_ID INTEGER, QUEUE_NAME VARCHAR2(255), COND VARCHAR2(1023), SELECTOR VARCHAR2(1023), CHANNEL_ID INTEGER, CLUSTERED CHAR(1), ALL_NODES CHAR(1), PRIMARY KEY(POSTOFFICE_NAME, NODE_ID, QUEUE_NAME))
  85. INSERT_BINDING=INSERT INTO JBM_POSTOFFICE (POSTOFFICE_NAME, NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED, ALL_NODES) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
  86. DELETE_BINDING=DELETE FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=? AND QUEUE_NAME=?
  87. LOAD_BINDINGS=SELECT QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED, ALL_NODES FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=?
  88. ]]></attribute>
  89. <!-- This post office is non clustered. If you want a clustered post office then set to true -->
  90. <attribute name="Clustered">false</attribute>
  91. <!-- All the remaining properties only have to be specified if the post office is clustered.You can safely comment them out if your post office is non clustered -->
  92. <!-- The JGroups group name that the post office will use -->
  93. <attribute name="GroupName">${jboss.messaging.groupname:MessagingPostOffice}</attribute>
  94. <!-- Max time to wait for state to arrive when the post office joins the cluster -->
  95. <attribute name="StateTimeout">30000</attribute>
  96. <!-- Max time to wait for a synchronous call to node members using the MessageDispatcher -->
  97. <attribute name="CastTimeout">30000</attribute>
  98. <!-- Set this to true if you want failover of connections to occur when a node is shut down -->
  99. <attribute name="FailoverOnNodeLeave">false</attribute>
  100. <depends optional-attribute-name="ChannelFactoryName">jboss.jgroups:service=ChannelFactory</depends>
  101. <attribute name="ControlChannelName">jbm-control</attribute>
  102. <attribute name="DataChannelName">jbm-data</attribute>
  103. <attribute name="ChannelPartitionName">${jboss.partition.name:DefaultPartition}-JMS</attribute>
  104. </mbean>
  105. <!-- Messaging JMS User Manager MBean config======================================= -->
  106. <mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService" name="jboss.messaging:service=JMSUserManager" xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
  107. <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
  108. <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
  109. <attribute name="DataSource">java:/DefaultDS</attribute>
  110. <attribute name="CreateTablesOnStartup">true</attribute>
  111. <attribute name="SqlProperties"><![CDATA[
  112. CREATE_USER_TABLE=CREATE TABLE JBM_USER (USER_ID VARCHAR2(32) NOT NULL, PASSWD VARCHAR2(32) NOT NULL, CLIENTID VARCHAR2(128), PRIMARY KEY(USER_ID))
  113. CREATE_ROLE_TABLE=CREATE TABLE JBM_ROLE (ROLE_ID VARCHAR2(32) NOT NULL, USER_ID VARCHAR2(32) NOT NULL, PRIMARY KEY(USER_ID, ROLE_ID))
  114. SELECT_PRECONF_CLIENTID=SELECT CLIENTID FROM JBM_USER WHERE USER_ID=?
  115. POPULATE.TABLES.1  = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('guest', 'guest')
  116. POPULATE.TABLES.2  = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('j2ee', 'j2ee')
  117. POPULATE.TABLES.3  = INSERT INTO JBM_USER (USER_ID, PASSWD, CLIENTID) VALUES ('john', 'needle','DurableSubscriberExample')
  118. POPULATE.TABLES.4  = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('nobody', 'nobody')
  119. POPULATE.TABLES.5  = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('dynsub', 'dynsub')
  120. POPULATE.TABLES.6  = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('guest','guest')
  121. POPULATE.TABLES.7  = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('j2ee','guest')
  122. POPULATE.TABLES.8  = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('john','guest')
  123. POPULATE.TABLES.9  = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('subscriber','john')
  124. POPULATE.TABLES.10 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('publisher','john')
  125. POPULATE.TABLES.11 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('publisher','dynsub')
  126. POPULATE.TABLES.12 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('durpublisher','john')
  127. POPULATE.TABLES.13 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('durpublisher','dynsub')
  128. POPULATE.TABLES.14 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('noacc','nobody')
  129. ]]></attribute>
  130. </mbean>
  131. </server>

Open \conf\login-config.xml and add these lines


  1. <application-policy name = "messaging">
  2. <authentication>
  3. <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required" >
  4. <module-option name = "unauthenticatedIdentity">guest</module-option>
  5. <module-option name = "dsJndiName">java:/jdbc/ProfilesDS</module-option>
  6. <module-option name = "principalsQuery">
  7. SELECT PASSWD FROM JBM_USER WHERE  USER_ID=?
  8. </module-option>
  9. <module-option name = "rolesQuery">
  10. SELECT ROLE_ID, 'Roles' FROM JBM_ROLE WHERE USER_ID=?
  11. </module-option>
  12. </login-module>
  13. </authentication>
  14. </application-policy>

Installing & Running PHP in Tomcat

Here are steps to install and run php in tomcat server.

  1. Download and install latest java from Oracle http://www.oracle.com/technetwork/java/javase/downloads/index.html
  2. Set java_home in system classpath
  3. Download latest tomcat from “http://tomcat.apache.org/download-70.cgi” and unzip c:\tomcat
  4. Download latest php for window “http://windows.php.net/download/”and unzip to a directory, 
    c:\php
  5. Set path in you system  for php folder like
    path=%path%;c:\php
  6. Download latest PECL Win32 binaries from http://museum.php.net/php5/  like download  “pecl-5.2.5-Win32.zip”
  7. Download latest  PHP-JAVA Bridge war file from http://sourceforge.net/projects/php-java-bridge/files/Binary%20package/php-java-bridge_6.2.1/
  8. Go to you php installation folder c:\php and rename “php.ini-production” file to “php.ini” file
  9. Add the new line (If does not exist) in new php.ini:
    ;extension=php_java.dll
  10. Copy php5servlet.dll from PECL 5.2.5 to c:\php
  11. copy php_java.dll from PECL 5.2.5 to 
    c:\php\ext
  12. Copy downloaded ” JavaBridgeTemplate621.war” to tomcat\webapps folder and rename as php.war
  13. Now start tomcat and access you php-java bridge application and test your php file “http://localhost:8080/php/
  14. If you are creating any php file it should go in tomcat\webapps\php\ folder

If you are getting  Error “Could not start FCGI server: java.io.IOException: PHP not found. Please install php-cgi” then MSVCR110.dll is missing from your system. Please install  Visual C++ library from Microsoft website “http://www.microsoft.com/en-us/download/confirmation.aspx?id=30679”. Make sure you download and install the x86 version not 64bit version

Conversion MS office to PDF through open source

There is always challenge to convert Microsoft office document to PDF document through open source. I had also some issue when I was working one of the projects and converting Microsoft word doc or Microsoft power point document  to pdf document through open source. Here are some steps to convert Microsoft word document or Microsoft power point document to pdf document through Java application and open source.

Prerequisite Requirements for conversion
1.)    JDK(1.5+)
2.)    Open office version-2.02+(Download from “http://www.openoffice.org/”)
3.)    jodconverter2.2.2 (Download from “http://sourceforge.net/projects/jodconverter/files/”)

Here are steps:-

1.)    install JDK(1.5+) and Open office version-2.02 in your local machine.
2.)    Go to <Open office  install folder>/ program/  folder
3.)    Run this command through MS dos window.

soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard

4.)    Now write the given java code and run

  1. import java.io.File;
  2. import com.artofsolving.jodconverter.DocumentConverter;
  3. import com.artofsolving.jodconverter.openoffice.connection.OpenOfficeConnection;
  4. import com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection;
  5. import com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter;
  6. public class MsDocToPdfUtil {
  7. public static void convertDocToPdf(){
  8. try {
  9. File in = new File("C:/test.doc");
  10. OpenOfficeConnection connection = new SocketOpenOfficeConnection(8100);
  11. connection.connect();
  12. DocumentConverter converter = new OpenOfficeDocumentConverter(connection);
  13. File outPutFile = new File("C:/test.pdf");
  14. converter.convert(in,outPutFile);
  15. connection.disconnect();
  16. }catch(Exception ex){
  17. ex.printStackTrace();
  18. }
  19. }
  20. public static void main(String[] args) {
  21. try {
  22. convertDocToPdf();
  23. } catch (Exception ex) {
  24. ex.printStackTrace();
  25. }
  26. }
  27. }

Webservice Spring WS-Security

My previous blog I explain some SOA concept. Now  In this blog I am jumping to some practical and explaining how to setup some basic web services with Spring framework and how to implement some security with web Services. To run this example  you need JDK 1.5+ and spring framework 3.0+I created some basic configuration. Here are list.
1. applicationContext-service.xml — It has some basic configuration of web service in spring
2. HelloWorldWS.java — This class is exposing webservice
3. HelloWorldServiceHandler.java — This class is monitoring incoming request and outgoing message. Here we implement WS-security.
4. HelloWorldManager.java — This class  is interface for business implementation.
5. HelloWorldManagerImpl.java— This class has business implementation.Now lets start how I implemented this web service. here are codes.
1. applicationContext-service.xml
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"
  5. xmlns:ws="http://jax-ws.dev.java.net/spring/core"
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans
  7. http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  8. http://jax-ws.dev.java.net/spring/core
  9. http://jax-ws.dev.java.net/spring/core.xsd
  10. http://jax-ws.dev.java.net/spring/servlet
  11. http://jax-ws.dev.java.net/spring/servlet.xsd">
  12. <bean id="constantMap" />
  13. <ws:service id="SOAPservice" bean="#helloWorldWS">
  14. <ws:handlers>
  15. <ref bean="helloWorldHandler" />
  16. </ws:handlers>
  17. </ws:service>
  18. <wss:bindings id="jaxWs">
  19. <wss:bindings>
  20. <wss:binding url="/webservices/HelloWorldService">
  21. <wss:service>
  22. <ref bean="SOAPservice"/>
  23. </wss:service>
  24. </wss:binding>
  25. </wss:bindings>
  26. </wss:bindings>
  27. <bean id="helloWorldHandler">
  28. <property name="constantMap" ref="constantMap" />
  29. </bean>
  30. <!-- Injecting DAO Object -->
  31. <bean id="helloWorldManager">
  32. <property name="target">
  33. <bean>
  34. <property name="userDAO"><ref bean="userDAO"/></property>
  35. </bean>
  36. </property>
  37. </bean>
  38. <bean id="helloWorldWS">
  39. <property name="helloWorldManager"><ref bean="helloWorldManager"/></property>
  40. </bean>
  41. </beans>
2. HelloWorldWS.java

  1. package com.vanrish.service;
  2. import javax.annotation.Resource;
  3. import javax.jws.WebMethod;
  4. import javax.jws.WebParam;
  5. import javax.jws.WebResult;
  6. import javax.jws.WebService;
  7. import javax.jws.soap.SOAPBinding;
  8. import javax.xml.ws.WebServiceContext;
  9. import com.vanrish.service.HelloWorldManager;
  10. import com.vanrish.xml.schema.PeopleInfoRequest;
  11. import com.vanrish.xml.schema.PeopleInfoResponse;
  12. @WebService (targetNamespace="http://www.vanrish.com/helloWorldService",serviceName = "HelloWorldService")
  13. @SOAPBinding(style=SOAPBinding.Style.DOCUMENT, use=SOAPBinding.Use.LITERAL, parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)
  14. public class HelloWorldWS {
  15. private HelloWorldManager helloWorldManager;
  16. @Resource
  17. WebServiceContext context;
  18. @WebMethod(exclude=true)
  19. public void setHelloWorldManager(HelloWorldManager helloWorldManager) {
  20. this.helloWorldManager = helloWorldManager;
  21. }
  22. @WebMethod(operationName = "getPeopleInfo")
  23. @WebResult(name = "PeopleInfo", partName = "PeopleInfo")
  24. public PeopleInfoResponse getPeopleInfo(@WebParam(name = "PeopleInfoRequest", partName = "PeopleInfoRequest",targetNamespace="http://www.vanrish.com/helloWorldService") PeopleInfoRequest peopleInfoRequest) throws Exception {
  25. return helloWorldManager.getPeopleInfo(peopleInfoRequest);
  26. }
  27. }
3. HelloWorldServiceHandler.java
  1. package com.vanrish.service.handler;
  2. import java.io.ByteArrayOutputStream;
  3. import java.util.Iterator;
  4. import java.util.Map;
  5. import java.util.Set;
  6. import javax.xml.namespace.QName;
  7. import javax.xml.soap.SOAPElement;
  8. import javax.xml.soap.SOAPEnvelope;
  9. import javax.xml.soap.SOAPHeader;
  10. import javax.xml.soap.SOAPMessage;
  11. import javax.xml.soap.SOAPPart;
  12. import javax.xml.ws.handler.MessageContext;
  13. import javax.xml.ws.handler.soap.SOAPHandler;
  14. import javax.xml.ws.handler.soap.SOAPMessageContext;
  15. import javax.xml.soap.Name;
  16. import org.apache.commons.logging.Log;
  17. import org.apache.commons.logging.LogFactory;

  18. public class HelloWorldServiceHandler implements SOAPHandler {

  19. private static final Log log = LogFactory.getLog(HelloWorldServiceHandler.class);
  20. /** The Constant USERNAME_TOKEN_STRING. */
  21. private static final String USERNAME_TOKEN_STRING = "UsernameToken";
  22. /** The Constant USERNAME_STRING. */
  23. private static final String USERNAME_STRING = "Username";
  24. /** The Constant PASSWORD_STRING. */
  25. private static final String PASSWORD_STRING = "Password";
  26. private Map constantMap;

  27. public Set getHeaders() {
  28. return null;
  29. }
  30. public void close(MessageContext context) {
  31. }
  32. public boolean handleFault(SOAPMessageContext context) {
  33. logToSystemOut(context);
  34. return true;
  35. }
  36. public boolean handleMessage(SOAPMessageContext context) {
  37. Boolean outboundProperty = (Boolean) context
  38. .get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
  39. boolean isSoapRequestHandle = false;
  40. if (outboundProperty.booleanValue()) {
  41. isSoapRequestHandle = true;
  42. /* ************************************************************************
  43. * If you are manupulating outgoing header then you need to add this code
  44. *
  45. **************************************************************************
  46. * try { SOAPMessage message = context.getMessage();
  47. *
  48. * SOAPPart sp = message.getSOAPPart();
  49. *
  50. * SOAPEnvelope envelope = sp.getEnvelope();
  51. *
  52. * SOAPHeader header = envelope.addHeader();
  53. *
  54. * SOAPElement security = header.addChildElement("Security", "wsse",
  55. * "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
  56. * );
  57. *
  58. * SOAPElement usernameToken =
  59. * security.addChildElement("UsernameToken", "wsse");
  60. * usernameToken.addAttribute(new QName("xmlns:wsu"),
  61. * "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
  62. * );
  63. *
  64. * SOAPElement username = usernameToken.addChildElement("Username",
  65. * "wsse"); username.addTextNode("TestUser");
  66. *
  67. * SOAPElement password = usernameToken.addChildElement("Password",
  68. * "wsse"); password.setAttribute("Type",
  69. * "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"
  70. * ); password.addTextNode("TestPassword");
  71. *
  72. * //Print out the outbound SOAP message to System.out
  73. * message.writeTo(System.out); System.out.println("");
  74. *
  75. *
  76. *
  77. * }catch (Exception e) { e.printStackTrace();
  78. *
  79. * }
  80. */
  81. } else {
  82. try {

  83. SOAPMessage message = context.getMessage();
  84. SOAPPart sp = message.getSOAPPart();
  85. SOAPEnvelope envelope = sp.getEnvelope();
  86. SOAPHeader sh = envelope.getHeader();
  87. isSoapRequestHandle = processSOAPHeader(sh);
  88. message.writeTo(System.out);
  89. if (!isSoapRequestHandle) {

  90. SOAPElement errorMessage = sh.addChildElement(
  91. "errorMessage", "error",
  92. "http://vanrish.com/helloService/error");
  93. SOAPElement error = errorMessage.addChildElement("error");
  94. error.addTextNode("Authentication Failed !!!");
  95. }
  96. } catch (Exception e) {
  97. e.printStackTrace();
  98. }
  99. }
  100. logToSystemOut(context);
  101. return isSoapRequestHandle;
  102. }
  103. private void logToSystemOut(SOAPMessageContext smc) {
  104. Boolean outboundProperty = (Boolean) smc
  105. .get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
  106. if (outboundProperty.booleanValue()) {
  107. log.debug("\nOutgoing message:");
  108. } else {
  109. log.debug("\nIncoming message:");
  110. }
  111. SOAPMessage message = smc.getMessage();
  112. try {
  113. log.debug(handleRequestAndResponse(message));
  114. } catch (Exception e) {
  115. System.out.println("Exception in handler: " + e);
  116. }
  117. }
  118. private String handleRequestAndResponse(SOAPMessage msg) {
  119. ByteArrayOutputStream obj = new ByteArrayOutputStream();
  120. try {
  121. msg.writeTo(obj);
  122. return obj.toString();
  123. } catch (Exception ex) {
  124. obj = null;
  125. ex.printStackTrace();
  126. }
  127. return "";
  128. }
  129. private boolean processSOAPHeader(SOAPHeader sh) {
  130. boolean authenticated = false;
  131. // look for authentication header element inside the HEADER block
  132. Iterator childElems = sh.getChildElements();
  133. SOAPElement child = extractUserNameInfo(childElems);
  134. if (child != null) {
  135. // call method to perform authentication
  136. authenticated = authenticateRequest(child);
  137. }
  138. return authenticated;
  139. }
  140. private SOAPElement extractUserNameInfo(Iterator childElems) {
  141. SOAPElement child = null;
  142. Name sName;
  143. // iterate through child elements
  144. while (childElems.hasNext()) {
  145. Object elem = childElems.next();

  146. if (elem instanceof SOAPElement) {
  147. // Get child element and its name
  148. child = (SOAPElement) elem;
  149. sName = child.getElementName();
  150. // Check whether there is a UserNameToken element
  151. if (!USERNAME_TOKEN_STRING.equalsIgnoreCase(sName
  152. .getLocalName())) {
  153. if (child.getChildElements().hasNext()) { // TODO check
  154. logic
  155. return extractUserNameInfo(child.getChildElements());
  156. }
  157. }
  158. }
  159. }
  160. return child;
  161. }
  162. private boolean authenticateRequest(SOAPElement element) {
  163. boolean authenticated = false;
  164. // variable for user name and password
  165. String userName = null;
  166. String password = null;
  167. Name sName;
  168. // get an iterator on child elements of SOAP element
  169. Iterator childElems = element.getChildElements();
  170. SOAPElement child;
  171. // loop through child elements
  172. while (childElems.hasNext()) {
  173. // get next child element
  174. Object elem = childElems.next();
  175. if (elem instanceof SOAPElement) {
  176. child = (SOAPElement) elem;
  177. // get the name of SOAP element
  178. sName = child.getElementName();
  179. // get the value of username element
  180. if (USERNAME_STRING.equalsIgnoreCase(sName.getLocalName())) {
  181. userName = child.getValue();
  182. } else if (PASSWORD_STRING.equalsIgnoreCase(sName
  183. .getLocalName())) {
  184. // get the value of password element
  185. password = child.getValue();
  186. }
  187. if (userName != null && password != null) {
  188. authenticated = getUserAuth(userName, password);
  189. break;
  190. }
  191. }
  192. }
  193. if (userName == null || password == null) {
  194. log.warn("Username or password is empty. userName : [" + userName
  195. + "], password : [" + password + "]");
  196. }
  197. return authenticated;
  198. }
  199. public Map getConstantMap() {
  200. return constantMap;
  201. }
  202. public void setConstantMap(Map constantMap) {
  203. this.constantMap = constantMap;
  204. }
  205. private boolean getUserAuth(String username, String password) {
  206. //Constant Map populated with database information
  207. String dbUserId = (String) constantMap.get("useIdFormDatabase");
  208. String dbPassword = (String) constantMap
  209. .get("passwordFormDatabase");
  210. if (dbUserId.equalsIgnoreCase(username) && dbPassword.equals(password)) {
  211. return true;
  212. }
  213. return false;
  214. }
  215. }
4. HelloWorldManager.java —
  1. package com.vanrish.service;
  2. import com.vanrish.xml.schema.PeopleInfoRequest;
  3. import com.vanrish.xml.schema.PeopleInfoResponse;
  4. public interface HelloWorldManager {
  5. public PeopleInfoResponse getPeopleInfo(PeopleInfoRequest peopleInfoRequest) throws Exception;
  6. }
5. HelloWorldManagerImpl.java —
  1. package com.vanrish.service.impl;
  2. import java.math.BigDecimal;
  3. import java.math.BigInteger;
  4. import java.util.ArrayList;
  5. import java.util.Calendar;
  6. import java.util.Date;
  7. import java.util.GregorianCalendar;
  8. import java.util.Iterator;
  9. import java.util.List;
  10. import java.util.Map;
  11. import java.util.Set;
  12. import javax.xml.datatype.DatatypeConfigurationException;
  13. import javax.xml.datatype.DatatypeConstants;
  14. import javax.xml.datatype.DatatypeFactory;
  15. import javax.xml.datatype.XMLGregorianCalendar;
  16. import org.apache.commons.logging.Log;
  17. import org.apache.commons.logging.LogFactory;
  18. import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer;
  19. import com.vanrish.dao.UserDAO;
  20. import com.vanrish.model.PeopleVO;
  21. import com.vanrish.service.HelloWorldManager;
  22. import com.vanrish.xml.schema.ObjectFactory;
  23. import com.vanrish.xml.schema.Person;
  24. import com.vanrish.xml.schema.PeopleInfoRequest;
  25. import com.vanrish.xml.schema.PeopleInfoResponse;
  26. public class HelloWorldManagerImpl implements HelloWorldManager {
  27. private UserDAO userDAO;
  28. public PeopleInfoResponse getPeopleInfo(PeopleInfoRequest peopleInfoRequest) throws Exception {
  29. ObjectFactory factory = new ObjectFactory();
  30. PeopleInfoResponse peopleInfoResponse = factory.createPeopleInfoResponse();
  31. PeopleVO peopleVO = new PeopleVO();
  32. peopleVO.setPeopleId(peopleInfoRequest.getPeopleId());
  33. peopleVO = userDAO.getPeopleInfo(peopleVO);
  34. Person person = factory.createPerson();
  35. person.setFirstName(peopleVO.getFirstName());
  36. person.setLastName(peopleVO.getLastName());
  37. person.setType(peopleVO.getPeopleType());
  38. person.setCreateDate(getXmlDate(peopleVO.getCreateDate()));
  39. peopleInfoResponse.setPerson(person);
  40. peopleInfoResponse.setMessage(SUCCESS_MESSAGE);
  41. peopleInfoResponse.setSuccess(true);
  42. return peopleInfoResponse;
  43. }
  44. private XMLGregorianCalendar getXmlDate(Date date) {
  45. try {
  46. GregorianCalendar cal = new GregorianCalendar();
  47. cal.setTime(date);
  48. XMLGregorianCalendar gc = DatatypeFactory.newInstance().newXMLGregorianCalendar(cal);
  49. gc.setTimezone(DatatypeConstants.FIELD_UNDEFINED);
  50. gc.setTime(DatatypeConstants.FIELD_UNDEFINED,
  51. DatatypeConstants.FIELD_UNDEFINED,
  52. DatatypeConstants.FIELD_UNDEFINED);
  53. return gc;
  54. } catch (DatatypeConfigurationException e) {
  55. log.warn("Cannot format expxiration date: " + date);
  56. return null;
  57. }catch(Exception ex){
  58. log.warn("Cannot format expxiration date: " + ex);
  59. return null;
  60. }
  61. }
  62. public void setUserDAO(UserDAO userDAO) {
  63. this.userDAO = userDAO;
  64. }
  65. }

Cloud Security

Now most of the company wants to embrace cloud computing but security is one of the main concern for these companies. Still CEO or CTO of the companies are feeling uncomfortable to use cloud computing. As an Architect, I also feel this is the one of the main area that cloud based application should focus. According to Gartner, There are seven risk factors for cloud computing.

1. Privileged user access
2. Regulatory compliance
3. Data location
4. Data segregation
5. Recovery
6. Investigative support
7. Long-term viability

There are different levels of risk for different type of cloud. Public cloud is front runner in risk among all other types of cloud.
In top of these risks still companies are thinking about cloud implementation in their organization. Companies are saying, risk is everywhere and you should mitigate these risks or overcome these risks.
Cloud is on demand service by provider to consumer, so there should be good understanding of cloud security between provider and consumer like good service level agreement and contract requirement between provider and consumer.
Here are few points to mitigate risks on cloud.

1. Secure logon – In cloud make sure every user has unique user id with proper authorization on cloud. It should be managed properly and it should access directory structure to provide access control.


2. Encrypted data – When you are accessing data on cloud particularly SAAS on public cloud, data should be properly encrypted and it should follow government privacy law (GLBA, DPPA, FCRA, HIPAA, etc.).

3. Secure Data backup – Data backup is one of the key areas where provider and subscriber should focus about security. There should be clear understanding between provider and subscriber in SLA (Service Level Agreement) about data backup security. There should be secure tool to data transfer, backup data and restore data in cloud.


4. Virtualization Security – Virtualization is back bone of cloud computing. There are multiple risks associated with hardware or software virtualization like VM (Virtual machine) isolation, hypervisor or multi-tenancy. To mitigate risk there should be strong and clear isolation level among different VM. There should be good administrative access and control of VM and also good reporting and logging tool for different VM and administration.

5. Application Security — There are big challenges of application security in different layers of cloud as SAAS, PAAS or IAAS. Application vulnerability is available in almost all level and layer of cloud. To mitigate application vulnerability in cloud we should focus on some of security point as given below.

a) Secure communication between application host machine and consumer.

b) Audit and review the application security on cloud in each level of SDLC (Software
    Development Life Cycle).

c) There should be clear security SLA (Service Level Agreement) of application between
    cloud provider and consumer for each layer of clouds (SAAS, PAAS, and IAAS).

d) Encrypted Application data should transit over network.

What is ESB?

Few days back, one of my friends asked me, what is ESB? How does ESB fit in SOA? It was an interesting question. Let me explain how does ESB work for SOA.

     Initially when organization was going to webservice they were getting issue with integration, orchestration, communication, transaction with services etc. Whenever they were making any change in vendor or services, this change was propagating to code and application. It was big change management for any small change in business or vendor services. It was also taking long time and resources to make any change in business or vendor services. There was no clear SLA (Service Level Agreement) between consumer and service provider.

   ESB (Enterprise Service Bus) gave major contribution to overcome all these issues. ESB is back bone of SOA. It provides pluggable architecture which enables easy decoupling of producer from consumer. It is an extension of EAI (Enterprise Application Integration), an earlier version of middleware, but it adds several other features. ESB is XML based technology. You can define end point, routing rule of message, transaction, or security in xml without doing any line of coding. ESB has clear SLA (Service Level Agreement) between consumer and service provider. Here are the main features of ESB.
1. Service Virtualization – ESB provides loosely couple architecture. You can couple or decouple your services without touching any part of code or services. In ESB you can define end point for each services and their routing rule. You can easily add or remove these services from ESB. Service virtualization gives an ability to define abstract service end point instead of using actual physical address.

2. Service Enablement – Organization were struggling to enable legacy system as services. ESB adapter such as JDBC adapter, Mainframe adapter etc., gives more flexibility to create SOAP based Webservice of any organization. This functionality reduces your IT investments and you can reuse your existing system.

3. Asynchronous Communication – ESB is the key infrastructure for message process and rerouting. ESB provides the platform for asynchronous message with intelligent transformation and rerouting to ensure messages are passed reliably. Services participate in the ESB using either Web services messaging standard or the JMS (Java Messaging System).

4. Protocol Bridging – ESB provides bridging between inbound message and out bound message. Like ESB gets inbound message as HTTP protocol and send to outbound as JMS protocol in one message flow. Both inbound message and outbound message communicate each other without knowing each other protocols.

                       

What is virtualization?

Virtualization concept came in 1960. It was brought by IBM for the Mainframe server to fully utilize hardware resources by logical partitioning them in virtual machine (VM). In 1980’s and 1990’s era, we almost forgot this technology due to rise of desktop and client server computing.
After this era we jumped on distributed computing technology. Company started to use multiple servers to execute their application. Each server took extra space and used more power and cooling which gave rise to extra expenditure cost to run application.
To overcome all this extra expenditure company started to explore virtualization. VM ware is one of the leading companies which provide virtualization. Virtualization is old technology in new box with more powerful resources and options.
Virtualization is the partitioning of not only mainframe server but any physical server into multiple virtual servers. It gives organization maximum utilization of hardware with same CAPEX (ongoing capital expenditure) and OPEX (ongoing Operational expenditure). Each server acts like a real physical server that can run on operating system with just like physical server. Now companies are partitioning their physical server into multiple virtual servers and run their application on virtual servers with same resources and less expenditure.

There are three different types of virtualization
  1.        Hardware virtualization – Hardware virtualization allow us to run different OS (Operating Server) and different servers simultaneously on the same hardware. 
  2.        Desktop virtualization – Desktop virtualization allow us to run different desktop for different users simultaneously on the same hardware.
  3.        Storage virtualization – Storage virtualization is the pooling of physical storage from multiple network devices on the same hardware.

Why SOA?


In my last blog, I explained about SOA. Now, I am going to explain why we need SOA in addition to all existing technologies. Why is business embracing this technology?
Our IT industry is around 40 years old. When IT industry had started, most of the applications were running on Mainframe. Most of the applications were available through centralized server (Mainframe server). Now IT industry is maturing and it is growing from a centralized infrastructure to a distributed infrastructure. Organizations are transitioning from bus computing to cloud computing. There are many software applications, software platforms and operating systems in there market. Business models are also changing very fast. IT industry is also changing along with business models. IT industry has to support both legacy systems and new systems.
 
SOA is a good solution to make a code work with new system and the legacy system at same time. I am summarizing some of the points, why I feel that an organization should implement SOA.

  1. Modular and loosely coupled  — SOA cuts big monolithic systems and services into small modular services. SOA not only disengages the process from system but it also makes loose couple among systems. If, for instance, a SOA implemented organization wants to implement a new service (Internal service, External service or Cloud based services), it can just plug that service or remove that service from the organization system without touching any existing system.
  2. Business Driven  — Now a days, business changes very fast. Mergers and Acquisitions are very common phenomena. Business needs are also changes frequently. There are different permutations and combination coming in market. IT also has to synchronize with all these business permutations and combination. SOA gives flexibility to work with all these changes with minimal effort. SOA is very close to business as well as the business people. One can define or change business process to address business needs in very small time with minimal effort. In short, organization business can change quickly along with the fast changing market.
  3. Platform IndependentSOA is completely platform independent. SOA service client or consumer can use SOA service without knowing SOA service provider platform, language or operating system. So, one can write SOA service without worrying about who is going to consume the service.
  4. Easy Service enablement  — There was big challenge for any organization to make any change in existing legacy system. SOA provides an easy tool to enable existing monolithic application or legacy mainframe system into a SOA service without knowing anything about those systems. Through SOA tool, one can expose interface(s) from existing system as service and use this service in other applications without touching any existing functionality. 
  5. Low Cost development and maintenanceAs I stated earlier, SOA is modular and loosely coupled. So one can implement new service or modify existing service(s) without touching any other service or application. As a result, it takes very small effort and time to make any change in application that uses SOA. SOA also provides the flexibility, such that service can be reused in any other application. For example, if an organization is using third party service (SAAS) for an application, it can reuse this service in other applications without investing on license, server space or maintenance. In other words, if organization builds a service for one application, it can reuse this service in multiple applications.
  6. Easy learning curveSOA is modular and loosely coupled, as such, it has a very easy learning curve. One can start to work on any service without knowing the whole application. SOA technology is completely based on XML and it is one of the easiest technologies and it is accepted by all applications and software.
  7. Increased operational efficiencyTo reuse existing SOA service, one can create new service by using current system or service. In summary, SOA helps us in creating and delivering a new product quickly.     

Types of Cloud Computing

In my earlier post, I explained about cloud? Now I am going to explain about different types of cloud computing and layers of cloud computing.
Based on organization’s business, economy and technical need, we divide Cloud in different category.
Cloud computing is define in three major technology layers. These are SAAS (Software As A service), PAAS (Platform As A Service) and IASS (Infrastructure As A Service).

        1. SAAS (Software As A Service) – This is the top technology layer of Cloud Computing and oldest among these three. Under this layer organization gets fully functional applications on-demand to provide specific services such as email management, CRM, ERP, web conferencing and an increasingly wide range of other applications. These software licenses are managed by Cloud computing company.
      2. PAAS (Platform As A Service) – Second layer of cloud computing is PAAS (Platform As A Service). In this layer organization gets mostly an operating environment to develop application, to run application or to deploy application. PAAS provides operating environment like Java, J2EE, .Net, Window, Linux etc.
      3. IAAS (Infrastructure AS A Service) – This layer provides all basic, physical and virtual resources used in application for any organization. This includes virtual platform (space on server) on which required operating environment and application are deployed. It also includes storage and datacenter.
 In other dimension, there are 4 types of cloud computing service available.  These are Public, Private, Community and Hybrid computing.
      1. Public cloud (External Cloud) – Public cloud is offering service by third party vendor over internet. If any vendor provides infrastructure, data center, search or other service to any organization, then it comes in public cloud type. This type of cloud shares  some benefit like efficiency, High availability, elastic capacity, Low upfront cost, less or no hardware setup and less or no system management.  This type of cloud computing service is provided by Amazon EC2, Microsoft Azure, Sun Microsystem cloud, Salesforce etc.  
      2. Private cloud (Internal cloud) – Private cloud is set up and managed by an enterprise’s own IT department and run inside the organization firewall. If any organization has large number of user and resources, then organization hosts cloud computing within their own firewall. This type of cloud computing is dedicated to that organization. It does not share any resource outside their organization. Any big organization like AT&T, Verizon or Bank of America open their infrastructure or data center near to low cost area and makes the service  available  through their own cloud, then it called as private Cloud computing. It shares some benefit like efficiency, High availability, elastic capacity, Lower cost over time, full access and flexibility, direct control over quality, service and security.
       3. Community cloud (Semi-private cloud) – Community cloud is offering service for similar type of business company. This type of cloud is public cloud but it focuses on same vertical domain companies. Like if any cloud dedicated to government or banking organization and it is serving only those types of organization, then it come as community cloud. It shares some benefit like efficiency, High availability, elastic capacity, expertise in domain knowledge, less cost over time compare to public cloud.
       4. Hybrid cloud (Integrated cloud) – Hybrid cloud is combination of any or all of the other types of cloud.  This type of cloud is  gaining lot of popularity among organizations.  This type of cloud computing give organization more flexibility to manage and share resource between private and public cloud. Like if  any organization host their application in public cloud and during peak sales time they need more server and space to handle this request, they can go for public cloud. In this type of cloud computing Model Company keeps  all sensitive data (transaction or credit card data) in private cloud and less sensitive data in public cloud. It shares  benefits like efficiency, High availability, elastic capacity, more control over quality, service and security, less cost over time compare to public and community cloud.