/*
   * (非 Javadoc)
   *
   * @seecom.fujitsu.rsi.server.acceptor.base.ContentsProfileBase#
   * stop_distribute_contents(long, long,
   * org.robotservices.v02.profile.acceptor.IDistributionTool)
   */
  @Override
  public Ret_value stop_distribute_contents(
      long conv_id, long distribution_id, IDistributionTool tools) {

    Ret_value ret = new Ret_value();
    ContentsProfileHelper helper = new ContentsProfileHelper(ret);
    // SharedDataで保持している会話IDと比較
    Long id = sharedData.getConv_id();
    if (id == null || id != conv_id) {
      // 認証エラー
      helper.setResult(RESULT.ERROR.getResult());
      helper.setDetailCode(DC(COP, STOP_DISTRIBUTE_CONTENTS, 180));
      helper.setDetail(MSG(180));
      return ret;
    }

    // 配信処理の停止
    tools.stopDistribute();

    // コンテンツマネージャーからロボットIDの登録を削除
    contentsman.unregistRobot(sharedData.getRobot_id());

    // 依頼結果の返却
    helper.setResult(RESULT.SUCCESS.getResult());
    // 正常終了時は詳細コードの値が不定
    helper.setDetailCode(DC_INDEFINITE);
    // 任意の文字列を設定
    helper.setDetail("依頼結果=正常終了");
    return ret;
  }