Trace: • REST Dienste
Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
de:jvx:common:util:rest [2020/07/24 23:47] admin |
de:jvx:common:util:rest [2026/11/11 12:22] (current) admin |
||
|---|---|---|---|
| Line 41: | Line 41: | ||
| * [[#passwort_aendern|Passwort ändern]] | * [[#passwort_aendern|Passwort ändern]] | ||
| * [[#datenbank_pruefen|Datenbank prüfen]] | * [[#datenbank_pruefen|Datenbank prüfen]] | ||
| + | * [[#speicher_status|Speicher Status]] | ||
| === Anmeldung testen === | === Anmeldung testen === | ||
| Line 49: | Line 50: | ||
| ''<nowiki>http://server:port/webapp/services/rest/</nowiki>**<fc #BF0000>APPLICATION_NAME</fc>**/_admin/**<fc #BF0000>testAuthentication</fc>**/**<fc #BF0000>parameter</fc>**'' | ''<nowiki>http://server:port/webapp/services/rest/</nowiki>**<fc #BF0000>APPLICATION_NAME</fc>**/_admin/**<fc #BF0000>testAuthentication</fc>**/**<fc #BF0000>parameter</fc>**'' | ||
| - | Der Request benötigt eine HashMap im JSON Format. | + | Der Request benötigt einen Text im JSON Format. |
| Beispiel: | Beispiel: | ||
| <file json> | <file json> | ||
| - | { "username" : "admin", | + | { |
| + | "username" : "admin", | ||
| "password" : "adminpassword" | "password" : "adminpassword" | ||
| } | } | ||
| Line 72: | Line 74: | ||
| ''<nowiki>http://server:port/webapp/services/rest/</nowiki>**<fc #BF0000>APPLICATION_NAME</fc>**/_admin/**<fc #BF0000>changePassword</fc>**/**<fc #BF0000>parameter</fc>**'' | ''<nowiki>http://server:port/webapp/services/rest/</nowiki>**<fc #BF0000>APPLICATION_NAME</fc>**/_admin/**<fc #BF0000>changePassword</fc>**/**<fc #BF0000>parameter</fc>**'' | ||
| - | Der Request benötigt eine HashMap im JSON Format. | + | Der Request benötigt einen Text im JSON Format. |
| Beispiel: | Beispiel: | ||
| <file json> | <file json> | ||
| - | { "username" : "admin", | + | { |
| + | "username" : "admin", | ||
| "oldpassword" : "oldpassword", | "oldpassword" : "oldpassword", | ||
| "newpassword" : "newpassword" | "newpassword" : "newpassword" | ||
| Line 97: | Line 100: | ||
| Wenn die Prüfung erfolgreich war, wird kein Response generiert und der Status Code ist 204 (SUCCESS_NO_CONTENT). Wenn die Datenbank nicht verfügbar ist, wird der Status Code 500 (SERVER_ERROR_INTERNAL) geliefert. Es ist ebenfalls möglich das die Konfiguration nicht gefunden werden konnte. In diesem Fall wird der Status Code 503 (SERVER_ERROR_SERVICE_UNAVAILABLE) geliefert. | Wenn die Prüfung erfolgreich war, wird kein Response generiert und der Status Code ist 204 (SUCCESS_NO_CONTENT). Wenn die Datenbank nicht verfügbar ist, wird der Status Code 500 (SERVER_ERROR_INTERNAL) geliefert. Es ist ebenfalls möglich das die Konfiguration nicht gefunden werden konnte. In diesem Fall wird der Status Code 503 (SERVER_ERROR_SERVICE_UNAVAILABLE) geliefert. | ||
| + | |||
| + | === Speicher Status === | ||
| + | |||
| + | Test URL:\\ | ||
| + | ''<nowiki>http://server:port/webapp/services/rest/</nowiki>**<fc #BF0000>APPLICATION_NAME</fc>**/_admin/**<fc #BF0000>memoryStatus</fc>**'' | ||
| + | |||
| + | Der Request benötigt einen Text im JSON Format. | ||
| + | |||
| + | Beispiel: | ||
| + | |||
| + | <file json> | ||
| + | { | ||
| + | "username" : "admin", | ||
| + | "password" : "adminpassword" | ||
| + | } | ||
| + | |||
| + | == POST-Response == | ||
| + | |||
| + | Wenn die Prüfung erfolgreich war, ist der Status Code 200 (SUCCESS). Die Antwort enthält einen Text im JSON Format: | ||
| + | |||
| + | <code json> | ||
| + | { | ||
| + | "totalMemory": 123456 | ||
| + | "freeMemory": 456 | ||
| + | "usedMemory": 123000 | ||
| + | "maxMemory": 200000 | ||
| + | } | ||
| + | </code> | ||
| === Benutzerdefinierte Dienste === | === Benutzerdefinierte Dienste === | ||
| Line 103: | Line 134: | ||
| <code java> | <code java> | ||
| - | AdminService.register(String pApplicationName, String pAction, IAdminServiceDelegate pDelegate); | + | UserService.register(String pApplicationName, String pAction, ICustomServiceDelegate pDelegate); |
| - | AdminService.unregister(String pApplicationName, String pAction, Class<? extends IAdminServiceDelegate> pClass) | + | UserService.unregister(String pApplicationName, String pAction); |
| </code> | </code> | ||
| - | erfolgen. Der Dienst kann entweder per GET oder POST Request angesprochen werden, je nachdem ob **//IAdminServiceGetDelegate//** oder **//IAdminServicePostDelegate//** verwendet wird. | + | erfolgen. Der Dienst kann entweder per GET oder POST Request angesprochen werden, je nachdem ob **//IACustomServiceGetDelegate//** oder **//IACustomServicePostDelegate//** verwendet wird. |
| Der Aufruf erfolgt mittels: | Der Aufruf erfolgt mittels: | ||
| Line 140: | Line 171: | ||
| ==GET-Response== | ==GET-Response== | ||
| - | Der Response enthält immer eine Liste von HashMaps im JSON Format. Als Key wird die Spaltenbezeichnung verwendet. | + | Der Response enthält immer eine Liste als Text im JSON Format. Als Key wird die Spaltenbezeichnung verwendet. |
| Beispiel: | Beispiel: | ||
| <file json> | <file json> | ||
| - | [ { "ID" : 0, | + | [ |
| + | { "ID" : 0, | ||
| "POST_ID" : 127, | "POST_ID" : 127, | ||
| "POST_PLZ" : "1127", | "POST_PLZ" : "1127", | ||
| Line 171: | Line 203: | ||
| ''<nowiki>http://server:port/webapp/services/rest/</nowiki>**<fc #BF0000>APPLICATION_NAME</fc>**/**<fc #BF0000>LIFECYCLE_CLASS</fc>**/data/**<fc #BF0000>STORAGE_NAME</fc>**'' | ''<nowiki>http://server:port/webapp/services/rest/</nowiki>**<fc #BF0000>APPLICATION_NAME</fc>**/**<fc #BF0000>LIFECYCLE_CLASS</fc>**/data/**<fc #BF0000>STORAGE_NAME</fc>**'' | ||
| - | Der Request benötigt eine HashMap im JSON Format. Als Key wird die Spaltenbezeichnung verwendet. | + | Der Request benötigt einen Text im JSON Format. Als Key wird die Spaltenbezeichnung verwendet. |
| Beispiel: | Beispiel: | ||
| <file json> | <file json> | ||
| - | { "POST_ID" : "0", | + | { |
| + | "POST_ID" : "0", | ||
| "STRA_ID" : "0", | "STRA_ID" : "0", | ||
| "HAUSNUMMER" : "9999" | "HAUSNUMMER" : "9999" | ||
| Line 187: | Line 220: | ||
| <file json> | <file json> | ||
| - | { "ID" : 1008, | + | { |
| + | "ID" : 1008, | ||
| "POST_ID" : 0, | "POST_ID" : 0, | ||
| "POST_PLZ" : "1000", | "POST_PLZ" : "1000", | ||
| Line 206: | Line 240: | ||
| ''<nowiki>http://server:port/webapp/services/rest/</nowiki>**<fc #BF0000>APPLICATION_NAME</fc>**/**<fc #BF0000>LIFECYCLE_CLASS</fc>**/data/**<fc #BF0000>STORAGE_NAME</fc>**?**<fc #BF0000>COLUMN=VALUE</fc>**&**<fc #BF0000>COLUMN2=VALUE2</fc>**'' | ''<nowiki>http://server:port/webapp/services/rest/</nowiki>**<fc #BF0000>APPLICATION_NAME</fc>**/**<fc #BF0000>LIFECYCLE_CLASS</fc>**/data/**<fc #BF0000>STORAGE_NAME</fc>**?**<fc #BF0000>COLUMN=VALUE</fc>**&**<fc #BF0000>COLUMN2=VALUE2</fc>**'' | ||
| - | Der Request benötigt eine HashMap im JSON Format. Als Key wird die Spaltenbezeichnung verwendet. | + | Der Request benötigt einen Text im JSON Format. Als Key wird die Spaltenbezeichnung verwendet. |
| Beispiel: | Beispiel: | ||
| - | |||
| <file json> | <file json> | ||
| - | { "ID" : "123", | + | { |
| + | "ID" : "123", | ||
| "HAUSNUMMER" : "0", | "HAUSNUMMER" : "0", | ||
| "STIEGE" : "0", | "STIEGE" : "0", | ||
| Line 226: | Line 260: | ||
| <file json> | <file json> | ||
| - | { "ID" : 0, | + | { |
| + | "ID" : 0, | ||
| "POST_ID" : 127, | "POST_ID" : 127, | ||
| "POST_PLZ" : "1127", | "POST_PLZ" : "1127", | ||
| Line 263: | Line 298: | ||
| <file json> | <file json> | ||
| - | { "autoIncrementColumnNames" : [ "ID" ], | + | { |
| + | "autoIncrementColumnNames" : [ "ID" ], | ||
| "columnMetaData" : [ { "allowedValues" : null, | "columnMetaData" : [ { "allowedValues" : null, | ||
| "autoIncrement" : true, | "autoIncrement" : true, | ||
