com.hp.oo.sdk.content.plugin.GlobalSessionObject.setResource()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(60)

本文整理了Java中com.hp.oo.sdk.content.plugin.GlobalSessionObject.setResource()方法的一些代码示例,展示了GlobalSessionObject.setResource()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GlobalSessionObject.setResource()方法的具体详情如下:
包路径:com.hp.oo.sdk.content.plugin.GlobalSessionObject
类名称:GlobalSessionObject
方法名:setResource

GlobalSessionObject.setResource介绍

暂无

代码示例

代码示例来源:origin: CloudSlang/cs-actions

@NotNull
public static List<String> getRowsFromGlobalSessionMap(@NotNull final GlobalSessionObject<Map<String, Object>> globalSessionObject, @NotNull final String aKey) {
  final Map<String, Object> globalMap = globalSessionObject.get();
  if (globalMap.containsKey(aKey)) {
    try {
      return (List<String>) globalMap.get(aKey);
    } catch (Exception e) {
      globalMap.remove(aKey);
      globalSessionObject.setResource(new SQLSessionResource(globalMap));
    }
  }
  return new ArrayList<>();
}

代码示例来源:origin: CloudSlang/cs-actions

@NotNull
public static String getStrColumns(@NotNull final GlobalSessionObject<Map<String, Object>> globalSessionObject, @NotNull final String strKeyCol) {
  final Map<String, Object> globalMap = globalSessionObject.get();
  if (globalMap.containsKey(strKeyCol) && globalMap.get(strKeyCol) instanceof String) {
    try {
      return (String) globalMap.get(strKeyCol);
    } catch (Exception e) {
      globalMap.remove(strKeyCol);
      globalSessionObject.setResource(new SQLSessionResource(globalMap));
    }
  }
  return EMPTY;
}

代码示例来源:origin: CloudSlang/cs-actions

@NotNull
public static GlobalSessionObject<Map<String, Object>> getOrDefaultGlobalSessionObj(@NotNull final GlobalSessionObject<Map<String, Object>> globalSessionObject) {
  if (globalSessionObject.get() != null) {
    return globalSessionObject;
  }
  globalSessionObject.setResource(new SQLSessionResource(new HashMap<String, Object>()));
  return globalSessionObject;
}

代码示例来源:origin: io.cloudslang.content/cs-http-client

