URI and UUID. Identifying things on the Web.



Similar documents
Network Programming. Writing network and internet applications.

Logging. Working with the POCO logging framework.

CORBA Programming with TAOX11. The C++11 CORBA Implementation

Comp151. Definitions & Declarations

An API for Reading the MySQL Binary Log

Theater Key Retrieval (TKR)

ns-3 Tutorial (Part IV) Wireless & Tracing System and Visualizing Results

CSCI110: Examination information.

C++ for Safety-Critical Systems. DI Günter Obiltschnig Applied Informatics Software Engineering GmbH

Performance Comparison of Elliptic Curve and RSA Digital Signatures

CSE 333 SECTION 6. Networking and sockets

>

COSC 6397 Big Data Analytics. Distributed File Systems (II) Edgar Gabriel Spring HDFS Basics

The POCO C++ Libraries for Device Software Development

sqlpp11 - An SQL Library Worthy of Modern C++

MS ACCESS DATABASE DATA TYPES

Internet Technologies. World Wide Web (WWW) Proxy Server Network Address Translator (NAT)

OpenCA v (ten-ten 2 )

A Client Server Transaction. Introduction to Computer Systems /18 243, fall th Lecture, Nov. 3 rd

Websense Web Security Gateway: Integrating the Content Gateway component with Third Party Data Loss Prevention Applications

Automatic Configuration and Service Discovery for Networked Smart Devices

Computer Programming C++ Classes and Objects 15 th Lecture

Phys4051: C Lecture 2 & 3. Comment Statements. C Data Types. Functions (Review) Comment Statements Variables & Operators Branching Instructions

INTERNET DOMAIN NAME SYSTEM

Single Pass Load Balancing with Session Persistence in IPv6 Network. C. J. (Charlie) Liu Network Operations Charter Communications

Copyright 2013 wolfssl Inc. All rights reserved. 2

BS1000 command and backlog protocol

Secure TCP/IP connection Description for UMG 604, UMG 605, UMG 508, UMG 509, UMG 511 and UMG 512

Member Functions of the istream Class

C++ program structure Variable Declarations

HTTPS Configuration for SAP Connector

The Meaning. Linkfiles In Forensic Examinations

First Workshop on Open Source and Internet Technology for Scientific Environment: with case studies from Environmental Monitoring

Package urltools. October 11, 2015

How To Create A C++ Web Service

Unix Security Technologies. Pete Markowsky <peterm[at] ccs.neu.edu>

Web. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture # Apache.

Netscape Internet Service Broker for C++ Programmer's Guide. Contents

INTRODUCTION UNIX NETWORK PROGRAMMING Vol 1, Third Edition by Richard Stevens

University of Amsterdam

3 Multimedia Programming with C++ and Multimedia Frameworks

Network Security. Chapter 3. Cornelius Diekmann. Version: October 21, Lehrstuhl für Netzarchitekturen und Netzdienste Institut für Informatik

Applied Informatics C++ Coding Style Guide

LAN API FOR DOORBIRD AND BIRDGUARD

SQLITE C/C++ TUTORIAL

Project 2: Bejeweled

Application Note. Onsight TeamLink And Firewall Detect v6.3

DEPLOYMENT GUIDE Version 1.4. Configuring IP Address Sharing in a Large Scale Network: DNS64/NAT64

Webair CDN Secure URLs

[MS-CCEIP]: Corporate Customer Experience Improvement Program Client-to-Server Protocol

SSL/TLS. What Layer? History. SSL vs. IPsec. SSL Architecture. SSL Architecture. IT443 Network Security Administration Instructor: Bo Sheng

Comparison of Linux and Symbian Based Implementations of Mobile Peer-to-Peer Environment

How to: Use Basic C++, Syntax and Operators

PetaLinux SDK User Guide. Application Development Guide

Syntax Check of Embedded SQL in C++ with Proto

Transport Layer Security Protocols

Lecture 2. Internet: who talks with whom?

Cisco Configuring Commonly Used IP ACLs

WWW. World Wide Web Aka The Internet. dr. C. P. J. Koymans. Informatics Institute Universiteit van Amsterdam. November 30, 2007

Login with Amazon. Getting Started Guide for Websites. Version 1.0

Blue Coat Security First Steps Solution for Deploying an Explicit Proxy

WinBioinfTools: Bioinformatics Tools for Windows Cluster. Done By: Hisham Adel Mohamed

Configuration Backup and Restore. Dgw v2.0 May 14,

Qpid Dispatch Router Book

Lab Configure and Test Advanced Protocol Handling on the Cisco PIX Security Appliance

Secure Web Appliance. Reverse Proxy

Spring Design ScreenShare Service SDK Instructions

Network Programming in Qt. TCP/IP Protocol Stack

[MS-SPEMAWS]: SharePoint Web Service Protocol. Intellectual Property Rights Notice for Open Specifications Documentation

Chapter 6 Configuring the SSL VPN Tunnel Client and Port Forwarding

Leveraging Advanced Load Sharing for Scaling Capacity to 100 Gbps and Beyond

Chapter 9: Name Services. 9.1 Introduction 9.2 Name services and the DNS 9.3 Directory services 9.6 Summary

P1 P2 P3. Home (p) 1. Diff (p) 2. Invalidation (p) 3. Page Request (p) 4. Page Response (p)

Web Services for Management Perl Library VMware ESX Server 3.5, VMware ESX Server 3i version 3.5, and VMware VirtualCenter 2.5

RTP / RTCP. Announcements. Today s Lecture. RTP Info RTP (RFC 3550) I. Final Exam study guide online. Signup for project demos

DIRECTOR GENERAL OF THE LITHUANIAN ARCHIVES DEPARTMENT UNDER THE GOVERNMENT OF THE REPUBLIC OF LITHUANIA

