|
|
@ -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);
|
|
|
|