connectionPoolHolder.setResource(new SessionResource<Map<String, PoolingHttpClientConnectionManager>>() {
  @Override
  public Map<String, PoolingHttpClientConnectionManager> get() {

代码示例来源:origin: io.cloudslang.content/score-http-client

connectionPoolHolder.setResource(new SessionResource<Map<String, PoolingHttpClientConnectionManager>>() {
  @Override
  public Map<String, PoolingHttpClientConnectionManager> get() {

代码示例来源:origin: io.openscore.content/score-http-client

connectionPoolHolder.setResource(new SessionResource<Map<String, PoolingHttpClientConnectionManager>>(){
  @Override
  public Map<String, PoolingHttpClientConnectionManager> get() {

代码示例来源:origin: CloudSlang/cs-actions

connectionPoolHolder.setResource(new SessionResource<Map<String, PoolingHttpClientConnectionManager>>() {
  @Override
  public Map<String, PoolingHttpClientConnectionManager> get() {

代码示例来源:origin: CloudSlang/cs-actions

/**
 * Save the SSH session and the channel in the cache.
 *
 * @param session      The SSH session.
 * @param channel      The SSH channel.
 * @param sessionParam The cache: GlobalSessionObject or SessionObject.
 */
public static boolean saveSshSessionAndChannel(Session session, Channel channel, GlobalSessionObject<Map<String, SSHConnection>> sessionParam, String sessionId) {
  final SSHConnection sshConnection;
  if (channel != null) {
    sshConnection = new SSHConnection(session, channel);
  } else {
    sshConnection = new SSHConnection(session);
  }
  if (sessionParam != null) {
    Map<String, SSHConnection> tempMap = sessionParam.get();
    if (tempMap == null) {
      tempMap = new HashMap<>();
    }
    tempMap.put(sessionId, sshConnection);
    sessionParam.setResource(new SSHSessionResource(tempMap));
    return true;
  }
  return false;
}

代码示例来源:origin: io.openscore.content/score-ssh

/**
 * Save the SSH session and the channel in the cache.
 *
 * @param session      The SSH session.
 * @param channel      The SSH channel.
 * @param sessionParam The cache: GlobalSessionObject or SessionObject.
 */
public static boolean saveSshSessionAndChannel(Session session, Channel channel, GlobalSessionObject<Map<String, SSHConnection>> sessionParam, String sessionId) {
  final SSHConnection sshConnection;
  if (channel != null) {
    sshConnection = new SSHConnection(session, channel);
  } else {
    sshConnection = new SSHConnection(session);
  }
  if (sessionParam != null) {
    Map<String, SSHConnection> tempMap = sessionParam.get();
    if (tempMap == null) {
      tempMap = new HashMap<>();
    }
    tempMap.put(sessionId, sshConnection);
    sessionParam.setResource(new SSHSessionResource(tempMap));
    return true;
  }
  return false;
}

代码示例来源:origin: io.cloudslang.content/score-ssh

/**
 * Save the SSH session and the channel in the cache.
 *
 * @param session      The SSH session.
 * @param channel      The SSH channel.
 * @param sessionParam The cache: GlobalSessionObject or SessionObject.
 */
public static boolean saveSshSessionAndChannel(Session session, Channel channel, GlobalSessionObject<Map<String, SSHConnection>> sessionParam, String sessionId) {
  final SSHConnection sshConnection;
  if (channel != null) {
    sshConnection = new SSHConnection(session, channel);
  } else {
    sshConnection = new SSHConnection(session);
  }
  if (sessionParam != null) {
    Map<String, SSHConnection> tempMap = sessionParam.get();
    if (tempMap == null) {
      tempMap = new HashMap<>();
    }
    tempMap.put(sessionId, sshConnection);
    sessionParam.setResource(new SSHSessionResource(tempMap));
    return true;
  }
  return false;
}

代码示例来源:origin: io.cloudslang.content/cs-ssh

/**
 * Save the SSH session and the channel in the cache.
 *
 * @param session      The SSH session.
 * @param channel      The SSH channel.
 * @param sessionParam The cache: GlobalSessionObject or SessionObject.
 */
public static boolean saveSshSessionAndChannel(Session session, Channel channel, GlobalSessionObject<Map<String, SSHConnection>> sessionParam, String sessionId) {
  final SSHConnection sshConnection;
  if (channel != null) {
    sshConnection = new SSHConnection(session, channel);
  } else {
    sshConnection = new SSHConnection(session);
  }
  if (sessionParam != null) {
    Map<String, SSHConnection> tempMap = sessionParam.get();
    if (tempMap == null) {
      tempMap = new HashMap<>();
    }
    tempMap.put(sessionId, sshConnection);
    sessionParam.setResource(new SSHSessionResource(tempMap));
    return true;
  }
  return false;
}

代码示例来源:origin: CloudSlang/cs-actions

public void init(String list, String delim, GlobalSessionObject<Map<String, Object>> session) throws IteratorProcessorException {
    session.setResource(new IteratorSessionResource(new HashMap<String, Object>()));

代码示例来源:origin: CloudSlang/cs-actions

globalSessionObject.setResource(new SQLSessionResource(sqlConnectionMap));
        sqlConnectionMap.put(strKeySkip, 0L);
      globalSessionObject.setResource(new SQLSessionResource(sqlConnectionMap));
    } else {
      result.put(SQL_QUERY, sqlInputs.getSqlCommand());
  globalSessionObject.setResource(new SQLSessionResource(sqlConnectionMap));
  return result;
} catch (Exception e) {

代码示例来源:origin: CloudSlang/cs-actions

globalSessionObject.setResource(new SQLSessionResource(globalMap));

相关文章