mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Change exception codes of device stream events
This commit is contained in:
parent
e643db08d1
commit
fe4e857639
@ -86,24 +86,27 @@ public class AnalyticsArtifactsManagementServiceImpl
|
|||||||
if (!isEdited) {
|
if (!isEdited) {
|
||||||
eventStreamAdminServiceStub.addEventStreamDefinitionAsString(streamDefinition);
|
eventStreamAdminServiceStub.addEventStreamDefinitionAsString(streamDefinition);
|
||||||
} else {
|
} else {
|
||||||
// Find and edit stream
|
|
||||||
if (eventStreamAdminServiceStub.getStreamDetailsForStreamId(id) != null) {
|
if (eventStreamAdminServiceStub.getStreamDetailsForStreamId(id) != null) {
|
||||||
eventStreamAdminServiceStub.editEventStreamDefinitionAsString(streamDefinition, id);
|
eventStreamAdminServiceStub.editEventStreamDefinitionAsString(streamDefinition, id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Response.ok().build();
|
return Response.ok().build();
|
||||||
} catch (AxisFault e) {
|
} catch (AxisFault e) {
|
||||||
log.error("Failed to create event definitions for tenantDomain: " + tenantDomain, e);
|
String errMsg = "Failed to create event definitions for tenantDomain: " + tenantDomain;
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
|
log.error(errMsg, e);
|
||||||
|
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
log.error("Failed to connect with the remote services for tenantDomain: " + tenantDomain, e);
|
String errMsg = "Failed to connect with the remote services for tenantDomain: " + tenantDomain;
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
|
log.error(errMsg, e);
|
||||||
|
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
|
||||||
} catch (JWTClientException e) {
|
} catch (JWTClientException e) {
|
||||||
log.error("Failed to generate jwt token for tenantDomain: " + tenantDomain, e);
|
String errMsg = "Failed to generate jwt token for tenantDomain: " + tenantDomain;
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
|
log.error(errMsg, e);
|
||||||
|
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
|
||||||
} catch (UserStoreException e) {
|
} catch (UserStoreException e) {
|
||||||
log.error("Failed to connect with the user store for tenantDomain: " + tenantDomain, e);
|
String errMsg = "Failed to connect with the user store for tenantDomain: " + tenantDomain;
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
|
log.error(errMsg, e);
|
||||||
|
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
|
||||||
} finally {
|
} finally {
|
||||||
cleanup(eventStreamAdminServiceStub);
|
cleanup(eventStreamAdminServiceStub);
|
||||||
}
|
}
|
||||||
@ -118,17 +121,21 @@ public class AnalyticsArtifactsManagementServiceImpl
|
|||||||
publishStream(stream);
|
publishStream(stream);
|
||||||
return Response.ok().build();
|
return Response.ok().build();
|
||||||
} catch (AxisFault e) {
|
} catch (AxisFault e) {
|
||||||
log.error("Failed to create event definitions for tenantDomain: " + tenantDomain, e);
|
String errMsg = "Failed to create event definitions for tenantDomain: " + tenantDomain;
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
|
log.error(errMsg, e);
|
||||||
|
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
log.error("Failed to connect with the remote services for tenantDomain: " + tenantDomain, e);
|
String errMsg = "Failed to connect with the remote services for tenantDomain: " + tenantDomain;
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
|
log.error(errMsg, e);
|
||||||
|
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
|
||||||
} catch (JWTClientException e) {
|
} catch (JWTClientException e) {
|
||||||
log.error("Failed to generate jwt token for tenantDomain: " + tenantDomain, e);
|
String errMsg = "Failed to generate jwt token for tenantDomain: " + tenantDomain;
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
|
log.error(errMsg, e);
|
||||||
|
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
|
||||||
} catch (UserStoreException e) {
|
} catch (UserStoreException e) {
|
||||||
log.error("Failed to connect with the user store for tenantDomain: " + tenantDomain, e);
|
String errMsg = "Failed to connect with the user store for tenantDomain: " + tenantDomain;
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
|
log.error(errMsg, e);
|
||||||
|
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errMsg).build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,7 +358,7 @@ public class AnalyticsArtifactsManagementServiceImpl
|
|||||||
/**
|
/**
|
||||||
* Set data to a stream dto and publish dto using a stub
|
* Set data to a stream dto and publish dto using a stub
|
||||||
*
|
*
|
||||||
* @param stream Stream definition
|
* @param stream Stream definition
|
||||||
* @throws RemoteException Exception that may occur during a remote method call
|
* @throws RemoteException Exception that may occur during a remote method call
|
||||||
* @throws UserStoreException Exception that may occur during JWT token generation
|
* @throws UserStoreException Exception that may occur during JWT token generation
|
||||||
* @throws JWTClientException Exception that may occur during connecting to client store
|
* @throws JWTClientException Exception that may occur during connecting to client store
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user