本文整理汇总了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;
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}