use of org.wso2.carbon.apimgt.rest.api.store.v1.dto.ApplicationDTO in project product-microgateway by wso2.
the class ValidationTestCase method start.
@BeforeClass
public void start() throws Exception {
ApplicationDTO application = new ApplicationDTO();
application.setName("jwtApp");
application.setTier("Unlimited");
application.setId((int) (Math.random() * 1000));
super.init("validation-project", new String[] { "validation/validation_api.yaml" }, null, "confs/validation.conf");
apikey = getAPIKey();
}
use of org.wso2.carbon.apimgt.rest.api.store.v1.dto.ApplicationDTO in project identity-inbound-auth-oauth by wso2-extensions.
the class RegisterApiServiceImpl method registerApplication.
@Override
public Response registerApplication(RegistrationRequestDTO registrationRequest) {
ApplicationDTO applicationDTO = null;
try {
Application application = DCRMUtils.getOAuth2DCRMService().registerApplication(DCRMUtils.getApplicationRegistrationRequest(registrationRequest));
applicationDTO = DCRMUtils.getApplicationDTOFromApplication(application);
} catch (DCRMClientException e) {
if (LOG.isDebugEnabled()) {
LOG.debug("Client error while registering application \n" + registrationRequest.toString(), e);
}
DCRMUtils.handleErrorResponse(e, LOG);
} catch (DCRMServerException e) {
DCRMUtils.handleErrorResponse(Response.Status.INTERNAL_SERVER_ERROR, e, true, LOG);
} catch (Throwable throwable) {
DCRMUtils.handleErrorResponse(Response.Status.INTERNAL_SERVER_ERROR, throwable, true, LOG);
}
return Response.status(Response.Status.CREATED).entity(applicationDTO).build();
}
use of org.wso2.carbon.apimgt.rest.api.store.v1.dto.ApplicationDTO in project identity-inbound-auth-oauth by wso2-extensions.
the class RegisterApiServiceImpl method getApplicationByName.
@Override
public Response getApplicationByName(String name) {
ApplicationDTO applicationDTO = null;
try {
Application application = DCRMUtils.getOAuth2DCRMService().getApplicationByName(name);
applicationDTO = DCRMUtils.getApplicationDTOFromApplication(application);
} catch (DCRMClientException e) {
if (LOG.isDebugEnabled()) {
LOG.debug("Client error while retrieving application by name : " + name, e);
}
DCRMUtils.handleErrorResponse(e, LOG);
} catch (Exception e) {
DCRMUtils.handleErrorResponse(Response.Status.INTERNAL_SERVER_ERROR, e, true, LOG);
}
return Response.status(Response.Status.OK).entity(applicationDTO).build();
}
use of org.wso2.carbon.apimgt.rest.api.store.v1.dto.ApplicationDTO in project identity-inbound-auth-oauth by wso2-extensions.
the class RegisterApiServiceImpl method getApplication.
@Override
public Response getApplication(String clientId) {
ApplicationDTO applicationDTO = null;
try {
Application application = DCRMUtils.getOAuth2DCRMService().getApplication(clientId);
applicationDTO = DCRMUtils.getApplicationDTOFromApplication(application);
} catch (DCRMClientException e) {
if (LOG.isDebugEnabled()) {
LOG.debug("Client error while retrieving application with client key:" + clientId, e);
}
DCRMUtils.handleErrorResponse(e, LOG);
} catch (DCRMServerException e) {
DCRMUtils.handleErrorResponse(Response.Status.INTERNAL_SERVER_ERROR, e, true, LOG);
} catch (Throwable throwable) {
DCRMUtils.handleErrorResponse(Response.Status.INTERNAL_SERVER_ERROR, throwable, true, LOG);
}
return Response.status(Response.Status.OK).entity(applicationDTO).build();
}
use of org.wso2.carbon.apimgt.rest.api.store.v1.dto.ApplicationDTO in project identity-api-user by wso2.
the class ApplicationToExternal method apply.
@Override
public ApplicationDTO apply(Application application) {
ApplicationDTO applicationDTO = new ApplicationDTO();
applicationDTO.setId(application.getResourceId());
applicationDTO.setAppId(application.getAppId());
applicationDTO.setSubject(application.getSubject());
applicationDTO.setAppName(application.getAppName());
return applicationDTO;
}
Aggregations