示例#1
0
  public SDKErrorCode setVideoSourceEx(
      String confId, String siteUri, String videoSourceUri, Integer isLock) throws SDKException {
    SDKErrorCode errorCode = new SDKErrorCode();
    if (StringUtils.isEmpty(confId)) {
      errorCode.setErrCode(ErrInfo.CONF_ID_ISNULL_ERRORCODE);
      return errorCode;
    }
    if (!StringUtils.isUintNumber(confId)) {
      errorCode.setErrCode(ErrInfo.CONF_ID_IS_INVALID_ERRORCODE);
      return errorCode;
    }
    if (StringUtils.isEmpty(siteUri) || StringUtils.isEmpty(videoSourceUri)) {
      errorCode.setErrCode(ErrInfo.SITE_URI_ISNULL_ERRORCODE);
      return errorCode;
    }
    Boolean isLck;
    if (null != isLock && 1 == isLock) {
      isLck = true;
    } else if (null != isLock && 0 == isLock) {
      isLck = false;
    } else {
      errorCode.setErrCode(ErrInfo.DATA_ERRORCODE);
      return errorCode;
    }
    HoldingConference holdingConference = new HoldingConference(confId);
    errorCode = holdingConference.setVideoSourceOfSite(siteUri, videoSourceUri, isLck);

    return errorCode;
  }
  public SDKErrorCode setSecretKey(String secretType, String secretKey, String iv) {
    SDKErrorCode result = new SDKErrorCode();
    if (StringUtils.isEmpty(secretType) || ESDKConstant.AES128.equals(secretType)) {
      if (!StringUtils.isEmpty(secretKey) && !StringUtils.isEmpty(iv)) {
        secretKey = RSA2048Utils.decodeFromBase64(secretKey);
        iv = RSA2048Utils.decodeFromBase64(iv);
        if (StringUtils.isEmpty(secretKey) || StringUtils.isEmpty(iv)) {
          result.setErrCode(ESDKErrorCodeConstant.SECRETKEY_DECODE_ERRORCODE);
          return result;
        }

        if (ESDKConstant.AES128_KEY_LENGTH == secretKey.length()
            && ESDKConstant.AES128_IV_LENGTH == iv.length()) {
          MessageContext mc = ThreadLocalHolder.get();
          String sdkSession = (String) mc.getEntities().get(InfoKeys.SDK_SESSION_ID.toString());
          sessionMgr.saveSecretKey(
              sdkSession, BytesUtils.hexStringToBytes(secretKey), BytesUtils.hexStringToBytes(iv));
        } else {
          result.setErrCode(ESDKErrorCodeConstant.SDK_DATA_INVALID_ERROR);
        }
      } else {
        result.setErrCode(ESDKErrorCodeConstant.SDK_DATA_INVALID_ERROR);
      }
    } else {
      result.setErrCode(ESDKErrorCodeConstant.NO_SUCH_ALGORITHM_ERRORCODE);
    }
    return result;
  }
示例#3
0
  public SDKErrorCode setContinuousPresenceEx(
      String confId, ContinuousPresenceParam continuousPresenceParam) throws SDKException {
    SDKErrorCode result = new SDKErrorCode();
    if (StringUtils.isEmpty(confId)) {
      result.setErrCode(ErrInfo.CONF_ID_ISNULL_ERRORCODE);
      return result;
    }
    if (!StringUtils.isUintNumber(confId)) {
      result.setErrCode(ErrInfo.CONF_ID_IS_INVALID_ERRORCODE);
      return result;
    }

    // DTS2015012306064,target为可选的
    if (null == continuousPresenceParam || null == continuousPresenceParam.getPresenceMode())
    //    || null == continuousPresenceParam.getTarget())
    {
      result.setErrCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
      return result;
    }

    // R5C00屏蔽查询会场和资源的接口,不再需要,性能很差
    // 准备Model
    HoldingConference holdingConference = new HoldingConference(confId);

    // 调用model
    result = holdingConference.setContinuousPresenceEx(continuousPresenceParam);
    return result;
  }
示例#4
0
 @Override
 public EndConfResponse endConf(EndConf parameters) {
   EndConfResponse response = new EndConfResponse();
   try {
     if (null == parameters) {
       response.setResultCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
       return response;
     }
     SDKErrorCode code = confCtrl.endConf(parameters.getConfId());
     response.setResultCode(Integer.parseInt(String.valueOf(code.getErrCode())));
   } catch (SDKException ex) {
     response.setResultCode((int) ex.getSdkErrCode());
   } catch (Exception e) {
     response.setResultCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
   }
   return response;
 }
