MUST be called when external push received

@param seq    sequence number of update
@param authId auth id
761373
@ObjectiveCName("onPushReceivedWithSeq:withAuthId:")
    public void onPushReceived(int seq, long authId) {
        if (modules.getUpdatesModule() != null) {
            modules.getUpdatesModule().onPushReceived(seq, authId);
        }
    }
837091
@Override
    public void onAuthCreated(BoxAuthentication.BoxAuthenticationInfo info) {
        if (sameUser(info) || getUserId() == null) {
            BoxAuthentication.BoxAuthenticationInfo.cloneInfo(mAuthInfo, info);
            if (info.getUser() != null) {
                setUserId(info.getUser().getId());
            }
            if (sessionAuthListener != null) {
                sessionAuthListener.onAuthCreated(info);
            }
        }
    }
610347
public void startKeepAliveSender(String authToken) {
    this.token = authToken;
    stopKeepAliveSender();

    logger.info("Starting keepAlive Sender");
    future = scheduler.scheduleAtFixedRate(new Runnable() {
      public void run() {
        sendKeepAliveBridgeMessage(appId, bridgeId, token, httpClient);
      }
    }, 0, keepAliveInterval, TimeUnit.MILLISECONDS);
  }
886078
private void authenticateAndWait(final CountDownLatch latch) throws InterruptedException, BitfinexClientException {
		if (authenticated) {
			return;
		}
		sendCommand(new AuthCommand(configuration.getAuthNonceProducer()));
		logger.debug("Waiting for connection ready events");
		latch.await(10, TimeUnit.SECONDS);

		if (!authenticated) {
			throw new BitfinexClientException("Unable to perform authentication, permissions are: " + permissions);
		}
	}
95400
public static void onPushPromiseRead(Http2PushPromise http2PushPromise, Http2ClientChannel http2ClientChannel,
                                         OutboundMsgHolder outboundMsgHolder) {
        int streamId = http2PushPromise.getStreamId();
        int promisedStreamId = http2PushPromise.getPromisedStreamId();

        if (LOG.isDebugEnabled()) {
            LOG.debug("Received a push promise on channel: {} over stream id: {}, promisedStreamId: {}",
                    http2ClientChannel, streamId, promisedStreamId);
        }

        if (outboundMsgHolder == null) {
            LOG.warn("Push promise received in channel: {} over invalid stream id : {}", http2ClientChannel, streamId);
            return;
        }
        http2ClientChannel.putPromisedMessage(promisedStreamId, outboundMsgHolder);
        http2PushPromise.setOutboundMsgHolder(outboundMsgHolder);
        outboundMsgHolder.addPromise(http2PushPromise);
    }
713202
public void setAuthMechOid(String authMechOid) {
        if (authMechOid == null || authMechOid.length() == 0) {
            this.authMechOid = this.getdefaultAuthMechOid();
        } else {
            this.authMechOid = authMechOid;
        }
    }
71325
public static void writeNucleotideSequence(OutputStream outputStream,
			Collection<DNASequence> dnaSequences, String seqType)
			throws Exception {
		GenericGenbankHeaderFormat<DNASequence, NucleotideCompound> genericGenbankHeaderFormat = new GenericGenbankHeaderFormat<DNASequence, NucleotideCompound>(
				seqType);
		// genericGenbankHeaderFormat.setLineSeparator(lineSep);
		GenbankWriter<DNASequence, NucleotideCompound> genbankWriter = new GenbankWriter<DNASequence, NucleotideCompound>(
				outputStream, dnaSequences, genericGenbankHeaderFormat);
		// genbankWriter.setLineSeparator(lineSep);
		genbankWriter.process();
	}
180739
public static function fromASN1(Sequence $seq): RSAPrivateKey
    {
        $version = $seq->at(0)
            ->asInteger()
            ->intNumber();
        if ($version != 0) {
            throw new \UnexpectedValueException("Version must be 0.");
        }
        // helper function get integer from given index
        $get_int = function ($idx) use ($seq) {
            return $seq->at($idx)
                ->asInteger()
                ->number();
        };
        $n = $get_int(1);
        $e = $get_int(2);
        $d = $get_int(3);
        $p = $get_int(4);
        $q = $get_int(5);
        $dp = $get_int(6);
        $dq = $get_int(7);
        $qi = $get_int(8);
        return new self($n, $e, $d, $p, $q, $dp, $dq, $qi);
    }
