1 / 19

Developer Libraries and Services

Developer Libraries and Services. Learning Objectives:. This module will help you... Learn about optional JXTA libraries and services Understand the goals of the JXTA Easy Entry Library (EZEL) project Understand the benefits of the JXTA Abstraction Library (JAL) API

Télécharger la présentation

Developer Libraries and Services

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Developer Libraries and Services

  2. Learning Objectives: • This module will help you... • Learn about optional JXTA libraries and services • Understand the goals of the JXTA Easy Entry Library (EZEL) project • Understand the benefits of the JXTA Abstraction Library (JAL) API • Gain familiarity with the JAL API • Learn about other JXTA services

  3. Overview • Optional Libraries • EZEL • JAL • JXTA Services • JAAS • JNLP • RMI, SOAP, etc.

  4. EZEL Overview • EZEL = Easy Entry Library for JXTA • Goal: • Enable a client-server developer – with no JXTA or P2P experience – to create a JXTA service in a single afternoon • Provides client/server-like API • Hides implementation details • Provides reasonable defaults

  5. Benefits • Simplifies JXTA application development • Reduces the learning curve • Provides “best practices” for handling common JXTA programming tasks • Complete isolation from API changes • Can “learn as you go” and supplement API with direct JXTA programming

  6. JAL: JXTA Abstraction Library • Extension to EZEL • API for commonly used JXTA primitives • Discover peers (and allow to be discovered) • Search for peers and peergroups • Create and manage peergroups • Communicate with other peers • Get information about peers and peergroups

  7. JAL Architecture Application EZEL Peer interface JXTA Abstraction Layer JXTA

  8. EZEL Classes • class net.pkg.jal.EZAdvertisement • class net.pkg.jal.EZCommunication • class net.pkg.jal.EZDiscovery • class net.pkg.jal.EZDisplay • class net.pkg.jal.EZGroups • class net.pkg.jal.EZMinimalPeer • Implements net.pkg.jal.Peer, net.jxta.pipe.PipeMsgListener • class net.pkg.jal.EZUtilities

  9. JAL API • void boot(String name)void boot(String name, String group) • Boot the peer; every peer must call it • void publish() • Publish peer so other can discover it • String getName() • Get the name of this peer • String[] getPeers() • Get peers associated with this peer in current peergroup

  10. JAL API Message Functions • boolean sendMessage(String name, Message msg)Message receiveMessage() • Send or receive a message • boolean broadcast(Message msg) • Broadcast a message to everyone in the group • Message newMessage() • Create a new, blank message • void pushObject(Message msg, String tag, Object obj)Object popObject(Message msg, String tag) • Push/pop an object to the Message

  11. JAL API Group Functions • String[] getGroups() • Get peergroups associated with this peer • void createGroup(String name) • Create a new group • void createAndOrJoinGroup(String name) • Create and/or join group • void joinGroup(String name) • Join a group • void leaveGroup(String name)

  12. JAL API Search & Display Functions • boolean searchGroupWithName(String name) • Search for a peergroup • boolean searchPeerWithName(String name) • Search for a peer • void displayPeers()void displayGroups()void displayServices() • Display all peers, peergroups, or services in the current peergroup • String getPeerStatistics() • Display some useful statistics

  13. import net.jxta.endpoint.Message;import net.pkg.jal.*;import java.io.*;public class TestApp { private static Peer me; public static void main (String args[]) {me = new EZMinimalPeer(); try {me.boot("MDE" + args[0]); me.displayPeers(); me.displayGroups(); me.createGroup("MDE"); me.displayGroups(); me.joinGroup("MDE"); me.displayPeers(); me.displayGroups(); //finally try out getJoinedGroups String a[] = me.getJoinedGroups(); System.out.println("getJoinedGroups:"); for(int i = 0; i < a.length; i++){ System.out.println(a[i]); } System.exit(0); }catch (Exception e) { e.printStackTrace(); System.exit(0); } System.exit(0); }} JAL Example

  14. JAAS Overview • Java Authentication and Authorization Service (JAAS) • Enables services to authenticate and enforce access controls upon users • Supports user-based authorization • Releases • Integrated into the Java 2 SDK, Standard Edition, v 1.4 • Optional package to the Java 2 SDK, v 1.3.x

  15. JAAS Membership Service Project • JAAS MemberShip Service • JXTA MembershipService implementation • Uses JAAS for authentication • Leverage existing authentication services • (JNDI, LDAP, NIS, WinNT, and Unix) • Provides a framework for integrating new authentication services • (Liberty, SAML, Passport) • Status • A functional implementation of JaasMembershipService is in place • http://jaas-membership.jxta.org

  16. Code Example try { MembershipService membership = jaasGroup.getMembershipService(); AuthenticationCredential authCred = new AuthenticationCredential(jaasGroup, "JAAS", null); membership.join(membership.apply(authCred)); Enumeration enum = membership.getCurrentCredentials(); if(enum.hasMoreElements()) { JaasCredential subjCred = (JaasCredential)enum.nextElement(); Subject subject = subjCred.getSubject(); } else { System.out.println("No Credentials!"); } } catch (Exception e) { }

  17. JXTA JnlpLoader Project • Goals: • An implementation of JxtaLoader • Utilizes Java Network Launching (JNLP) to load modules, and resources • JnlpLoader is based on OpenJNLP • http://openjnlp.nanode.org/ • Status • Basic functionality is complete • http://jnlploader.jxta.org/

  18. JXTA Community Services • http://services.jxta.org • SOAP • JXTA SOAP bindings • JXTA-RMI • RMI API on top of JXTA • Validation Service • A ValidationService for JXTA Advertisements • Many more ...

  19. Developer Libraries and Services

More Related