1 modeling stateful resources with web services ice 0534 - ph.d lecture 20042068 byung-sang kim

35
1 Modeling Stateful Resources Modeling Stateful Resources with Web Services with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

Upload: caitlin-washington

Post on 25-Dec-2015

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

1

Modeling Stateful Resources with Modeling Stateful Resources with Web ServicesWeb Services

ICE 0534 - Ph.D lecture20042068

Byung-sang Kim

Page 2: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

2

ContentsContents

Introduction SOA and ServicesMotivation

Modeling Stateful Resources in WSStateless & StatefulThe WS-Resource Framework Model

Standardization and ImplementationPublic Review SpecificationsJava WS Core in GT4

Page 3: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

3

Service Oriented Architecture Service Oriented Architecture (SOA)?(SOA)?

An SOA application is a composition of services

A “service” is the atomic unit of an SOA Services encapsulate a business process Service Providers Register themselves Service use involves: Find, Bind,

Execute Most well-known instance is

Web Services

ServiceRegistry

ServiceProvider

ServiceConsumer

Find Register

Bind,Execute

Page 4: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

4

Web ServicesWeb Services

“A Web service is a software system designed to support interoperable machine-to-machine interaction over a network.”

“It has an interface described in a machine-processable format (specifically WSDL).”

“Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.”

W3C – Web Services Architecture

Page 5: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

5

Grid ..?Grid ..?

Flexible, secure, coordinated resource sharing among dynamic collections of individuals, institutions, and resource

How different from distributed computing? Focused on dynamic, cross-organizational

sharing Internet scale distributed computing

Grid architecture Protocol architecture by which VO users and

resources negotiate , establish, manage and exploit sharing relationships.

A services standards-based open architecture that facilitates extensibility, interoperability, portability and code sharing

Page 6: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

6

Motivation (1/2)Motivation (1/2)

Grid Focus on the sharing multiple sources Need standard protocol and infrastructure for

SOA WS is good as a Grid infrastructure and

standard protocol (OGSA) But WS

Focus on the interoperability between services Does not care current status of the services

and their entities Need Service that acts upon stateful resources

Provides access to, or manipulates a set of logical stateful resources

Page 7: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

7

Motivation (2/2)Motivation (2/2)

Building large-scale systems by composition of many heterogeneous components demands that we extract and standardize common patterns Use WS-Addressing for referring to resources,

with extensions for stability Define resource lifetime management interfaces Define resource inspection and monitoring

interfaces Define base fault representation & groups

WSRF is just a start to WS Distributed Management (WSDM) defining resource management framework (probably) on WSRF

Page 8: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

8

Grid Services as an extension of Grid Services as an extension of WS WS

Resource management protocol

Resource framework in WSDL

•Remote Job Execution•Resource Discovery & Monitoring •Data Transfer & replication•Security

Grid Stuff

•WSDL / XML•SOAP / HTTP•TCP / IP•Internet

WSRFWeb

Services

OGSA

OASIS

Page 9: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

9

Modeling Stateful Modeling Stateful Resources with Web Resources with Web

ServicesServices

Page 10: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

10

State ?State ?

Service’s Internal data Attributes which are needed to persist

across multiple invocation Web Service’s internal data

Attributes which are needed to maintain for multiple clients

Attributes which are needed to deal with the dependencies among multiple services

Service’s status at system level Service’s life time, system workload, disk

information

Page 11: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

11

Stateless Web ServiceStateless Web Service

Page 12: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

12

Stateful Web ServiceStateful Web Service

Page 13: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

13

Web Services and Stateful Web Services and Stateful ResourcesResources “State” appears in almost all applications

Data in a purchase order Current usage agreement for resources on a

grid Metrics associated with work load on a Web

server

There are many possible ways Web services might model, access and manage state The WS-Resource Framework proposes to

standardize this capability for Web services

Page 14: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

14

Modeling Stateful ResourcesModeling Stateful Resources

A stateful resource is something that exists even when you're not interacting with it. E.g. database backend service

Stateful resources have properties that define state these properties are how you interact with them Properties have values Add/remove/change properties and values

dynamically WSRF Specification:

a WS-Resource is the combination of a Web service and a stateful resource on which it acts.

Web Service + WSRF = Stateful Resources = WS-Resource

Page 15: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

15

Inte

rface

WebService

The WS-Resource framework The WS-Resource framework modelmodel

Web Service

WSDLRun-time environment

Source : www.ibm.com

Page 16: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

16

Inte

rface

WebService

message

message

Invoking a Web Service

address

Endpoint Reference

Run-time environment

The WS-Resource framework The WS-Resource framework modelmodel

Source : www.ibm.com

