/*
(non-Javadoc)

@seeorg.restcomm.protocols.ss7.tcap.asn.comp.TCBeginMessage# setOriginatingTransactionId(java.lang.String)
435760
public void setOriginatingTransactionId(byte[] t) {
        if (t != null && t.length != 4)
            throw new IllegalArgumentException("TransactionId leng must be 4 bytes, found: " + t.length);
        this.originatingTransactionId = t;

    }
803181
@Override
  public final void setItsId(final WarehouseRestId pItsId) {
    this.itsId = pItsId;
    if (this.itsId != null) {
      this.invItem = this.itsId.getInvItem();
      this.warehouseSite = this.itsId.getWarehouseSite();
      this.unitOfMeasure = this.itsId.getUnitOfMeasure();
    } else {
      this.invItem = null;
      this.warehouseSite = null;
      this.unitOfMeasure = null;
    }
  }
641754
public void setUserTransactionRegistry(org.ironjacamar.core.spi.transaction.usertx.UserTransactionRegistry v)
   {
      utp.setUserTransactionRegistry(v);
   }
757131
@Override
    public void terminateTransaction()
    {
        if (tmLog.isDebugEnabled()) {
            tmLog.debug("Aborting transaction: " + TxnEgo.txnIdToString(txnId));
        }
        FragmentTaskMessage dummy = new FragmentTaskMessage(0L, 0L, 0L, 0L, false, false, false,
                m_nPartTxn, m_restartTimestamp);
        FragmentResponseMessage poison = new FragmentResponseMessage(dummy, 0L);
        TransactionTerminationException termination = new TransactionTerminationException(
                "Transaction interrupted.", txnId);
        poison.setStatus(FragmentResponseMessage.TERMINATION, termination);
        offerReceivedFragmentResponse(poison);
     }
713867
public void encode(AsnOutputStream aos) throws EncodeException {

        if (this.originatingTransactionId == null || this.originatingTransactionId.length != 4)
            throw new EncodeException("Error while encoding TCQueryMessage: originatingTransactionId is not defined or has not a length 4");

        if ((this.component == null || this.component.length == 0) && this.dp == null)
            throw new EncodeException("Error while encoding TCQueryMessage: neither dialogPortion nor componentPortion is defined");

        try {
            if (this.dialogTermitationPermission)
                aos.writeTag(Tag.CLASS_PRIVATE, false, TCQueryMessage._TAG_QUERY_WITH_PERM);
            else
                aos.writeTag(Tag.CLASS_PRIVATE, false, TCQueryMessage._TAG_QUERY_WITHOUT_PERM);
            int pos = aos.StartContentDefiniteLength();

            aos.writeOctetString(Tag.CLASS_PRIVATE, TCQueryMessage._TAG_TRANSACTION_ID, this.originatingTransactionId);

            if (this.dp != null)
                this.dp.encode(aos);

            if (component != null && component.length > 0) {
                aos.writeTag(Tag.CLASS_PRIVATE, false, TCQueryMessage._TAG_COMPONENT_SEQUENCE);
                int pos2 = aos.StartContentDefiniteLength();
                for (Component c : this.component) {
                    c.encode(aos);
                }
                aos.FinalizeContent(pos2);
            }

            aos.FinalizeContent(pos);

        } catch (IOException e) {
            throw new EncodeException("IOException while encoding TCQueryMessage: " + e.getMessage(), e);
        } catch (AsnException e) {
            throw new EncodeException("AsnException while encoding TCQueryMessage: " + e.getMessage(), e);
        }

    }
799505
@Override
    public void setTransactionState(boolean transactionState) {
        if (log.isDebugEnabled()) {
            log.debug(String.format("Received transaction state change: '%s':%n%s",
                    endpointConfiguration.getServerConfiguration().getDatabaseName(),
                    String.valueOf(transactionState)));
        }

        this.transactionState = transactionState;
        if(!endpointConfiguration.isAutoTransactionHandling() && transactionState){
            handleMessageAndCheckResponse(JdbcMessage.startTransaction());
        }
    }
63878
private void abortTransactions(Set<String> transactionalIds) {
		for (String transactionalId : transactionalIds) {
			try (FlinkKafkaInternalProducer<byte[], byte[]> kafkaProducer =
				initTransactionalProducer(transactionalId, false)) {
				// it suffice to call initTransactions - this will abort any lingering transactions
				kafkaProducer.initTransactions();
			}
		}
	}
1356067
protected void eventPreUnlocked(SIMPMessage msg, TransactionCommon tran)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "eventPreUnlocked", new Object[]{ msg, tran});
    
    if ((msg.guessRedeliveredCount() + 1) >= _baseDestHandler.getMaxFailedDeliveries())
    {
      // Override the check of the threshold from the local case because we only
      // reroute to the exception destination if we are local to the queuepoint.
      // If the threshold is reached we remove the AIMessageItem and drive the expiry
      // code - which should flow the relevant redeliveryCount back to the DME
      // in a reject.
      
      boolean tranCreated = false;
      if (tran == null)
      {
        /* Create a new transaction under which to perform the reroute */
        tran = _tranManager.createLocalTransaction(false);
        tranCreated = true;
      }
      
      // Perform a forced expiry
      ((AIMessageItem)msg).setRejectTransactionID(tran.getPersistentTranId());
      // Increment the unlockCount
      _aih.incrementUnlockCount(msg.getMessage().getGuaranteedRemoteGetValueTick());
      
      // Remove msg
      try
      {
        if (msg.isInStore())
        {
          Transaction msTran = _messageProcessor.resolveAndEnlistMsgStoreTransaction(tran);
          msg.remove(msTran, msg.getLockID());
        }
        
        if (tranCreated)
          ((LocalTransaction)tran).commit();
        
        // If successful, make sure we dont try to unlock the msg
        msg.setRedeliveryCountReached();
      }
      catch (MessageStoreException e) 
      {
        // FFDC
        FFDCFilter.processException(
          e,
          "com.ibm.ws.sib.processor.impl.RemoteConsumerDispatcher.eventPreUnlocked",
          "1:1090:1.97.2.21",
          this);

        SibTr.exception(tc, e);
        // Any exception will mean we wait until expiry for a reject
      }
      catch (SIException e)
      {
        // FFDC
        FFDCFilter.processException(
          e,
          "com.ibm.ws.sib.processor.impl.RemoteConsumerDispatcher.eventPreUnlocked",
          "1:1102:1.97.2.21",
          this);

        SibTr.exception(tc, e);
        // Any exception will mean we wait until expiry for a reject
      }      
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "eventPreUnlocked");
  }
