SSLconfiguration On Jboss Server

Step 1:Open Terminal  and put below the comman.
sh.4.4$ /usr/lib/jvm/java-1.6.0/bin/keytool -genkey -alias tomcat -keyalg RSA server. keystore
OR
%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA \
  -keystore \path\to\my\keystore

This command will create a new file, in the home directory of the user under which you run it, named ".keystore".
After executing this command, you will first be prompted for the keystore password. The default password used by JBoss Web is "changeit" (all lower case), although you can specify a custom password if you like.
Next, you will be prompted for general information about this Certificate, such as company, contact name, and so on. This information will be displayed to users who attempt to access a secure page in your application, so make sure that the information provided here matches what they will expect.
Please check in below the screen shot.

Note: your private key password and keystore password should be the same. If they differ, you will get an error along the lines of java.io.IOException: Cannot recover key
Step:2    Configure your secure socket in the /var/lib/jbossas/server/atg_production/deploy/jbossweb.sar/server.xml
($CATALINA_HOME/conf/server.xml)
Copy below the code into server.xml

   

   
               protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="25" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS"
               keystoreFile="${jboss.server.home.dir}/conf/server.keystore"
               keystorePass="changeit"
    />

Step:3 After completing these configuration changes, you must restart JBoss Web as you normally do.Click on below the URL:
https://localhost:8080/sample



NOTE:
(1) Not supplying identity information: this indicates that there is a valid security certificate, but it is an ordinary certificate and not an EVSSL (green lock) certificate. Same as a gray padlock, as far as the main page goes. So that part of the message is not worrisome unless the site used to show a green padlock before.
(2) Gray exclamation-triangle: this indicates that that the page contains "mixed" content. More specifically, although the page was retrieved through an encrypted connection (HTTPS) with a valid certificate, something in the page was retrieved over an open connection.


Core Java (Advanced Topics)


Java Exceptions Handling:
In Exception mechanism to handle errors ,other exceptional conditions and how to throw and catch exception.
More Click -->

Java Collections Framework :
The Java collections framework (JCF) is a set of classes and interfaces that implement commonly reusable collection data structure.
Java provided ad hoc classes such as Dictionary,Vector,Stack and Properties to store and manipulate group of object.

The Collection interface(Java.util.Collection) and Map (java.util.Map) are two main root interface of java collection classes

Advantages of Collection Framework:

  1. Consistent API :  The API has basic set of interfaces like Collection Set,List or Map.All those classes (Such as ArrayList, LinkedList,vector etc) which implements,these interface have some conman set of methods.
  2. Reduces Programming effort : The programmer need not to worry about design of collection rather then he can focus on it's best  use in the program.
  3. Increases program speed and quality:  Increase performance by providing high-performance implementations of  useful data and algorithms.

Short Note On Collection :

Set : Doesn't allow duplicates. Example implementations of Set interface are HashSet (Hashing based) and TreeSet (balanced BST based).
Note that TreeSet implements SortedSet.
List : Can contain duplicates and elements are ordered. Example implementations are LinkedList (linked list based) and ArrayList (dynamic array based)
Queue : Typically order elements in FIFO order except exceptions like PriorityQueue.  
Deque : Elements can be inserted and removed at both ends. Allows both LIFO and FIFO. 
Map : Contains Key value pairs. Doesn't allow duplicates. Example implementation are HashMap and TreeMap and TreeMap implements SortedMap.        
More Click -->

Date-Time APIs :
The Date/Time API is moved to java.time package and Joda time format is followed. Another goodie is that most classes are Threadsafe and immutable.
More Click -->

Core Java (Fundamentals)

Fundamentals of Java programming language.

Object-Oriented Programming Concepts:-
core concepts behind object-oriented programming language like as objects, messages, classes, and inheritance.
More Click -->

Language Basics
describes the features of the language, including variables, arrays, data types, operators, and control flow.
More Click -->

Classes and Objects
describes how to write the classes from which objects are created, and how to create and use the objects.
More Click -->

Annotations
An Annotations are a form of metadata and provide information for the compiler.

Interfaces and Inheritance: 
describes how to modify the methods that a subclass inherits from superclasses.
Numbers and Strings: This lesson describes how to use Number and String objects and how to format data for output.

Generics :
They were designed to extend Java's type system to allow “a type or method to operate on objects of various types while providing compile-time type safety”.

Packages : 
With help package you to organize and structure your classes and their relationships to one another.

Core Java (Evolution of Java)

What is Java ? Java is more than just the programming language itself, that is concurrent, class-based, object-oriented language, "write once, run anywhere" (WORA), meaning that compiled Java code can run on all platforms that support Java without the need for recompilation. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM).

Java was developed by James Ghosling, Patrick Naughton, Mike Sheridan at Sun Microsystems Inc. in 1991.It took 18 months to develop the first working version.
The initial name was Oak but it was renamed to Java in 1995 as OAK was a registered trademark of another Tech company.

