wso2 api 管理器数据库 [英] wso2 api manager database

查看:42
本文介绍了wso2 api 管理器数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不明白如何访问 API (api_id) USER (user_id)、订阅(用户 'x' 是否订阅了 API 'y'?)...

如何通过连接到某个数据库来执行此类控制?

解决方案

虽然你的问题不是很清楚,但希望你想知道WSO2 API Manager是如何实现数据库数据访问部分的.我来解释一下WSO2 API Manager是如何控制的数据库数据.

您可以从 [1] 中找到 WSO2 API Manager 使用的数据库脚本 [它包含 h2/mysql/oracle dbscripts],用于创建它的数据库表结构.您会注意到有单独的数据库表要存储APIs[AM_API]、订阅者[AM_SUBSCRIBER]和订阅者[AM_SUBSCRIPTION]等信息.你会注意到如何使用外键来启用表之间的关系来控制数据,同时确保数据以一致的方式存储.

然后有一个为 WSO2 API 管理器相关后端功能定义的内置 Java API,您可以从 [2] 中找到它,其实现的 Java 代码可以从 [3] 中找到.如果您查看 ApiMgtDAO.javaorg.wso2.carbon.apimgt.impl bundle 中的类实现,您将更好地理解 API Manager 的数据库访问层是如何通过数据库数据查询实现的.

希望以上对您有所帮助.

谢谢;

/拉拉吉

[1] https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.0.0/products/apimgt/1.0.0/modules/distribution/resources/sql/

[2]https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.0.0/components/apimgt/org.wso2.carbon.apimgt.api/1.0.0/

[3]https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.0.0/components/apimgt/org.wso2.carbon.apimgt.impl/1.0.0/

I don't understand how can I access the data of APIs (api_id) USER (user_id), subscriptions (is a user 'x' subscribed to API 'y'?) ...

how can I perform such controls by connecting to some db?

解决方案

Though your question is not much clear,hope you want to know how WSO2 API Manager implemented database data accessing part.I'll explain how WSO2 API Manager did controlling over database data.

You could found the database scripts[it contains h2/mysql/oracle dbscripts] use by WSO2 API Manager from [1] which used to create the database table structure of it.You'll notice there are separate database tables to store information on APIs[AM_API] ,subscribers[AM_SUBSCRIBER] and subscriptions[AM_SUBSCRIPTION],etc.And you'll notice how foreign keys have been used to enable relationships among tables to perform controls over data while ensuring that the data stored in a consistent way.

Then there's an inbuilt java API defined for WSO2 API Manager related back-end functionalities and you can found it from [2] and its implemented java code can be found from [3].If you have a look on ApiMgtDAO.java class implementation in org.wso2.carbon.apimgt.impl bundle,you'll get a better understanding how the database access layer for API Manager implemented with querying through database data.

Hope above will help to you.

Thanks;

/Lalaji

[1] https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.0.0/products/apimgt/1.0.0/modules/distribution/resources/sql/

[2]https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.0.0/components/apimgt/org.wso2.carbon.apimgt.api/1.0.0/

[3]https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.0.0/components/apimgt/org.wso2.carbon.apimgt.impl/1.0.0/

这篇关于wso2 api 管理器数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