Returns UserAgent based on specified unique id
@param id Id value of the user agent.
@return UserAgent
181899
public static UserAgent valueOf(int id)
	{
		OperatingSystem operatingSystem = OperatingSystem.valueOf((short) (id >> 16));
		Browser browser = Browser.valueOf( (short) (id & 0x0FFFF));
		return new UserAgent(operatingSystem,browser);
	}
445446
public Permalink get(String id) {
        for (Permalink p : this)
            if(p.getId().equals(id))
                return p;
        return null;
    }
991323
public User findUserByKeycloakId(UUID userId) {
    AuthSource authSource = authSourceDAO.findByStrategy(KEYCLOAK_AUTH_SOURCE);
    if (authSource == null) {
      logger.error("Could not find Keycloak auth source");
    }
    
    UserIdentification userIdentification = userIdentificationDAO.findByExternalId(userId.toString(), authSource);
    if (userIdentification != null) {
      return userIdentification.getUser();
    }
    
    return null;
  }
406801
public synchronized USER remove(final ID sessionId)
	{
		final USER user = getUser(sessionId);
		if (user != null)
		{
			usersOnline.remove(user);
		}
		sessionIdToUser.remove(sessionId);
		return user;
	}
1354133
public Used newUsed(QualifiedName id) {
	Used res = of.createUsed();
	res.setId(id);
	return res;
    }
670671
public User withId(final long id) {
      return new User(id, username, displayName, slug, email, createTimestamp, url, metadata);
   }
119126
public function onceUsingId($id)
    {
        $user = $this->provider->retrieveById($id);

        $this->setUser($user);

        return ($user instanceof UserInterface);
    }
830223
private function getUserById($id)
    {
        $user = $this->userService->findUserById($id);

        if (empty($user)) {
            throw $this->createNotFoundException('user not found');
        }

        return $user;
    }
5319
private static @Nullable
    User getOrCreateById(@Nonnull String id, @Nonnull String fullName, boolean create) {
        User u = AllUsers.get(id);
        if (u == null && (create || UserIdMapper.getInstance().isMapped(id))) {
            u = new User(id, fullName);
            AllUsers.put(id, u);
            if (!id.equals(fullName) && !UserIdMapper.getInstance().isMapped(id)) {
                try {
                    u.save();
                } catch (IOException x) {
                    LOGGER.log(Level.WARNING, "Failed to save user configuration for " + id, x);
                }
            }
        }
        return u;
    }
1227412
public long getId(final String agent) throws InvalidUserAgentError,
            InvalidSystemClock {
        if (!isValidUserAgent(agent)) {
            exceptionsCounter.inc();
            throw new InvalidUserAgentError();
        }

        final long id = nextId();
        genCounter(agent);

        return id;
    }
839182
public function getById($id)
    {
        $path = new ResourcePathServiceOperation($this->getContext(),$this->getResourcePath(),"getById",array($id));
        return new User($this->getContext(),$path);
    }
9999
protected Person getPersonById(String id) {
		Person person = null;
		try {
			Long personId = Long.valueOf(id);
			if (logger.isDebugEnabled()) {
				logger.debug("Retrieving Person with id=[{}]", personId);
			}
			person = entityManager.find(Person.class, personId);
		} catch (NumberFormatException e) {
			if (logger.isWarnEnabled()) {
				logger.warn("Invalid number format: {}", id);
			}
		}
		if (person == null) {
			throw new IllegalArgumentException();
		}
		return person;
	}
723617
private String generateUserAgent(String userAgent) {
        String title = null;
        String thisVersion = null;

        if(userAgent == null) {
            StackTraceElement[] callers = Thread.currentThread().getStackTrace();
            String module = null;
            String callerClass = null;
            int stackIdx;
            for(stackIdx = callers.length - 1; stackIdx >= 0; stackIdx--) {
                callerClass = callers[stackIdx].getClassName();
                try {
                    Class<?> clazz = Class.forName(callerClass);
                    ClassLoader classLoader = clazz.getClassLoader();
                    // skip JRE classes
                    if (classLoader == null) {
                        continue;
                    }
                    String classFilePath = callerClass.replace(".", "/") + ".class";
                    URL classUrl = classLoader.getResource(classFilePath);
                    if (classUrl != null) {
                        String classUrlPath = classUrl.getPath();
                        int jarSeparator = classUrlPath.indexOf('!');
                        if (jarSeparator > 0) {
                            module = classUrlPath.substring(0, jarSeparator);
                            // extract the last path element (the jar name only)
                            module = module.substring(module.lastIndexOf('/') + 1);
                            break;
                        }
                    }
                } catch (Exception ex) { }
            }
            userAgent = module + "!" + callerClass;
        }
        try {
            final Properties properties = new Properties();
            properties.load(this.getClass().getClassLoader().getResourceAsStream("sdk.properties"));
            thisVersion = properties.getProperty("sdk.version");
            title = properties.getProperty("sdk.name");
        } catch (IOException e) { }
        return title + "/" + thisVersion + "/" + userAgent + "/" + System.getProperty("os.name") + " "
                + System.getProperty("java.vm.name") + " " + System.getProperty("java.vendor") + " "
                + System.getProperty("java.version");
    }
302365
function Session_getAgentByID(id) {
  for (var i=0; i<this.channels.length; i++) {
    var agents = this.channels[i].getAgents()
    for (var j=0; j<agents.length; j++) {
      var agent = agents[j]
      if (agent.info.id == id) return agent
    }
  }
}
1171675
public String makeUniqueJavaIdentifier(String id)
    {
        String jid = makeJavaId(id);
        String old = map.put(jid, id);
        if (old != null)
        {
            String oid = jid;
            for (int ii=1;old != null;ii++)
            {
                jid = oid+ii;
                old = map.put(jid, id);
            }
        }
        return jid;
    }
1239712
public static String getHttpServletRequestUserAgent(final HttpServletRequest request) {
        if (request != null) {
            return request.getHeader(USER_AGENT_HEADER);
        }
        return null;
    }
875521
public Entity getEntity(String id) {
        Entity e = getEntities().get(id);
        if (e == null) {
            return null;
        }
        return e;
    }