Top Banner
LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009
32

LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Jan 01, 2016

Download

Documents

Posy Hunt
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

LexEVS in a caGrid

Environment

Interacting with

LexEVS 5.0

November 2009

Page 2: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

LexEVS in a caGrid Environment

Course Outline

• Course Learning Objectives• Discuss the components required for installing a distributed environment.

• Discuss the download and setup of LexEVS 5.0 for the caGrid Environment.

• Provide hands-on code exercises.

Page 3: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Session Details: LexEVS in a caGrid Environment Lesson Syllabus

• Lesson 1: Overview of caGrid Environment• Lesson 2: Hands-On Installation• Lesson 3: Hands-On Code Examples

Page 4: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 1: Overview of Distributed Mode

• When you complete this lesson, you will be able to:• Identify the components required for installing a LexEVS caGrid

environment, for both the Analytical and Data Grid Services.

Page 5: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 1: Overview of Distributed Mode

Distributed Environment Components

• The reference software stack:

• Java 1.5

• MySQL 5.0.45

• JBoss 4.0.5 GA

• LexEVS 5.0 local runtime

• LexEVS 5.0 distributed environment

• These should already be in place on your workstation. The LexEVS 5.0 local runtime, as well as the distributed envirnonment, have been installed and configured previously.

• Reference files:

• LexEVS_50_caGRIDServices_analytical_jboss.zip

• LexEVS_50_caGRIDServices_data_jboss.zip

Page 6: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 1: Overview of Distributed Mode

Reference Files

• LexEVS_50_caGRIDServices_analytical_jboss.zip

• LexEVS 5.0 Analytical Grid Service

• Includes war directory structure (wsrf.war) to be deployed to JBoss server.

• Available from VKC download.

• LexEVS_50_caGRIDServices_data_jboss.zip

• LexEVS 5.0 Data Grid Service

• Includes war directory structure (wsrf.war) to be deployed to JBoss server.

• Available from VKC download.

Page 7: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 2: Hands-On Installation

• When you complete this lesson, you will be able to:• Download and setup of LexEVS 5.0 caGrid environment for both the

Analytical and Grid Services.

Page 8: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 2: Hands-On Installation

Install Distributed Components

• Reference document:

• installsetupgridservices.doc

• We will take 15 minutes to perform this hands-on exercise.

Page 9: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 2: Hands-On Installation

Review Installation

• Copy the Data Grid Service wsrf.war directory into incompleteLexevsServer\server\cacoreDataGrid\deploy directory.

• Copy the Analytical Grid Service wsrf.war directory into incompleteLexevsServer\server\analyticalGrid\deploy directory.

• First start the Data Grid Service server (startServer1.bat)

• Once that is started, start the Analytical Grid Service server (startServer2.bat)

Page 10: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

• When you complete this lesson, you will be able to:• Execute code examples in a caGrid environment.

Page 11: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Exercises

• Code Examples for the LexEVS Grid Environment are split into two Eclipse Projects:

• bootcamp-analytical-grid• Code examples for the LexEVS Analytical Grid Service

• bootcamp-data-grid• Code Examples for the LexEVS Data Grid Service

• Hands-on code examples are broken down into three categories:

• Examples

• Exercises

• Solutions

Page 12: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Analytical Grid Service

• The following Code Examples will focus on the LexEVS Analytical Grid Environment

• All source code will be find in the ‘bootcamp-analytical-grid’ Eclipse Project

Page 13: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Analytical Grid Service Example Overview

ConnectToLexEVSAnalyticalGridService.java• Demonstrates how to connect to the LexEVS Analytical Grid Service. Using the

LexBIGServiceGridAdapter, a reference to a LexEVS Analytical Grid Service can be obtained given a URL.

/**

* Gets the LexBIG Service for the LexEVS Analytical Grid Service.

* @return the analytical grid lex big service

* @throws Exception the exception

*/

public LexBIGService getAnalyticalGridLexBIGService() throws Exception {

//Obtain the LexBIGServiceGridAdapter with the appropriate //URL. From that, get the LexBIGServiceInterface.

return new LexBIGServiceGridAdapter(SERVICE_URL)

.getLexBIGServiceInterface();

}

Page 14: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Example 1: Analytical Grid Service

• Navigate to:• lexevs.bootcamp.grid.analytical.examples.lexbigservice

.ConnectToLexEVSAnalyticalGridService

Page 15: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Exercise 1: Analytical Grid Service

• Navigate to:• lexevs.bootcamp.grid.analytical.exercises.lexbigservic

e.ConnectToLexEVSAnalyticalGridServiceExercise

• HINT:

• Modify the method protected LexBIGService getAnalyticalGridLexBIGServicee()so that it instantiates LexBIGService using a LexBIGServiceGridAdapter.

Page 16: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Answer 1: Analytical Grid Service

• Implemented method:

• private static String SERVICE_URL = BootcampConstants.ANALYTICAL_SERVICE_URL;

