gluu
公開メンバ関数 | 静的公開変数類 | 限定公開変数類 | 静的非公開変数類 | 全メンバ一覧
org.gluu.oxtrust.api.client.people.PeopleClient クラス
org.gluu.oxtrust.api.client.people.PeopleClient の継承関係図
Inheritance graph
org.gluu.oxtrust.api.client.people.PeopleClient 連携図
Collaboration graph

公開メンバ関数

 PeopleClient (Client client, String baseURI)
 
List< GluuCustomPersonlist ()
 
List< GluuCustomPersonsearchGroups (String pattern, int size)
 
GluuCustomPerson getGroup (String inum)
 
read (String id) throws ClientErrorException
 
String create (T requestEntity) throws OxTrustAPIException
 
String add (T requestEntity) throws OxTrustAPIException
 
boolean update (T requestEntity, String id)
 
boolean delete (String id)
 
boolean remove (String inum)
 

静的公開変数類

static final int HTTP_OK = 200
 

限定公開変数類

WebTarget webTarget
 
Client client
 
Class< T > entityClass
 

静的非公開変数類

static final String PATH = "/restv1/api/people"
 

詳解

構築子と解体子

◆ PeopleClient()

org.gluu.oxtrust.api.client.people.PeopleClient.PeopleClient ( Client  client,
String  baseURI 
)
inline
17  {
18  super(GluuCustomPerson.class, client, baseURI, PATH);
19  }
Client client
Definition: AbstractClient.java:31
static final String PATH
Definition: PeopleClient.java:15

関数詳解

◆ add()

String org.gluu.oxtrust.api.client.util.AbstractClient< T >.add ( requestEntity) throws OxTrustAPIException
inlineinherited
75  {
76  WebTarget resource=webTarget;
77  System.out.println("Final Url:" + resource.getUri().toString());
78  Response response = resource.request().post(Entity.entity(requestEntity, MediaType.APPLICATION_JSON));
79  if (response.getStatus() != HTTP_OK) {
80  System.out.println("Error:" + response.getStatus());
81  throw new OxTrustAPIException("Response error. HTTP code: " + response.getStatus() + ", reason phrase: "
82  + response.getStatusInfo().getReasonPhrase(), response.getStatus());
83  }
84  response.close();
85  return response.readEntity(String.class);
86  }
WebTarget webTarget
Definition: AbstractClient.java:30
static final int HTTP_OK
Definition: AbstractClient.java:28

◆ create()

String org.gluu.oxtrust.api.client.util.AbstractClient< T >.create ( requestEntity) throws OxTrustAPIException
inlineinherited

Create (save) entity.

引数
requestEntity
戻り値
ID of created entity (inum bu default)
例外
ClientErrorException
OxTrustAPIException
62  {
63  Response response = webTarget.path("create").request()
64  .post(Entity.entity(requestEntity, MediaType.APPLICATION_JSON));
65  if (response.getStatus() != HTTP_OK) {
66  throw new OxTrustAPIException("Response error. HTTP code: " + response.getStatus() + ", reason phrase: "
67  + response.getStatusInfo().getReasonPhrase(), response.getStatus());
68  }
69  String id = response.readEntity(String.class);
70  response.close();
71 
72  return id;
73  }
WebTarget webTarget
Definition: AbstractClient.java:30
static final int HTTP_OK
Definition: AbstractClient.java:28

◆ delete()

boolean org.gluu.oxtrust.api.client.util.AbstractClient< T >.delete ( String  id)
inlineinherited
98  {
99  WebTarget resource = webTarget.path("delete/{id}").resolveTemplate("id", id);
100  Response response = resource.request(MediaType.TEXT_PLAIN).delete();
101 
102  int code = response.getStatus();
103  response.close();
104  return code == HTTP_OK;
105  }
WebTarget webTarget
Definition: AbstractClient.java:30
static final int HTTP_OK
Definition: AbstractClient.java:28

◆ getGroup()

