We got a requirement where we have to fetch all registered device details from SMP 3.0 Admin cockpit those have been registered for push notifications (GCM, APNS, BES,WNS, MPNS). We have got access to Derby DB tables where required information is available.
This database stores information about the data that passes through the SAP Mobile platform system like execution requests between client and server, information about native and hybrid applications, back-end notification requests, and usage statistics.
Note: This write-up is only for SMP 3.0 development edition where Derby Database is get installed by default. For SMP 3.0 Production, you can find SMP related information in other database (either Oracle DB, ASE, DB2) that has been chosen while SMP installation.
There is a table name SMP_NOTIFICATION_TARGET that has all required details.
Tools & Platform Used: SQuirreL SQL Client v.3.5.3, Eclipse Kepler 4.3, SMP 3.0 SP03, Windows
- SAP Mobile Platform Tool must be added as a plugin in Eclipse Kepler. How to do it?
- Derby DB should be accessible through SQuirreL SQL Client How to open the SMP3 (Developer Edition) internal database (Apache Derby)
Note: If you are trying to install “Integration Gateway plugins” in eclipse juno, you may not find it. This tool will not be available for Eclipse juno, as SAP has official ended the support of Eclipse Juno in the end of June 2014. See this announcement.
1. In Eclipse Kepler, Go to File>New>SAP Mobile Platform OData Implementation Project
2. Give any project name. Make sure to select proper server as Target Runtime. (I have installed SMP 3.0 SP03 on my machine so i have chosen respective option).
3. Give a Model name and click>Finish.
4. Create a new Entity>Give some name.
5. Make sure EntitySet should have same name as Table name > SMP_NOTIFICATION_TARGET
And its properties name should match as above table’s column names. (as per first screenshot)
Note: There is no need of implement the OData service (as in Eclipse JUNO) since odatasrv has already been generated at the time of project creation.
6. Right click DerbyModel.odatasrv> Select Data source> select JDBC>Finish
7. Right Click project>Generate and deploy Integration content
Note: There is no need to deploy the JDBC driver for apache derby, because it is already on the build path (by SMP system). So do not deploy again the jdbc driver inside the pickup folder..
8. Logon to Gateway cockpit: https://smpserverip:8083/gateway/cockpit
- Create a new destination under DESTINATIONS tab>Create a new Destination
- Provide below details:
|Authentication Type||Basic Authentication|
9. Switch to “SERVICES” tab, Click the deployed OData service and then Click on “Add Destinations“
10. Click on “Open service document”
11. To get EntitySet details, add SMP_NOTIFICATION_TARGET at the end of above URL.
To get the list of device id and Device notification key against an application id
ℹ To get list of all Application Connection ids against all Application IDs registered in admin cockpit then look for SMP_APPLN_CONNECTION_INFO table. It will also show if Application connection status is ACTIVE or DELETED.
Tips: When an entity type is created in an OData implementation project, there is one property key parameter gets created by default. Make sure to remove/rename it. Otherwise you may encounter with below error while opening EntitySet URL. As this key parameter is not present in database table.
“An exception occurred”.
Big thanks to Marvin Hoffmann for his valuable inputs.