971930
public void setChaincodeValidationPlugin(String chaincodeValidationPlugin) throws InvalidArgumentException {
        if (Utils.isNullOrEmpty(chaincodeValidationPlugin)) {
            throw new InvalidArgumentException("The getChaincodeValidationPlugin parameter can not be null or empty.");
        }
        this.chaincodeValidationPlugin = chaincodeValidationPlugin;
    }
656070
public void setOntRelationId(String v) {
    if (OntRelationMention_Type.featOkTst && ((OntRelationMention_Type)jcasType).casFeat_ontRelationId == null)
      jcasType.jcas.throwFeatMissing("ontRelationId", "de.julielab.jules.types.OntRelationMention");
    jcasType.ll_cas.ll_setStringValue(addr, ((OntRelationMention_Type)jcasType).casFeatCode_ontRelationId, v);}
1343404
public void setCommerceAccountOrganizationRelLocalService(
		com.liferay.commerce.account.service.CommerceAccountOrganizationRelLocalService commerceAccountOrganizationRelLocalService) {
		this.commerceAccountOrganizationRelLocalService = commerceAccountOrganizationRelLocalService;
	}
32268
protected synchronized void setXID(byte[] XID)
                    throws ObjectManagerException
    {
        throw new InvalidStateException(this, InternalTransaction.stateTerminated, InternalTransaction.stateNames[InternalTransaction.stateTerminated]);
    }
