Business, Code, JavaEE, SOA, Technical, WebServices

Current Technology Research

Languages – used to solve problems that work with user interaction and machine development.

Kotlin for Java and Android.

Swift for IOS and Mac.
Cloud Technologies and Platforms – Infrastructure, functions and platforms that provide integrated solutions for systems and applications high availability and deployments.

Amazon Web Services (AWS).

Google Firebase

Understanding Domain Driven Design – is an approach to software development for complex needs by connecting the implementation to an evolving model.

http://en.wikipedia.org/wiki/Domain-driven_design

http://dddsample.sourceforge.net/

http://www.domainlanguage.com/


Reactive Programming
– is a programming paradigm oriented around data flows and the propagation of change.

http://en.wikipedia.org/wiki/Reactive_programming

http://news.dice.com/2014/01/13/how-is-reactive-different-from-procedural-programming/

https://www.youtube.com/watch?v=jIsxcXBWthI


Concurrency in Java
– is a form of computing in which several computations are executing during overlapping time periods –concurrently – instead of sequentially (one completing before the next starts). This is a property of a system – this may be an individual program, a computer, or a network – and there is a separate execution point or “thread of control” for each computation (“process”).

http://en.wikipedia.org/wiki/Concurrent_programming

http://en.wikipedia.org/wiki/Concurrency_in_java

http://tutorials.jenkov.com/java-concurrency/index.html

Hexagonal Architecture – Allow an application to equally be driven by users, programs, automated test or batch scripts, and to be developed and tested in isolation from its eventual run-time devices and databases.

As events arrive from the outside world at a port, a technology-specific adapter converts it into a usable procedure call or message and passes it to the application. The application is blissfully ignorant of the nature of the input device. When the application has something to send out, it sends it out through a port to an adapter, which creates the appropriate signals needed by the receiving technology (human or automated). The application has a semantically sound interaction with the adapters on all sides of it, without actually knowing the nature of the things on the other side of the adapters.

http://alistair.cockburn.us/Hexagonal+architecture

Software Company

http://asp-software.org/www/misv_resources/marketing-articles/how-to-make-a-million-dollars-in-software/

 

Advertisements
Code, JavaEE, SOA, Technical, WebServices

Read Remote File Contents

@Test
public void formatOutput() {
    final String routerJS =
            "static/master/router.js";
    readRemoteFileContents(routerJS);
}

private void readRemoteFileContents(final String fileToRead) {
    HttpURLConnection connection = null;
    try {
        connection = (HttpURLConnection)githubURL(fileToRead).openConnection();
    } catch (IOException e) {
        e.printStackTrace();
    }

    Scanner scanner = null;
    try (BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
        scanner = new Scanner(
                new StringReader(
                        reader.lines().collect(
                                Collectors.joining(System.getProperty("line.separator")))))
        .useDelimiter(System.getProperty("line.separator"));

        while(scanner.hasNext()) {
            System.out.printf("%s%n", scanner.next());
        }
    } catch (IOException e) {

    } finally {
        if (scanner != null) scanner.close();
        if (connection != null) connection.disconnect();
    }

}

private URL githubURL(final String fileToRead) throws MalformedURLException {
    final String baseGitHubFiles = "https://raw.githubusercontent.com/enterprisesaas/";
    final StringBuilder url = new StringBuilder(baseGitHubFiles).append(fileToRead);
    return new URL(url.toString());
}
Code, JavaEE, SOA, Technical, WebServices

Hello World Restful Web Service Using Spring

Spring Framework provides all kinds of wonderful benefits to the modern developer. It has provided a way to build REST Web Services that is straightforward and productive. You only have to use what you need from Spring, its not an all or nothing framework.

In order to facilitate building our ‘Hello World’ service, we will first open IntelliJ IDEA 13 Community Edition and create a new project.

Create new project.

Select Maven as the project type and enter the project name as HelloWorldRestService as shown.

Enter project name.

Click the Next button and select the checkbox [] Create from archetype, then choose the maven-archetype-webapp, click next and finish. If asked, select to enable auto import for your maven settings.

Your project should look like the following.

Initial project view.

Replace your pom.xml file will the contents below.


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 <modelVersion>4.0.0</modelVersion>

<groupId>HelloWorldRestService</groupId>
 <artifactId>HelloWorldRestService</artifactId>
 <version>1.0-SNAPSHOT</version>
 <packaging>war</packaging>
 <properties>
 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 <java.version>1.7</java.version>
 <maven.compiler.plugin>2.3.2</maven.compiler.plugin>
 <spring.version>4.0.0.RELEASE</spring.version>
 </properties>

<dependencies>
 <dependency>
 <groupId>junit</groupId>
 <artifactId>junit</artifactId>
 <version>4.11</version>
 <scope>test</scope>
 </dependency>
 <dependency>
 <groupId>org.springframework</groupId>
 <artifactId>spring-core</artifactId>
 <version>${spring.version}</version>
 </dependency>