The Art of Exploiting Logical Flaws in Web Apps. Sumit sid Siddharth Richard deanx Dean

Transport and Network Layer

Innovative, High-Density, Massively Scalable Packet Capture and Cyber Analytics Cluster for Enterprise Customers

Intel TSX (Transactional Synchronization Extensions) Mike Dai Wang and Mihai Burcea

Arduino Internet Connectivity: Maintenance Manual Julian Ryan Draft No. 7 April 24, 2015

Computer Networks Network architecture

W3C Meeting ISO/IEC/IEEE P

What is CSG150 about? Fundamentals of Computer Networking. Course Outline. Lecture 1 Outline. Guevara Noubir noubir@ccs.neu.

Overview of TCP/IP. TCP/IP and Internet

Specific Simple Network Management Tools

Managing Ports and System Services using BT NetProtect Plus firewall

Nuance Mobile Developer Program. HTTP Services for Nuance Mobile Developer Program Clients

The Internet of Unpatched Things

Network Security CS 192

Slide 1 Introduction cnds@napier 1 Lecture 6 (Network Layer)

OpenStage / OpenScape Desk Phone IP Provisioning Interface

Transcription:

URI and UUID Identifying things on the Web.

Overview > Uniform Resource Identifiers (URIs) > URIStreamOpener > Universally Unique Identifiers (UUIDs)

Uniform Resource Identifiers > Uniform Resource Identifiers (RFC 3986) are used to identify resources on the Web. > POCO provides the POCO::URI class that can be used for building and storing URIs and to split URIs into their components. > #include "Poco/URI.h"

URI Structure > An URI consists of: > a Scheme (or protocol name) part > an Authority part (user information, host name and port number) > a Path part > a Query part > and a Fragment part

URI Examples http://www.google.com/search?q=poco Scheme Host Path Query

URI Examples (cont'd) http://appinf.com/poco/docs/poco.uri.html#5589 Scheme Host Path Fragment

URI Examples (cont'd) ftp://anonymous@upload.sourceforge.com/incoming Scheme User Host Path

#include "Poco/URI.h" #include <iostream> int main(int argc, char** argv) { Poco::URI uri1("http://www.appinf.com:88/sample?example-query#frag"); std::string scheme(uri1.getscheme()); // "http" std::string auth(uri1.getauthority()); // "www.appinf.com:88" std::string host(uri1.gethost()); // "www.appinf.com" unsigned short port = uri1.getport(); // 88 std::string path(uri1.getpath()); // "/sample" std::string query(uri1.getquery()); // "example-query" std::string frag(uri1.getfragment()); // "frag" std::string pathetc(uri1.getpathetc()); // "/sample?examplequery#frag" Poco::URI uri2; uri2.setscheme("https"); uri2.setauthority("www.appinf.com"); uri2.setpath("/another sample"); std::string s(uri2.tostring()); // "https://www.appinf.com/another%20sample"

std::string uri3("http://www.appinf.com"); uri3.resolve("/poco/info/index.html"); s = uri3.tostring(); // "http://www.appinf.com/poco/info/index.html" uri3.resolve("support.html"); s = uri3.tostring(); // "http://www.appinf.com/poco/info/support.html" uri3.resolve("http://sourceforge.net/projects/poco"); s = uri3.tostring(); // "http://sourceforge.net/projects/poco" } return 0;

URIStreamOpener > Poco::URIStreamOpener is used to create and open input streams for resources identified by URIs. > #include "Poco/URIStreamOpener.h" > For every URI scheme used, a subclass of Poco::URIStreamFactory must be registered. > POCO provides stream factories for files, HTTP, HTTPS and FTP resources.

#include "Poco/URIStreamOpener.h" #include "Poco/Net/HTTPStreamFactory.h" #include "Poco/Net/FTPStreamFactory.h" #include <memory> int main(int argc, char** argv) { Poco::Net::HTTPStreamFactory::registerFactory(); Poco::Net::FTPStreamFactory::registerFactory(); Poco::URIStreamOpener& opener = Poco::URIStreamOpener::defaultOpener(); } std::auto_ptr<std::istream> istr1( opener.open("http://www.appinf.com/index.html") ); std::auto_ptr<std::istream> istr2( opener.open("ftp://ftp.appinf.com/pub/poco/poco-1.2.5.tar.gz") ); std::auto_ptr<std::istream> istr3( opener.open("file:///usr/include/stdio.h") ); return 0;

UUIDs > A UUID (Universally Unique Identifier) is an identifier that is unique across both space and time, with respect to the space of all UUIDs. > Three flavors: > time-based > name-based > random

The UUID Class > Poco::UUID stores a UUID, supporting full value semantics including all relational operators. > #include "Poco/UUID.h" > UUIDs can be converted to and from strings.

The UUIDGenerator Class > Poco::UUIDGenerator is used to create UUIDs. > #include "Poco/UUIDGenerator.h" > UUIDs can be created > time based (ethernet MAC address + timestamp) > name-based (usually from an URI) > random

#include "Poco/UUID.h" #include "Poco/UUIDGenerator.h" #include <iostream> using Poco::UUID; using Poco::UUIDGenerator; int main(int argc, char** argv) { UUIDGenerator& generator = UUIDGenerator::defaultGenerator(); UUID uuid1(generator.create()); // time based UUID uuid2(generator.createrandom()); UUID uuid3(generator.createfromname(uuid::uri(), "http://appinf.com"); std::cout << uuid1.tostring() << std::endl; std::cout << uuid2.tostring() << std::endl; std::cout << uuid3.tostring() << std::endl; } return 0;

Copyright 2006-2010 by Applied Informatics Software Engineering GmbH. Some rights reserved. www.appinf.com info@appinf.com T +43 4253 32596 F +43 4253 32096