You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2016/10/06 13:40:09 UTC

[1/2] syncope git commit: Adding client library sample for changing user status

Repository: syncope
Updated Branches:
  refs/heads/2_0_X 594d5cc3a -> ce5bbb953
  refs/heads/master 336fe415c -> 291c6d31e


Adding client library sample for changing user status


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/ce5bbb95
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/ce5bbb95
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/ce5bbb95

Branch: refs/heads/2_0_X
Commit: ce5bbb953789f679a21cac9b8ba13e279b3422fb
Parents: 594d5cc
Author: Francesco Chicchiricc� <il...@apache.org>
Authored: Thu Oct 6 15:39:41 2016 +0200
Committer: Francesco Chicchiricc� <il...@apache.org>
Committed: Thu Oct 6 15:39:41 2016 +0200

----------------------------------------------------------------------
 .../workingwithapachesyncope/restfulservices.adoc | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/ce5bbb95/src/main/asciidoc/reference-guide/workingwithapachesyncope/restfulservices.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/reference-guide/workingwithapachesyncope/restfulservices.adoc b/src/main/asciidoc/reference-guide/workingwithapachesyncope/restfulservices.adoc
index b870f65..b6317cc 100644
--- a/src/main/asciidoc/reference-guide/workingwithapachesyncope/restfulservices.adoc
+++ b/src/main/asciidoc/reference-guide/workingwithapachesyncope/restfulservices.adoc
@@ -349,3 +349,21 @@ Map<String, Set<String>> realm2entitlements = self.getLeft(); // <2>
 <1> http://syncope.apache.org/apidocs/2.0/org/apache/syncope/common/lib/to/UserTO.html[UserTO^] of the requesting user
 <2> for each <<realms,realm>>, the owned <<entitlements,entitlements>>
 ====
+
+.Change user status
+====
+[source,java]
+----
+String key = ...; // <1>
+StatusPatch statusPatch = new StatusPatch();
+statusPatch.setKey(key);
+statusPatch.setType(StatusPatchType.SUSPEND); // <2>
+UserTO userTO = userService.status(statusPatch).
+  readEntity(new GenericType<ProvisioningResult<UserTO>>() {
+  }).getEntity(); // <3>
+----
+<1> assume the key of the user to be suspended is known in advance
+<2> `ACTIVATE`, `SUSPEND`, `REACTIVATE` values are accepted, and honored depending on the actual status of the user
+being updated
+<3> request for user update and read back the updated entity
+====


[2/2] syncope git commit: Adding client library sample for changing user status

Posted by il...@apache.org.
Adding client library sample for changing user status


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/291c6d31
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/291c6d31
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/291c6d31

Branch: refs/heads/master
Commit: 291c6d31e18956b6ccb4ca24e6b389490ae71475
Parents: 336fe41
Author: Francesco Chicchiricc� <il...@apache.org>
Authored: Thu Oct 6 15:39:41 2016 +0200
Committer: Francesco Chicchiricc� <il...@apache.org>
Committed: Thu Oct 6 15:39:56 2016 +0200

----------------------------------------------------------------------
 .../workingwithapachesyncope/restfulservices.adoc | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/291c6d31/src/main/asciidoc/reference-guide/workingwithapachesyncope/restfulservices.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/reference-guide/workingwithapachesyncope/restfulservices.adoc b/src/main/asciidoc/reference-guide/workingwithapachesyncope/restfulservices.adoc
index 0380916..7adacd6 100644
--- a/src/main/asciidoc/reference-guide/workingwithapachesyncope/restfulservices.adoc
+++ b/src/main/asciidoc/reference-guide/workingwithapachesyncope/restfulservices.adoc
@@ -349,3 +349,21 @@ Map<String, Set<String>> realm2entitlements = self.getLeft(); // <2>
 <1> http://syncope.apache.org/apidocs/2.0/org/apache/syncope/common/lib/to/UserTO.html[UserTO^] of the requesting user
 <2> for each <<realms,realm>>, the owned <<entitlements,entitlements>>
 ====
+
+.Change user status
+====
+[source,java]
+----
+String key = ...; // <1>
+StatusPatch statusPatch = new StatusPatch();
+statusPatch.setKey(key);
+statusPatch.setType(StatusPatchType.SUSPEND); // <2>
+UserTO userTO = userService.status(statusPatch).
+  readEntity(new GenericType<ProvisioningResult<UserTO>>() {
+  }).getEntity(); // <3>
+----
+<1> assume the key of the user to be suspended is known in advance
+<2> `ACTIVATE`, `SUSPEND`, `REACTIVATE` values are accepted, and honored depending on the actual status of the user
+being updated
+<3> request for user update and read back the updated entity
+====