/* (non-Javadoc)
@see org.apereo.portal.IUserIdentityStore#getPortalUserId(java.lang.String)
517118
@Override
    public Integer getPortalUserId(String userName) {
        final List<Integer> results =
                this.jdbcOperations.queryForList(
                        "SELECT USER_ID FROM UP_USER WHERE USER_NAME=?", Integer.class, userName);
        return DataAccessUtils.singleResult(results);
    }
1100504
@Override
    public IPortletEntity getPortletEntity(
            HttpServletRequest request, String portletEntityIdString) {
        final IPortletEntityId portletEntityId =
                this.parseConsistentPortletEntityId(request, portletEntityIdString);
        return this.getPortletEntity(request, portletEntityId);
    }
1047466
public static Credentials getUserById(DAO serverDao, String userId) throws DAO.DAOException {
        Query query = new QueryBuilder()
                .select()
                .from(Credentials.class)
                .where(Credentials.OWNER_ID_KEY,OPERAND.EQ,userId)
                .build();

        TransientObject to = (TransientObject) ObjectUtils.get1stOrNull(serverDao.query(query));
        if(to==null){
            return null;
        } else {
            return to(Credentials.class,to);
        }
    }
1241712
public User findUserById(String userId) {
    return createUserQuery(org.camunda.bpm.engine.impl.context.Context.getCommandContext())
      .userId(userId)
      .singleResult();
  }
596958
@Override
    public IPortletEntity getPortletEntity(
            HttpServletRequest request, IPortletEntityId portletEntityId) {
        Validate.notNull(portletEntityId, "portletEntityId can not be null");

        // Sync on the request map to make sure duplicate IPortletEntitys aren't ever created
        final PortletEntityCache<IPortletEntity> portletEntityCache =
                this.getPortletEntityMap(request);

        return this.getPortletEntity(request, portletEntityCache, portletEntityId, null, -1);
    }
860221
public String getId()
  {
    try
    {
      if(id == null) 
        id = ""+itemStream.getID();
    }
    catch(MessageStoreException e)
    {
      // FFDC
      FFDCFilter.processException(
          e,
          "com.ibm.ws.sib.processor.runtime.XmitPointControl.getId",
          "1:136:1.17", 
          this);
      
      SibTr.exception(tc, e);
    }
    return id;
  }
1304773
@SuppressWarnings("unchecked")
    @Override
	public <T extends ApiUser> T getUserById(int id) {
	    User sfsUser = getZone().getUserById(id);
	    if(sfsUser != null && sfsUser.containsProperty(APIKey.USER))
	        return (T) sfsUser.getProperty(APIKey.USER);
	    return null;
	}
27508
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.adwords.axis.v201809.rm.AdwordsUserListServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.adwords.axis.v201809.rm.AdwordsUserListServiceSoapBindingStub _stub = new com.google.api.ads.adwords.axis.v201809.rm.AdwordsUserListServiceSoapBindingStub(new java.net.URL(AdwordsUserListServiceInterfacePort_address), this);
                _stub.setPortName(getAdwordsUserListServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
1276379
@Override
    public IPortletEntity getPortletEntity(String layoutNodeId, int userId) {
        if (layoutNodeId.startsWith(TransientUserLayoutManagerWrapper.SUBSCRIBE_PREFIX)) {
            final String databaseChannelSubscribeId =
                    this.determineDatabaseChannelSubscribeId(layoutNodeId);

            final IPortletEntity portletEntity =
                    this.delegatePortletEntityDao.getPortletEntity(
                            databaseChannelSubscribeId, userId);
            return this.wrapEntity(portletEntity);
        }

        return this.delegatePortletEntityDao.getPortletEntity(layoutNodeId, userId);
    }
823270
public String getUserID(String globusID) {
        String [] ids = getUserIDs(globusID);
        if (ids != null && ids.length > 0) {
            return ids[0];
        } else {
            return null;
        }
    }
553012
@SuppressWarnings("unchecked")
    @Override
	public <T extends ApiUser> T getUserByName(String username) {
	    User sfsUser = getZone().getUserByName(username);
        if(sfsUser != null && sfsUser.containsProperty(APIKey.USER))
            return (T) sfsUser.getProperty(APIKey.USER);
        return null;
	}
1302004
protected IPortletEntity getPortletEntity(
            HttpServletRequest request,
            PortletEntityCache<IPortletEntity> portletEntityCache,
            IPortletEntityId portletEntityId,
            String layoutNodeId,
            int userId) {

        IPortletEntity portletEntity;

        // First look in the request map
        if (portletEntityId != null) {
            portletEntity = portletEntityCache.getEntity(portletEntityId);
        } else {
            portletEntity = portletEntityCache.getEntity(layoutNodeId, userId);
        }

        if (portletEntity != null) {
            logger.trace(
                    "Found IPortletEntity {} in request cache", portletEntity.getPortletEntityId());
            return portletEntity;
        }

        // Didn't find it, next look in the session map
        final PortletEntityCache<PortletEntityData> portletEntityDataMap =
                this.getPortletEntityDataMap(request);
        final PortletEntityData portletEntityData;
        if (portletEntityId != null) {
            portletEntityData = portletEntityDataMap.getEntity(portletEntityId);
        } else {
            portletEntityData = portletEntityDataMap.getEntity(layoutNodeId, userId);
        }

        if (portletEntityData != null) {

            // Stick the entity wrapper in the request map (if it wasn't already added by another
            // thread)
            portletEntity =
                    portletEntityCache.storeIfAbsentEntity(
                            portletEntityData.getPortletEntityId(),
                            new Function<IPortletEntityId, IPortletEntity>() {
                                @Override
                                public IPortletEntity apply(IPortletEntityId input) {
                                    // Found a session stored entity, wrap it to make it a real
                                    // IPortletEntity
                                    logger.trace(
                                            "Found PortletEntityData {} in session cache, caching wrapper in the request",
                                            portletEntityData.getPortletEntityId());

                                    return wrapPortletEntityData(portletEntityData);
                                }
                            });

            return portletEntity;
        }

        // Still didn't find it, look in the persistent store
        if (portletEntityId != null) {
            if (portletEntityId instanceof PortletEntityIdImpl) {
                final PortletEntityIdImpl consistentPortletEntityId =
                        (PortletEntityIdImpl) portletEntityId;
                final String localLayoutNodeId = consistentPortletEntityId.getLayoutNodeId();
                final int localUserId = consistentPortletEntityId.getUserId();

                portletEntity =
                        this.portletEntityDao.getPortletEntity(localLayoutNodeId, localUserId);
            } else {
                portletEntity = this.portletEntityDao.getPortletEntity(portletEntityId);
            }
        } else {
            portletEntity = this.portletEntityDao.getPortletEntity(layoutNodeId, userId);
        }

        // Found a persistent entity, wrap it to make the id consistent between the persistent and
        // session stored entities
        if (portletEntity != null) {
            final IPortletEntityId consistentPortletEntityId =
                    this.createConsistentPortletEntityId(portletEntity);

            final IPortletEntity anonPortletEntity = portletEntity;

            // Stick the entity wrapper in the request map (if it wasn't already added by another
            // thread)
            portletEntity =
                    portletEntityCache.storeIfAbsentEntity(
                            consistentPortletEntityId,
                            new Function<IPortletEntityId, IPortletEntity>() {
                                @Override
                                public IPortletEntity apply(IPortletEntityId input) {
                                    logger.trace(
                                            "Found persistent IPortletEntity {}, mapped id to {}, caching the wrapper in the request",
                                            anonPortletEntity.getPortletEntityId(),
                                            consistentPortletEntityId);
                                    return new PersistentPortletEntityWrapper(
                                            anonPortletEntity, consistentPortletEntityId);
                                }
                            });

            return portletEntity;
        }

        // Didn't find an entity, just return null
        return null;
    }
818897
protected User getUser(int id) {
    User user = users().get(id);
    if (user == null) {
      throw new IllegalStateException(format("Could not find user corresponding to id [%d]", id));
    }

    return user;
  }
552812
@Override
    public String getResolvedUserid()
                    throws SIConnectionUnavailableException, SIConnectionDroppedException,
                    SIErrorException
    {
        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
            SibTr.entry(CoreSPIConnection.tc, "getResolvedUserid", this);

        // See if this connection has been closed
        checkNotClosed();

        String userName = null;
        try {
            if (_subject != null)
                userName = runtimeSecurityService.getUniqueUserName(_subject);
        } catch (MessagingSecurityException mse) {
            // No FFDC Needed here, just log an exception
            if (CoreSPIConnection.tc.isDebugEnabled())
                SibTr.exception(tc, mse);
        }

        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
            SibTr.exit(CoreSPIConnection.tc, "getResolvedUserid", userName);

        return userName;
    }
892524
@Override
    public IPerson getPerson(HttpServletRequest request) throws PortalSecurityException {

        /*
         * This method overrides the implementation of getPerson() in BasePersonManager, but we only
         * want the RemoteUser behavior here if we're using RemoteUser AuthN.
         */
        if (!remoteUserSecurityContextFactory.isEnabled()) {
            return super.getPerson(request);
        }

        // Return the person object if it exists in the user's session
        final HttpSession session = request.getSession(false);
        IPerson person = null;
        if (session != null) {
            person = (IPerson) session.getAttribute(PERSON_SESSION_KEY);
            if (person != null) {
                return person;
            }
        }

        try {
            // Create a new instance of a person
            person = createPersonForRequest(request);

            // If the user has authenticated with the server which has implemented web
            // authentication,
            // the REMOTE_USER environment variable will be set.
            String remoteUser = request.getRemoteUser();

            // We don't want to ignore the security contexts which are already configured in
            // security.properties, so we
            // retrieve the existing security contexts.  If one of the existing security contexts is
            // a RemoteUserSecurityContext,
            // we set the REMOTE_USER field of the existing RemoteUserSecurityContext context.
            //
            // If a RemoteUserSecurityContext does not already exist, we create one and populate the
            // REMOTE_USER field.

            ISecurityContext context;
            Enumeration subContexts = null;
            boolean remoteUserSecurityContextExists = false;

            // Retrieve existing security contexts.
            context = person.getSecurityContext();
            if (context != null) subContexts = context.getSubContexts();

            if (subContexts != null) {
                while (subContexts.hasMoreElements()) {
                    ISecurityContext ctx = (ISecurityContext) subContexts.nextElement();
                    // Check to see if a RemoteUserSecurityContext already exists, and set the
                    // REMOTE_USER
                    if (ctx instanceof RemoteUserSecurityContext) {
                        RemoteUserSecurityContext remoteuserctx = (RemoteUserSecurityContext) ctx;
                        remoteuserctx.setRemoteUser(remoteUser);
                        remoteUserSecurityContextExists = true;
                    }
                }
            }

            // If a RemoteUserSecurityContext doesn't already exist, create one.
            // This preserves the default behavior of this class.
            if (!remoteUserSecurityContextExists) {
                RemoteUserSecurityContext remoteuserctx = new RemoteUserSecurityContext(remoteUser);
                person.setSecurityContext(remoteuserctx);
            }
        } catch (Exception e) {
            // Log the exception
            logger.error("Exception creating person for request: {}", request, e);
        }
        if (session != null) {
            // Add this person object to the user's session
            session.setAttribute(PERSON_SESSION_KEY, person);
        }
        // Return the new person object
        return (person);
    }
521113
public UserEntity findUserById(String userId) {
    checkAuthorization(Permissions.READ, Resources.USER, userId);
    return getDbEntityManager().selectById(UserEntity.class, userId);
  }
527598
protected Integer getUserId() {
        Integer userId = ThreadContext.getContext(UserWebConstant.CTX_USERID);
        if (userId != null) {
            return userId;
        }
        return null;
    }