<dependency>
 <groupId>org.springframework</groupId>
 <artifactId>spring-context</artifactId>
 <version>${spring.version}</version>
 </dependency>

<dependency>
 <groupId>org.springframework</groupId>
 <artifactId>spring-beans</artifactId>
 <version>${spring.version}</version>
 </dependency>

<dependency>
 <groupId>org.springframework</groupId>
 <artifactId>spring-web</artifactId>
 <version>${spring.version}</version>
 </dependency>

<dependency>
 <groupId>org.springframework</groupId>
 <artifactId>spring-webmvc</artifactId>
 <version>${spring.version}</version>
 </dependency>

<dependency>
 <groupId>org.springframework</groupId>
 <artifactId>spring-jms</artifactId>
 <version>${spring.version}</version>
 </dependency>

<dependency>
 <groupId>org.springframework</groupId>
 <artifactId>spring-orm</artifactId>
 <version>${spring.version}</version>
 </dependency>

<dependency>
 <groupId>org.springframework</groupId>
 <artifactId>spring-oxm</artifactId>
 <version>${spring.version}</version>
 </dependency>

<dependency>
 <groupId>org.springframework</groupId>
 <artifactId>spring-test</artifactId>
 <version>${spring.version}</version>
 </dependency>

<dependency>
 <groupId>log4j</groupId>
 <artifactId>log4j</artifactId>
 <version>1.2.17</version>
 </dependency>

<dependency>
 <groupId>org.slf4j</groupId>
 <artifactId>slf4j-api</artifactId>
 <version>1.7.2</version>
 <type>jar</type>
 </dependency>

<dependency>
 <groupId>com.google.code.gson</groupId>
 <artifactId>gson</artifactId>
 <version>2.2.2</version>
 </dependency>
 </dependencies>

<build>
 <plugins>
 <plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-compiler-plugin</artifactId>
 <version>${maven.compiler.plugin}</version>
 <configuration>
 <source>${java.version}</source>
 <target>${java.version}</target>
 <compilerArgument>
 -XDignore.symbol.file
 </compilerArgument>
 </configuration>
 </plugin>
 </plugins>
 </build>
</project>

Create Rest Controller

Create a new package named hello in /src/main/java. Create a new class named HelloRestController, then annotate the class with the @Controller annotation and enter the following code.

private final Logger logger = LoggerFactory.getLogger(HelloRestController.class);

@RequestMapping(value = "/helloworld", method = RequestMethod.GET)
 public @ResponseBody String displayTemplateJSON() throws Exception {
 logger.info("displayTemplateJSON() method invoked.");
 Map<String, Object> dataStructure = new HashMap<>();
 Map<String, Object> data = new HashMap<>();
 Gson gson = new Gson();

// build a simple data structure
 dataStructure.put("dataStructure", getStructure());
 logger.info("displayTemplateJSON(), building data structure.");

// convert Map to JSON
 String json = gson.toJson(dataStructure, Map.class);
 logger.info("displayTemplateJSON(), converting data structure to JSON.");

if (json != null) {
 logger.info("displayTemplateJSON(), returning data structure as JSON.");
 return json;
 }

return "\"{ \"No data foundl.\"}\"";
 }

 private Map<String, Object> getStructure() {
 Map<String, Object> data = new HashMap<>();
 data.put("Task", "Learn Spring Rest Web Services.");
 data.put("Company", "Example Inc.");

List<String> requestTypes = new ArrayList<>();
 requestTypes.add("RequestTypeOne");
 requestTypes.add("RequestTypeTwo");
 requestTypes.add("RequestTypeThree");
 requestTypes.add("RequestTypeFour");
 requestTypes.add("RequestTypeFive");
 requestTypes.add("RequestTypeSix");
 requestTypes.add("RequestTypeSeven");
 requestTypes.add("RequestTypeEight");
 data.put("RequestTypes", requestTypes);

logger.info("displayTemplateJSON(), data structure is: {}", data);
 return data;
 }

Configuration

You’re almost done. To ensure that Spring knows about your MVC Controller and outputs your logging, create a class named WebConfig, annotate it with @Configuration, @EnableWebMvc and @ComponentScan as shown.

intellij-webconfig

Next, create log4j.properties in /src/main/resources with the following content.

intellij-log4j

 

 

web.xml Configuration

A web.xml is required for this setup (note: there are ways to get rid of this as well, not covered in this article). Replace the contents of your web.xml with the following.


<?xml version="1.0" ?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
 version="3.0">

<display-name>Web Application</display-name>
<servlet>
<servlet-name>myServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
 <param-name>contextClass</param-name>
 <param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
</init-param>
<init-param>
 <param-name>contextConfigLocation</param-name>
 <param-value>hello.WebConfig</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
 <servlet-name>myServlet</servlet-name>
 <url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>

