io.apiman.gateway.engine.beans.Api.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(226)

本文整理了Java中io.apiman.gateway.engine.beans.Api.<init>()方法的一些代码示例,展示了Api.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Api.<init>()方法的具体详情如下:
包路径:io.apiman.gateway.engine.beans.Api
类名称:Api
方法名:<init>

Api.<init>介绍

[英]Constructor.
[中]构造器。

代码示例

代码示例来源:origin: apiman/apiman

  1. /**
  2. * Retires the API, removing it from the engine.
  3. */
  4. protected void retireApi() {
  5. Api api = new Api();
  6. api.setOrganizationId(orgId);
  7. api.setApiId(apiId);
  8. api.setVersion(String.valueOf(version));
  9. getEngine().getRegistry().retireApi(api, new IAsyncResultHandler<Void>() {
  10. @Override
  11. public void handle(IAsyncResult<Void> result) {
  12. // This is a good faith effort - we don't really care if it can't be retired.
  13. }
  14. });
  15. }

代码示例来源:origin: apiman/apiman

  1. @Override
  2. public void retire(String organizationId, String apiId, String version, AsyncResponse response)
  3. throws RegistrationException, NotAuthorizedException {
  4. Api api = new Api();
  5. api.setOrganizationId(organizationId);
  6. api.setApiId(apiId);
  7. api.setVersion(version);
  8. registry.retireApi(api, handlerWithEmptyResult(response));
  9. }

代码示例来源:origin: apiman/apiman

  1. /**
  2. * @see io.apiman.gateway.api.rest.contract.IApiResource#retire(java.lang.String, java.lang.String, java.lang.String)
  3. */
  4. @Override
  5. public void retire(String organizationId, String apiId, String version) throws RegistrationException,
  6. NotAuthorizedException {
  7. final Set<Throwable> errorHolder = new HashSet<>();
  8. final CountDownLatch latch = new CountDownLatch(1);
  9. Api api = new Api();
  10. api.setOrganizationId(organizationId);
  11. api.setApiId(apiId);
  12. api.setVersion(version);
  13. // Retire api; latch until result returned and evaluated
  14. getEngine().getRegistry().retireApi(api, latchedResultHandler(latch, errorHolder));
  15. awaitOnLatch(latch, errorHolder);
  16. }

代码示例来源:origin: io.apiman/apiman-test-policies

  1. /**
  2. * Retires the API, removing it from the engine.
  3. */
  4. protected void retireApi() {
  5. Api api = new Api();
  6. api.setOrganizationId(orgId);
  7. api.setApiId(apiId);
  8. api.setVersion(String.valueOf(version));
  9. getEngine().getRegistry().retireApi(api, new IAsyncResultHandler<Void>() {
  10. @Override
  11. public void handle(IAsyncResult<Void> result) {
  12. // This is a good faith effort - we don't really care if it can't be retired.
  13. }
  14. });
  15. }

代码示例来源:origin: io.apiman/apiman-gateway-api-rest-impl

  1. /**
  2. * @see io.apiman.gateway.api.rest.contract.IApiResource#retire(java.lang.String, java.lang.String, java.lang.String)
  3. */
  4. @Override
  5. public void retire(String organizationId, String apiId, String version) throws RegistrationException,
  6. NotAuthorizedException {
  7. final Set<Throwable> errorHolder = new HashSet<>();
  8. final CountDownLatch latch = new CountDownLatch(1);
  9. Api api = new Api();
  10. api.setOrganizationId(organizationId);
  11. api.setApiId(apiId);
  12. api.setVersion(version);
  13. // Retire api; latch until result returned and evaluated
  14. getEngine().getRegistry().retireApi(api, latchedResultHandler(latch, errorHolder));
  15. awaitOnLatch(latch, errorHolder);
  16. }

代码示例来源:origin: apiman/apiman

  1. @Override
  2. public void retire(String organizationId, String apiId, String version) throws RegistrationException, NotAuthorizedException {
  3. Api api = new Api();
  4. api.setOrganizationId(organizationId);
  5. api.setApiId(apiId);
  6. api.setVersion(version);
  7. registry.retireApi(api, (IAsyncResultHandler<Void>) result -> {
  8. if (result.isError()) {
  9. throwError(result.getError());
  10. }
  11. });
  12. }

代码示例来源:origin: io.apiman/apiman-gateway-api-rest-impl

  1. @Override
  2. public void retire(String organizationId, String apiId, String version, AsyncResponse response)
  3. throws RegistrationException, NotAuthorizedException {
  4. Api api = new Api();
  5. api.setOrganizationId(organizationId);
  6. api.setApiId(apiId);
  7. api.setVersion(version);
  8. getEngine().getRegistry().retireApi(api, handlerWithEmptyResult(response));
  9. }

代码示例来源:origin: apiman/apiman

  1. policy.setPolicyJsonConfig(getPolicyConfiguration(config));
  2. Api api = new Api();
  3. api.setEndpoint(backEndApi.getName());
  4. api.setEndpointType("TEST");

