Corrected a typo on [APIMCertificateMGTException]

revert-70aa11f8
Rasika Perera 8 years ago
parent c2490347b6
commit a16052431c

@ -19,7 +19,7 @@
package org.wso2.carbon.apimgt.handlers; package org.wso2.carbon.apimgt.handlers;
public class APIMCertificateMGTExcepton extends Exception{ public class APIMCertificateMGTException extends Exception{
private static final long serialVersionUID = -37676242646464497L; private static final long serialVersionUID = -37676242646464497L;
@ -33,26 +33,26 @@ public class APIMCertificateMGTExcepton extends Exception{
this.errorMessage = errorMessage; this.errorMessage = errorMessage;
} }
public APIMCertificateMGTExcepton(String msg, Exception nestedEx) { public APIMCertificateMGTException(String msg, Exception nestedEx) {
super(msg, nestedEx); super(msg, nestedEx);
setErrorMessage(msg); setErrorMessage(msg);
} }
public APIMCertificateMGTExcepton(String message, Throwable cause) { public APIMCertificateMGTException(String message, Throwable cause) {
super(message, cause); super(message, cause);
setErrorMessage(message); setErrorMessage(message);
} }
public APIMCertificateMGTExcepton(String msg) { public APIMCertificateMGTException(String msg) {
super(msg); super(msg);
setErrorMessage(msg); setErrorMessage(msg);
} }
public APIMCertificateMGTExcepton() { public APIMCertificateMGTException() {
super(); super();
} }
public APIMCertificateMGTExcepton(Throwable cause) { public APIMCertificateMGTException(Throwable cause) {
super(cause); super(cause);
} }
} }

@ -167,7 +167,7 @@ public class AuthenticationHandler extends AbstractHandler {
} catch (URISyntaxException e) { } catch (URISyntaxException e) {
log.error("Error while processing certificate.", e); log.error("Error while processing certificate.", e);
return false; return false;
} catch (APIMCertificateMGTExcepton e) { } catch (APIMCertificateMGTException e) {
log.error("Error while processing certificate.", e); log.error("Error while processing certificate.", e);
return false; return false;
} }

@ -26,7 +26,7 @@ import org.apache.ws.security.util.Base64;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.wso2.carbon.apimgt.handlers.APIMCertificateMGTExcepton; import org.wso2.carbon.apimgt.handlers.APIMCertificateMGTException;
import org.wso2.carbon.apimgt.handlers.beans.DCR; import org.wso2.carbon.apimgt.handlers.beans.DCR;
import org.wso2.carbon.apimgt.handlers.config.IOTServerConfiguration; import org.wso2.carbon.apimgt.handlers.config.IOTServerConfiguration;
import org.wso2.carbon.apimgt.handlers.invoker.RESTInvoker; import org.wso2.carbon.apimgt.handlers.invoker.RESTInvoker;
@ -65,13 +65,13 @@ public class Utils {
Unmarshaller unmarshaller = fileContext.createUnmarshaller(); Unmarshaller unmarshaller = fileContext.createUnmarshaller();
return (IOTServerConfiguration) unmarshaller.unmarshal(doc); return (IOTServerConfiguration) unmarshaller.unmarshal(doc);
} catch (JAXBException | APIMCertificateMGTExcepton e) { } catch (JAXBException | APIMCertificateMGTException e) {
log.error("Error occurred while initializing Data Source config", e); log.error("Error occurred while initializing Data Source config", e);
return null; return null;
} }
} }
public static Document convertToDocument(File file) throws APIMCertificateMGTExcepton { public static Document convertToDocument(File file) throws APIMCertificateMGTException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true); factory.setNamespaceAware(true);
try { try {
@ -79,13 +79,13 @@ public class Utils {
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
return docBuilder.parse(file); return docBuilder.parse(file);
} catch (Exception e) { } catch (Exception e) {
throw new APIMCertificateMGTExcepton("Error occurred while parsing file, while converting " + throw new APIMCertificateMGTException("Error occurred while parsing file, while converting " +
"to a org.w3c.dom.Document", e); "to a org.w3c.dom.Document", e);
} }
} }
public static String getAccessToken(IOTServerConfiguration iotServerConfiguration) public static String getAccessToken(IOTServerConfiguration iotServerConfiguration)
throws APIMCertificateMGTExcepton { throws APIMCertificateMGTException {
try { try {
if (clientId == null || clientSecret == null) { if (clientId == null || clientSecret == null) {
getClientSecretes(iotServerConfiguration); getClientSecretes(iotServerConfiguration);
@ -109,16 +109,16 @@ public class Utils {
return accessToken; return accessToken;
} catch (URISyntaxException e) { } catch (URISyntaxException e) {
throw new APIMCertificateMGTExcepton("Error occurred while trying to call oauth token endpoint", e); throw new APIMCertificateMGTException("Error occurred while trying to call oauth token endpoint", e);
} catch (JSONException e) { } catch (JSONException e) {
throw new APIMCertificateMGTExcepton("Error occurred while converting the json to object", e); throw new APIMCertificateMGTException("Error occurred while converting the json to object", e);
} catch (IOException e) { } catch (IOException e) {
throw new APIMCertificateMGTExcepton("Error occurred while trying to call oauth token endpoint", e); throw new APIMCertificateMGTException("Error occurred while trying to call oauth token endpoint", e);
} }
} }
private static void getClientSecretes(IOTServerConfiguration iotServerConfiguration) private static void getClientSecretes(IOTServerConfiguration iotServerConfiguration)
throws APIMCertificateMGTExcepton { throws APIMCertificateMGTException {
try { try {
DCR dcr = new DCR(); DCR dcr = new DCR();
dcr.setOwner(iotServerConfiguration.getUsername()); dcr.setOwner(iotServerConfiguration.getUsername());
@ -141,11 +141,11 @@ public class Utils {
clientId = jsonResponse.getString("client_id"); clientId = jsonResponse.getString("client_id");
clientSecret = jsonResponse.getString("client_secret"); clientSecret = jsonResponse.getString("client_secret");
} catch (JSONException e) { } catch (JSONException e) {
throw new APIMCertificateMGTExcepton("Error occurred while converting the json to object", e); throw new APIMCertificateMGTException("Error occurred while converting the json to object", e);
} catch (IOException e) { } catch (IOException e) {
throw new APIMCertificateMGTExcepton("Error occurred while trying to call DCR endpoint", e); throw new APIMCertificateMGTException("Error occurred while trying to call DCR endpoint", e);
} catch (URISyntaxException e) { } catch (URISyntaxException e) {
throw new APIMCertificateMGTExcepton("Error occurred while trying to call DCR endpoint", e); throw new APIMCertificateMGTException("Error occurred while trying to call DCR endpoint", e);
} }
} }

Loading…
Cancel
Save