1103294
void logSequences() {

        OrderedHashSet set = sessionData.sequenceUpdateSet;

        if (set == null || set.isEmpty()) {
            return;
        }

        for (int i = 0, size = set.size(); i < size; i++) {
            NumberSequence sequence = (NumberSequence) set.get(i);

            database.logger.writeSequenceStatement(this, sequence);
        }

        sessionData.sequenceUpdateSet.clear();
    }
289813
@SuppressWarnings("unchecked")
    public <T extends IEntity> T updateAccountOnTxns(T entity) throws FMSException {

        IntuitMessage intuitMessage = prepareupdateAccountOnTxns(entity);

        //execute interceptors
        executeInterceptors(intuitMessage);

        return (T) retrieveEntity(intuitMessage);
    }
680293
public void updateSequenceElement(int[] sequence, int pos, int oldVal) {
    if(models != null){
      for(int i = 0; i < models.length; i++)
        models[i].updateSequenceElement(sequence, pos, oldVal);
      return; 
    }
    model1.updateSequenceElement(sequence, pos, 0);
    model2.updateSequenceElement(sequence, pos, 0);
  }
945902
protected final <R extends Request<T>> R setSequence(int sequence) {
        checkIfActive();
        this.sequence = sequence;
        return (R) this;
    }
630084
private void sequenceQuery(
      long index,
      long sequence,
      long timestamp,
      RaftSession session,
      PrimitiveOperation operation,
      CompletableFuture<OperationResult> future) {
    // If the query's sequence number is greater than the session's current sequence number, queue the request for
    // handling once the state machine is caught up.
    long commandSequence = session.getCommandSequence();
    if (sequence > commandSequence) {
      log.trace("Registering query with sequence number " + sequence + " > " + commandSequence);
      session.registerSequenceQuery(sequence, () -> indexQuery(index, timestamp, session, operation, future));
    } else {
      indexQuery(index, timestamp, session, operation, future);
    }
  }
781839
public void update(@Nonnull Authentication auth) throws IOException {
        List<String> roles = new ArrayList<>();
        for (GrantedAuthority ga : auth.getAuthorities()) {
            roles.add(ga.getAuthority());
        }
        String[] a = roles.toArray(new String[0]);
        if (!Arrays.equals(this.roles,a)) {
            this.roles = a;
            this.timestamp = System.currentTimeMillis();
            user.save();
        }
    }
1085446
@Override
	public Result<Void> touch(AuthzTrans trans, String name, int ... seg) {
		/////////////
		// Direct Service Cache Invalidation
		/////////////
		// ConcurrentQueues are open-ended.  We don't want any Memory leaks 
		// Note: we keep a separate counter, because "size()" on a Linked Queue is expensive
		if(cacheUpdate!=null) {
			try {
				if(!CacheUpdate.notifyDQ.offer(new CacheUpdate.Transfer(name, seg),2,TimeUnit.SECONDS)) {
					trans.error().log("Cache Notify Queue is not accepting messages, bouncing may be appropriate" );
				}
			} catch (InterruptedException e) {
				trans.error().log("Cache Notify Queue posting was interrupted" );
			}
		}

		/////////////
		// Table Based Cache Invalidation (original)
		/////////////
		// Note: Save time with multiple Sequence Touches, but PreparedStmt doesn't support IN
		StringBuilder start = new StringBuilder("CacheInfoDAO Touch segments ");
		start.append(name);
		start.append(": ");
		StringBuilder sb = new StringBuilder("BEGIN BATCH\n");
		boolean first = true;
		for(int s : seg) {
			sb.append(UPDATE_SP);
			sb.append(TABLE);
			sb.append(" SET touched=dateof(now()) WHERE name = '");
			sb.append(name);
			sb.append("' AND seg = ");
			sb.append(s);
			sb.append(";\n");	
			if(first) {
				first =false;
			} else {
				start.append(',');
			}
			start.append(s);
		}
		sb.append("APPLY BATCH;");
		TimeTaken tt = trans.start(start.toString(),Env.REMOTE);
		try {
			getSession(trans).executeAsync(sb.toString());
		} catch (DriverException | APIException | IOException e) {
			reportPerhapsReset(trans,e);
			return Result.err(Result.ERR_Backend, CassAccess.ERR_ACCESS_MSG);
		} finally {
			tt.done();
		}
		return Result.ok();
	}
723076
public static void writeSequence(OutputStream outputStream, Sequence<?> sequence) throws Exception {
		writeSequences(outputStream, singleSeqToCollection(sequence));
	}
776038
@Override
	public T visitPSeq(PSeqContext ctx) {
//		on(ctx);
		appendAst(ctx, tok(PARAM_SEQUENCE));
		return super.visitPSeq(ctx);
	}