Client client = ClientBuilder.newClient(); WebTarget webtarget = client.target("http://service.com/user").queryparam("card", " "); Invo

Similar documents
"CAS を利用した Single Sign On 環境の構築"

JAVA H13 OISA JAVA 1

Microsoft PowerPoint - Lecture_3

ALG ppt

intra-mart Accel Platform — イベントナビゲータ 開発ガイド   初版  

¥Í¥Ã¥È¥ï¡¼¥¯¥×¥í¥°¥é¥ß¥ó¥°ÆÃÏÀ

アルゴリズムとデータ構造1

A B 1: Ex. MPICH-G2 C.f. NXProxy [Tanaka] 2:

intra-mart Accel Platform — イベントナビゲータ 開発ガイド   初版   None

WTM2019SingleSignOn

Microsoft PowerPoint - Lecture_2

tkk0408nari

1_cover

226

PowerPoint プレゼンテーション

Oracle9i JDeveloperによるWebサービスの構築

Exam : 1z1-809-JPN Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-809-JPN Exam's Question and Answers 1 from Ac

新・明解Java入門

VB.NETコーディング標準

PowerPoint Presentation


Q&A集

Microsoft PowerPoint - グリッド協議会GT4演習資料_2007_配布用

Microsoft Word - jpluginmanual.doc

SpringSecurity

Java演習(4) -- 変数と型 --

marangozova.dvi

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

IE6 2 BMI chapter1 Java 6 chapter2 Java 7 chapter3 for if 8 chapter4 : BMI 9 chapter5 Java GUI 10 chapter6 11 chapter7 BMI 12 chap

intra-mart Accel Platform — IM-Repository拡張プログラミングガイド   初版  

Microsoft PowerPoint ppt

: : : TSTank 2

untitled

Part1 159 a a

PowerPoint Presentation

Gartner Day

問題1 以下に示すプログラムは、次の処理をするプログラムである

Programming-C-9.key

2

