Gateway newGateway = gatewayContext.newGateway(gateway.getFactoryId()); newGateway.update(gateway);
Gateway newGateway = gatewayContext.newGateway(gateway.getModel()); newGateway.setName(gateway.getName()); newGateway.setAddress(gateway.getAddress()); newGateway.setDescription(gateway.getDescription()); newGateway.setSerialNumber(gateway.getSerialNumber());
    void saveValid(IRequestCycle cycle_) {        Gateway gateway = getGateway();        GatewayContext gatewayContext = getGatewayContext();        if (gateway.isNew()) {            Gateway newGateway = gatewayContext.newGateway(gateway.getFactoryId());            newGateway.update(gateway);            setGateway(newGateway);            gateway = newGateway;        }        gatewayContext.storeGateway(gateway);        // attach gateway to current rule        Integer ruleId = getRuleId();        if (null != ruleId) {            DialPlanContext manager = getDialPlanManager();            DialingRule rule = manager.getRule(ruleId);            rule.addGateway(gateway);            manager.storeRule(rule);        }    }