/* (non-Javadoc)
@see com.ibm.ws.sib.processor.runtime.SIMPRemoteQueuePointControllable#getPtoPOutboundTransmit(java.lang.String, java.lang.String)
481411
public SIMPPtoPOutboundTransmitControllable getPtoPOutboundTransmit()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getPtoPOutboundTransmit");

    PtoPOutputHandler outputHandler = (PtoPOutputHandler) itemStream.getOutputHandler();
    SourceStreamManager sourceStreamManager = outputHandler.getSourceStreamManager();
    SIMPPtoPOutboundTransmitControllable control =
      (SIMPPtoPOutboundTransmitControllable)
        sourceStreamManager.getStreamSetRuntimeControl();

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getPtoPOutboundTransmit");

    return control;
  }
91087
@Nullable
  static ClientTransport getTransportFromPickResult(PickResult result, boolean isWaitForReady) {
    final ClientTransport transport;
    Subchannel subchannel = result.getSubchannel();
    if (subchannel != null) {
      transport = ((AbstractSubchannel) subchannel).obtainActiveTransport();
    } else {
      transport = null;
    }
    if (transport != null) {
      final ClientStreamTracer.Factory streamTracerFactory = result.getStreamTracerFactory();
      if (streamTracerFactory == null) {
        return transport;
      }
      return new ClientTransport() {
        @Override
        public ClientStream newStream(
            MethodDescriptor<?, ?> method, Metadata headers, CallOptions callOptions) {
          return transport.newStream(
              method, headers, callOptions.withStreamTracerFactory(streamTracerFactory));
        }

        @Override
        public void ping(PingCallback callback, Executor executor) {
          transport.ping(callback, executor);
        }

        @Override
        public InternalLogId getLogId() {
          return transport.getLogId();
        }

        @Override
        public ListenableFuture<SocketStats> getStats() {
          return transport.getStats();
        }
      };
    }
    if (!result.getStatus().isOk()) {
      if (result.isDrop()) {
        return new FailingClientTransport(result.getStatus(), RpcProgress.DROPPED);
      }
      if (!isWaitForReady) {
        return new FailingClientTransport(result.getStatus(), RpcProgress.PROCESSED);
      }
    }
    return null;
  }
1019259
protected SITransaction getTransaction() {

        if (TRACE.isEntryEnabled()) {
            final String methodName = "getTransaction";
            SibTr.entry(this, TRACE, methodName);
            SibTr.exit(this, TRACE, methodName, null);
        }
        return null;

    }
250608
public long getLastTickReceived() throws SIMPRuntimeOperationFailedException
  {
    //Returns the tick of the last message received and acknowleged
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getLastTickReceived");

    try
    {
      assertValidControllable();
    }
    catch (SIMPControllableNotFoundException e)
    {
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.runtime.RemoteConsumerReceiver.getLastTickReceived",
        "1:161:1.47",
        this);
      
      SIMPRuntimeOperationFailedException finalE =
        new SIMPRuntimeOperationFailedException(
          nls.getFormattedMessage(
            "INTERNAL_MESSAGING_ERROR_CWSIP0003",
            new Object[] {"RemoteConsumerReceiver.getLastTickReceived",
                "1:169:1.47",
                          e,
                          aiStream.getStreamId()},
            null), e);
            
      SibTr.exception(tc, finalE);
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getLastTickReceived", finalE);
      throw finalE;
    }
    //the last tick received and acknowledged is the compelted prefix
    long tick = aiStream.getStateStream().getCompletedPrefix();

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getLastTickReceived", Long.valueOf(tick));
      
    return tick;
  }
643733
public boolean send101SwitchingProtocol(String protocol) {
        // if the channel stopped while we parsed this Expect request, we want
        // to send an error to close the connection and avoid the body transfer
        // PK12235, check for a full stop only
        if (this.myLink.getChannel().isStopped()) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Channel stopped, sending error instead of 100-continue");
            }
            try {
                sendError(StatusCodes.UNAVAILABLE.getHttpError());
            } catch (Throwable t) {
                FFDCFilter.processException(t, CLASS_NAME + ".check100Continue", "1206");
            }
            return false;
        }
        // if we're running on the SR for z/OS, never send the 100-continue
        // response no matter what the request says
        if (getHttpConfig().isServantRegion()) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "100 continue not sent on SR");
            }
            return true;
        }

        // send the 101 response synchronously since it should not
        // take that long to dump a single buffer out
        HttpResponseMessageImpl msg = getResponseImpl();
        msg.setStatusCode(StatusCodes.SWITCHING_PROTOCOLS);

        msg.setHeader(HttpHeaderKeys.HDR_UPGRADE, protocol);
        msg.setSpecialHeader(HttpHeaderKeys.HDR_CONNECTION, "Upgrade");

        msg.setContentLength(0);
        VirtualConnection vc = sendHeaders(msg, Http100ContWriteCallback.getRef());
        if (null == vc) {
            // writing async
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Async write of 100 continue still going");
            }
            return false;
        }
        // reset the values on the response message
        resetMsgSentState();
        msg.setStatusCode(StatusCodes.OK);
        msg.setVersion(VersionValues.V20);
        // 366388
        msg.removeHeader(HttpHeaderKeys.HDR_CONTENT_LENGTH);

        // this msg will be re-used after the connection is upgraded, so we need to remove these two headers
        msg.removeHeader(HttpHeaderKeys.HDR_UPGRADE);
        msg.removeHeader(HttpHeaderKeys.HDR_CONNECTION);
        return true;
    }
64691
public SIMPRemoteQueuePointControllable getRemoteQueuePointControlByID(String id)
    throws SIMPInvalidRuntimeIDException,
           SIMPControllableNotFoundException,
           SIMPException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getRemoteQueuePointControlByID", new Object[] { id });
      
    SIMPRemoteQueuePointControllable rqp = null;
    
    // Extract the destination uuid and ME uuid from the id string
    String [] tokens = id.split(RuntimeControlConstants.REMOTE_QUEUE_ID_INSERT);
    
    DestinationHandler dest = null;
    if (tokens.length > 0)
    {
      // Locate the destination
      dest = destinationManager.getDestinationInternal(new SIBUuid12(tokens[0]), true);        
      if (dest != null)
      {
        ControlAdapter control = dest.getControlAdapter();        
        if (control instanceof Queue)
          rqp = ((Queue) control).getRemoteQueuePointControlByMEUuid(tokens[1]);             
      }
    }
    
    if (dest == null || rqp == null)
    {      
      SIMPControllableNotFoundException finalE =
        new SIMPControllableNotFoundException(
          nls_cwsik.getFormattedMessage(
            "DESTINATION_NOT_FOUND_ERROR_CWSIP0341", 
            new Object[] { id, messageProcessor.getMessagingEngineName() },
            null));     
                    
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
        SibTr.exit(tc, "getRemoteQueuePointControlByID", finalE);
      throw finalE;
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getRemoteQueuePointControlByID");

    return rqp;
  }
855998
public SendRequest getSendRequest() {
        Transaction tx = new Transaction(params);
        for (Protos.Output output : paymentDetails.getOutputsList())
            tx.addOutput(new TransactionOutput(params, tx, Coin.valueOf(output.getAmount()), output.getScript().toByteArray()));
        return SendRequest.forTx(tx).fromPaymentDetails(paymentDetails);
    }
601972
public T withOptionalOutgoingPayload(Optional<Map<String, ByteBuffer>> outgoingPayload) {
        getOptions().setOutgoingPayLoad(outgoingPayload);
        return getThis();
    }
1082371
@Override
    public int getHostPort(Object endPoint)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getHostPort", endPoint);

        int port = 0;
        if (endPoint instanceof CFEndPoint)
        {
            port = ((CFEndPoint) endPoint).getPort();
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "getHostPort", Integer.valueOf(port));
        return port;
    }
1106455
private HttpOutboundServiceContextImpl getInterface(VirtualConnection inVC) {

        if (null == this.myInterface) {
            this.myInterface = new HttpOutboundServiceContextImpl((TCPConnectionContext) getDeviceLink().getChannelAccessor(), this, inVC, this.myChannel.getHttpConfig());
        }
        return this.myInterface;
    }
1150073
public Method getEndpointMethod() throws ResourceAdapterInternalException {

        final String methodName = "getEndpointMethod";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName);
        }

        if (ON_MESSAGE_METHOD == null) {

            try {

                ON_MESSAGE_METHOD = MessageListener.class.getMethod(
                        "onMessage", new Class[] { Message.class });

            } catch (final Exception exception) {

                FFDCFilter.processException(exception, CLASS_NAME + "."
                        + methodName, FFDC_PROBE_2, this);
                if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
                    SibTr.exception(this, TRACE, exception);
                }
                throw new ResourceAdapterInternalException(NLS
                        .getFormattedMessage("ON_MESSAGE_CWSJR1483",
                                new Object[] { exception }, null), exception);

            }

        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, methodName, ON_MESSAGE_METHOD);
        }
        return ON_MESSAGE_METHOD;

    }
1323985
@Override
    public void batchPrecommit(TransactionCommon currentTran)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "batchPrecommit", currentTran);
        try
        {
            persistCompletedPrefix(currentTran);
        } catch (SIResourceException e)
        {
            //FFDC
            FFDCFilter.processException(
                                        e,
                                        "com.ibm.ws.sib.processor.gd.GuaranteedTargetStream.batchPrecommit",
                                        "1:1911:1.110",
                                        this);

            SibTr.exception(tc, e);

            //TODO don't know what to do here - rethrow?!
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "batchPrecommit");
    }
1069222
@Override
    public OutputCommitter getOutputCommitter(TaskAttemptContext taskAttemptContext)
            throws IOException, InterruptedException {
        return new OutputCommitter() {
            @Override
            public void setupJob(JobContext jobContext) throws IOException {
            }

            @Override
            public void cleanupJob(JobContext jobContext) throws IOException {
            }

            @Override
            public void setupTask(TaskAttemptContext taskAttemptContext) throws IOException {
            }

            @Override
            public void commitTask(TaskAttemptContext taskAttemptContext) throws IOException {
            }

            @Override
            public void abortTask(TaskAttemptContext taskAttemptContext) throws IOException {
            }

            @Override
            public boolean needsTaskCommit(TaskAttemptContext taskAttemptContext) throws IOException {
                return false;
            }
        };
    }
1251194
public Bounds getDistanceBounds(TimePoint tpFrom, TimePoint tpTo) {
		final long max = distance[tpFrom.getID()][tpTo.getID()];
		final long min = -distance[tpTo.getID()][tpFrom.getID()];
		return new Bounds(min, max);
	}
1055995
public SIMPRemoteQueuePointControllable getRemoteQueuePointControlByID(String id)
    throws SIMPInvalidRuntimeIDException,
           SIMPControllableNotFoundException,
           SIMPException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getRemoteQueuePointControlByID", id);
      
    assertMessageHandlerNotCorrupt();
    SIMPIterator remoteQueuePoints = getRemoteQueuePointIterator();
    SIMPRemoteQueuePointControllable rqp = null;
    while(remoteQueuePoints.hasNext())
    {
      SIMPXmitPoint nextRqp = (SIMPXmitPoint)remoteQueuePoints.next();
       String rqpID = nextRqp.getId();
       if(id.equals(rqpID))
       {
         //we have found it
         rqp = (SIMPRemoteQueuePointControllable) nextRqp;
         break; 
       }
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getRemoteQueuePointControlByID", rqp);
    return rqp;
  }
370397
@Override
    public LocalizationPoint getQueuePoint(SIBUuid8 meUuid)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "getQueuePoint", new Object[] { meUuid, this });

        PtoPMessageItemStream stream = null;

        if (meUuid.equals(_messageProcessor.getMessagingEngineUuid()))
        {
            stream = _pToPLocalMsgsItemStream;
        }
        else
        {
            stream = _localisationManager.getXmitQueuePoint(meUuid);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "getQueuePoint", stream);

        return stream;
    }
431336
public Method getEndpointMethod() throws ResourceAdapterInternalException {

        final String methodName = "getEndpointMethod";
        if (TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName);
        }

        if (ON_MESSAGE_METHOD == null) {

            try {

                ON_MESSAGE_METHOD = SibRaMessageListener.class.getMethod(
                        "onMessage", new Class[] { SIBusMessage.class,
                                AbstractConsumerSession.class,
                                SITransaction.class });

            } catch (final Exception exception) {

                FFDCFilter.processException(exception, CLASS_NAME + "."
                        + methodName, FFDC_PROBE_2);
                if (TRACE.isEntryEnabled()) {
                    SibTr.exception(TRACE, exception);
                }
                throw new ResourceAdapterInternalException(NLS
                        .getFormattedMessage("ON_MESSAGE_CWSIV0851",
                                new Object[] { exception }, null), exception);

            }

        }

        if (TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, methodName, ON_MESSAGE_METHOD);
        }
        return ON_MESSAGE_METHOD;

    }