+ All Categories
Home > Documents > Creating Adjudicators in a WAR Computer Science Innovations, LLC.

Creating Adjudicators in a WAR Computer Science Innovations, LLC.

Date post: 16-Jan-2016
Category:
Upload: byron-franklin
View: 219 times
Download: 0 times
Share this document with a friend
Popular Tags:
34
Creating Adjudicators in a WAR Computer Science Innovations, LLC
Transcript
Page 1: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

Creating Adjudicators in a WAR

Computer Science Innovations, LLC

Page 2: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

Setup

Make sure /cloud project is downloaded Start up eclipse and open it in cloud directory

(something like /home/scott/cloud) ssh -X [email protected] to be able to open X

sessions if doing this on cloud [Screenshot]

Page 3: Creating Adjudicators in a WAR Computer Science Innovations, LLC.
Page 4: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

Setup (Eclipse)

Close front window and right click on left to open a New Project

[Screenshot]

Page 5: Creating Adjudicators in a WAR Computer Science Innovations, LLC.
Page 6: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

Setup (Eclipse)

Title the project cloud and hit Finish [Screenshot]

Page 7: Creating Adjudicators in a WAR Computer Science Innovations, LLC.
Page 8: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

Setup (Eclipse)

Screen should look like below [Screenshot]

Page 9: Creating Adjudicators in a WAR Computer Science Innovations, LLC.
Page 10: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

Setup (Eclipse)

Click Yes to include java perspective [Screenshot]

Page 11: Creating Adjudicators in a WAR Computer Science Innovations, LLC.
Page 12: Creating Adjudicators in a WAR Computer Science Innovations, LLC.
Page 13: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

Setup (Eclipse)

Go to util/src/cloud/LoadRestfulWebService.java

[Screenshot]

Page 14: Creating Adjudicators in a WAR Computer Science Innovations, LLC.
Page 15: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

LoadRestfulWebService Explained

Typical protocols

– Http, https, REST, JSON, 1-way SSL (https), 2-way SSL (https with identity assertion)

LoadRestfulWebService

– Uses RESTful service to load users, groups, and roles

– Calls cloud application and loads data into SOLR

Page 16: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

LoadRestfulWebService Explained

Main() adds roles, groups, and users AddUser(), AddRoles(), AddGroups()

– Gets properties from properties file

– Gets URI information to fill in user data• Category is 'table name'

– Sends data to servlet that writes to SOLR GetProperties()

– Gets data from load.properties

– Files are either on the web or off the classpath, load.properties is off classpath

Page 17: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

JSONUpdateServlet

Go to cloud-war/src/java/cloud/servlets/JSONUpdateServlet.java

[Screenshot]

Page 18: Creating Adjudicators in a WAR Computer Science Innovations, LLC.
Page 19: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

JSONUpdateServlet

Takes data from URI that is sent RESTfully and writes it to SOLR

WriteToSOLR() already exists and should be used to write to SOLR

Page 20: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

Where to Start?

Cloud-functional-tests/src/TestAdd.java [Screenshot]

Page 21: Creating Adjudicators in a WAR Computer Science Innovations, LLC.
Page 22: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

TestAdd.java

Test program that goes to SOLR, makes a request

– JUNIT test uses asserts to see if the test passes or fails. If assert line is true, test works, if not, then test does not work.

Page 23: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

Seeing if cloud works

Go to cloud/cloud/solr.solr.home/collection1/data and do an rm -rf *

Go to terminal, start tomcat with 'st' In other window, cd to /cloud/cloud and type:

ant deploy [Screenshot]

Page 24: Creating Adjudicators in a WAR Computer Science Innovations, LLC.
Page 25: Creating Adjudicators in a WAR Computer Science Innovations, LLC.
Page 26: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

Seeing if cloud works

In cloud/cloud do:

ant run-clear-index

ant run-load-web-service In browser go to:

localhost:8080/cloud/select?q=*:*&rows=100

[Screenshot]

Page 27: Creating Adjudicators in a WAR Computer Science Innovations, LLC.
Page 28: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

Cloud Project Continued

You have to add a login module to cloud

– Already added in for you Files to take from adjudicator_software folder

in content.scottstreit.com/compsec

– Jaas.config goes in tomcat config directory

– RolePrincipal.java

– SolrLoginModule.java• It gets called in web.xml

– There are security constraints and login-configs in web.xml

Page 29: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

SolrLoginModule

SolrLoginModule.java• It gets called in web.xml

– There are security constraints and login-configs in web.xml

– <auth-method>BASIC</auth-method> for login-config

Page 30: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

Cloud Project Continued

You have to add a login module to cloud

– Already added in for you Files to take from adjudicator_software folder

in content.scottstreit.com/compsec

– Jaas.config goes in tomcat config directory

– RolePrincipal.java

– SolrLoginModule.java• It gets called in web.xml

– There are security constraints and login-configs in web.xml

Page 31: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

JUNIT Test Attempt

In cloud/cloud run the following:

ant run-tests [Screenshot]

Page 32: Creating Adjudicators in a WAR Computer Science Innovations, LLC.
Page 33: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

JUNIT Test Attempt

Go to /cloud/cloud/cloud-functional-tests/classes and open the TestAdd.xml file inside the folder

[Screenshot]

Page 34: Creating Adjudicators in a WAR Computer Science Innovations, LLC.

Recommended