use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class ApplicationSiteUtils method getBasePath.
@SuppressWarnings("unchecked")
public static String getBasePath(String sysId, HttpServletRequest request) {
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
if (StringUtils.isBlank(sysId)) {
return basePath;
}
ISysService<SysVO, TbSys, String> sysService = (ISysService<SysVO, TbSys, String>) AppContext.getBean("core.service.SysService");
SysVO sys = new SysVO();
sys.setSysId(sysId);
try {
DefaultResult<SysVO> result = sysService.findByUK(sys);
if (result.getValue() == null) {
return basePath;
}
sys = result.getValue();
basePath = request.getScheme() + "://" + sys.getHost() + "/" + sys.getContextPath() + "/";
} catch (ServiceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return basePath;
}
use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class ApplicationSiteUtils method getContextPath.
@SuppressWarnings("unchecked")
public static String getContextPath(String sysId) {
String contextPath = "";
ISysService<SysVO, TbSys, String> sysService = (ISysService<SysVO, TbSys, String>) AppContext.getBean("core.service.SysService");
SysVO sys = new SysVO();
sys.setSysId(sysId);
try {
DefaultResult<SysVO> result = sysService.findByUK(sys);
if (result.getValue() == null) {
return contextPath;
}
sys = result.getValue();
contextPath = sys.getContextPath();
} catch (ServiceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return contextPath;
}
use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class CxfServerBean method shutdownOrReloadCallAllSystem.
public static Map<String, String> shutdownOrReloadCallAllSystem(HttpServletRequest request, String type) throws ServiceException, Exception {
Map<String, String> result = new HashMap<String, String>();
boolean status = true;
List<SysVO> systemList = ApplicationSiteUtils.getSystems();
StringBuilder out = new StringBuilder();
for (SysVO sys : systemList) {
try {
Map<String, Object> dataMap = shutdownOrReloadCallOneSystem(request, sys.getSysId(), type);
out.append(sys.getSysId()).append(" = ").append(dataMap.get("message")).append("\n");
if (!YesNo.YES.equals(dataMap.get("success"))) {
status = false;
}
} catch (Exception e) {
e.printStackTrace();
status = false;
out.append(sys.getSysId()).append(" = ").append(e.getMessage().toString()).append("\n");
}
}
result.put("message", out.toString());
if (status) {
result.put("success", YesNo.YES);
} else {
result.put("success", YesNo.NO);
}
return result;
}
use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class ApplicationSiteUtils method checkLoginUrlWithAllSysHostConfig.
@SuppressWarnings("unchecked")
public static boolean checkLoginUrlWithAllSysHostConfig(HttpServletRequest request) {
boolean pathSuccess = true;
ISysService<SysVO, TbSys, String> sysService = (ISysService<SysVO, TbSys, String>) AppContext.getBean("core.service.SysService");
try {
List<TbSys> sysList = sysService.findListByParams(null);
for (int i = 0; sysList != null && i < sysList.size() && pathSuccess; i++) {
TbSys sys = sysList.get(i);
pathSuccess = !checkCrossSite(sys.getHost().toLowerCase(), request);
if (pathSuccess) {
pathSuccess = checkTestConnection(sys.getHost(), sys.getContextPath(), request);
}
}
} catch (ServiceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return pathSuccess;
}
use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class ApplicationSiteUtils method getHost.
@SuppressWarnings("unchecked")
public static String getHost(String sysId) {
String host = "";
ISysService<SysVO, TbSys, String> sysService = (ISysService<SysVO, TbSys, String>) AppContext.getBean("core.service.SysService");
SysVO sys = new SysVO();
sys.setSysId(sysId);
try {
DefaultResult<SysVO> result = sysService.findByUK(sys);
if (result.getValue() == null) {
return "";
}
sys = result.getValue();
host = sys.getHost();
} catch (ServiceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return host;
}
Aggregations