📄 sunflowutil.java
字号:
package cn.com.iaspec.workflow.util;
import org.apache.log4j.*;
import cn.com.iaspec.workflow.exception.*;
import com.sunyard.sunflow.client.*;
public class SunflowUtil{
static Logger logger=Logger.getLogger(SunflowUtil.class);
public static String hostName="";
public static int portName=1093;
public SunflowUtil(String hostName,int portName){
this.hostName=hostName;
this.portName=portName;
}
public static SunflowClient getSunflowClient(String sessionId)
throws CannotLinkToSunflowServerException{
//连接到信雅达工作流引擎
try{
logger.debug("begin getSunflowClient");
SunflowClient sunflowClient=new SunflowClient(hostName,portName,sessionId);
logger.debug("end getSunflowClient");
return sunflowClient;
}
catch(Exception ex){
logger.error(ex);
throw new CannotLinkToSunflowServerException("不能连接到信雅达工作流引擎。");
}
}
public static SunflowClient getSunflowClient()
throws CannotLinkToSunflowServerException{
//连接到信雅达工作流引擎
try{
logger.info(" hostName is "+hostName+" and portName is "+portName);
SunflowClient sunflowClient=new SunflowClient(hostName,portName);
return sunflowClient;
}
catch(Exception ex){
logger.error(ex);
throw new CannotLinkToSunflowServerException("不能连接到工作流引擎。");
}
}
public static SunflowClient getSunflowClient(String loginName,String password)
throws CannotLinkToSunflowServerException,IncorrectUserInfoException{
//连接到信雅达工作流引擎
SunflowClient sunflowClient=null;
try{
logger.info(" hostName is "+hostName+" and portName is "+portName);
sunflowClient=new SunflowClient(hostName,portName);
}
catch(Exception ex){
logger.error(ex);
throw new CannotLinkToSunflowServerException("不能连接到工作流引擎。");
}
//登录验证
try{
sunflowClient.connect(loginName,password);
}
catch(Exception ex){
logger.error(ex);
throw new IncorrectUserInfoException("登录验证失败。");
}
return sunflowClient;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -