Returns a list of the currently active sessions.

@param string $selenium_server_url The url of the remote Selenium WebDriver server
@param int $timeout_in_ms
@return array
962350
public static function getAllSessions($selenium_server_url = 'http://localhost:4444/wd/hub', $timeout_in_ms = 30000)
    {
        $executor = new HttpCommandExecutor($selenium_server_url);
        $executor->setConnectionTimeout($timeout_in_ms);

        $command = new WebDriverCommand(
            null,
            DriverCommand::GET_ALL_SESSIONS,
            []
        );

        return $executor->execute($command)->getValue();
    }
1343306
public function get_session_lock($rowid, $timeout) {
        parent::get_session_lock($rowid, $timeout);

        $fullname = $this->dbname.'-'.$this->prefix.'-session-'.$rowid;
        $sql = 'SELECT MOODLELIB.GET_LOCK(:lockname, :locktimeout) FROM DUAL';
        $params = array('lockname' => $fullname , 'locktimeout' => $timeout);
        $this->query_start($sql, $params, SQL_QUERY_AUX);
        $stmt = $this->parse_query($sql);
        $this->bind_params($stmt, $params);
        $result = oci_execute($stmt, $this->commit_status);
        if ($result === false) { // Any failure in get_lock() raises error, causing return of bool false
            throw new dml_sessionwait_exception();
        }
        $this->query_end($result, $stmt);
        oci_free_statement($stmt);
    }
1265662
protected static function file_get_contents($url, $timeout)
    {
        $opts = array(
            'http' => array(
                'timeout' => $timeout,
            ),
        );
        return file_get_contents($url, false, stream_context_create($opts));
    }
1114740
private List<String> getFurtherInfoLines(CmsSessionInfo currentSession) {

        boolean neverActive = false;
        Long inacTime = new Long(0L);
        List<String> res = new ArrayList<String>();
        if (currentSession == null) {
            inacTime = new Long(System.currentTimeMillis() - m_user.getLastlogin());
            neverActive = m_user.getLastlogin() == 0L;
        } else {
            inacTime = new Long(System.currentTimeMillis() - currentSession.getTimeUpdated());
        }

        String[] inactiveTime = CmsSessionInfo.getHourMinuteSecondTimeString(inacTime.longValue());

        if (!neverActive) {
            if (currentSession != null) {
                res.add("");
                res.add("<p>Session info:</p>");
                res.add(
                    CmsVaadinUtils.getMessageText(
                        Messages.GUI_MESSAGES_LAST_ACTIVITY_2,
                        inactiveTime[1] + ":" + inactiveTime[2],
                        CmsVaadinUtils.getMessageText(Messages.GUI_MESSAGES_MINUTES_0)) + getStatusHTML(inacTime));
            } else {
                res.add(getLastLoginMessage(inacTime));
            }
        }
        res.add(
            CmsVaadinUtils.getMessageText(Messages.GUI_USERMANAGEMENT_USER_DATE_CREATED_0)
                + ": "
                + CmsDateUtil.getDateTime(
                    new Date(m_user.getDateCreated()),
                    DateFormat.SHORT,
                    A_CmsUI.get().getLocale()));
        if (currentSession != null) {
            res.add(TableProperty.Site.getLocalizedMessage() + ": " + getSiteTitle(currentSession));

            try {
                res.add(
                    TableProperty.Project.getLocalizedMessage()
                        + ": "
                        + A_CmsUI.getCmsObject().readProject(currentSession.getProject()).getName());
            } catch (CmsException e) {
                LOG.error("Unable to read project", e);
            }
        }
        return res;
    }
608920
public String getAgeOfSession() {

        String[] ret = getHourMinuteSecondTimeString(System.currentTimeMillis() - m_timeCreated);
        return ret[0] + ":" + ret[1];

    }
886925
public function isSeleniumServerRunning()
    {
        $seleniumServerIsRunning = false;

        $errorLevel = 0;
        $errorMessage = '';
        $timeout = 1;
        $socket = @fsockopen(
            $this->getSeleniumHost(),
            $this->getSeleniumPort(),
            $errorLevel,
            $errorMessage,
            $timeout
        );

        if ($socket !== false) {
            $seleniumServerIsRunning = true;
            fclose($socket);
        }

        return $seleniumServerIsRunning;
    }
1188917
public static function findAll($page_request = null)
    {
        if($page_request != null){
            return self::listAllAddresses(['page' => $page_request->getPageNumber(), 'size' => $page_request->getSize() ]);
        }else {
            return self::listAllAddresses();
        }
    }
434850
public function findOne(
        $query = [],
        $fields = [],
        $timeout = 2000
    ) {
        $this->getContext()->getLog()->profileStart($this->profileName . __FUNCTION__);
        $options = [
            'socketTimeoutMS' => $timeout
        ];
        $out = $this->mongoCollection->findOne($query, $fields, $options);
        if ($out === null) {
            return [];
        }
        $this->getContext()->getLog()->profileEnd($this->profileName . __FUNCTION__);

        return $out;
    }
267112
public static function findAll($page_request = null)
    {
        if($page_request != null){
            return self::listAllReturnOperations(['page' => $page_request->getPageNumber(), 'size' => $page_request->getSize() ]);
        }else {
            return self::listAllReturnOperations();
        }
    }
791265
public function waitUntilStatus($by, $value, $displayed = true, $timeout = 0)
    {
        try {
            /** @var \PHPUnit_Extensions_Selenium2TestCase_Element $element */
            return $this->waitUntil(function() use ($by, $value, $displayed) {
                /** @var \PHPUnit_Extensions_Selenium2TestCase_Element $element */
                $element = $this->$by($value);

                if ($displayed) {
                    return $element->displayed() && $element->enabled() ? $element : null;
                }

                return !$element->displayed() ? $element : null;
            }, empty($timeout) ? self::TIMEOUT_ELEMENT : $timeout);
        } catch (\Exception $exception) {
            $this->fail(
                $exception->getMessage() . ' | ' .
                __FUNCTION__ . ' | ' . $by . ' | ' . $value . ' | ' . ($displayed ? 'displayed' : 'hidden')
            );

            return $this->$by($value);
        }
    }
172843
public List<WebElement> findAll() {
		checkState(webDriver != null, "No WebDriver specified.");
		checkState(by != null, "No By instance for locating elements specified.");

		log.info(toString());

		final List<WebElement> result = newArrayList();

		try {
			if (timeoutSeconds > 0L) {
				WebDriverWait wait = createWebDriverWait();
				wait.until(new Function<WebDriver, List<WebElement>>() {
					@Override
					public List<WebElement> apply(final WebDriver input) {
						doFindElements(result, input);
						if (result.isEmpty()) {
							// this means, we try again until the timeout occurs
							throw new WebElementException("No matching element found.");
						}
						return result;
					}

					@Override
					public String toString() {
						return WebElementFinder.this.toString();
					}
				});
			} else {
				doFindElements(result, webDriver);
			}
			return result;
		} catch (TimeoutException ex) {
			Throwable cause = ex.getCause();
			for (Class<? extends Throwable> thClass : IGNORED_EXCEPTIONS) {
				if (thClass.isInstance(cause)) {
					return ImmutableList.of();
				}
			}
			throw new WebElementException(ex);
		}
	}
797461
public function getServerCredentials()
    {
        if (is_null($this->server)) {
            return [];
        }

        return isset($this->servers[$this->server]) ? $this->servers[$this->server] : [];
    }
826109
public static function findAll($page_request = null)
    {
        if($page_request != null){
            return self::listAllOptionSets(['page' => $page_request->getPageNumber(), 'size' => $page_request->getSize() ]);
        }else {
            return self::listAllOptionSets();
        }
    }
1359092
public function getActiveSessions()
    {
        $activeSessions = [];
        foreach ($this->metaDataCache->getByTag('session') as $sessionIdentifier => $sessionInfo) {
            $session = new Session($sessionIdentifier, $sessionInfo['storageIdentifier'], $sessionInfo['lastActivityTimestamp'], $sessionInfo['tags']);
            $activeSessions[] = $session;
        }
        return $activeSessions;
    }
375686
public function getActiveSessions()
    {
        // Parse the user-agents to get a user-friendly Browser, version and platform.
        $parser = UAParser\Parser::create();
        $this->getRepositoryAuthtoken()->deleteExpiredTokens();
        $sessions = $this->getRepositoryAuthtoken()->getActiveSessions() ?: [];

        foreach ($sessions as &$session) {
            $ua = $parser->parse($session->getUseragent());
            $session->setBrowser(sprintf('%s / %s', $ua->ua->toString(), $ua->os->toString()));
        }

        return $sessions;
    }
256997
protected function getSessionLocks() {
    if ($this->session->exist(self::SESSION_VARNAME)) {
      return $this->session->get(self::SESSION_VARNAME);
    }
    return [];
  }
636991
public function get_session_lock($rowid, $timeout) {
        parent::get_session_lock($rowid, $timeout);

        $fullname = $this->dbname.'-'.$this->prefix.'-session-'.$rowid;
        $sql = "SELECT GET_LOCK('$fullname', $timeout)";
        $this->query_start($sql, null, SQL_QUERY_AUX);
        $result = $this->mysqli->query($sql);
        $this->query_end($result);

        if ($result) {
            $arr = $result->fetch_assoc();
            $result->close();

            if (reset($arr) == 1) {
                return;
            } else {
                throw new dml_sessionwait_exception();
            }
        }
    }