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

Upload: posy-hunt

Post on 01-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

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.

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

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.

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

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.

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.

Lesson 2: Hands-On Installation

Install Distributed Components

• Reference document:

• installsetupgridservices.doc

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

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)

Lesson 3: Hands-On Code Examples

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

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

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

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();

}

Lesson 3: Hands-On Code Examples

Example 1: Analytical Grid Service

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

.ConnectToLexEVSAnalyticalGridService

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.

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.

}

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.

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.

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

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);

}

Lesson 3: Hands-On Code Examples

Example 3: Data Grid Service

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

GridServiceHandle

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.

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

}

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.

Lesson 3: Hands-On Code Examples

Example 4: Search for Coding Scheme

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

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.

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;}

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.

Lesson 3: Hands-On Code Examples

Example 5: Search for Concept

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

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'.

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;

}

LexEVS in caGrid Environment

Questions?