Page 17: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

17

What is a WS-Resource Examples of WS-Resources:

Physical entities (e.g.. processor, communication link, disk drive)or Logical construct (e.g.. agreement, running task, subscription)

Real or virtual Static (long-lived, pre-existing) or

Dynamic (created and destroyed as needed)

Simple (one), or Compound (collection)

Unique - Has a distinguishable identity and lifetime

Stateful - Maintains a specific state that can be materialized using XML

May be accessed through one or more Web Services

resource

The WS-Resource framework The WS-Resource framework modelmodel

Source : www.ibm.com

Page 18: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

18

context

Inte

rface

WebService

messageid

message

Using a Web service to access a WS-Resource

id

address

resource

Run-time environment

Endpoint Reference

The WS-Resource framework The WS-Resource framework modelmodel

AddressResource id

Source : www.ibm.com

Page 19: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

19

context

Inte

rface

WebService

messageid

message

Using a Web service to access a WS-Resource

id

address

resource

resource

Endpoint ReferenceEndpoint Reference

The WS-Resource framework The WS-Resource framework modelmodel

Run-time environment

Source : www.ibm.com

Page 20: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

20

Inte

rface

WebService

message

message

Creating / Locating a WS-Resource

address

Endpoint Reference

resource

Endpoint Reference

Web Service either locates or creates a WS-

Resource

address

id

The WS-Resource framework The WS-Resource framework modelmodel

Run-time environment

Source : www.ibm.com

Page 21: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

21

IBM

WS-Resource Properties Resource state and metadata

“Projected” as an XML document Query and Set operations

WS-Resource LifeTime Explicit destruction or

“Soft state” time-to-live Provides for cleanup

of resource instances resource

<ProcessorProperties><ProcID>5A34C1DE03</ProcID><ProcArchitecture>Power6.2</ProcArchitecture><ProcSpeedMIPS>400</ProcSpeed><ProcCacheMB>256<ProcCache><ProcRunning>1</ProcRunning>

</ProcessorProperties>

The WS-Resource framework The WS-Resource framework modelmodel

Source : www.ibm.com

Page 22: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

22

WS-NotificationWS-Notification

Asynchronous WS resource state handling

WS-NotificationLoosely coupled, asynchronous messaging in a Web services context

Standardizes the role of Brokers, Publishers, Subscribers and Consumers

Provides two forms of publish/subscribe: direct publishing and brokered publishing

Page 23: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

23

Subscriber indicates interest in a particular “Topic” by issuing a “subscribe” request

Broker (intermediary) permits decoupling Publisher and Subscriber

“Subscriptions” are WS-ResourcesVarious subscriptions are possible

Publisher need NOT be a Web ServiceNotification may be “triggered” by:

WS Resource Property value changesOther “situations”

Broker examines current subscriptions Brokers may

“Transform” or “interpret” topicsFederate to provide scalability

Broker

Subscriber

WS-NotificationWS-Notification

Publisher

subscribe

subscribe

S S S

notify

notify

notify

notify

Page 24: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

24

Standardization & Standardization & ImplementationImplementation

Page 25: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

25

Current public review specificationsCurrent public review specifications (still on going):(still on going): http://www.oasis-open.org/committees/tc_home.php?

wg_abbrev=wsrf

WS-Resource specification WS-ResourceProperties (WSRF-RP) specification WS-ResourceLifetime (WSRF-RL) specification WS-ServiceGroup (WSRF-SG) specification WS-BaseFaults (WSRF-BF) specification

WS-Resource WSDL WS-ResourceProperties (WSRF-RP) WSDL WS-ResourceLifetime (WSRF-RL) WSDL WS-ServiceGroup (WSRF-SG) WSDL WS-BaseFaults (WSRF-BF) WSDL

WSN (WS-Notification) also can refer in http://www.oasis-open.org/home/index.php

Page 26: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

26

Service Composition

Transports

Messaging

Description

Quality ofExperience(QoX)

WS-Service Group

WS-Resource Properties

WS-Resource Lifetime

WS-Base Faults

WS-Notification

HTTP/HTTPS SMTP RMI / IIOP

XSD WSDL

SOAPXML WS-Addressing WS-Renewable References

WS-Metadata ExchangeWS-Policy

JMS

WS-Security

WS-Reliable Messaging WS-Transaction

BPEL4WS

How these proposals relates to other How these proposals relates to other Web services standardsWeb services standards

Page 27: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

27

WS-ResourceWS-Resource

http://docs.oasis-open.org/wsrf/rpw-1

describes the relationship between a Web service and a resource in the WS-Resource Framework.

WS-Resource Access Pattern, an abstract concept of how resources are

