Documentation

Trace:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
jvx:common:util:rest [2019/03/05 08:58]
admin
jvx:common:util:rest [2019/03/13 09:10]
admin
Line 31: Line 31:
  
 ===== Available services ===== ===== Available services =====
 +
 +==== Administration ====
 +
 +Various services are available for the administration. These can only be used by POST requests in the standard case. However, if certain custom services have been registered, they can also be addressed via GET request.
 +
 +The following services are available by default:
 +
 +  * [[#​test_authentication|Test authentication]]
 +  * [[#​change_password|Change password]]
 +
 +=== Test authentication ===
 +
 +Test URL:​\\ ​
 +''<​nowiki>​http://​server:​port/​webapp/​services/​rest/</​nowiki>​**<​fc #​BF0000>​APPLICATION_NAME</​fc>​**/​**<​fc #​BF0000>​LIFECYCLE_CLASS</​fc>​**/​_admin/​**<​fc #​BF0000>​testAuthentication</​fc>​**''​ \\ 
 +or \\ 
 +''<​nowiki>​http://​server:​port/​webapp/​services/​rest/</​nowiki>​**<​fc #​BF0000>​APPLICATION_NAME</​fc>​**/​**<​fc #​BF0000>​LIFECYCLE_CLASS</​fc>​**/​_admin/​**<​fc #​BF0000>​testAuthentication</​fc>​**/​**<​fc #​BF0000>​parameter</​fc>​**''​
 +
 +The request requires a HashMap in JSON format.
 +
 +Example:
 +
 +<file json>
 +{ "​username"​ : "​admin",​
 +  "​password"​ : "​adminpassword"​
 +}
 +</​file>​
 +
 +The username can also be omitted. In this case, the parameter from the URL will be used as the username.
 +
 +== POST-Response ==
 +
 +If the login was successful, no response is generated and the status code is 204 (SUCCESS_NO_CONTENT).
 +
 +=== Change password ===
 +
 +Test URL:​\\ ​
 +''<​nowiki>​http://​server:​port/​webapp/​services/​rest/</​nowiki>​**<​fc #​BF0000>​APPLICATION_NAME</​fc>​**/​**<​fc #​BF0000>​LIFECYCLE_CLASS</​fc>​**/​_admin/​**<​fc #​BF0000>​changePassword</​fc>​**''​ \\ 
 +or \\ 
 +''<​nowiki>​http://​server:​port/​webapp/​services/​rest/</​nowiki>​**<​fc #​BF0000>​APPLICATION_NAME</​fc>​**/​**<​fc #​BF0000>​LIFECYCLE_CLASS</​fc>​**/​_admin/​**<​fc #​BF0000>​changePassword</​fc>​**/​**<​fc #​BF0000>​parameter</​fc>​**''​
 +
 +The request requires a HashMap in JSON format.
 +
 +Example:
 +
 +<file json>
 +{ "​username"​ : "​admin",​
 +  "​oldpassword"​ : "​oldpassword",​
 +  "​newpassword"​ : "​newpassword"​
 +}
 +</​file>​
 +
 +The username can also be omitted. In this case, the parameter from the URL will be used as the username.
 +
 +== POST-Response ==
 +
 +If the password has been changed, no response is generated and the status code is 204 (SUCCESS_NO_CONTENT).
 +
 +=== Custom services ===
 +
 +If you want to register your own service at runtime, this can be done by
 +
 +<code java>
 +AdminService.register(String pApplicationName,​ String pAction, IAdminServiceDelegate pDelegate);
 +AdminService.unregister(String pApplicationName,​ String pAction, Class<? extends IAdminServiceDelegate>​ pClass)
 +</​code>​
 +
 +The service can be addressed either via GET or POST request, depending on whether ** // IAdminServiceGetDelegate // ** or ** // IAdminServicePostDelegate // ** is used.
 +
 +Test URL:
 +
 +''<​nowiki>​http://​server:​port/​webapp/​services/​rest/</​nowiki>​**<​fc #​BF0000>​APPLICATION_NAME</​fc>​**/​**<​fc #​BF0000>​LIFECYCLE_CLASS</​fc>​**/​_admin/​**<​fc #​BF0000>​ACTION</​fc>​**''​ \\ 
 +or \\ 
 +''<​nowiki>​http://​server:​port/​webapp/​services/​rest/</​nowiki>​**<​fc #​BF0000>​APPLICATION_NAME</​fc>​**/​**<​fc #​BF0000>​LIFECYCLE_CLASS</​fc>​**/​_admin/​**<​fc #​BF0000>​ACTION</​fc>​**/​**<​fc #​BF0000>​parameter</​fc>​**''​
  
 ====Storage access ​ (CRUD, Meta Data)==== ====Storage access ​ (CRUD, Meta Data)====
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information