55 7 Java C Java TCP/IP TCP/IP TCP TCP_RO.java import java.net.*; import java.io.*; public class TCP_RO { public static void main(string[] a

Dec , IS p. 1/60

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =

オブジェクト脳のつくり方

2

Client Client public void sendobject(object message) String String Web Container String RemoteEndpoint String Endpoint throwsioexception, EncodeExcept

Exam : 1z0-809 日本語 (JPN) Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO 1 / 8 Get Latest & Valid 1z0-809-JPN Exam's Question and Answe

JAVA とテンプレート

10K pdf

honbun.indd

やさしいJavaプログラミング -Great Ideas for Java Programming サンプルPDF

intra-mart Accel Platform

JBoss Application Server におけるディレクトリトラバーサルの脆弱性

目的 泡立ち法を例に Comparableインターフェイスの実装 抽象クラスの利用 型パラメタの利用 比較 入替 の回数を計測

Quick Sort 計算機アルゴリズム特論 :2017 年度 只木進一

ストラドプロシージャの呼び出し方

Java (5) 1 Lesson 3: x 2 +4x +5 f(x) =x 2 +4x +5 x f(10) x Java , 3.0,..., 10.0, 1.0, 2.0,... flow rate (m**3/s) "flow

K227 Java 2

アルゴリズムとデータ構造1

II 1 p.1 1 Servlet 1.1 Web Web WWW HTML CGI Common Gateway Interface Web HTML Web Web CGI CGI CGI Perl, PHP C JavaScript Web CGI HTML 1.2 Servlet Java

ex01.dvi

日 用 用 面 示 用 用 方

** 平成 16 年度 FE 午後問題 Java** 示現塾プロジェクトマネージャ テクニカルエンジニア ( ネットワーク ) など各種セミナーを開催中!! 開催日 受講料 カリキュラム等 詳しくは 今すぐアクセス!! 平成 16

Java (9) 1 Lesson Java System.out.println() 1 Java API 1 Java Java 1

TopLink å SampleClient.java... 5 Ò readallsample() querysample() cachesample() Ç..

問 次の Fortran プログラムの説明及びプログラムを読んで、設問に答えよ。

untitled

Cubby in Action

Servlet JSP JSP Servlet/JSP における 日 本 語 の 処 理 - 1

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =

Thread

( ( ( )

Javaセキュアコーディングセミナー2013東京第1回 演習の解説

/ ( ) 8/7/ :21 p.2/64

ALG ppt

IPSJ SIG Technical Report Vol.2015-CLE-16 No /5/23 RESTful Web API Web 1,2,3,4,a) 1,3,2,4 5,6 6 Wannous Muhammad 7,1,8 4,2,1 3,2,1 Maxima Web JS

r3.dvi

HTML/JSP/Servlet... 7 JSP... 7 Servlet Struts Struts Struts FormBean LoginForm

java_servlet2_見本

Microsoft Word - 430_15_Developing_Stored_Procedure.doc

宅建練馬表478号1_4ol [更新済み].eps

untitled

Web 1 p.2 1 Servlet Servlet Web Web Web Apache Web Servlet JSP Web Apache Tomcat Jetty Apache Tomcat, Jetty Java JDK, Eclipse

概要

設定手順

r02.dvi

Java プログラミング Ⅰ 3 回目変 数 今日の講義講義で学ぶ内容 変数とは 変数の使い方 キーボード入力の仕方 変 数 変 数 一時的に値を記憶させておく機能 変数は 型 ( データ型 ) と識別子をもちます 2 型 ( データ型 ) 変数に記憶する値の種類変数の型は 記憶できる値の種類と範囲

ohp02.dvi

intra-mart im-JavaEE Framework

Safari AppletViewer Web HTML Netscape Web Web 15-1 Applet Web Applet init Web paint Web start Web HTML stop destroy update init Web paint start Web up

Local variable x y i paint public class Sample extends Applet { public void paint( Graphics gc ) { int x, y;... int i=10 ; while ( i < 100 ) {... i +=

(Microsoft PowerPoint - daqmiddware-overview [\214\335\212\267\203\202\201[\203h])

ValueHolder... 9 Customer.java Oracle TopLink 10g(10.1.3) È Volume3 2


aiuser.book

2

はじめに インフォマート API の呼び出しには OAuth2.0 による認証を受ける必要があります OAuth2.0 を使うことで インフォマート API を利用するサービスは インフォマートプラットフォーム ID( 1 以下 PFID) とパスワードを保存したり処理したりすることなく PFID

Javaセキュアコーディングセミナー東京 第3回 入出力(File, Stream)と例外時の動作 演習解説

TopLink È... 3 TopLink...5 TopLink åø... 6 TopLink å Workbench O/R ~... 8 Workbench À ~... 8 Foundation Library å... 8 TopL

..0.._ e.qxp

法人保険( )

Transcription:

Builds a Client object ClientBuilder Client WebTarget Invocation Builds a WebTarget with the target URI Specifies HTTP method and auxiliary properties Invocation.Builder Configures URI parameters and initiates request building process

Client client = ClientBuilder.newClient(); WebTarget webtarget = client.target("http://service.com/user").queryparam("card", "4275391126915480"); Invocation.Builder builder = webtarget.request("text/plain"); Invocation invocation = builder.header("testheader","testvalue").buildget(); Response response = invocation.invoke();

public interface ContainerRequestFilter{ public void filter( ContainerRequestContext reqctx) throws IOException; @Provider @PreMatching public class PreMatchingAuthFilter{ public void filter( ContainerRequestContext reqctx) throws IOException { if(reqctx.getheaderstring( "Authorization") == null){ reqctx.abortwith( Response.status(403).build()); else{ //check credentials... @Provider public class PostMatchingFilterExample{ public void filter(containerrequestcontext reqctx) throws IOException{ "Referrer: " + reqctx.getheaderstring("referrer")); "Base URI: "+ reqctx.geturiinfo().getbaseuri()); "HTTP Request method: "+ reqctx.getmethod());

@Provider public class AContainerResponseFilter{ public void filter( ContainerRequestContext reqctx, ContainerResponseContext resctx) throws IOException{ //adding a custom header to the response resctx.getheaders().add("x-search-id", "qwer1234-tyuio5678-asdfg9876"); public class ClientResponseLoggerFilter { public void filter( ClientRequestContext reqctx, ClientResponseContext resctx) throws IOException{ "Response status: " + resctx.getstatus());

public interface WriterInterceptor{ public void aroundwritefrom( WriterInterceptorContext writerctx) throws IOException, WebApplicationException; @NameBinding @Target({ ElementType.TYPE, ElementType.METHOD ) @Retention(value = RetentionPolicy.RUNTIME) public @interface Audited { @Provider @Audited public class AuditFilter implements ContainerRequestFilter { //filter implementation...

@GET @Path("{id") @Produces("application/json") @Audited public Response find( @PathParam("id") String custid){ //search and return customer info.equals(resinfo.getresourceclass()) && resinfo.getresourcemethod().getname().contains("put")) { ctx.register( AuthenticationFilter.class); public interface DynamicFeature { public void configure( ResourceInfo resinfo, FeatureContext ctx); @Provider public class DynamicAuthFilterFeature implements DynamicFeature { @Override public void configure( ResourceInfo resinfo, FeatureContext ctx) { if (UserResource.class

@GET @Path("{id") public void search( @Suspended AsyncResponse asyncresp, @PathParam("id") String id){ //launching search in a new thread new Thread(){ public void run(){ //execute search op and resume UserInfo user = //obtain via search... asyncresp.resume(user);.start(); Invocation.Builder builder1 = //... AsyncInvoker invoker = builder1.async();

//obtain a Future Future<Response> future1 = invoker.get(); //create another builder Invocation.Builder builder2 =... Invocation invocation = builder2.buildget(); //provide a callback Future<Response> future2 = invocation.submit( new InvocationCallback<Customer>(){ public void completed(customer cust){ "Customer ID:" + cust.getid()); public void failed(throwable t){ "Unable to fetch Cust details: " + t.getmessage()); ); public class BookNotFoundMapper implements ExceptionMapper<BookNotFoundException>{ @Override Response toresponse( BookNotFoundException bnfe){ return Response.status(404).build(); BadRequestException ForbiddenException InternalServerErrorException NotAcceptableException NotAllowedException NotAuthorizedException NotFoundException NotSupportedException ServiceUnavailableException

ServiceUnavailableException InternalServerErrorException ServerErrorException BadRequestException ForbiddenException WebApplicationException ClientErrorException NotAcceptableException NotAuthorizedException RedirectionException NotFoundException NotSupportedException NotAllowedException public class CustomerSearchRequest{ @QueryParam("id") private String userid; @HeaderParam("Accept") private String accept; @CookieParam("lastAccessed") private Date lastaccessed; //getters to fetch the values