Checks if the user already exists

@param registrationRequest
@param callback
324245
function (registrationRequest, callback) {
            this.fetchUser(registrationRequest, function (err, user) {
                if (!err && user) {
                    err = RegistrationError.USER_ALREADY_EXISTS
                }
                callback(err);
            });
        }
1031296
function(sessionId, withUser, callback) {

            if (arguments[1] instanceof Function) {
                callback = withUser;
                withUser = true;
            }

            if (!sessionId) {
                callback && callback("No sessionId");
                return;
            }

            var api = this.$.api,
                self = this,
                session = api.createEntity(Session, sessionId);

            session.fetch({
                fetchSubModels: (withUser ? ["user"] : []),
                noCache: true
            }, function(err, session) {

                if (err) {
                    session = null;
                }

                api.set("session", session);
                self.set("session", session);

                callback && callback(err, session);
            });

        }
259439
void onSuccessfulRegistration(Context context, String regId) {

        // You should send the registration ID to your server over HTTP, so it
        // can use GCM/HTTP or CCS to send messages to your app.
        getGcmListener(context).sendRegistrationIdToBackend(regId);

        // Persist the regID - no need to register again.
        // Also serves for detection of previous registrations
        storeRegistrationId(context, regId);
    }
1222022
function(item, callback) {
                if (hasCache && typeof queueDb == 'object') {
                    queueDb.waitQ.where('uniqueId')
                        .equals(item.uniqueId)
                        .and(function(item) {
                            return item.owner == parseInt(userInfo.id);
                        })
                        .delete()
                        .then(function() {
                            callback && callback();
                        })
                        .catch(function(error) {
                            fireEvent('error', {
                                code: error.code,
                                message: error.message,
                                error: error
                            });
                        });
                }
                else {
                    for (var i = 0; i < chatWaitQueue.length; i++) {
                        if (chatWaitQueue[i].uniqueId == item.uniqueId) {
                            chatWaitQueue.splice(i, 1);
                        }
                    }
                    callback && callback();
                }
            }
1373468
function(userId, callback) {
      if (!userId) return callback(new Error(utils.i18n.identities.id));
      utils.debug('Identities get: ' + userId);

      request.get({
        path: '/users/' + userId + '/identity'
      }, callback);
    }
1241624
private SipResponse processRegisterRequest(final SipRequest request) {
        final SipURI requestURI = (SipURI) request.getRequestUri();
        final Buffer domain = requestURI.getHost();
        final SipURI aor = getAOR(request);

        // the aor is not allowed to register under this domain
        // generate a 404 according to specfication
        if (!validateDomain(domain, aor)) {
            return request.createResponse(404);
        }

        final Binding.Builder builder = Binding.with();
        builder.aor(aor);
        builder.callId(request.getCallIDHeader());
        builder.expires(getExpires(request));
        builder.cseq(request.getCSeqHeader());

        // NOTE: this is also cheating. There may be multiple contacts
        // and they must all get processed but whatever...
        builder.contact(getContactURI(request));

        final Binding binding = builder.build();
        final List<Binding> currentBindings = this.locationService.updateBindings(binding);
        final SipResponse response = request.createResponse(200);
        currentBindings.forEach(b -> {
            final SipURI contactURI = b.getContact();
            contactURI.setParameter("expires", b.getExpires());
            final ContactHeader contact = ContactHeader.with(contactURI).build();
            response.addHeader(contact);
        });

        return response;
    }
1354304
def _Register(self, conditions, callback):
    """"""
    for condition in conditions:
      registered = self._registry.setdefault(condition, [])
      if callback and callback not in registered:
        registered.append(callback)
1035389
private static String checkUserIdentifier(final FormItemList formItemList,
			final CreateUserResponse createUserResponse) {
		final String userId = formItemList
				.getField(ProtocolConstants.Parameters.Create.User.USER_IDENTIFIER);
		if (userId != null) {
			final Node user = NeoUtils.getUserByIdentifier(userId);
			if (user == null) {
				return userId;
			}

			createUserResponse.userIdentifierInvalid(userId);
		} else {
			createUserResponse.userIdentifierMissing();
		}

		return null;
	}
573382
function(authResult, redirectUrl) {
        if (authResult.user) {
          handleSignedInUser(authResult.user);
        }
        if (authResult.additionalUserInfo) {
          document.getElementById('is-new-user').textContent =
              authResult.additionalUserInfo.isNewUser ?
              'New User' : 'Existing User';
        }
        // Do not redirect.
        return false;
      }
396837
function createUser(user, callback) {
      /* jshint validthis:true */
      var cb = callback || angular.noop;

      return User.save(user,
        function (data) {
          return cb(user);
        },
        function (err) {
          return cb(err);
        }.bind(this)).$promise;
    }
988497
public void registerCallback(UOWScopeCallback callback)
    {
        if (tc.isEntryEnabled()) Tr.entry(tc, "registerCallback", new Object[]{callback, this});
        
        _callbackManager.addCallback(callback);
        
        if (tc.isEntryEnabled()) Tr.exit(tc, "registerCallback");
    }
717919
public static Request registerRequest(Request req) {
    assert req.supportedVersions().length > 0;
    for (API_VERSION ver : req.supportedVersions()) {
      String href = req.href(ver);
      assert (! _requests.containsKey(href)) : "Request with href "+href+" already registered";
      _requests.put(href,req);
      req.registered(ver);
    }
    return req;
  }
797413
public void registerActivitResumeEvent(IActivityResumeCallback callback) {
        HMSAgentLog.d("registerOnResume:" + StrUtils.objDesc(callback));
        resumeCallbacks.add(callback);
    }
1124710
function (context, authorisationRequest, callback) {

            try {
                this._isAuthorized(context, authorisationRequest);
                callback();
            } catch (e) {
                callback(e);
            }
        }
1249103
def register_callback(self, callback):
        
        if not callable(callback):
            raise ValueError('callback is not a callable')

        self.callbacks.append(callback)
1254840
public void unRegisterActivitResumeEvent(IActivityResumeCallback callback) {
        HMSAgentLog.d("unRegisterOnResume:" + StrUtils.objDesc(callback));
        resumeCallbacks.remove(callback);
    }
638014
public static boolean callbacksRegistered() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "callbacksRegistered");

        if (_syncLevel < 0) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                Tr.exit(tc, "callbacksRegistered", Boolean.FALSE);
            return false;
        }

        final int maxLevels = _syncLevels.size();
        for (int level = 0; level < maxLevels; level++) {
            final ArrayList syncs = _syncLevels.get(_syncLevel);

            if (syncs != null && !syncs.isEmpty()) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    Tr.exit(tc, "callbacksRegistered", Boolean.TRUE);
                return true;
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(tc, "callbacksRegistered", Boolean.FALSE);
        return false;
    }