/** * Update an oAuth application owner * * @param appInfoDTO accept an appinfoDTO object * @return OAuthApplicationInfo this object will contain all the properties of updated oAuth application */ default OAuthApplicationInfo updateApplicationOwner(OAuthAppRequest appInfoDTO, String owner) throws APIManagementException { throw new APIManagementException("This is not supported"); }
public boolean deleteApi(String apiProviderName, String apiName, String version) throws AxisFault { RESTAPIAdminClient restClient = getRestapiAdminClient(apiProviderName, apiName, version); // Delete secure vault alias properties if exists try { deleteRegistryProperty(apiProviderName, apiName, version, MultitenantConstants.SUPER_TENANT_DOMAIN_NAME); } catch (APIManagementException e) { String msg = "Failed to delete secure endpoint password alias " + e.getMessage(); throw new AxisFault(msg, e); } return restClient.deleteApi(); }
private void handleException(String msg, Throwable t) throws APIManagementException { log.error(msg, t); throw new APIManagementException(msg, t); }
/** * Delete the API from Gateway * * @param tenantDomain * @throws AxisFault */ public boolean deleteApiForTenant(String apiProviderName, String apiName, String version, String tenantDomain) throws AxisFault { RESTAPIAdminClient restClient = getRestapiAdminClient(apiProviderName, apiName, version); // Delete secure vault alias properties if exists try { deleteRegistryProperty(apiProviderName, apiName, version, tenantDomain); } catch (APIManagementException e) { String msg = "Failed to delete secure endpoint password alias " + e.getMessage(); throw new AxisFault(msg, e); } return restClient.deleteApi(tenantDomain); }
public APIIdentifier(String apiId) throws APIManagementException { //eg: apiId = "P1_API1_v1.0.0" String[] split = apiId.split("_"); if (split.length == 3) { this.providerName = split[0]; this.apiName = split[1]; this.version = split[2]; } else { throw new APIManagementException("Invalid API ID : " + apiId); } }
log.error("Error occurred while querying from the stream processor " + e.getMessage(), e); throw new APIMgtUsageQueryServiceClientException( "Error occurred while querying from the stream processor " + e.getMessage(), e);
/** * logs the error message and throws an exception * * @param message Error message * @param throwable * @throws APIManagementException */ private static void handleException(String message, Throwable throwable) throws APIManagementException { log.error(message, throwable); throw new APIManagementException(throwable); }
/** * encrypt the plain text password * * @param plainTextPass * plain text password * @return encrypted password * @throws APIManagementException */ public String doEncryption(String tenantDomain, String secureVaultAlias, String plainTextPass) throws AxisFault { MediationSecurityAdminServiceClient client = getMediationSecurityAdminServiceClient(); String encodedValue; try { encodedValue = client.doEncryption(plainTextPass); setRegistryProperty(tenantDomain, secureVaultAlias, encodedValue); } catch (APIManagementException e) { String msg = "Failed to encrypt and store the secured endpoint password, " + e.getMessage(); throw new AxisFault(msg, e); } return encodedValue; }
/** * common method to throw exceptions. * * @param msg this parameter contain error message that we need to throw. * @param e Exception object. * @throws org.wso2.carbon.apimgt.api.APIManagementException */ private void handleException(String msg, Exception e) throws APIManagementException { log.error(msg, e); throw new APIManagementException(msg, e); }
log.error("Error occurred while querying from Stream Processor " + e.getMessage(), e); throw new APIMgtUsageQueryServiceClientException("Error occurred while querying from Stream Processor ", e);
private static void handleException(String msg, Throwable t) throws APIManagementException { log.error(msg, t); throw new APIManagementException(msg, t); }
log.error("Error occurred while querying from Stream Processor " + e.getMessage(), e); throw new APIMgtUsageQueryServiceClientException("Error occurred while querying from Stream Processor ", e);
/** * encrypt the plain text password * * @param cipher * init cipher * @param plainTextPass * plain text password * @return encrypted password * @throws APIManagementException */ public String doEncryption(String plainTextPass) throws APIManagementException { String encodedValue = null; try { encodedValue = mediationSecurityAdminServiceStub.doEncrypt(plainTextPass); // encodedValue = CryptoUtil.getDefaultCryptoUtil() // .encryptAndBase64Encode(plainTextPass.getBytes()); //why ESB can not use this? } catch (Exception e) { String msg = "Failed to encrypt the secured endpoint password, " + e.getMessage(); throw new APIManagementException(msg, e); } return encodedValue; }
log.error("Error occurred while querying from Stream Processor " + e.getMessage(), e); throw new APIMgtUsageQueryServiceClientException("Error occurred while querying from Stream Processor", e);
String error = "Signature algorithm not found."; throw new APIManagementException(error, e); } catch (InvalidKeyException e) { String error = "Invalid private key provided for the signature"; throw new APIManagementException(error, e); } catch (SignatureException e) { String error = "Error in signature"; throw new APIManagementException(error, e); } catch (RegistryException e) { String error = "Error in loading tenant registry for " + tenantDomain; throw new APIManagementException(error, e);
log.error("Error occurred while querying from Stream Processor " + e.getMessage(), e); throw new APIMgtUsageQueryServiceClientException("Error occurred while querying from Stream Processor ", e);
} else { String error = "Error in obtaining tenant's keystore"; throw new APIManagementException(error); throw new APIManagementException(error, e); } catch (CertificateEncodingException e) { String error = "Error in generating public cert thumbprint"; throw new APIManagementException(error, e); } catch (NoSuchAlgorithmException e) { String error = "Error in generating public cert thumbprint"; throw new APIManagementException(error, e); } catch (Exception e) { String error = "Error in obtaining tenant's keystore"; throw new APIManagementException(error, e);
log.error("Error occurred while querying from Stream Processor " + e.getMessage(), e); throw new APIMgtUsageQueryServiceClientException("Error occurred while querying from Stream Processor ", e);
/** * This method will publish event for alert types configurations. * @param alertTypeDTO DTO object. * @throws APIManagementException */ @Override public void publishEvent(AlertTypeDTO alertTypeDTO) throws APIManagementException { DataBridgeAlertTypesPublisherDTO dataBridgeAlertTypesPublisherDTO = new DataBridgeAlertTypesPublisherDTO(alertTypeDTO); try { String streamID = DataPublisherUtil.getApiManagerAnalyticsConfiguration().getAlertTypeStreamName() + ":" + DataPublisherUtil.getApiManagerAnalyticsConfiguration().getAlertTypeStreamVersion(); dataPublisher.tryPublish(streamID,System.currentTimeMillis(), null, null, (Object[]) dataBridgeAlertTypesPublisherDTO.createPayload()); } catch (Exception e) { log.error("Error while publishing alert types events.", e); throw new APIManagementException("Error while publishing alert types events"); } }
log.error("Error occurred while querying from stream processor " + e.getMessage(), e); throw new APIMgtUsageQueryServiceClientException("Error occurred while querying from stream processor ", e);