示例#5
0
  @Override
  public SetAudioSwitchResponse setAudioSwitch(SetAudioSwitch parameters) {
    SetAudioSwitchResponse setAudioSwitchResponse = new SetAudioSwitchResponse();
    SDKErrorCode result = null;
    try {
      if (null == parameters) {
        setAudioSwitchResponse.setResultCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
        return setAudioSwitchResponse;
      }
      result = confCtrl.setAudioSwitch(parameters.getConfId(), parameters.isOnOff());
      setAudioSwitchResponse.setResultCode((int) result.getErrCode());
    } catch (SDKException ex) {
      setAudioSwitchResponse.setResultCode((int) ex.getSdkErrCode());
    } catch (Exception e) {
      setAudioSwitchResponse.setResultCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
    }

    return setAudioSwitchResponse;
  }
示例#6
0
  @Override
  public DelSiteFromConfResponse delSiteFromConf(DelSiteFromConf parameters) {
    DelSiteFromConfResponse delSiteFromConfResponse = new DelSiteFromConfResponse();
    SDKErrorCode result = null;
    try {
      if (null == parameters) {
        delSiteFromConfResponse.setResultCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
        return delSiteFromConfResponse;
      }
      result = confCtrl.delSiteFromConf(parameters.getConfId(), parameters.getSiteUri());
      if (result != null) {
        delSiteFromConfResponse.setResultCode((int) result.getErrCode());
      }
    } catch (SDKException ex) {
      delSiteFromConfResponse.setResultCode((int) ex.getSdkErrCode());
    } catch (Exception e) {
      if (result != null) delSiteFromConfResponse.setResultCode((int) result.getErrCode());
    }

    return delSiteFromConfResponse;
  }