GluuCustomPerson org.gluu.oxtrust.api.client.people.PeopleClient.getGroup ( String  inum)
inline
36  {
37  System.out.println("Final Url:" + webTarget.getUri().toString());
38  WebTarget resource = webTarget.path("/{inum}").resolveTemplate("inum", inum);
39  return resource.request(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON)
40  .get(GluuCustomPerson.class);
41  }
WebTarget webTarget
Definition: AbstractClient.java:30

◆ list()

List<GluuCustomPerson> org.gluu.oxtrust.api.client.people.PeopleClient.list ( )
inline
21  {
22  System.out.println("Final Url:" + webTarget.getUri().toString());
23  GenericType<List<GluuCustomPerson>> responseType = new GenericType<List<GluuCustomPerson>>() {
24  };
25  return webTarget.request().get(responseType);
26  }
WebTarget webTarget
Definition: AbstractClient.java:30

◆ read()

T org.gluu.oxtrust.api.client.util.AbstractClient< T >.read ( String  id) throws ClientErrorException
inlineinherited

Read entity by ID.

引数
idID of the entity (inum bu default)
戻り値
entity instance
例外
ClientErrorException
49  {
50  WebTarget resource = webTarget.path("read/{id}").resolveTemplate("id", id);
51  return resource.request(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON).get(entityClass);
52  }
Class< T > entityClass
Definition: AbstractClient.java:32
WebTarget webTarget
Definition: AbstractClient.java:30

◆ remove()

boolean org.gluu.oxtrust.api.client.util.AbstractClient< T >.remove ( String  inum)
inlineinherited
107  {
108  WebTarget resource = webTarget.path("/{inum}").resolveTemplate("inum", inum);
109  System.out.println("Final Url:" + resource.getUri().toString());
110  Response response = resource.request(MediaType.TEXT_PLAIN).delete();
111  response.close();
112  return response.getStatus() == HTTP_OK;
113  }
WebTarget webTarget
Definition: AbstractClient.java:30
static final int HTTP_OK
Definition: AbstractClient.java:28

◆ searchGroups()

List<GluuCustomPerson> org.gluu.oxtrust.api.client.people.PeopleClient.searchGroups ( String  pattern,
int  size 
)
inline
28  {
29  WebTarget resource = webTarget.path("search").queryParam("pattern", pattern).queryParam("size", size);
30  System.out.println("Final Url:" + resource.getUri().toString());
31  GenericType<List<GluuCustomPerson>> responseType = new GenericType<List<GluuCustomPerson>>() {
32  };
33  return resource.request(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON).get(responseType);
34  }
WebTarget webTarget
Definition: AbstractClient.java:30

◆ update()

boolean org.gluu.oxtrust.api.client.util.AbstractClient< T >.update ( requestEntity,
String  id 
)
inlineinherited
88  {
89  WebTarget resource = webTarget.path("update/{id}").resolveTemplate("id", id);
90 
91  Response response = resource.request().put(Entity.entity(requestEntity, MediaType.APPLICATION_JSON));
92 
93  int code = response.getStatus();
94  response.close();
95  return code == HTTP_OK;
96  }
WebTarget webTarget
Definition: AbstractClient.java:30
static final int HTTP_OK
Definition: AbstractClient.java:28

メンバ詳解

◆ client

Client org.gluu.oxtrust.api.client.util.AbstractClient< T >.client
protectedinherited

◆ entityClass

Class<T> org.gluu.oxtrust.api.client.util.AbstractClient< T >.entityClass
protectedinherited

◆ HTTP_OK

final int org.gluu.oxtrust.api.client.util.AbstractClient< T >.HTTP_OK = 200
staticinherited

◆ PATH

final String org.gluu.oxtrust.api.client.people.PeopleClient.PATH = "/restv1/api/people"
staticprivate

◆ webTarget

WebTarget org.gluu.oxtrust.api.client.util.AbstractClient< T >.webTarget
protectedinherited

このクラス詳解は次のファイルから抽出されました: