Format RPi and Arduino source

revert-dabc3590
lasantha 7 years ago
parent eb5e174dbd
commit b2c7033608

@ -222,11 +222,13 @@ public class ArduinoServiceImpl implements ArduinoService {
.getRealmConfiguration().getAdminUserName() + "@" + PrivilegedCarbonContext .getRealmConfiguration().getAdminUserName() + "@" + PrivilegedCarbonContext
.getThreadLocalCarbonContext().getTenantDomain(); .getThreadLocalCarbonContext().getTenantDomain();
if (apiApplicationKey == null) { if (apiApplicationKey == null) {
String adminUsername = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm().getRealmConfiguration().getAdminUserName(); String adminUsername =
PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm().getRealmConfiguration()
.getAdminUserName();
String tenantAdminDomainName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); String tenantAdminDomainName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
APIManagementProviderService apiManagementProviderService = APIUtil.getAPIManagementProviderService(); APIManagementProviderService apiManagementProviderService = APIUtil.getAPIManagementProviderService();
String[] tags = {ArduinoConstants.DEVICE_TYPE}; String[] tags = {ArduinoConstants.DEVICE_TYPE};
try{ try {
PrivilegedCarbonContext.startTenantFlow(); PrivilegedCarbonContext.startTenantFlow();
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantAdminDomainName); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantAdminDomainName);
PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(adminUsername); PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(adminUsername);

@ -203,14 +203,16 @@ public class RaspberryPiServiceImpl implements RaspberryPiService {
throw new DeviceManagementException(msg); throw new DeviceManagementException(msg);
} }
if (apiApplicationKey == null) { if (apiApplicationKey == null) {
String adminUsername = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm().getRealmConfiguration().getAdminUserName(); String adminUsername =
PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm().getRealmConfiguration()
.getAdminUserName();
String tenantAdminDomainName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); String tenantAdminDomainName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
String applicationUsername = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm() String applicationUsername = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm()
.getRealmConfiguration().getAdminUserName() + "@" + PrivilegedCarbonContext .getRealmConfiguration().getAdminUserName() + "@" + PrivilegedCarbonContext
.getThreadLocalCarbonContext().getTenantDomain(); .getThreadLocalCarbonContext().getTenantDomain();
APIManagementProviderService apiManagementProviderService = APIUtil.getAPIManagementProviderService(); APIManagementProviderService apiManagementProviderService = APIUtil.getAPIManagementProviderService();
String[] tags = {RaspberrypiConstants.DEVICE_TYPE}; String[] tags = {RaspberrypiConstants.DEVICE_TYPE};
try{ try {
PrivilegedCarbonContext.startTenantFlow(); PrivilegedCarbonContext.startTenantFlow();
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantAdminDomainName); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantAdminDomainName);
PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(adminUsername); PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(adminUsername);

Loading…
Cancel
Save