From 018d875a84d9b42ab186cad29c19cff1454d577e Mon Sep 17 00:00:00 2001 From: ayyoob Date: Wed, 26 Apr 2017 10:34:51 +0530 Subject: [PATCH] removed temporary logs (cherry picked from commit 615e44e) --- .../admin/DeviceTypePublisherAdminServiceImpl.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypePublisherAdminServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypePublisherAdminServiceImpl.java index 6177a1e43f..d4995c1503 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypePublisherAdminServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypePublisherAdminServiceImpl.java @@ -214,6 +214,9 @@ public class DeviceTypePublisherAdminServiceImpl implements DeviceTypePublisherA } catch (RegistryException e) { log.error("Failed to load tenant, tenantDomain: " + tenantDomain, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); + } catch (ParseException e) { + log.error("Invalid stream definition for device type" + type " for tenant, tenantDomain: " + tenantDomain, e); + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); } } @@ -335,7 +338,7 @@ public class DeviceTypePublisherAdminServiceImpl implements DeviceTypePublisherA } private void publishDynamicEventStream(String deviceType, String tenantDomain, List streamList) - throws IOException, UserStoreException, JWTClientException { + throws IOException, UserStoreException, JWTClientException, ParseException { PrivilegedCarbonContext.startTenantFlow(); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain, true); @@ -382,14 +385,9 @@ public class DeviceTypePublisherAdminServiceImpl implements DeviceTypePublisherA String version = (String) steamJson.get("version"); String streamId = name +":"+version; if (eventStreamAdminServiceStub.getStreamDefinitionDto(streamId) == null) { - log.error("its not there"); eventStreamAdminServiceStub.addEventStreamDefinitionAsString(streamContent); - } else { - log.error("its there"); } } - } catch (ParseException e) { - e.printStackTrace(); } finally { cleanup(eventStreamAdminServiceStub); PrivilegedCarbonContext.endTenantFlow();