當前位置: 首頁>>代碼示例>>Java>>正文


Java StringUtils.isEmpty方法代碼示例

本文整理匯總了Java中com.huawei.esdk.platform.common.utils.StringUtils.isEmpty方法的典型用法代碼示例。如果您正苦於以下問題:Java StringUtils.isEmpty方法的具體用法?Java StringUtils.isEmpty怎麽用?Java StringUtils.isEmpty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.huawei.esdk.platform.common.utils.StringUtils的用法示例。


在下文中一共展示了StringUtils.isEmpty方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getAlarmTypeModel2South

import com.huawei.esdk.platform.common.utils.StringUtils; //導入方法依賴的package包/類
public AlarmTypeSouth getAlarmTypeModel2South(AlarmTypeInfo domain) {
	AlarmTypeSouth south = new AlarmTypeSouth();
	south.clear();
	south.alarmInType = domain.getAlarmInType();
	south.alarmLevel = getAlarmLevelModel2South(domain.getAlarmLevel());
	south.category = BytesUtils.stringToBytesForIVS(domain.getCategory());
	south.enable = domain.getEnable();
	south.id = domain.getAlarmTypeID();
	south.isUserDefined = domain.getIsUserDefined();
	south.name = BytesUtils.stringToBytesForIVS(domain.getAlarmTypeName());
	if (!StringUtils.isEmpty(domain.getReserve())) {
		south.reserve = BytesUtils.stringToBytesForIVS(domain.getReserve());
	}
	south.type = BytesUtils.stringToBytesForIVS(domain.getAlarmTypeCode());

	return south;
}
 
開發者ID:Huawei,項目名稱:eSDK_IVS_Java,代碼行數:18,代碼來源:AlarmMgrCabilityConvert.java

示例2: getAlarmTypeListModel2South

import com.huawei.esdk.platform.common.utils.StringUtils; //導入方法依賴的package包/類
/**
 * 告警類型級別領域bean轉換為南向bean
 * 
 * @param domain
 *            告警類型級別領域bean
 * @return 告警類型級別南向bean
 * @see [類、類#方法、類#成員]
 * @since [eSDK IVS V100R003C10]
 */
public AlarmTypeListSouth getAlarmTypeListModel2South(AlarmTypeInfos domain) {
	int size = domain.getAlarmTypeListInfos().size();
	AlarmTypeListSouth south = new AlarmTypeListSouth(size);
	south.clear();
	south.total = domain.getTotal();
	if (!StringUtils.isEmpty(domain.getReserve())) {
		south.reserve = BytesUtils.stringToBytesForIVS(domain.getReserve());
	}

	south.indexRange = getIndexRangeModel2South(domain.getIndexRange());

	for (int i = 0; i < size; i++) {
		AlarmTypeSouth alarmTypeSouth = getAlarmTypeModel2South(domain.getAlarmTypeListInfos().get(i));

		south.alarmTypes[i] = alarmTypeSouth;
	}

	return south;
}
 
開發者ID:Huawei,項目名稱:eSDK_IVS_Java,代碼行數:29,代碼來源:AlarmMgrCabilityConvert.java

示例3: moveFile

import com.huawei.esdk.platform.common.utils.StringUtils; //導入方法依賴的package包/類
private String moveFile(String logFile)
{
    if (StringUtils.isEmpty(logFile))
    {
        return logFile;
    }
    
    File file = new File(logFile);
    //Move the file to temp folder for uploading
    File destFile = new File(file.getParent() + File.separator + "temp" + File.separator + file.getName());
    try
    {
        if (destFile.exists())
        {
            destFile.delete();
        }
        FileUtils.moveFile(file, destFile);
        file = destFile;
    }
    catch (IOException e)
    {
        LOGGER.error("", e);
    }
    
    return file.getPath();
}
 
開發者ID:Huawei,項目名稱:eSDK_IVS_Java,代碼行數:27,代碼來源:LogFileUploaderTask.java

示例4: isEmptyAttendeeRequest

import com.huawei.esdk.platform.common.utils.StringUtils; //導入方法依賴的package包/類
private boolean isEmptyAttendeeRequest(AttendeeRequest attendeeRequest)
{
    if (null == attendeeRequest)
    {
        return true;
    }
    
    if (StringUtils.isEmpty(attendeeRequest.getAccount()) || StringUtils.isEmpty(attendeeRequest.getAttNumber())
        || StringUtils.isEmpty(attendeeRequest.getAttType()) || StringUtils.isEmpty(attendeeRequest.getConfId())
        || StringUtils.isEmpty(attendeeRequest.getSubPbx()) || StringUtils.isEmpty(attendeeRequest.getUserId())
        || StringUtils.isEmpty(attendeeRequest.getGwIp()))
    //|| StringUtils.isEmpty(attendeeRequest.getAttStatus()) 
    //|| StringUtils.isEmpty(attendeeRequest.getEmail()) 
    //|| StringUtils.isEmpty(attendeeRequest.getSpeakStatus())
    {
        return true;
    }
    
    return false;
}
 
