Exemple #1
0
  /** 变更MDNVod */
  @Transactional(readOnly = false)
  public void saveResourcesByMdnVod(
      Resources resources,
      String changeDescription,
      Integer vodId,
      String vodDomain,
      String vodBandwidth,
      String vodProtocol,
      String sourceOutBandwidth,
      String sourceStreamerUrl) {

    /* 新增或更新资源Resources的服务变更Change. */

    Change change =
        comm.changeServcie.saveOrUpdateChangeByResources(resources, vodId, changeDescription);

    MdnVodItem mdnVodItem = this.getMdnVodItem(vodId);

    ServiceTag serviceTag = resources.getServiceTag();

    /* 比较资源变更前和变更后的值. */

    boolean isChange =
        comm.compareResourcesService.compareMdnVodItem(
            resources,
            change,
            mdnVodItem,
            vodDomain,
            vodBandwidth,
            vodProtocol,
            sourceOutBandwidth,
            sourceStreamerUrl);

    // 当资源有更改的时候,更改状态.如果和资源不相关的如:服务标签,指派人等变更,则不变更资源的状态.
    if (isChange) {
      serviceTag.setStatus(ResourcesConstant.Status.已变更.toInteger());
      resources.setStatus(ResourcesConstant.Status.已变更.toInteger());
    }
    resources.setServiceTag(serviceTag);
    comm.serviceTagService.saveOrUpdate(serviceTag);

    mdnVodItem.setSourceOutBandwidth(sourceOutBandwidth);
    mdnVodItem.setSourceStreamerUrl(sourceStreamerUrl);
    mdnVodItem.setVodBandwidth(vodBandwidth);
    mdnVodItem.setVodDomain(vodDomain);
    mdnVodItem.setVodProtocol(vodProtocol);

    this.saveOrUpdate(mdnVodItem);

    // 更新resources

    comm.resourcesService.saveOrUpdate(resources);
  }
Exemple #2
0
  /**
   * 变更MDN
   *
   * @param resources 资源
   * @param serviceTagId 服务标签ID
   * @param changeDescription 变更描述
   * @param coverArea 重点覆盖地域
   * @param coverIsp 重点覆盖ISP
   */
  @Transactional(readOnly = false)
  public void saveResourcesByMdn(
      Resources resources,
      Integer serviceTagId,
      String changeDescription,
      String coverArea,
      String coverIsp) {

    /* 新增或更新资源Resources的服务变更Change. */

    Change change = comm.changeServcie.saveOrUpdateChangeByResources(resources, changeDescription);

    MdnItem mdnItem = this.getMdnItem(resources.getServiceId());

    /* 比较资源变更前和变更后的值. */

    boolean isChange =
        comm.compareResourcesService.compareMdnItem(
            resources, change, mdnItem, coverArea, coverIsp);

    ServiceTag serviceTag = comm.serviceTagService.getServiceTag(serviceTagId);

    // 当资源有更改的时候,更改状态.如果和资源不相关的如:服务标签,指派人等变更,则不变更资源的状态.
    if (isChange) {
      serviceTag.setStatus(ResourcesConstant.Status.已变更.toInteger());
      resources.setStatus(ResourcesConstant.Status.已变更.toInteger());
    }
    resources.setServiceTag(serviceTag);
    comm.serviceTagService.saveOrUpdate(serviceTag);

    mdnItem.setCoverArea(coverArea);
    mdnItem.setCoverIsp(coverIsp);

    this.saveOrUpdate(mdnItem);

    // 更新resources

    comm.resourcesService.saveOrUpdate(resources);
  }
Exemple #3
0
  /** 变更MDNVod */
  @Transactional(readOnly = false)
  public void saveResourcesByMdnLive(
      Resources resources,
      String changeDescription,
      Integer liveId,
      String bandwidth,
      String name,
      String guid,
      String liveDomain,
      String liveBandwidth,
      String liveProtocol,
      Integer streamOutMode,
      Integer encoderMode,
      String httpUrlEncoder,
      String httpBitrateEncoder,
      String hlsUrlEncoder,
      String hlsBitrateEncoder,
      String httpUrl,
      String httpBitrate,
      String hlsUrl,
      String hlsBitrate) {

    /* 新增或更新资源Resources的服务变更Change. */

    Change change =
        comm.changeServcie.saveOrUpdateChangeByResources(resources, liveId, changeDescription);

    MdnLiveItem mdnLiveItem = this.getMdnLiveItem(liveId);

    ServiceTag serviceTag = resources.getServiceTag();

    /* 比较资源变更前和变更后的值. */

    boolean isChange =
        comm.compareResourcesService.compareMdnLiveItem(
            resources,
            change,
            mdnLiveItem,
            bandwidth,
            name,
            guid,
            liveDomain,
            liveBandwidth,
            liveProtocol,
            streamOutMode,
            encoderMode,
            httpUrlEncoder,
            httpBitrateEncoder,
            hlsUrlEncoder,
            hlsBitrateEncoder,
            httpUrl,
            httpBitrate,
            hlsUrl,
            hlsBitrate);

    // 当资源有更改的时候,更改状态.如果和资源不相关的如:服务标签,指派人等变更,则不变更资源的状态.
    if (isChange) {
      serviceTag.setStatus(ResourcesConstant.Status.已变更.toInteger());
      resources.setStatus(ResourcesConstant.Status.已变更.toInteger());
    }
    resources.setServiceTag(serviceTag);
    comm.serviceTagService.saveOrUpdate(serviceTag);

    this.updateMdnLiveItemToApply(
        mdnLiveItem,
        bandwidth,
        name,
        guid,
        liveDomain,
        liveBandwidth,
        liveProtocol,
        streamOutMode,
        encoderMode,
        httpUrlEncoder,
        httpBitrateEncoder,
        hlsUrlEncoder,
        hlsBitrateEncoder,
        httpUrl,
        httpBitrate,
        hlsUrl,
        hlsBitrate);

    // 更新resources

    comm.resourcesService.saveOrUpdate(resources);
  }