Search in sources :

Example 6 with IdentityApplicationManagementValidationException

use of org.wso2.carbon.identity.application.common.IdentityApplicationManagementValidationException in project carbon-identity-framework by wso2.

the class ApplicationManagementServiceImpl method buildImportErrorResponse.

private ImportResponse buildImportErrorResponse(IdentityApplicationManagementClientException e) {
    ImportResponse importResponse = new ImportResponse();
    importResponse.setResponseCode(ImportResponse.FAILED);
    importResponse.setApplicationName(null);
    String errorCode = e.getErrorCode() != null ? e.getErrorCode() : INVALID_REQUEST.getCode();
    importResponse.setErrorCode(errorCode);
    if (e instanceof IdentityApplicationManagementValidationException) {
        importResponse.setErrors(((IdentityApplicationManagementValidationException) e).getValidationMsg());
    } else {
        String message = e.getMessage();
        if (StringUtils.isNotBlank(message)) {
            importResponse.setErrors(new String[] { e.getMessage() });
        }
    }
    return importResponse;
}
Also used : ImportResponse(org.wso2.carbon.identity.application.common.model.ImportResponse) IdentityApplicationManagementValidationException(org.wso2.carbon.identity.application.common.IdentityApplicationManagementValidationException)

Aggregations

IdentityApplicationManagementValidationException (org.wso2.carbon.identity.application.common.IdentityApplicationManagementValidationException)6 IdentityApplicationManagementException (org.wso2.carbon.identity.application.common.IdentityApplicationManagementException)4 ServiceProvider (org.wso2.carbon.identity.application.common.model.ServiceProvider)4 IdentityApplicationManagementClientException (org.wso2.carbon.identity.application.common.IdentityApplicationManagementClientException)3 AbstractApplicationMgtListener (org.wso2.carbon.identity.application.mgt.listener.AbstractApplicationMgtListener)3 ApplicationMgtListener (org.wso2.carbon.identity.application.mgt.listener.ApplicationMgtListener)3 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 JAXBContext (javax.xml.bind.JAXBContext)1 JAXBException (javax.xml.bind.JAXBException)1 UnmarshallerHandler (javax.xml.bind.UnmarshallerHandler)1 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)1 SAXParser (javax.xml.parsers.SAXParser)1 SAXParserFactory (javax.xml.parsers.SAXParserFactory)1 ImportResponse (org.wso2.carbon.identity.application.common.model.ImportResponse)1 InboundAuthenticationRequestConfig (org.wso2.carbon.identity.application.common.model.InboundAuthenticationRequestConfig)1 IdentityOAuthAdminException (org.wso2.carbon.identity.oauth.IdentityOAuthAdminException)1 OAuthAppDAO (org.wso2.carbon.identity.oauth.dao.OAuthAppDAO)1 OAuthAppDO (org.wso2.carbon.identity.oauth.dao.OAuthAppDO)1