開發者ID:Huawei,項目名稱:eSDK_EC_SDK_Java,代碼行數:21,代碼來源:AttendeeResource.java

示例5: getAllAppMappings

import com.huawei.esdk.platform.common.utils.StringUtils; //導入方法依賴的package包/類
@Override
public List<AppMappingConfig> getAllAppMappings()
{
    List<AppMappingConfig> result = appMappingDAO.getAllAppMappings();
    if (null != result && !result.isEmpty())
    {
        for (AppMappingConfig item : result)
        {
            if (null != item && !StringUtils.isEmpty(item.getDeviceAppPwd()))
            {
                item.setDeviceAppPwd(AES128System.decryptPwdByOldKey(item.getDeviceApp(), item.getDeviceAppPwd()));
            }
        }
    }
    return result;
}
 
開發者ID:Huawei,項目名稱:eSDK_IVS_Java,代碼行數:17,代碼來源:AppMappingConfigService.java

示例6: setSecretKey

import com.huawei.esdk.platform.common.utils.StringUtils; //導入方法依賴的package包/類
@Override
public SetSecretKeyResponse setSecretKey(SetSecretKey parameters)
{
    SetSecretKeyResponse response = new SetSecretKeyResponse();
    
    if (null == parameters || StringUtils.isEmpty(parameters.getSecretKey()))
    {
        response.setResultCode(ESDKErrorCodeConstant.SDK_PARAM_NOT_COMPLETE_ERRORCODE);
        return response;
    }
    
    try
    {
        SDKErrorCode result = keyService.setSecretKey(parameters.getSecretType(), parameters.getSecretKey(), parameters.getIv());
        response.setResultCode((int)result.getErrCode());
    }
    catch (Exception e)
    {
        LOGGER.error("setSecretKey method error", e);
        response.setResultCode(ESDKErrorCodeConstant.ERROR_CODE_SYS_ERROR);
    }
    
    return response;
}
 
開發者ID:Huawei,項目名稱:eSDK_EC_SDK_Java,代碼行數:25,代碼來源:PlatformKeyMgrImpl.java

示例7: buildHttpHost

import com.huawei.esdk.platform.common.utils.StringUtils; //導入方法依賴的package包/類
private HttpHost buildHttpHost()
{
    if (StringUtils.isEmpty(serverUrl))
    {
        return null;
    }
    
    HttpHost result;
    
    String scheme = serverUrl.substring(0, serverUrl.indexOf("://"));
    String server = serverUrl.substring(serverUrl.indexOf("://") + 3, serverUrl.indexOf("/", scheme.length() + 3));
    if (server.contains(":"))
    {
        result = new HttpHost(server.split(":")[0], Integer.valueOf(server.split(":")[1]), scheme);
    }
    else
    {
        result = new HttpHost(server, 80, scheme);
    }
    
    return result;
}
 
開發者ID:Huawei,項目名稱:eSDK_IVS_Java,代碼行數:23,代碼來源:RestfulAdapterImplHttpClientHTLS.java

示例8: processCallbackMessage

import com.huawei.esdk.platform.common.utils.StringUtils; //導入方法依賴的package包/類
@Override
public String processCallbackMessage(String inMessage) {
	String res;
	if (StringUtils.isEmpty(inMessage))
	{
		res = "The incoming callback message is empty";
		LOGGER.warn(res);
		return res;
	}
	
	if (inMessage.contains("notify_ctcuserstate"))
	{
		res = processUserStateMsg(inMessage);
	}
	else if (inMessage.contains("notify_ctcconferstate"))
	{
		res = processConferStateMsg(inMessage);
	}
	else if (inMessage.contains("notify_ctcconfinfo"))
	{
		res = processConfInfoMsg(inMessage);
	}
	else
	{
		res = "The incoming callback message cannot be recognized by eSDK.";
	}
	
	return res;
}
 
開發者ID:Huawei,項目名稱:eSDK_EC_SDK_Java,代碼行數:30,代碼來源:AppServerCallbackService.java

示例9: unRegister