代码示例来源:origin: apiman/apiman

  1. @Override
  2. public void retire(String organizationId, String apiId, String version, AsyncResponse response)
  3. throws RegistrationException, NotAuthorizedException {
  4. Api api = new Api();
  5. api.setOrganizationId(organizationId);
  6. api.setApiId(apiId);
  7. api.setVersion(version);
  8. getEngine().getRegistry().retireApi(api, handlerWithEmptyResult(response));
  9. }

代码示例来源:origin: io.apiman/apiman-test-policies

  1. policy.setPolicyJsonConfig(getPolicyConfiguration(config));
  2. Api api = new Api();
  3. api.setEndpoint(backEndApi.getName());
  4. api.setEndpointType("TEST");

代码示例来源:origin: apiman/apiman

  1. private void processData() {
  2. if (configs.size() == 0) {
  3. log.warn("File loaded into registry was empty. No entities created.");
  4. return;
  5. }
  6. try {
  7. // Naive version initially.
  8. for (Auth3ScaleBean bean : configs) {
  9. // Reflects the remote data structure.
  10. BackendConfiguration config = bean.getThreescaleConfig().getProxyConfig().getBackendConfig();
  11. Api api = new Api();
  12. api.setApiId(config.getSystemName());
  13. api.setOrganizationId(defaultOrgName);
  14. api.setEndpoint(config.getProxy().getApiBackend());
  15. api.setEndpointContentType("text/json"); // don't think there is an equivalent of this in 3scale
  16. api.setEndpointType("rest"); //don't think there is an equivalent of this in 3scale
  17. api.setParsePayload(false); // can let user override this?
  18. api.setPublicAPI(true); // is there an equivalent of this?
  19. api.setVersion(defaultVersion); // don't think this is relevant anymore
  20. setPolicies(api, bean);
  21. log.debug("Processing: {0}", config);
  22. log.debug("Creating API: {0}", api);
  23. apis.add(api);
  24. }
  25. dataProcessed = true;
  26. checkQueue();
  27. } catch (DecodeException e) {
  28. failAll(e);
  29. }
  30. }

代码示例来源:origin: io.apiman/apiman-gateway-engine-3scale

  1. private void processData() {
  2. if (configs.size() == 0) {
  3. log.warn("File loaded into registry was empty. No entities created.");
  4. return;
  5. }
  6. try {
  7. // Naive version initially.
  8. for (Auth3ScaleBean bean : configs) {
  9. // Reflects the remote data structure.
  10. BackendConfiguration config = bean.getThreescaleConfig().getProxyConfig().getBackendConfig();
  11. Api api = new Api();
  12. api.setApiId(config.getSystemName());
  13. api.setOrganizationId(defaultOrgName);
  14. api.setEndpoint(config.getProxy().getApiBackend());
  15. api.setEndpointContentType("text/json"); // don't think there is an equivalent of this in 3scale
  16. api.setEndpointType("rest"); //don't think there is an equivalent of this in 3scale
  17. api.setParsePayload(false); // can let user override this?
  18. api.setPublicAPI(true); // is there an equivalent of this?
  19. api.setVersion(defaultVersion); // don't think this is relevant anymore
  20. setPolicies(api, bean);
  21. log.debug("Processing: {0}", config);
  22. log.debug("Creating API: {0}", api);
  23. apis.add(api);
  24. }
  25. dataProcessed = true;
  26. checkQueue();
  27. } catch (DecodeException e) {
  28. failAll(e);
  29. }
  30. }

代码示例来源:origin: apiman/apiman

  1. ApiVersionBean versionBean = storage.getApiVersion(info.organizationId, info.id, info.version);
  2. Api gatewayApi = new Api();
  3. gatewayApi.setEndpoint(versionBean.getEndpoint());
  4. gatewayApi.setEndpointType(versionBean.getEndpointType().toString());

代码示例来源:origin: apiman/apiman

  1. Api gatewayApi = new Api();
  2. gatewayApi.setOrganizationId(versionBean.getApi().getOrganization().getId());
  3. gatewayApi.setApiId(versionBean.getApi().getId());

代码示例来源:origin: io.apiman/apiman-manager-api-rest-impl

  1. Api gatewayApi = new Api();
  2. gatewayApi.setOrganizationId(versionBean.getApi().getOrganization().getId());
  3. gatewayApi.setApiId(versionBean.getApi().getId());

代码示例来源:origin: apiman/apiman

  1. Api gatewayApi = new Api();
  2. gatewayApi.setEndpoint(versionBean.getEndpoint());
  3. gatewayApi.setEndpointType(versionBean.getEndpointType().toString());

代码示例来源:origin: io.apiman/apiman-manager-api-rest-impl

  1. Api gatewayApi = new Api();
  2. gatewayApi.setEndpoint(versionBean.getEndpoint());
  3. gatewayApi.setEndpointType(versionBean.getEndpointType().toString());

相关文章