use of io.apiman.manager.api.core.IApiCatalog in project apiman by apiman.
the class TestCdiFactory method provideApiCatalog.
@Produces
@ApplicationScoped
public static IApiCatalog provideApiCatalog(IPluginRegistry pluginRegistry) {
return new IApiCatalog() {
/**
* @see io.apiman.manager.api.core.IApiCatalog#search(java.lang.String, java.lang.String)
*/
@Override
public List<AvailableApiBean> search(String keyword, String namespace) {
List<AvailableApiBean> rval = new ArrayList<>();
AvailableApiBean asb = new AvailableApiBean();
asb.setName("Test API 1");
asb.setDescription("The first test API.");
asb.setEndpoint("http://api1.example.org/api");
asb.setEndpointType(EndpointType.rest);
rval.add(asb);
asb = new AvailableApiBean();
asb.setName("Test API 2");
asb.setDescription("The second test API.");
asb.setEndpoint("http://api2.example.org/api");
asb.setEndpointType(EndpointType.rest);
rval.add(asb);
return rval;
}
/**
* @see io.apiman.manager.api.core.IApiCatalog#getNamespaces(java.lang.String)
*/
@Override
public List<ApiNamespaceBean> getNamespaces(String currentUser) {
List<ApiNamespaceBean> rval = new ArrayList<>();
ApiNamespaceBean bean = new ApiNamespaceBean();
bean.setCurrent(true);
bean.setName("current");
bean.setOwnedByUser(true);
rval.add(bean);
bean = new ApiNamespaceBean();
bean.setCurrent(false);
bean.setName("ns1");
bean.setOwnedByUser(true);
rval.add(bean);
bean = new ApiNamespaceBean();
bean.setCurrent(false);
bean.setName("ns2");
bean.setOwnedByUser(false);
rval.add(bean);
bean = new ApiNamespaceBean();
bean.setCurrent(false);
bean.setName("ns3");
bean.setOwnedByUser(false);
rval.add(bean);
return rval;
}
};
}
Aggregations