Do actually login for the user by given entity. (no silent)
@param givenEntity The given entity for user. (NotNull)
@param option The option of login specified by caller. (NotNull)
335586
protected void doLoginByGivenEntity(USER_ENTITY givenEntity, LoginSpecifiedOption option) {
        assertGivenEntityRequired(givenEntity);
        handleLoginSuccess(givenEntity, option);
    }
968271
public void trySetIdentity(Object entity, String id) {
        Class<?> entityType = entity.getClass();
        Field identityProperty = _conventions.getIdentityProperty(entityType);

        if (identityProperty == null) {
            return;
        }

        setPropertyOrField(identityProperty.getType(), entity, identityProperty, id);
    }
258193
public InputSource resolveEntity(String name, String publicId, String baseURI, String systemId) {
        return resolveEntity(publicId, systemId);
    }
1097492
public function login($options = []) {
		$options = Hash::merge($this->getConfig('login'), $options);
		$this->_handleUserBeingAlreadyLoggedIn($options);
		$entity = $this->UserTable->newEntity(null, ['validate' => false]);

		if ($this->_getRequest()->is('post')) {
			$user = $this->_beforeLogin($entity, $options);
			if ($user) {
				return $this->_afterLogin($user, $options);
			} else {
				$this->handleFlashAndRedirect('error', $options);
			}
		}

		if ($options['setEntity']) {
			$this->_setViewVar('userEntity', $entity);
		}

		return false;
	}
1115215
function Session(identity, connection, options) {
  if (!(this instanceof Session)) {
    return new Session(identity, connection, options);
  }

  assert(identity instanceof Identity, 'Invalid identity supplied');

  if (!(connection instanceof Connection)) {
    options = connection || {};
    options.passive = true;
  }

  this.options = merge(Object.create(Session.DEFAULTS), options);
  this.client = new Client(identity);
  this._identity = identity;

  if (!this.options.passive) {
    this._connection = connection;
    this._connection.open(this._onConnect.bind(this));
  } else {
    this._onConnect();
  }

  if (this.options.subscribe) {
    this.client.on('message', this._onMessage.bind(this)).subscribe();
  }
}
870920
public void login(String user) throws AppEngineException {
    Preconditions.checkNotNull(user);
    if (!EMAIL_PATTERN.matcher(user).find()) {
      throw new AppEngineException("Invalid email address: " + user);
    }
    try {
      runner.run(ImmutableList.of("auth", "login", user), null);
    } catch (ProcessHandlerException | IOException ex) {
      throw new AppEngineException(ex);
    }
  }
1263884
public void saveEntity(String entityId, boolean clearOnSuccess, Command callback) {

        CmsEntity entity = m_entityBackend.getEntity(entityId);
        saveEntity(entity, clearOnSuccess, callback);
    }
974933
function(entity, options) {
      this._byId[entity.cid] = entity;
      var id = this.entityId(entity.attributes);
      if (id != null) this._byId[id] = entity;
      entity.on('all', this._onEntityEvent, this);
    }
935453
function SessionStrategy(options, deserializeUser) {
  if (typeof options == 'function') {
    deserializeUser = options;
    options = undefined;
  }
  options = options || {};
  
  Strategy.call(this);
  this.name = 'session';
  this._deserializeUser = deserializeUser;
}
1256002
private void load2Entity(Object entity, Method setMethod, Object value) throws Exception {
        try {
            if (value != null) {
                setMethod.invoke(entity, value);
            }
        } catch (Exception e) {
            String sValue = value.toString();
            String sValueClass = value.getClass().toString();
            System.out.println("Error in " + setMethod.getName() + " invoke with param :" + sValue + " type is " +
                    sValueClass);
            throw e;
        }
    }
55442
function(entity, options) {
      options = options ? langx.clone(options) : {};
      var wait = options.wait;
      entity = this._prepareEntity(entity, options);
      if (!entity) return false;
      if (!wait) this.add(entity, options);
      var collection = this;
      var success = options.success;
      options.success = function(m, resp, callbackOpts) {
        if (wait) collection.add(m, callbackOpts);
        if (success) success.call(callbackOpts.context, m, resp, callbackOpts);
      };
      entity.save(null, options);
      return entity;
    }
363005
function EntityInstantiator(options) {
  if (!options.store) throw new Error("Missing store");
  if (!options.Entity) throw new Error("Missing entity constructor");
  if (!options.logger) throw new Error("Missing logger");
  this.store  = options.store;
  this.Entity = options.Entity;
  this.logger = options.logger;
}
496701
@POST
    @Consumes(MediaType.APPLICATION_JSON)
    public Response register(@Context Session session,EncryptedEntity.Reader entity){
        try{
            Credentials credentials = session.getUser();
            entity.setKey(keyManager.getPrivateKey());

            credentials.setPushMessagingKey(entity.get("token"));
            dao.save(credentials);
        } catch (DAOException e) {
            logger.severe(ExceptionUtils.getStackTrace(e));
            return fromDAOExpection(e);
        } catch (Exception e) {
            logger.severe(ExceptionUtils.getStackTrace(e));
            return Response.serverError().entity("Shit").build();
        }

        return Response.ok().build();
    }
924732
@Override
  public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {

    String filename = xhtmlResourceMap.get(publicId);
    if (filename != null) {
      String resourceName = resourceFolder + "/" + filename;
      InputStream is = XHtmlEntityResolver.class.getResourceAsStream(resourceName);

      if (is == null) {
        throw new IOException("Resource '" + resourceName + "' not found in class path.");
      }

      return new InputSource(is);
    }

    return null;
  }
356347
@Override
    public InputSource resolveEntity(String publicId, String systemId) {
        logger.debug("CMLResolver: resolving ", publicId, ", ", systemId);
        systemId = systemId.toLowerCase();
        if ((systemId.indexOf("cml-1999-05-15.dtd") != -1) || (systemId.indexOf("cml.dtd") != -1)
                || (systemId.indexOf("cml1_0.dtd") != -1)) {
            logger.info("File has CML 1.0 DTD");
            return getCMLType("cml1_0.dtd");
        } else if ((systemId.indexOf("cml-2001-04-06.dtd") != -1) || (systemId.indexOf("cml1_0_1.dtd") != -1)
                || (systemId.indexOf("cml_1_0_1.dtd") != -1)) {
            logger.info("File has CML 1.0.1 DTD");
            return getCMLType("cml1_0_1.dtd");
        } else {
            logger.warn("Could not resolve systemID: ", systemId);
            return null;
        }
    }
185263
@Override
  public IdentityLinkEntity involveUser(ExecutionEntity executionEntity, String userId, String type) {
    for (IdentityLinkEntity identityLink : executionEntity.getIdentityLinks()) {
      if (identityLink.isUser() && identityLink.getUserId().equals(userId)) {
        return identityLink;
      }
    }
    return addIdentityLink(executionEntity, userId, null, type);
  }
996513
public void addEntity(Entity entity){
		boolean delayed = updating || familyManager.notifying();
		entityManager.addEntity(entity, delayed);
	}