示例#7
0
 @Override
 public AddSiteToConfResponse addSiteToConf(AddSiteToConf parameters) {
   // 定义返回对象soap对象
   AddSiteToConfResponse medicalResponse = new AddSiteToConfResponse();
   // 使用领域模型
   SDKErrorCode result = new SDKErrorCode();
   try {
     if (null == parameters) {
       medicalResponse.setResultCode(ErrInfo.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
       return medicalResponse;
     }
     result = confCtrl.addSiteToConf(parameters.getConfId(), parameters.getSiteUri());
     medicalResponse.setResultCode((int) result.getErrCode());
   } catch (SDKException ex) {
     medicalResponse.setResultCode((int) ex.getSdkErrCode());
   } catch (Exception e) {
     result.setErrCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
     medicalResponse.setResultCode((int) result.getErrCode());
   }
   return medicalResponse;
 }
示例#8
0
  public SDKErrorCode setAudioSwitchEx(String confId, Integer isSwitch, Integer swtichGate)
      throws SDKException {
    SDKErrorCode result = new SDKErrorCode();
    boolean enable = false;
    if (StringUtils.isEmpty(confId)) {
      result.setErrCode(ErrInfo.CONF_ID_ISNULL_ERRORCODE);
      return result;
    }
    if (!StringUtils.isUintNumber(confId)) {
      result.setErrCode(ErrInfo.CONF_ID_IS_INVALID_ERRORCODE);
      return result;
    }

    if (null == swtichGate) {
      swtichGate =
          Integer.parseInt(
              ConfigManager.getInstance()
                  .getValue("professional.setAudioSwitch.switchGateDefaultVal"));
    }

    int switchGateMaxVal =
        Integer.parseInt(
            ConfigManager.getInstance().getValue("professional.setAudioSwitch.switchGateMaxVal"));
    int switchGateMinVal =
        Integer.parseInt(
            ConfigManager.getInstance().getValue("professional.setAudioSwitch.switchGateMinVal"));

    if (switchGateMinVal > swtichGate || switchGateMaxVal < swtichGate) {
      result.setErrCode(ErrInfo.PARAM_OUTOFRANGE_ERRORCODE);
      return result;
    }

    if (null == isSwitch) {
      result.setErrCode(ErrInfo.CONTROL_CODE_IS_NULL_ERRORCODE);
      return result;
    }

    if (1 == isSwitch) {
      enable = true;
    } else if (0 == isSwitch) {
      enable = false;
    } else {
      result.setErrCode(ErrInfo.CONTROL_CODE_IS_INCORRECT_ERRORCODE);
      return result;
    }

    // 准备Model
    HoldingConference conferenceAudioSwitch = new HoldingConference(confId);
    // 调用model
    result = conferenceAudioSwitch.setAudioSwitchEX(enable, swtichGate);

    return result;
  }
示例#9
0
  public SDKErrorCode setBroadcastContinuousPresenceEx(String confId, Integer isBroadcast)
      throws SDKException {
    SDKErrorCode result = new SDKErrorCode();

    if (StringUtils.isEmpty(confId)) {
      result.setErrCode(ErrInfo.CONF_ID_ISNULL_ERRORCODE);
      return result;
    }
    if (!StringUtils.isUintNumber(confId)) {
      result.setErrCode(ErrInfo.CONF_ID_IS_INVALID_ERRORCODE);
      return result;
    }
    if (null == isBroadcast) {
      result.setErrCode(ErrInfo.CONTROL_CODE_IS_NULL_ERRORCODE);
      return result;
    }

    HoldingConference holdingConference = new HoldingConference(confId);
    SDKResult<ContinuousPresenceCapability> cpcapaResult =
        holdingConference.getContinuousPresenceInfoEx();

    // 判断会议是否支持多画面
    if (0 != cpcapaResult.getErrCode()) {
      result.setErrCode(cpcapaResult.getErrCode());
      return result;
    }

    if (0 == isBroadcast) {
      result = holdingConference.setBroadcastContinuousPresenceEx();
    } else if (1 == isBroadcast) {
      // edit by gaolinfei
      // 用于取消广播多画面
      result = holdingConference.cancelBroadcastContinuousPresenceEx();
      // edit end
    } else {
      result.setErrCode(ErrInfo.CONTROL_CODE_IS_INCORRECT_ERRORCODE);
    }

    return result;
  }
示例#10
0
  public SDKErrorCode setSitesQuietEx(String confId, List<String> siteUris, Integer isQuiet)
      throws SDKException {
    SDKErrorCode result = new SDKErrorCode();
    boolean enable = false;
    if (StringUtils.isEmpty(confId)) {
      result.setErrCode(ErrInfo.CONF_ID_ISNULL_ERRORCODE);
      return result;
    }
    if (!StringUtils.isUintNumber(confId)) {
      result.setErrCode(ErrInfo.CONF_ID_IS_INVALID_ERRORCODE);
      return result;
    }
    if (ListUtils.isEmptyList(siteUris)) {
      result.setErrCode(ErrInfo.SITE_URI_ISNULL_ERRORCODE);
      return result;
    }
    if (null == isQuiet) {
      result.setErrCode(ErrInfo.CONTROL_CODE_IS_NULL_ERRORCODE);
      return result;
    }
    if (0 == isQuiet) {
      enable = true;
    } else if (1 == isQuiet) {
      enable = false;
    } else {
      result.setErrCode(ErrInfo.CONTROL_CODE_IS_INCORRECT_ERRORCODE);
      return result;
    }

    // 准备Model
    SiteInConference siteInConference = new SiteInConference();
    siteInConference.setConfId(confId);
    siteInConference.setSiteUris(siteUris);
    // 调用model
    result = siteInConference.setSitesQuietEx(enable);

    return result;
  }
示例#11
0
  public SDKErrorCode setBroadcastSiteEx(String confId, String siteUri, Integer isBroadcast)
      throws SDKException {
    SDKErrorCode result = new SDKErrorCode();

    if (StringUtils.isEmpty(confId)) {
      result.setErrCode(ErrInfo.CONF_ID_ISNULL_ERRORCODE);
      return result;
    }
    if (!StringUtils.isUintNumber(confId)) {
      result.setErrCode(ErrInfo.CONF_ID_IS_INVALID_ERRORCODE);
      return result;
    }
    if (StringUtils.isEmpty(siteUri)) {
      result.setErrCode(ErrInfo.SITE_URI_ISNULL_ERRORCODE);
      return result;
    }
    if (null == isBroadcast) {
      result.setErrCode(ErrInfo.CONTROL_CODE_IS_NULL_ERRORCODE);
      return result;
    }

    if (0 == isBroadcast) {
      // 准备Model
      HoldingConference holdingConference = new HoldingConference(confId);
      // 调用model 开始广播
      result = holdingConference.setBroadcastSiteEx(siteUri);
    } else if (1 == isBroadcast) {
      // 准备Model
      HoldingConference holdingConference = new HoldingConference(confId);
      // 调用model 开始广播
      result = holdingConference.cancelBroadcastSiteEx(siteUri);
      //            result.setErrCode(ErrInfo.PARAM_IS_RESERVE_ERRORCODE);
    } else {
      result.setErrCode(ErrInfo.CONTROL_CODE_IS_INCORRECT_ERRORCODE);
    }

    return result;
  }