public LexBIGService getAnalyticalGridLexBIGService() throws Exception {

return new LexBIGServiceGridAdapter(SERVICE_URL) //Obtain the LexBIGServiceGridAdapter with the appropriate URL.

.getLexBIGServiceInterface(); //From that, get the LexBIGServiceInterface.

}

Page 17: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Demonstrate Service Contexts

DemonstrateServiceContexts

• Demonstrates how the LexEVS Analytical Grid Service uses caGrid Service Contexts to provide a state-full Web Service.

Page 18: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Example 2: Demonstrate Service Contexts

• Navigate to:• lexevs.bootcamp.grid.analytical.examples.lexbigservice

.DemonstrateServiceContexts

• The output of this example will demonstrate the actual classes returned to the client.

Page 19: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Data Grid Service

• The following Code Examples will focus on the LexEVS Data Grid Environment

• All source code will be find in the ‘bootcamp-data-grid’ Eclipse Project

Page 20: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Data Grid Service Example Overview

GetDataGridServiceHandle.java• Demonstrates how to connect to the LexEVS Data Grid Service. The DataServiceClient is

then used to construct a DataServiceHandle, which provides easier access to caGrid Data Service APIs

/**

* Return a reference to a LexEVS DataGridService.

* @return the data service handle

* @throws Exception the exception

*/

protected DataServiceHandle getDataGridServiceHandle() throws Exception{

//Create a DataServiceClient, and create a

//DataServiceHandle from that client.

DataServiceClient svc = new DataServiceClient(SERVICE_URL);

return new DataServiceHandle(svc);

}

Page 21: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Example 3: Data Grid Service

• Navigate to:• lexevs.bootcamp.grid.data.examples.dataservice.GetData

GridServiceHandle

Page 22: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Exercise 3: Data Grid Service

• Navigate to:• lexevs.bootcamp.grid.data.exercises.dataservice.GetDat

aGridServiceHandleExercise

• HINT:

• Modify the method protected DataServiceHandle getDataGridServiceHandle() so that it instantiates DataServiceHandle using a DataServiceClient.

Page 23: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Answer 3: Data Grid Service

• Implemented method:

• protected static String SERVICE_URL = BootcampConstants.DATA_GRID_SERVICE_URL;

protected DataServiceHandle getDataGridServiceHandle() throws Exception {

DataServiceClient svc = new DataServiceClient(SERVICE_URL); //Obtain the DataServiceClient with the correct URL

return new DataServiceHandle(svc);//Instantiate a DataServiceHandle with the DataServiceClient

}

Page 24: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Search for Coding Scheme Example Overview

CqlConcept.java

• Demonstrates how to connect to the LexEVS Data Grid Service and construct a CQL query to search for a CodingScheme.

Page 25: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Example 4: Search for Coding Scheme

• Navigate to:• lexevs.bootcamp.grid.data.examples.cql.CqlCodingScheme

Page 26: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Exercise 4: Search for Coding Scheme

• Navigate to:• lexevs.bootcamp.grid.data.exercises.cql.CqlCodingSchem

eExercise• HINT:

• Modify the method

• protected CQLQuery getCqlQuery ()

• This method should produce a CQLQuery that matches every loaded CodingScheme on the system.

Page 27: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Answer 4: Search for Coding Scheme

• Implemented method:

@Override

protected CQLQuery getCqlQuery() throws Exception {

//Create a new CQLQuery

CQLQuery query = new CQLQuery();

Object target = new Object();

//set the 'target' to 'CodingScheme'

target.setName(CodingScheme.class.getName());

query.setTarget(target);

//return the CQLQuery without specifying any

//specific Attributes to search for. This will

//match all CodingSchemes.

return query;}

Page 28: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Search for Concept Example Overview

CqlConcept.java

• Demonstrates how to connect to the LexEVS Data Grid Service and construct a CQL query to search for a Concept.

Page 29: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Example 5: Search for Concept

• Navigate to:• lexevs.bootcamp.grid.data.examples.cql.CqlConcept

Page 30: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Exercise 5: Search for Concept

• Navigate to:• lexevs.bootcamp.grid.data.exercises.cql.CqlConceptExer

cise• HINT:

• Modify the method • protected Attribute getAttribute()

• This method should produces an 'Attribute' that will match a Concept with an 'entityCode that equals 'Muscle'.

Page 31: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

Lesson 3: Hands-On Code Examples

Answer 5: Search for Concept

• Implemented method:

@Override

protected Attribute getAttribute() throws Exception {

Attribute attribute = new Attribute();//Construct a new 'Attribute'

attribute.setName("entityCode");//Set the name to 'entityCode'

attribute.setValue("Muscle");//Set the value to 'Muscle'

attribute.setPredicate(Predicate.EQUAL_TO);//Specify that it must be 'EQUAL_TO'

return attribute;

}

Page 32: LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.

LexEVS in caGrid Environment

Questions?