accessed through Web services, the means by which WS-Resources are

referenced.

Page 28: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

28

WS-RP (ResourceProperty)WS-RP (ResourceProperty)

http://docs.oasis-open.org/wsrf/rpw-1 Web Services Resource Properties 1.2 (Public Review Draft 01, 10 June

2005)

Resource Property defined by the state model A piece of information Reflect a part of the resource’s state, meta-data,

manageability information Resource properties Document

Logical composition of resource property elements Resource property Element

XML representation of a resource property Child of the root element of a resource properties

document XML global element definition and unique Qname

Resource Property Value Value(s) associated with a resource property

Page 29: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

29

WS-RP (simple example)WS-RP (simple example)

<wsdl:definitions … " …>… <wsdl:types> <xsd:schema targetNamespace="http://example.com/diskDrive" ... >

<!-- Resource property element declarations --> <xsd:element name="NumberOfBlocks" type="xsd:integer"/> <xsd:element name="BlockSize" type="xsd:integer" /> <xsd:element name="Manufacturer" type="xsd:string" /> <xsd:element name="StorageCapability" type="xsd:string" />

<!-- Resource properties document declaration --> <xsd:element name="GenericDiskDriveProperties"> <xsd:complexType> <xsd:sequence> <xsd:element ref="tns:NumberOfBlocks"/> <xsd:element ref="tns:BlockSize" /> <xsd:element ref="tns:Manufacturer" /> <xsd:any minOccurs="0" maxOccurs="unbounded" /> <xsd:element ref="tns:StorageCapability“ minOccurs="0“ maxOccurs="unbounded" /> </xsd:sequence> </xsd:complexType> </xsd:element>…</xsd:schema></wsdl:types>

Resource property element

declarations

Resource properties document

The resource properties document associated with GenericDiskDrive Defines the GenericDiskDrive portType

Page 30: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

30

WS-RP (simple example)WS-RP (simple example)

…<!-- Association of resource properties document to a portType --><wsdl:portType name="GenericDiskDrive"wsrf-rp:ResourceProperties="tns:GenericDiskDriveProperties" ><operation name="start" …/><operation name="stop" …/>…</wsdl:portType>…</wsdl:definitions>

Association of resource

properties document to a

portType

The resource properties document associated with GenericDiskDrive Defines the GenericDiskDrive portType

The association of the resource properties document with the portType defines the type of the WS-Resource.

Page 31: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

31

WS-RP (simple example)WS-RP (simple example)

<wsrp:GetMultipleResourceProperties

xmlns:tns="http://example.com/diskdrive" …>

<wsrp:ResourceProperty>tns:NumberOfBlocks</wsrp:ResourceProperty>

<wsrp:ResourceProperty>tns:BlockSize</wsrp:ResourceProperty> <wsrf-rp:ResourceProperty>tns:StorageCapability</wsrf-rp:ResourceProperty>

</wsrp:GetMultipleResourceProperties>

The request message used to retrieve two resource property elements from the WS-Resource that implements the GenericDiskDrive portType:

Page 32: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

32

WS-RP (simple example)WS-RP (simple example)

A sample response to the simple get request:

<wsrf-rp:GetMultipleResourcePropertiesResponse

xmlns:ns1="http://example.com/diskdrive"

xmlns:ns2="http://example.com/capabilities" ...>

<ns1:NumberOfBlocks>22</ns1:NumberOfBlocks>

<ns1:BlockSize>1024</ns1:BlockSize>

<ns1:StorageCapability>

<ns2:NoSinglePointOfFailure>true</ns2:NoSinglePointOfFailure>

</ns1:StorageCapability>

<ns1:StorageCapability><ns2:DataRedundancyMax>42

</ns2:DataRedundancyMax></ns1:StorageCapability>

</wsrf-rp:GetMultipleResourcePropertiesResponse>

Page 33: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

33

OGSA, WSRF, GT4 RelationshipOGSA, WSRF, GT4 Relationship

Page 34: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

34

Java WS Core in GT4Java WS Core in GT4

A component in GT4 functionality An implementation of the Web Services

Resource Framework (WSRF) and the Web Service Notification (WSN) family of standards.

It provides APIs and tools for building stateful Web services. An Implementation of the 2004/06 OASIS

WSRF and WSN working draft specifications Basic HTTP/1.1 client & server support JNDI based registry based on the JNDI

service in Apache Tomcat

Page 35: 1 Modeling Stateful Resources with Web Services ICE 0534 - Ph.D lecture 20042068 Byung-sang Kim

35

Java WS CoreJava WS Core

Visit following link for more information http://www.globus.org/toolkit/docs/4.0/common/

javawscore/

Any questions for WSRF ?