import com.huawei.esdk.platform.common.utils.StringUtils; //導入方法依賴的package包/類
@DELETE
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public RestErrCode unRegister(@QueryParam("modules") String modules)
{
    RestErrCode resBean = new RestErrCode();
    if (StringUtils.isEmpty(modules))
    {
        resBean.setResultCode(String.valueOf(ErrInfo.SDK_UC_PARAM_NOT_COMPLETE_ERRORCODE));
        resBean.setResultContext(ErrInfo.SDK_UC_PARAM_NOT_COMPLETE_ERRORCODESC);
        return resBean;
    }
    try
    {
        List<String> moduleList = new ArrayList<String>();
        for (String module : modules.split(","))
        {
            if (!StringUtils.isEmpty(module))
            {
                moduleList.add(module);
            }
        }
        
        SDKErrorCode result = callbackService.unregister(moduleList);
        
        resBean.setResultCode(result.getErrCode() + "");
        resBean.setResultContext(StringUtils.avoidNull(result.getDescription()));
        return resBean;
    }
    catch (Exception e)
    {
        LOGGER.error("unRegister method error", e);
        resBean.setResultCode(String.valueOf(ESDKErrorCodeConstant.ERROR_CODE_SYS_ERROR));
        resBean.setResultContext("eSDK system error");
        return resBean;
    }
}
 
開發者ID:Huawei,項目名稱:eSDK_EC_SDK_Java,代碼行數:38,代碼來源:CallbackResource.java

示例10: modifyAlarmLinkage

import com.huawei.esdk.platform.common.utils.StringUtils; //導入方法依賴的package包/類
/** 
 * 修改告警聯動策略
 *
 * @param parameters 修改告警聯動策略請求參數,包含告警聯動策略xml
 * @return ModifyAlarmLinkageResponse 修改告警聯動策略響應
 * @since eSDK IVS V100R003C00
 */
@Override
public ModifyAlarmLinkageResponse modifyAlarmLinkage(ModifyAlarmLinkage parameters)
{
    ModifyAlarmLinkageResponse response = new ModifyAlarmLinkageResponse();
    
    if (null == parameters || StringUtils.isEmpty(parameters.getRequestXML()))
    {
        // 參數錯誤
        LOGGER.error("The input parameter of modifyAlarmLinkage method is error");
        response.setResultCode(ErrInfo.DATA_ERRORCODE);
        return response;
    }
    
    SDKErrorCode result = new SDKErrorCode();
    
    try
    {
        result = alarmMgrService.modifyAlarmLinkage(parameters.getRequestXML());
    }
    catch (SDKException e)
    {
        LOGGER.error("modifyAlarmLinkage failed", e);
        response.setResultCode((int)e.getSdkErrCode());
        return response;
    }
    catch (Exception ex)
    {
        LOGGER.error("modifyAlarmLinkage failed", ex);
        response.setResultCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
        return response;
    }
    
    response.setResultCode((int)result.getErrCode());
    return response;
}
 
開發者ID:Huawei,項目名稱:eSDK_IVS_Java,代碼行數:43,代碼來源:IVSProfessionalAlarmManagerImpl.java

示例11: getDeviceGroup

import com.huawei.esdk.platform.common.utils.StringUtils; //導入方法依賴的package包/類
/** 
 * 獲取設備組列表
 * @param parameters 設備組
 * @return  GetDeviceGroupResponse 設備組列表
 * @see [類、類#方法、類#成員]
 * @since  eSDK IVS V100R003C00
 */
@Override
public GetDeviceGroupResponse getDeviceGroup(GetDeviceGroup parameters)
{
    GetDeviceGroupResponse response = new GetDeviceGroupResponse();
    
    if (null == parameters || StringUtils.isEmpty(parameters.getDomainCode()))
    {
        // 參數錯誤
        LOGGER.error("The input parameter of getDeviceGroup method is error");
        response.setResultCode(ErrInfo.DATA_ERRORCODE);
        return response;
    }
    
    SDKResult<DeviceGroupInfos> result = null;
    
    try
    {
        result = deviceMgrService.getDeviceGroup(parameters.getDomainCode(), parameters.getDeviceGroupCode());
    }
    catch (SDKException e)
    {
        LOGGER.error("getDeviceGroup method failed", e);
        response.setResultCode((int)e.getSdkErrCode());
        return response;
    }
    catch (Exception ex)
    {
        LOGGER.error("getDeviceGroup method failed", ex);
        response.setResultCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
        return response;
    }
    response = ivsProfessionalDeviceManagerConvert.getDeviceGroupResponseModel2Soap(result);
    return response;
}
 
開發者ID:Huawei,項目名稱:eSDK_IVS_Java,代碼行數:42,代碼來源:IVSProfessionalDeviceManagerImpl.java

示例12: validDate

import com.huawei.esdk.platform.common.utils.StringUtils; //導入方法依賴的package包/類
private boolean validDate(String dateTime)
{
    if (StringUtils.isEmpty(dateTime))
    {
        return false;
    }
    
    if (null == DateUtils.stringToDate(dateTime, "yyyy-MM-dd HH:mm:ss"))
    {
        return false;
    }
    
    return true;
}
 
開發者ID:Huawei,項目名稱:eSDK_EC_SDK_Java,代碼行數:15,代碼來源:BMUCTCResource.java

示例13: doLogFileUpload

