/** * {@inheritDoc} */ @Override public DseSession getSession(String hostsAndPorts, String username, String password, String keyspace, boolean forceNew) { return getSession(hostsAndPorts, username, password, null, keyspace, forceNew); }
/** * {@inheritDoc} */ @Override public DseSession getSession() { return getSession(false); }
/** * {@inheritDoc} */ @Override public DseSession getSession(String hostsAndPorts, String username, String password, String keyspace) { return getSession(hostsAndPorts, username, password, null, keyspace, false); }
/** * Obtain a DSE session instance. * * <p> * The existing session instance will be returned if such existed. * </p> * * @param hostsAndPorts * @param username * @param password * @param authorizationId * DSE allows a user to connect as another user or role, provide the name of the * user/role you want to connect as via this parameter * @param keyspace * @return * @throws NoHostAvailableException * @throws AuthenticationException */ public DseSession getSession(String hostsAndPorts, String username, String password, String authorizationId, String keyspace) { return getSession(hostsAndPorts, username, password, authorizationId, keyspace, false); }
/** * Obtain a DSE session instance. * * @param hostsAndPorts * @param username * @param password * @param authorizationId * DSE allows a user to connect as another user or role, provide the name of the * user/role you want to connect as via this parameter * @param keyspace * @param forceNew * force create new session instance (the existing one, if any, * will be closed by calling {@link Session#closeAsync()}) * @return * @throws NoHostAvailableException * @throws AuthenticationException */ public DseSession getSession(String hostsAndPorts, String username, String password, String authorizationId, String keyspace, boolean forceNew) { return getSession(SessionIdentifier.getInstance(hostsAndPorts, username, password, authorizationId, keyspace), forceNew); }
/** * {@inheritDoc} */ public DseSession getSession(boolean forceNew) { return getSession(getDefaultHostsAndPorts(), getDefaultUsername(), getDefaultPassword(), defaultAuthorizationId, getDefaultKeyspace(), forceNew); }