Building and Deploying

Run maven clean and then install, deploy to your favorite Servlet container.

Invoke the rest service at: http://localhost:8080/HelloWorldRestService/helloworld

 

Enjoy.

Code, JavaEE, SOA, WebServices

Messaging Lifecycle Design

Goals:

  1. Abstract away common details for processing data exchanged using Messaging Oriented Middleware.
  2. Start with the common items and drill-down into the details.
  3. Support exchanging various types of text data, e.g., JSON, XML, YML, CSV
  4. Declare a lifecycle interface with the common items defined to be implemented by an abstract class which will them be subclassed by detail classes.

MessagingLifecycle <interface>

import javax.jms.Message;
import java.io.InputStream;
import java.util.Map;

public interface MessagingLifecycle {

/**
 * loadProductMetaData
 *
 * Loads ALL meta data connected to the given object instance
 * @return
 */
 public Map<String, Object> loadProductMetaData();

/**
 * convertMessageToInputStream
 *
 * Converts the given message to an InputStream
 * @param message
 * @return
 */
 public InputStream convertMessageToInputStream(Message message);

/**
 * performXSLTransformations
 *
 * Allows a product's given XML to be massaged using XPath
 * @param inputStream
 * @return
 */
 public InputStream performXSLTransformations(InputStream inputStream);

/**
 * convertInputStreamToXMLForRequestType
 *
 * Convert the inputStream into a JAXB object instance
 * @param inputStream
 * @param typeToConvertTo
 * @return
 */
 public Object convertInputStreamToXMLForRequestType(InputStream inputStream, Class typeToConvertTo);

}

Business, WebServices

Java EE Senior Web Developer Profile

DAVID KING, SENIOR JAVA WEB DEVELOPER  enterprise.saas@gmail.com
WEB SERVICES PROJECTS
RESTFUL WEB SERVICE DATA PROVIDER

Property Inspections enhancement to existing applications created the need for a go-between data provider. A new RestFul Web Service was created to serve as this data provider for multiple internal applications. Provided technical implementation estimates for programming tasks. Designed Java interfaces for service API, models objects, enums. Worked with and gave guidance to developer for persistence API Java interface and test module settings and configured Spring Framework XML files for Spring MVC, Spring Security and Bean Wiring.

SOAP/MTOM WEB SERVICES FOR REPORTS UPLOAD
To aid workflow requirements for business processes related to Property Inspections, a new SOAP/MTOM Web Service was created to allow multiple vendors to upload completed reports. Researched XML Schema requirements for MTOM/XOP element creation and validated XML Schema and WSDL for WS-I Compliance. Implemented Web Services module for SOAP/MTOM using Spring Web Services. Migrated WS-I Basic Security Profile to use Digest Authentication using Spring Security. Provided Development Support and Problem Resolution for vendor testing.

WEB APPLICATIONS

ONLINE UNIVERSITY WEB DIRECTORY
Radford University had an existing web directory based upon flat files and SAS templates which a maintenance issue, also the interface was not easy to use providing an unpleasant experience for its users. Mr. King was tasked with writing a completely new web directory front-end using existing data stored in an Oracle database. The requirements for the directory included providing search capabilities to the general public and made available to faculty/staff and students of the university. It was built using Java EE Technologies including User Interface Design, Middle Tier Application Container Deployment, Database SME Interactions and Unit/User Acceptance Testing.

THIRD PARTY ON-LINE FORUMS AND KNOWLEDGE BASE SUITE UPGRADE
Standalone Forums and Knowledge Base applications were outdated and a better solution was proposed to merge two independent forums and a single knowledge base into a new integrated forums and knowledge base suite. Wrote code to integrate 3rd Party Forums and Knowledge Base suite into single sign-on process for existing portal. Coded JUnit tests to verify new functionality. Deployed application to Clustered Web Logic Application Server. Worked with vendor technical support and internal team to resolve performance issues.

PROJECT SKILLS  – Used Across All Projects
•  Attend, facilitate and contribute to application design meetings and requirements refinement.
•  Write technical specifications to convert business requirements to a technical plan of  execution.
•  Code class hierarchies using Object-Oriented Design and technical problem solving skills.
•  Develop unit tests to validate technical implementation, and research and fix application bugs and defects.

EMPLOYERS
TEKPARTNERS AT ROYAL CARIBBEAN CRUISE LINES, FL – 50/hr 8/2011 – 2/2012
CITIZENS PROPERTY INSURANCE CORPORATION, FL – 75k 11/2008 – 6/2011
AT&T, VA- 61 k 10/2006 – 7/2008
RADFORD UNIVERSITY, VA-  41k 10/2001 – 10/2006

EDUCATION
Bachelor of Science in Information Technology, Magna Cum Laude GPA 3.80 graduated 07/2005 from
American Inter-Continental University, Hoffman Estates, IL.