Iterates over the remote transactions and returns the XID of the one that has an internal id equal with the
supplied internal Id.
356761
public Xid getRemoteTransactionXid(Long internalId) {
      for (RemoteTransaction rTx : getRemoteTransactions()) {
         RecoverableTransactionIdentifier gtx = (RecoverableTransactionIdentifier) rTx.getGlobalTransaction();
         if (gtx.getInternalId() == internalId) {
            if (trace) log.tracef("Found xid %s matching internal id %s", gtx.getXid(), internalId);
            return gtx.getXid();
         }
      }
      if (trace) log.tracef("Could not find remote transactions matching internal id %s", internalId);
      return null;
   }
96428
int prepareContext(Xid xid, boolean onePhaseCommit, long timeout) {
      PrepareTransactionOperation operation;
      Collection<Modification> modifications;
      try {
         modifications = toModification();
         if (trace) {
            log.tracef("Preparing transaction xid=%s, remote-cache=%s, modification-size=%d", xid, cacheName,
                  modifications.size());
         }
         if (modifications.isEmpty()) {
            return XAResource.XA_RDONLY;
         }
      } catch (Exception e) {
         return Integer.MIN_VALUE;
      }
      try {
         int xaReturnCode;
         do {
            operation = operationsFactory
                  .newPrepareTransactionOperation(xid, onePhaseCommit, modifications, recoverable, timeout);
            xaReturnCode = operation.execute().get();
         } while (operation.shouldRetry());
         return xaReturnCode;
      } catch (Exception e) {
         log.exceptionDuringPrepare(xid, e);
         return XAException.XA_RBROLLBACK;
      }
   }
662091
function getId (transaction) {
	var hash = crypto.createHash('sha256').update(getBytes(transaction).toString('hex'), 'hex').digest();
	var temp = new Buffer(8);
	for (var i = 0; i < 8; i++) {
		temp[i] = hash[7 - i];
	}

	var id = bignum.fromBuffer(temp).toString();
	return id;
}
1174243
def get_by_id(id)
      accts = @accounts.select {|acct| acct.uuid == id }

      if accts.size == 0
        raise KeyError, "account with id #{id} unknown"
      elsif accts.size > 1
        logger.warn "multiple accounts with same UUID found", uuid: id
      end

      accts[0]
    end
1143057
def get_user_xrds_url(xrds, claimed_id)
      types_to_match = ['http://www.iana.org/assignments/relation/describedby']
      services = OpenID::Yadis::apply_filter(claimed_id, xrds)
      services.each do | service |
        if service.match_types(types_to_match)
          template = REXML::XPath.first(service.service_element, '//openid:URITemplate', NAMESPACES)
          authority = REXML::XPath.first(service.service_element, '//openid:NextAuthority', NAMESPACES)
          url = template.text.gsub('{%uri}', CGI::escape(claimed_id))
          return [url, authority.text]
        end
      end
    end
1297022
@Override
	public TransactionId getTransIdFromByte(byte[] transId) {
		
		ByteBuffer byteBuffer = ByteBuffer.wrap(transId);
		int appId = getUnsignedShort(byteBuffer);
		int busCode = getUnsignedShort(byteBuffer);
		long trxId = byteBuffer.getLong();
		
		return new TransactionId(codecer.findString(APP_ID, appId), codecer.findString(BUSINESS_CODE, busCode), trxId);
	}
659791
public String getTransactionId()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getTransactionId");
    
    String tranID = null;
    PersistentTranId pTranID = itemStream.getTransactionId();
    
    if (pTranID != null)
    {
      tranID = pTranID.toTMString(); 
    }
      
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getTransactionId", tranID);
    return tranID;
  }
499857
public void createLocalTx(Xid xid, EmbeddedTransaction tx) {
      localTxTable.put(xid, tx);
      if (trace) {
         log.tracef("[%s] New tx=%s", xid, tx);
      }
   }