import com.huawei.esdk.platform.common.utils.StringUtils; //導入方法依賴的package包/類
private boolean doLogFileUpload(String fileNameWithPath, String product)
{
    if (StringUtils.isEmpty(fileNameWithPath))
    {
        return true;
    }
    
    String content = "";
    String logServerUrl = ConfigManager.getInstance().getValue("log.server.url");
    
    if (logServerUrl.toLowerCase().startsWith(ESDKConstant.PROTOCOL_ADAPTER_TYPE_HTTPS))
    {
        content = doUploadByHttpsURLConnection(logServerUrl, fileNameWithPath, product);
    }
    else
    {
        content = doUploadByHttpURLConnection(logServerUrl, fileNameWithPath, product);
    }
        
    
    if (content.contains("\"resultCode\":\"0\""))
    {
        return true;
    }
    else
    {
        LOGGER.warn("File file " + fileNameWithPath + " is uploaded to log server failed,"
            + " the response from server is " + content);
    }
    
    return false;
}
 
開發者ID:Huawei,項目名稱:eSDK_IVS_Java,代碼行數:33,代碼來源:LogFileUploaderTask.java

示例14: getAlarmLinkageList

import com.huawei.esdk.platform.common.utils.StringUtils; //導入方法依賴的package包/類
/** 
 * 獲取告警聯動策略列表
 * 
 * @param parameters 聯動策略列表查詢條件
 * @return GetAlarmLinkageListResponse  成功返回0,失敗返回錯誤碼
 * @see [類、類#方法、類#成員]
 * @since  eSDK IVS V100R003C00
 */
@Override
public GetAlarmLinkageListResponse getAlarmLinkageList(GetAlarmLinkageList parameters)
{
    GetAlarmLinkageListResponse response = new GetAlarmLinkageListResponse();
    
    if (null == parameters || StringUtils.isEmpty(parameters.getRequestXML()))
    {
        // 參數錯誤
        LOGGER.error("The input parameter of getAlarmLinkageList method is error");
        response.setResultCode(ErrInfo.DATA_ERRORCODE);
        return response;
    }
    
    SDKResult<String> result = new SDKResult<String>();
    
    try
    {
        result = alarmMgrService.getAlarmLinkageList(parameters.getRequestXML());
        
    }
    catch (SDKException e)
    {
        LOGGER.error("getAlarmLinkageList failed", e);
        response.setResultCode((int)e.getSdkErrCode());
        return response;
    }
    catch (Exception ex)
    {
        LOGGER.error("getAlarmLinkageList failed", ex);
        response.setResultCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
        return response;
    }
    
    response.setResultCode((int)result.getErrCode());
    if (0 == result.getErrCode())
    {
        response.setResponseXML(result.getResult());
    }
    return response;
}
 
開發者ID:Huawei,項目名稱:eSDK_IVS_Java,代碼行數:49,代碼來源:IVSProfessionalAlarmManagerImpl.java

示例15: userAuthentication

import com.huawei.esdk.platform.common.utils.StringUtils; //導入方法依賴的package包/類
/** 
 * 授權告警用戶認證
 * 
 * @param parameters 登錄密碼
 * @return UserAuthenticationResponse  成功返回0,失敗返回錯誤碼
 * @see [類、類#方法、類#成員]
 * @since  eSDK IVS V100R003C00
 */
@Override
public UserAuthenticationResponse userAuthentication(UserAuthentication parameters)
{
    UserAuthenticationResponse response = new UserAuthenticationResponse();
    
    if (null == parameters || StringUtils.isEmpty(parameters.getPassword()))
    {
        // 參數錯誤
        LOGGER.error("The input parameter of userAuthentication method is error");
        response.setResultCode(ErrInfo.DATA_ERRORCODE);
        return response;
    }
    
    SDKErrorCode result = null;
    
    try
    {
        String tempPwd = CipherUtils.decodeFromBase64(parameters.getPassword());
        if (StringUtils.isEmpty(tempPwd))
        {
            response.setResultCode(ErrInfo.PWD_ERRORCODE);
            return response;
        }
        result = alarmMgrService.userAuthentication(tempPwd);
        
    }
    catch (SDKException e)
    {
        LOGGER.error("userAuthentication failed", e);
        response.setResultCode((int)e.getSdkErrCode());
        return response;
    }
    catch (Exception ex)
    {
        LOGGER.error("userAuthentication failed", ex);
        response.setResultCode(ErrInfo.SDK_SYSTEM_ERRORCODE);
        return response;
    }
    
    response.setResultCode((int)result.getErrCode());
    return response;
}
 
開發者ID:Huawei,項目名稱:eSDK_IVS_Java,代碼行數:51,代碼來源:IVSProfessionalAlarmManagerImpl.java


注:本文中的com.huawei.esdk.platform.common.utils.StringUtils.isEmpty方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。