1008861
public long noteTransactionRecievedAndReturnLastSeen(long initiatorHSId, long txnId,
            long lastSafeTxnIdFromInitiator)
    {
        // System.out.printf("Site %d got heartbeat message from initiator %d with txnid/safeid: %d/%d\n",
        //                   m_siteId, initiatorSiteId, txnId, lastSafeTxnIdFromInitiator);

        // this doesn't exclude dummy txnid but is also a sanity check
        assert(txnId != 0);

        // Drop old data from already-failed initiators.
        if (m_initiatorData.containsKey(initiatorHSId) == false) {
            //hostLog.info("Dropping txn " + txnId + " data from failed initiatorSiteId: " + initiatorSiteId);
            return DtxnConstants.DUMMY_LAST_SEEN_TXN_ID;
        }

        // update the latest transaction for the specified initiator
        LastInitiatorData lid = m_initiatorData.get(initiatorHSId);
        if (lid.m_lastSeenTxnId < txnId)
            lid.m_lastSeenTxnId = txnId;
        if (lid.m_lastSafeTxnId < lastSafeTxnIdFromInitiator)
            lid.m_lastSafeTxnId = lastSafeTxnIdFromInitiator;

        /*
         * Why aren't we asserting that the txnId is > then the last seen/last safe
         * It seems like this should be guaranteed by TCP ordering and we want to
         * know if it isn't!
         */

        // find the minimum value across all latest transactions
        long min = Long.MAX_VALUE;
        for (LastInitiatorData l : m_initiatorData.values())
            if (l.m_lastSeenTxnId < min) min = l.m_lastSeenTxnId;

        //  This transaction is the guaranteed minimum
        //  but is not yet necessarily 2PC'd to every site.
        m_newestCandidateTransaction = min;

        // this will update the state of the queue if needed
        updateQueueState();

        // return the last seen id for the originating initiator
        return lid.m_lastSeenTxnId;
    }
274322
public void setCommerceNotificationQueueEntryLocalService(
		com.liferay.commerce.notification.service.CommerceNotificationQueueEntryLocalService commerceNotificationQueueEntryLocalService) {
		this.commerceNotificationQueueEntryLocalService = commerceNotificationQueueEntryLocalService;
	}
93234
public void associateServerTransaction(ClientTransaction ct, ServerTransaction st) {
		if (ct == null) {
			throw new NullPointerException("null client transaction");
		}		
		if (st == null) {
			throw new NullPointerException("null server transaction");
		}
		final ClientTransactionWrapper ctw = (ClientTransactionWrapper) ct;
		final ServerTransactionWrapper stw = (ServerTransactionWrapper) st;
		
		final DialogWrapper stDialog = (DialogWrapper) st.getDialog();
		if (stDialog == null) {
			throw new IllegalArgumentException("the specified server transaction has no dialog.");
		}
		
		ctw.setAssociatedServerTransaction(((ServerTransactionActivityHandle) stw.getActivityHandle()).getTxId(),true);
	}
1367667
public void setChaincodeEndorsementPlugin(String chaincodeEndorsementPlugin) throws InvalidArgumentException {
        if (Utils.isNullOrEmpty(chaincodeEndorsementPlugin)) {
            throw new InvalidArgumentException("The getChaincodeEndorsementPlugin parameter can not be null or empty.");
        }
        this.chaincodeEndorsementPlugin = chaincodeEndorsementPlugin;
    }
623542
@Override
    public void setClientID(String clientID) throws InvalidClientIDRuntimeException, IllegalStateRuntimeException, JMSRuntimeException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setClientID", new Object[] { clientID });

        try {
            jmsConnection.setClientID(clientID);
        } catch (InvalidClientIDException icie) {
            throw (InvalidClientIDRuntimeException) JmsErrorUtils.getJMS2Exception(icie, InvalidClientIDRuntimeException.class);
        } catch (IllegalStateException ise) {
            throw (IllegalStateRuntimeException) JmsErrorUtils.getJMS2Exception(ise, IllegalStateRuntimeException.class);
        } catch (JMSException jmse) {
            throw (JMSRuntimeException) JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "setClientID");
        }

    }