156 Commits

Author SHA1 Message Date
Rohit Yadav
0b1c2a5981 ApiDiscovery: Fix listApis interface, fix getProperties
In case of api discovery, it does not make sense to create a separate properties file
If this plugin is enabled in components.xml, a user should be able to discover
all the apis accessible to their role.

listApis based on role type of caller user

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-10 15:55:02 -08:00
Rohit Yadav
c6d9877d64 ApiDiscoveryService: Move refactor, interface should be in plugins and not in cloud-api
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-10 10:59:38 -08:00
Rohit Yadav
d13cc7e7e4 ApiDiscoveryService: Use only as pluggable service
Remove usage and impl as adapter.
We have duplicate code that generates apiname:cmd class maps which is
unavoidable right now as:

- Plugin should not depend on ApiServer or any other component
- cloud-utils cannot depend on cloud-api for the APICommand annotation
- Use java reflect to create a static method in cloud-utils that does the job
  would be unsafe.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-09 17:25:29 -08:00
Rohit Yadav
2eee2cd999 plugins: Fix getPropertiesFiles() for pluggable service plugins, CiscoNexusVSMEElement
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-09 04:56:32 -08:00
Rohit Yadav
d613c59dcb plugins: Fix apidiscovery's annotation field values and example plugin's name
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-08 20:00:13 -08:00
Rohit Yadav
2c04dad529 ApiDiscovery: New plugin to help discover apis on mgmt server
- Introduces api/discovery plugin that helps discover apis on the mgmt server
- It's a pluggable service, therefore has it's own api-discovery_commands.properties
  where the discovery api, listApi can be blacklisted (by removing it), or it's
  role mask can be changed
- By default its response has all the apis
- Changes in other parts of the code to make it work, viz. components.xml, pom.xml,
  and in ApiServer where it is used as an adapter to get apiname, cmd mappings

The ApiDiscoveryService interface is a contract that the implementing class will
provide:

1. A means to get all the apis as a list of response, plugin is free to implement
   the response class, as long as it extends on the BaseResponse:

    ListResponse<? extends BaseResponse> listApis();

2. Provides a map of apiname as the key and cmd class as the value:

    Map<String, Class<?>> getApiNameCmdClassMapping();

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-08 18:54:29 -08:00