648536
def get_xid_device(device_number):
    
    scanner = XidScanner()
    com = scanner.device_at_index(device_number)
    com.open()
    return XidDevice(com)
69508
def _resolved_pid(self):
        """"""
        if not isinstance(self.pid, PersistentIdentifier):
            return resolve_pid(self.pid)
        return self.pid
825299
def _fetch_analysis_for_local_id(analysis, ans_cond):
    
    # Getting the first reflexed analysis from the chain
    first_reflexed = analysis.getOriginalReflexedAnalysis()
    # Getting all reflexed analysis created due to this first analysis
    analyses_catalog = getToolByName(analysis, CATALOG_ANALYSIS_LISTING)
    derivatives_brains = analyses_catalog(
        getOriginalReflexedAnalysisUID=first_reflexed.UID()
    )
    # From all the related reflexed analysis, return the one that matches
    # with the local id 'ans_cond'
    for derivative in derivatives_brains:
        derivative = derivative.getObject()
        if derivative.getReflexRuleLocalID() == ans_cond:
            return derivative
    return None
731807
def get_asset_id(self, tx_id):
        
        tx = self.driver.instance.transactions.retrieve(txid=tx_id)
        assert tx is not None
        return tx['id'] if tx['operation'] == 'CREATE' else tx['asset']['id']
244397
private GVRCursorController getUniqueControllerId(int deviceId) {
        GVRCursorController controller = controllerIds.get(deviceId);
        if (controller != null) {
            return controller;
        }
        return null;
    }
122164
function IDBObjectStore(storeProperties, transaction) {
        this.name = storeProperties.name;
        this.keyPath = JSON.parse(storeProperties.keyPath);
        this.transaction = transaction;

        // autoInc is numeric (0/1) on WinPhone
        this.autoIncrement = typeof storeProperties.autoInc === "string" ? storeProperties.autoInc === "true" : !!storeProperties.autoInc;

        this.__indexes = {};
        this.indexNames = new idbModules.util.StringList();
        var indexList = JSON.parse(storeProperties.indexList);
        for (var indexName in indexList) {
            if (indexList.hasOwnProperty(indexName)) {
                var index = new idbModules.IDBIndex(this, indexList[indexName]);
                this.__indexes[index.name] = index;
                if (!index.__deleted) {
                    this.indexNames.push(index.name);
                }
            }
        }
    }
551134
public XID extractID(XAttributable element) {
		XAttribute attribute = element.getAttributes().get(KEY_ID);
		if (attribute == null) {
			return null;
		} else {
			return ((XAttributeID) attribute).getValue();
		}
	}
449489
public String getTransactionId()
  {
    String tranID = null;
    try
    {
      PersistentTranId pTranID = getSIMPMessage().getTransactionId();
      
      if (pTranID != null)
      {
        tranID = pTranID.toTMString(); 
      }
    }
    catch (SIResourceException e)
    {
      // No FFDC code needed  
      SibTr.exception(tc, e);
    }      

    return tranID;
  }
847959
@Override
  public InetSocketAddress lookup(final Identifier id) throws Exception {

    return cache.get(id, new Callable<InetSocketAddress>() {

      @Override
      public InetSocketAddress call() throws Exception {
        final int origRetryCount = NameLookupClient.this.retryCount;
        int retriesLeft = origRetryCount;
        while (true) {
          try {
            return remoteLookup(id);
          } catch (final NamingException e) {
            if (retriesLeft <= 0) {
              throw e;
            } else {
              final int currentRetryTimeout = NameLookupClient.this.retryTimeout
                  * (origRetryCount - retriesLeft + 1);
              LOG.log(Level.WARNING,
                  "Caught Naming Exception while looking up " + id
                      + " with Name Server. Will retry " + retriesLeft
                      + " time(s) after waiting for " + currentRetryTimeout + " msec.");
              Thread.sleep(currentRetryTimeout);
              --retriesLeft;
            }
          }
        }
      }

    });
  }