Evolution of Java:
Java was initially lunched as Java 1.0(JDK 1.0 (23rd Jan, 1996)) but soon after it's release .
Java 1.1(JDK 1.1 (19th Feb, 1997)) was lunch , in this java version 1.1 redefined event handling ,new library elements are added.
Java 1.2(J2SE 1.2 (8th Dec, 1998)) Swing and most important part was added Collection framework and suspend(). resume() and stop method were deprecated from Thread class.

Java 1.3(J2SE 1.3 (8th May, 2000)) no major changes were made but next release that was Java 1.4 (J2SE 1.4 (6th Feb, 2002)) contained several important changes, keyword (assert),chained exception and channel base I/O class has introduced.
Java 1.5(J2SE 5.0 (30th Sep, 2004)) was called J2SE ,it add following major new feature :
- Generics,
- Annotations,
- Autoboxing and autounboxing,
- Enumerations,
- For-each loop,
- Varargs,
- Static import,
- Formatted I/O,
- Concurrency utilities.

In Java SE 7 (28th July, 2011) which included many new changes, like :
- Now String can be used to control Switch statement,
- Multi Catch Exception,
- try-with-resource statement,
- Binary Integer Literals,

And the latest addition to the lot is, Java SE 8, it was released on March 18, 2014.JAVA 8 is a revolutionary release of the world's development platform. It includes a huge upgrade to the Java programming model and coordinated evolution JVM and libraries.

The following features for Java 8 Programming:

              1. Lambda Expressions and Functional Interfaces,
              2. Java Stream API(java.util.stream) for Bulk Data Operations on Collections,
              3. default and static methods in Interfaces,
              4. forEach() method in Iterable interface,
              5. Java Time API,
                   6. Collection API improvements,
              7. Concurrency API improvements,
              8. Java IO improvements,
              9. Nashorn JavaScript Engine,
              10.Parallel Array Sorting,
              11.Type and Repating Annotations,
              12 JDBC Enhancements etc.



Lombok - Tutorial and Implementation

Lombok is worked to reduse boilerplate code for model/data object,e.g,it can generate getters and setters for those object automatically by using Lombok annotations.We have uased in Spring boot application .

The easiest way is to use the @Data annotation,see in bellow example:



for adding @data annotation you will get all this getters and setters.  
Step for implements lombok :-


1. To implements Lombok
1.           Add following  dependency  in pom.xml
         In  properties tag

      <lombok> 1.16.18<lombok>

      In dependencies
       
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok}</version>
            <optional>true</optional>
        </dependency>

2.Download Lombok jar from ( https://projectlombok.org/), double click on jara it will automatically install in you IDE. If it could not able to install automatically, browse and add IDE home path manually.

3. Add lambok.jar into your project

4. Add  -vmargs -javaagent:lombok.jar in STS ini file

5. Build you project

6. Remove all setter/getter toString equals and hashcode method for you entity class.

7. use @Data annotation of import lombok.Data;

Java Keywords

In Java programming language has fifty keywords. Each keyword has specific meaning in java language,You can not used keyword for anything other then it's pre-assigned meaning.

Keyword   
Description
abstract 
an abstract class or method
assert   
when assertions enabled , throws an error if condition not fulfilled
boolean
The Boolean type with values true and false
break
Breaks out of the switch or loop
byte
The 8-bit integer type
case
A case of the swatch statement
Catch
The clause of the try block catching an exception
char
The Unicode character type
class
Define the class type
continue
Continue at the end a loop
default
-The default clause of the switch
-Denotes default implementation of the an interface method.
do
The top of do/while loop
double
The double-precision floating-number type
else
The else clause of an if statement
enum
An enumerated type
extends
Defines the parent class of a class
final
A constant ,or a class or method that cannot be overridden
finally
The part of a try block that is always execute
float
The single-precision floating-point type
for
A loop type
If
A conditional statement
implements
Defines the interface(s) that a class implements
import
Imports a package
instanceof
Tests if an object is an instance of a class
int
The 32-bit integer type
interface
An abstract type with methods that a class can implement
long
The 64-bit long integer type
native
A method implemented by the host system
new
Allocates a new object or array
null
A null reference
package
A package of classes
private
A feature that is accessible only by methods of the class 
protected
A feature that is accessible only by methods of this class,its sub ,and other class in the same package
public
A feature that is accessible by methods of all classes
return
returns from a method
short
the 16-bit integer type
static
A feature that is unique to it's class, not to object of it's class
strictfp
Use strict rules for floating-point computations
super
Invoke a superclass constructor or method
switch
A selection statement
synchronied
A method or code block that is atomic to a thread
this
the implicit argument of the method .or a constructor of this class
throw
throws an exception
throws
The exception that a method can throw
transient
mark data that should not be persistent
try
A block of code that traps exceptions
void
donates a method that returns no value
volatile
Ensures that a field is coherently accessed by multiple threads
while
A loop