Development of the EDEX plug-in Ingest overview Manual Endpoint LDM DistributionSrv Plugin decoder Plugin Data Object PersistIndexSrv NotificationSrv.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

CE881: Mobile and Social Application Programming Simon M. Lucas Menus and Dialogs.
Developing in CAS. Why? As distributed you edit CAS 3 with Eclipse and build with Maven 2 – Best Practice for Release Engineering – Difficult edit-debug.
Apache Struts Technology
Remote Method Invocation (RMI) Mixing RMI and sockets
1 CS Sept. Customizing a class & testing Quiz 2 on Tuesday 15 Sept Purpose of a constructor (slide 5) Evaluating a new expression (slide 6) Fields;
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
Views Dwight Deugo Nesa Matic
Apache Struts Technology A MVC Framework for Java Web Applications.
Writing Methods. Create the method Methods, like functions, do something They contain the code that performs the job Methods have two parts.
Lesson 3 Remote Method Invocation (RMI) Mixing RMI and sockets Rethinking out tic-tac-toe game.
SETUP AND CONFIGURATIONS WEBLOGIC SERVER. 1.Weblogic Installation 2.Creating domain through configuration wizard 3.Creating domain using existing template.
Introducing JavaBeans Lesson 2A / Slide 1 of 30 JDBC and JavaBeans Pre-assessment Questions 1.Which of the given symbols is used as a placeholder for PreparedStatement.
Using Ant to build J2EE Applications Kumar
Struts 2.0 an Overview ( )
Ch 8-3 Working with domains and Active Directory.
Chapter 4 Code Editor Goals and Objectives Program more efficiently? How can you speed up your development process? Do you want to learn useful shortcuts.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA ‏ Packages.
SelfDiagnose “who is to blame” ernest micklei, April 2007.
1 v1.6 08/02/2006 Overview of Eclipse Lectures 1.Overview 2.Installing and Running 3.Building and Running Java Classes 4.Refactoring 5.Debugging 6.Testing.
Using Eclipse. What is Eclipse? The Eclipse Platform is an open source IDE (Integrated Development Environment), created by IBM for developing Java programs.
IT 211 Project Integration and Deployment Lab #11.
CSC172 Intro Pepper. Goals Reminder of what a class is How to create and use classes How to design classes How to think in terms of objects How to comment.
Writing Widgets & Custom Script API for BOY Xihui Chen
LiveCycle Data Services Introduction Part 2. Part 2? This is the second in our series on LiveCycle Data Services. If you missed our first presentation,
© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Data Structures for Java William H. Ford William R. Topp Appendix E The EZJava.
Copyright © Curt Hill Java Looking at our first console application in Eclipse.
Introduction to Eclipse CSC 216 Lecture 3 Ed Gehringer Using (with permission) slides developed by— Dwight Deugo Nesa Matic
GEMVC. The Setup Folders Views Value Objects (VOs) Custom Events Service CFCs Controller Model Application Main MXML.
How to Build a Struts Application with JBuilder 9.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Introduction to Android (Part.
JSF Framework Java Server Faces Presented by Songkran Totiya (6/10/2014)
1 CSC/ECE 517 Fall 2010 Lec. 3 Overview of Eclipse Lectures Lecture 2 “Lecture 0” Lecture 3 1.Overview 2.Installing and Running 3.Building and Running.
Using oXygen 12 with XQuery Using oXygen to build and execute XQuery XQuery applications on eXist Date: April 2011 Dan McCreary President Dan McCreary.
Connect. Communicate. Collaborate PerfsonarUI plug-in tutorial Nina Jeliazkova ISTF, Bulgaria.
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai Montreal CRIM Workshop Sakai code exercises Aaron Zeckoski.
Separating the Interface from the Engine: Creating Custom Add-in Tasks for SAS Enterprise Guide ® Peter Eberhardt Fernwood Consulting Group Inc.
CIS 234: Java Methods Dr. Ralph D. Westfall April, 2010.
Surya Bahadur Kathayat Outline  Ramses  Installing Ramses  Ramses Perspective (Views and Editors)  Importing/Exporting Example.
13 Copyright © 2004, Oracle. All rights reserved. Adding Validation and Error Handling.
Building Packages BCIS 3680 Enterprise Programming.
CIT 590 Intro to Programming Lecture 13. Some Eclipse shortcuts CTRL + SHIFT + F – format file (proper indentation etc). Please do this before you submit.
FTP COMMANDS OBJECTIVES. General overview. Introduction to FTP server. Types of FTP users. FTP commands examples. FTP commands in action (example of use).
Chapter 11: Advanced Inheritance Concepts. Objectives Create and use abstract classes Use dynamic method binding Create arrays of subclass objects Use.
© I-Logix Rhapsody C++ V /01/2004E1-1 “Essential” Tool Training Basic Rhapsody Basic Rhapsody Rhapsody in C++ V /01/04.
Open project in Microsoft Visual Studio → build program in “Release” mode.
In this class, we will cover: Overriding a method Overloading a method Constructors Mutator and accessor methods The import statement and using prewritten.
SDJ INFOSOFT PVT. LTD. 2 BROWSERBROWSER JSP JavaBean DB Req Res Application Layer Enterprise server/Data Sources.
Apache Struts Technology A MVC Framework for Java Web Applications.
Customizing Share Document Previews Will Abson Senior Integrations Engineer and Share Extras Project Lead
Today Javadoc. Packages and static import. Viewing API source code. Upcoming Topics: –protected access modifier –Using the debugger in Eclipse –JUnit testing.
Using Ant in Eclipse Dwight Deugo Nesa Matic
Objectives Take Identified dataset Develop data model and data plug-in Develop EDEX plug-in to ingest data Understand data flow Be able to start from.
9.1 CLASS (STATIC) VARIABLES AND METHODS Defining classes is only one aspect of object-oriented programming. The real power of object-oriented programming.
Eclipse.
The eclipse IDE IDE = “Integrated Development Environment”
Module Road Map Refactoring Why Refactoring? Examples
Class Structure 15-Jun-18.
CCA Skill Certification
Web Development in Microsoft Visual Studio 2013
Overview of Eclipse Lectures
1. Open Visual Studio 2008.
Add Image and Title to Individual Page
Electronics II Physics 3620 / 6620
Constructors, GUI’s(Using Swing) and ActionListner
Using Eclipse.
Java IDE Dwight Deugo Nesa Matic Portions of the notes for this lecture include excerpts from.
Java Programming Language
Plug-In Architecture Pattern
Presentation transcript:

Development of the EDEX plug-in

Ingest overview Manual Endpoint LDM DistributionSrv Plugin decoder Plugin Data Object PersistIndexSrv NotificationSrv Post gres HDF5

Plug-in naming conventions Use reverse – E.g. gov.nasa.msfc.sport….. Data Plug-in – gov.nasa.msfc.sport.dataplugin.pluginname EDEX Plug-in – gov.nasa.msfc.sport.edex.pluginname CAVE Plug-in – gov.nasa.msfc.sport.viz.pluginname

Creating new project File Menu, New, Project – Select Plug-in Project, Next – Project Name: gov.nasa.msfc.epdt.edex.plugin.aqi Next – Provider Name: EPDT – Uncheck generate Activator – Unchecked This plug-in will make contributions to the UI – No is checked for creating a rich client application. – Finished

Adding to uframe Open file com.raytheon.edex.uframe feature.xml

Adding to includegen This step is only required if your plug-in does not contain noaa.nws or raytheon Edit build.edex, edex, common.properties – Add to includegen.filter – Includegen.filter=raytheon|noaa\.nws|nasa\.msfc

Note If you place your plug-ins into a separate directory you will also need to add it to build.edex, edex, common.properties – Add entry to extend the dir.01 – So if you organize your plug-ins into a epdt directory – Create entry dir.08=epdt

Adding base dependencies Edit META-INF/MANIFEST.MF Add following plug-in dependencies gov.nasa.msfc.epdt.dataplugin.aqi, com.raytheon.uf.common.dataplugin;bundle-version=" ", com.raytheon.uf.common.geospatial;bundle-version=" ", org.dom4j;bundle-version="1.0.0" gov.nasa.msfc.epdt.dataplugin.aqi, com.raytheon.uf.common.dataplugin;bundle-version=" ", com.raytheon.uf.common.geospatial;bundle-version=" ", org.dom4j;bundle-version="1.0.0"

Creating package for decoder Right click on project, New, Package Name: gov.nasa.msfc.epdt.edex.plugin.aqi Finish

Creating decoder Right click on newly created package, New, Class – Name: AQIDecoder – Finish – Now you should have a new class in the correct package, but should be empty.

Add Placeholder decode method Create decode method public class AQIDecoder { public PluginDataObject[] decode(String input) throws Exception { return null; } public class AQIDecoder { public PluginDataObject[] decode(String input) throws Exception { return null; } Resolve PluginDataObject to com.raytheon.uf.common.dataplugin.PluginDataObject

Discuss various methods that could decode method could be public PluginDataObject[] decode(String input) throws Exception { } public PluginDataObject[] decode(byte[] data) throws Exception { } public PluginDataObject[] decode(byte[] data, Headers header) throws Exception { String filename = (String)headers.get(“camelfilenameonly”); } public PluginDataObject[] decode(String input) throws Exception { } public PluginDataObject[] decode(byte[] data) throws Exception { } public PluginDataObject[] decode(byte[] data, Headers header) throws Exception { String filename = (String)headers.get(“camelfilenameonly”); } Camel will know what you want and will provide data in that type

Now that we have decoder? Want to wire decoder to get data This is performed using Spring configuration files This will wire our new decoder to the architecture. Later we will tell EDEX to route products to our decoder. Manual Endpoint LDM Distribution Srv Plugin decoder

Introduction to Spring What is Spring? – Way to create instances of java objects using xml code. – Then you can wire them together using more spring configuration code. – Allows for very flexible configuration that can be reconfigured easily. – – Let’s look at some basic examples unrelated to AWIPS II.

Creating a Bean //Create new String using null constructor String myString = new String(); //Create new String using null constructor String myString = new String(); Now the Spring Context will have a bean named myString Above is the way to create an object in Java, and below is the way using Spring

Constructor args in spring package gov.nasa.msfc.sport.epdt.test; public class MyClass { String name; public MyClass(String name) { this.name = name; } package gov.nasa.msfc.sport.epdt.test; public class MyClass { String name; public MyClass(String name) { this.name = name; } Now the Spring Context will have a bean named thisOne, of the type MyClass. thisOne will have the name variable set to EPDT

Basic wiring package gov.nasa.msfc.sport.epdt.test; public class MyClass { String name; public MyClass(String name) { this.name = name; } package gov.nasa.msfc.sport.epdt.test; public class MyClass { String name; public MyClass(String name) { this.name = name; } Now the Spring Context will have a bean named thisOne, of the type MyClass. thisOne will have the name variable set to EPDT, but we could reuse myString in other beans

Wiring references to beans package gov.nasa.msfc.sport.epdt.test; public class MyClass { } package gov.nasa.msfc.sport.epdt.test; public class MyClass { } Now the Spring Context will have two beans named thisOne and theOther, And thisOne gets injected into theOther. package gov.nasa.msfc.sport.epdt.other; public class MyOtherClass { MyClass myclass; public MyOtherClass(MyClass myclass) { this.myclass = myclass; } package gov.nasa.msfc.sport.epdt.other; public class MyOtherClass { MyClass myclass; public MyOtherClass(MyClass myclass) { this.myclass = myclass; }

Properties and getters and setters package gov.nasa.msfc.sport.epdt.test; public class MyClass { String name; public setName(String name) { this.name = name; } package gov.nasa.msfc.sport.epdt.test; public class MyClass { String name; public setName(String name) { this.name = name; } Now the Spring Context will have a bean named thisOne, of the type MyClass. thisOne will have the name variable set to EPDT. It used the setter method called setName.

One last type of Spring Wiring used public class PluginRegistry extends GenericRegistry { private static PluginRegistry instance = new PluginRegistry(); … public static PluginRegistry getInstance() { return instance; public Object register(String pluginName, PluginProperties pluginProperties) throws RegistryException { public class PluginRegistry extends GenericRegistry { private static PluginRegistry instance = new PluginRegistry(); … public static PluginRegistry getInstance() { return instance; public Object register(String pluginName, PluginProperties pluginProperties) throws RegistryException { This pattern is used for registration purposes within the EDEX framework.

Creating directories to hold spring Right click on the project, New, Folder – Name: res Right click on newly created folder called res, new, folder – Name: spring

Make sure this gets bundled with jar Double Click on build.properties – Add Check next to res directory – Save file Now anything in the res directory will get bundled with the jar that is created.

pluginname-common.xml Right click on spring folder and select New, Other, XML, XML file – File Name: pluginname-common.xml, where pluginname is the name of your plug-in. – Finish This Spring configuration file will create some beans that are used in other spring configuration files. Within this file you will also register your plug-in with the plug-in registry service. Plugin Registry Service is used by other parts of EDEX to find out information about your plugin.

epdtaqi-common.xml <beans xmlns=" xmlns:xsi=" xsi:schemaLocation=" <beans xmlns=" xmlns:xsi=" xsi:schemaLocation=" Define plug-in name into bean for later use in Spring Context

epdtaqi-common.xml cont’d Define Plug-in properties and then register your plug-in to the Plug-in Registry

pluginname-ingest.xml Right click on spring folder and select New, Other, XML, XML File file called pluginname-ingest.xml, where pluginname is the name of your plug-in. Finish This Spring configuration file will create some beans for your decoder and Data Access Object (DAO). It will also create threads to do work, and register your plug-in within camel to receive products from distribution service.

epdtaqi-ingest.xml Define register thread pattern to do work.

epdtaqi-ingest.xml Create instance of Decoder, and register with distribution service to get data.

epdtaqi-ingest.xml <camelContext id="epdtaqi-camel“ xmlns= errorHandlerRef="errorHandler“ ? epdtaqi java.lang.Throwable <camelContext id="epdtaqi-camel“ xmlns= errorHandlerRef="errorHandler“ ? epdtaqi java.lang.Throwable Define pipeline to process data.

epdtaqi-ingest.xml Registers Camel context for our pipeline to the Context manager. Starting our camel context, thus enabling our pipeline.

Creating the utility tree for purging Right click on project, New, Folder Name: utility Right click on utility folder you just created, new folder common_static. Right click on the common_static and create new folder called base. Right click on the base and create new folder called purge. Right click on purge directory, New,Other, XML, XML File – Name: pluginnamePurgeRules.xml, where plugin name is your plugin name. – Finish This file will hold your custom purge rules for your data you ingest with this plugin.

Purge rules Only keep 10 versions default

Other purge types network :00:00 NALMA 90 network :00:00 NALMA 90

Looking around the ADE for purge rules

Creating the utility tree for distribution file. Right click on utility folder, New, Folder – Name: edex_static. Right click on the edex_static and create new folder called base. Right click on the base and create new folder called distribution. Right click on distribution directory, New, Other, XML, XML File – Name: pluginname.xml, where plugin name is your plugin name. This file will hold rules that tell Distribution Service to route incoming products to your plugin.

Distribution file airnow* airnow* airnow* aqi* airnow* aqi* These distribution rules are applied to the headers of the files, and to the filenames. So it can match either. And data can be routed to multiple plug-ins. These files can be edited while EDEX is running. They will be re-read on the fly by EDEX.

Deploying the plug-in Expand out build.edex – Right click on deploy-install.xml Select Run As.., 2 Ant Build Watch console and make sure your two plug- ins got deployed. Might have to change preferences in console to allow more output.

Where do these files go for deploy Plugins get deployed to – /awips2/edex/lib/plugins Items in the utility directory go to – /awips2/edex/data/utility

Logging in your plug-in Using IUFStatusHandler public class AQIDecoder { private static IUFStatusHandler handler = UFStatus.getHandler(AQIDecoder.class); public PluginDataObject[] decode(String input) throws Exception { handler.info(“Starting decoding EPDT AQI”); return null; } public class AQIDecoder { private static IUFStatusHandler handler = UFStatus.getHandler(AQIDecoder.class); public PluginDataObject[] decode(String input) throws Exception { handler.info(“Starting decoding EPDT AQI”); return null; } Need to add dependency for com.raytheon.uf.common.status Resolve com.raytheon.uf.common.status.IUFStatusHandler, andResolve com.raytheon.uf.common.status.UFStatus handler.debug(“This is a debug message”);

Deploy again Expand out build.edex – Right click on deploy-install.xml Select Run As.., 2 Ant Build Now if you ingest a file it should print – “Starting decoding EPDT AQI” – In the ingest logfile.

Running EDEX If qpidd, edex_postgres, and http-pypies are running. Then you can start EDEX as user awips using: – cd /awips2/edex/bin – Normal./start.sh ingest – Debugging./start.sh ingest -d – This will only start the ingest. Watch for message stating that EDEX is Operational. – Then you can ingest your file.

Ingesting a file Copy your data file into – /awips2/edex/data/manual Watch the log file for EDEX ingest – tail –f /awips2/edex/logs/edex-ingest-YYYYMMDD.log – At this point it will print out to the ingest logfile the statement, and since we are returning a null it will also print errors.

Questions