use of com.itrus.portal.db.MobileSecretKeyConfigExample in project portal by ixinportal.
the class KeySegmentationTask method buildTask.
public static void buildTask(final WebSocketSession session, final WebSocketMessage<?> message) throws UnsupportedEncodingException, NoSuchAlgorithmException, URISyntaxException {
// header 获取云盾秘钥连接 // TODO: 2017/11/29
final WebSocketHttpHeaders headers = new WebSocketHttpHeaders();
MobileSecretKeyConfigExample configExample = new MobileSecretKeyConfigExample();
MobileSecretKeyConfig keyConfig = accesskeyLiensConfigService.selectByConfig(configExample);
// keyConfig.getPasswordNumber()
headers.add("appId", keyConfig.getPasswordNumber());
headers.add("Content-Signature", Base64.encode(HMACSHA1.getHmacSHA1(/*keyConfig.getPasswordNumber(),keyConfig.getPassword()*/
"1", "123"), false));
final URI uri = new URI(/*keyConfig.getConnectAddress()*/
"ws://192.168.102.237:8080/km/webSocketServer");
Runnable task = new Runnable() {
@Override
public void run() {
WebSocketClient webSocketClient = new StandardWebSocketClient();
webSocketClient.doHandshake(new KeySegmentationWebSocketHandler(session, message), headers, uri);
}
};
threadPool.execute(task);
}
use of com.itrus.portal.db.MobileSecretKeyConfigExample in project portal by ixinportal.
the class MobileAccesskeyLiensConfigController method show.
// 显示详情
@RequestMapping(produces = "text/html")
public String show(Model uiModel) {
MobileSecretKeyConfigExample configExample = new MobileSecretKeyConfigExample();
MobileSecretKeyConfigExample.Criteria cfe = configExample.createCriteria();
List<MobileSecretKeyConfig> configs = mobileAccesskeyLiensService.selectAll(configExample);
if (configs.size() > 0) {
MobileSecretKeyConfig config = configs.get(0);
uiModel.addAttribute("config", config);
} else {
MobileSecretKeyConfig config = null;
uiModel.addAttribute("config", config);
}
return "mobileaccesskeyliensconfig/show";
}
Aggregations