Спасибо большое!
Вот так все заработало, может пригодится кому нибудь.
Код:
package ru.rta.bgbilling.inet;
import ru.bitel.bgbilling.kernel.container.managed.ServerContext;
import ru.bitel.bgbilling.kernel.event.EventProcessor;
import ru.bitel.bgbilling.kernel.script.server.dev.GlobalScriptBase;
import ru.bitel.bgbilling.modules.inet.api.common.bean.InetDevice;
import ru.bitel.bgbilling.modules.inet.api.common.bean.InetDeviceType;
import ru.bitel.bgbilling.modules.inet.api.common.service.InetDeviceService;
import ru.bitel.bgbilling.modules.inet.api.server.event.InetReloadEvent;
import ru.bitel.bgbilling.server.util.Setup;
import ru.bitel.common.sql.ConnectionSet;
import ru.bitel.oss.systems.inventory.resource.common.bean.Device;
import java.util.*;
public class test
extends GlobalScriptBase
{
@Override
public void execute( Setup setup, ConnectionSet connectionSet )
throws Exception
{
HashSet groupd = new HashSet( 1, 1 ); //сэт с id групп устройств
groupd.add(new Integer(1));
ServerContext context = ServerContext.get();
InetDeviceService deviceService = context.newService( InetDeviceService.class, 2 ); //(Class, int moduleId)
// получение типа устройства по id
InetDeviceType deviceType = deviceService.deviceTypeGet( 5 );
InetDevice device = new InetDevice();
device.setDeviceTypeId( 5 );
device.setParentId(2);
device.setHost("10.147.2.254");
device.setIdentifier("50let40-1p-9et-DGS-3627G-M");
device.setUsername("");
device.setPassword("");
device.setSecret("");
device.setConfig("");
device.setComment("");
device.setDeviceGroupIds(groupd);
device.setTitle( Device.generateTitle( device, deviceType ) );
print(device);
// обновление в базе
deviceService.deviceUpdate( device );
// перезагрузка конфигурации на всех приложениях (access/accounting)
EventProcessor.getInstance().publish( new InetReloadEvent( 2, 0 )); //( moduleId, userId )
}
}