Sets the browser session this proxy queue is being used in
conjunction with.
@see com.ibm.ws.sib.comms.client.proxyqueue.BrowserProxyQueue#setBrowserSession(BrowserSessionProxy)
428351
public void setBrowserSession(BrowserSessionProxy browserSession)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "setBrowserSession", browserSession);
      
      if (this.browserSession != null)
      {
         // We are flagging this here as we should never call setBrowserSession() twice. 
         // A proxy queue is associated with a session for the lifetime of the session and calling
         // it twice is badness.
         SIErrorException e = new SIErrorException(
            nls.getFormattedMessage("RESET_OF_BROWSER_SESSION_SICO1035", null, null)
         );
         
         FFDCFilter.processException(e, CLASS_NAME + ".setBrowserSession",
                                     CommsConstants.BROWSERPQ_SETBROWSERSESS_01, this);
         
         throw e;
      }
      
      if (browserSession == null)
      {
         // You can't pass in a null you complete badger
         SIErrorException e = new SIErrorException(
            nls.getFormattedMessage("NULL_BROWSER_SESSION_SICO1036", null, null)
         );
         
         FFDCFilter.processException(e, CLASS_NAME + ".setBrowserSession",
                                     CommsConstants.BROWSERPQ_SETBROWSERSESS_02, this);
         
         throw e;         
      }
      
      this.browserSession = browserSession;
      convHelper.setSessionId(browserSession.getProxyID());
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "setBrowserSession");
   }
1256108
public void setCookie(final HttpServletRequest prequest, final HttpServletResponse presponse)
      throws IOException {
    final CsrfToken csrf = (CsrfToken) prequest.getAttribute(CsrfToken.class.getName());
    if (csrf != null) {
      Cookie cookie = WebUtils.getCookie(prequest, ResourcePaths.XSRF_COOKIE);
      final String token = csrf.getToken();
      if (cookie == null || token != null && !token.equals(cookie.getValue())) {
        cookie = new Cookie(ResourcePaths.XSRF_COOKIE, token);
        cookie.setPath(
            StringUtils.defaultString(StringUtils.trimToNull(prequest.getContextPath()), "/"));
        presponse.addCookie(cookie);
      }
    }
  }
1278522
@Override
    public BrowserSession createBrowserSession(SIDestinationAddress destinationAddress,
                                               DestinationType destinationType,
                                               SelectionCriteria criteria,
                                               String alternateUser)

                    throws SIConnectionDroppedException, SIConnectionUnavailableException, SITemporaryDestinationNotFoundException, SIErrorException, SIIncorrectCallException, SIResourceException, SINotPossibleInCurrentConfigurationException
    {
        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
            SibTr.entry(CoreSPIConnection.tc, "createBrowserSession",
                        new Object[] { this, destinationAddress, destinationType, criteria });

        // See if this connection has been closed
        checkNotClosed();
        // Check for null parameters    
        checkBrowserSessionNullParameters(destinationAddress);

        BrowserSession session = createBrowserSession(destinationAddress,
                                                      destinationType,
                                                      criteria,
                                                      false,
                                                      alternateUser,
                                                      false);

        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
            SibTr.exit(CoreSPIConnection.tc, "createBrowserSession", session);
        return session;
    }
78747
@Override
	protected void onQueueBrowserEnumerationClose()
	{
	    try
        {
    		CloseBrowserEnumerationQuery query = new CloseBrowserEnumerationQuery();
    		query.setSessionId(session.getId());
    		query.setBrowserId(browser.getId());
    		query.setEnumId(id);
    		transportEndpoint.blockingRequest(query);
        }
	    catch (JMSException e)
        {
            ErrorTools.log(e, log);
        }
	}
730406
function _setSessionReferrer(){

    if (document.referrer){

        sessionReferrer = document.referrer;
        const oldReferrer = utils.getCookie(constants.referrerCookieName);

        return oldReferrer != document.referrer;

    }

}
1197554
private void setProxy(String proxyStr) {
    String[] strs = proxyStr.split(":", 2);
    if (strs.length != 2)
      throw new RuntimeException("Bad SOCKS proxy parameter: " + proxyStr);
    String host = strs[0];
    int port = Integer.parseInt(strs[1]);
    this.proxy =
        new Proxy(Proxy.Type.SOCKS, InetSocketAddress.createUnresolved(host,
            port));
  }
203385
void removeBrowser(JmsQueueBrowserImpl browser) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "removeBrowser", browser);
        browsers.remove(browser);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "removeBrowser");
    }
241645
public void setAsynchConsumer(AsynchConsumerCallback consumer,
                                 int maxActiveMessages,
                                 long messageLockExpiry,
                                 int maxBatchSize,
                                 OrderingContext orderContext,
                                 int maxSequentialFailures,                                             //SIB0115d.comms
                                 long hiddenMessageDelay,
                                 boolean stoppable)                                                             //472879
      throws SISessionUnavailableException, SISessionDroppedException,
             SIConnectionUnavailableException, SIConnectionDroppedException,
             SIErrorException,
             SIIncorrectCallException
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setAsynchConsumer",
                                           new Object[]
                                           {
                                              consumer,
                                              maxActiveMessages,
                                              messageLockExpiry,
                                              maxBatchSize,
                                              orderContext,
                                              maxSequentialFailures,                                    //SIB0115d.comms
                                              hiddenMessageDelay,
                                              stoppable                                                         //472879
                                           });

      if (sessionId == 0)
      {
         // If the session Id = 0, then no one called setSessionId(). As such we are unable to flow
         // to the server as we do not know which session to instruct the server to use.
         SIErrorException e = new SIErrorException(
            nls.getFormattedMessage("SESSION_ID_HAS_NOT_BEEN_SET_SICO1043", null, null)
         );

         FFDCFilter.processException(e, CLASS_NAME + ".setAsyncConsumer",
                                     CommsConstants.CONVERSATIONHELPERIMPL_02, this);

         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Session Id was 0", e);

         throw e;
      }

      CommsByteBuffer request = getCommsByteBuffer();
      // Connection object id
      request.putShort(connectionObjectId);
      // Consumer session id
      request.putShort(sessionId);
      // Now put the message order context id if we have one
      if (orderContext != null)
      {
         request.putShort(((OrderingContextProxy)orderContext).getId());
      }
      else
      {
         request.putShort(CommsConstants.NO_ORDER_CONTEXT);
      }
      // Client session id - this is the proxy queue ID
      request.putShort(proxyQueueId);
      // Max active messages
      request.putInt(maxActiveMessages);
      // Message lock expiry
      request.putLong(messageLockExpiry);
      // Max batch size
      request.putInt(maxBatchSize);

      // If callback is Stoppable then send maxSequentialFailures & hiddenMessageDelay then change the
      // Segment Id to Stoppable  SIB0115d.comms
      int JFapSegmentId = JFapChannelConstants.SEG_REGISTER_ASYNC_CONSUMER;                             //SIB0115d.comms

      if (stoppable) {                                                                           //SIB0115d.comms,472879
        request.putInt(maxSequentialFailures);                                                          //SIB0115d.comms
        request.putLong(hiddenMessageDelay);
        JFapSegmentId = JFapChannelConstants.SEG_REGISTER_STOPPABLE_ASYNC_CONSUMER;                     //SIB0115d.comms
      }                                                                                                 //SIB0115d.comms

      CommsByteBuffer reply = null;
      try
      {
         // Pass on call to server
         reply = jfapExchange(request,
                              JFapSegmentId,                                                            //SIB0115d.comms
                              JFapChannelConstants.PRIORITY_MEDIUM,
                              true);
      }
      catch (SIConnectionLostException e)
      {
         // No FFDC Code needed
         // Converting this to a connection dropped as that is all we can throw
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Connection was lost", e);

         throw new SIConnectionDroppedException(e.getMessage(), e);
      }

      // Confirm appropriate data returned
      try
      {
         short err = reply.getCommandCompletionCode(JFapChannelConstants.SEG_REGISTER_ASYNC_CONSUMER_R);
         if (err != CommsConstants.SI_NO_EXCEPTION)
         {
            checkFor_SISessionUnavailableException(reply, err);
            checkFor_SISessionDroppedException(reply, err);
            checkFor_SIConnectionUnavailableException(reply, err);
            checkFor_SIConnectionDroppedException(reply, err);
            checkFor_SIIncorrectCallException(reply, err);
            checkFor_SIErrorException(reply, err);
            defaultChecker(reply, err);
         }
      }
      finally
      {
         if (reply != null) reply.release();
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setAsynchConsumer");
   }
802560
public void setProxy(String proxyhost, int proxyport) {
		proxy = new java.net.Proxy(java.net.Proxy.Type.HTTP, new InetSocketAddress(proxyhost, proxyport));
	}
123108
@Override
    public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSException {
        throw new JMSException(SQSMessagingClientConstants.UNSUPPORTED_METHOD);
    }
889807
def setProxy(self, protocol="http"):
        
        # Setting proxy
        try:
            new = { protocol: self.proxies[protocol]}
            self.br.set_proxies( new )
        except:
            # No proxy defined for that protocol
            pass
365577
public static function setSession($client_id, array $session)
    {
        if (Context::$client_id === $client_id) {
            $_SESSION = $session;
            Context::$old_session = $_SESSION;
        }
        static::setSocketSession($client_id, Context::sessionEncode($session));
    }
1350372
public void setProxy(String proxyHost, int proxyPort) {
        System.setProperty("http.proxySet", "true");
        System.setProperty("http.proxyHost", proxyHost);
        System.setProperty("http.proxyPort", "" + proxyPort);
        System.setProperty("https.proxyHost", proxyHost);
        System.setProperty("https.proxyPort", "" + proxyPort);
    }
757638
protected void startSession()throws SocksException{
	   
	   System.out.println("Session: " + proxyHost + ":" + proxyPort);
       try{
         if(chainProxy == null)
            proxySocket = new Socket(proxyIP,proxyPort);
         else if(proxyIP != null)
            proxySocket = new SocksSocket(chainProxy,proxyIP,proxyPort);
         else
            proxySocket = new SocksSocket(chainProxy,proxyHost,proxyPort);

         in = proxySocket.getInputStream();
         out = proxySocket.getOutputStream();
       }catch(SocksException se){
         throw se;
       }catch(IOException io_ex){
         throw new SocksException(SOCKS_PROXY_IO_ERROR,""+io_ex);
       }
   }
1369734
public static void setProxy(String proxyAddr) {
        if (proxyAddr != null) {
            Scanner s = new Scanner(proxyAddr);
            
            // Split into "proxyAddr:proxyPort".
            proxyAddr = null;
            int proxyPort = 8080;
            try {
                s.findInLine("(http://|)([^:/]+)(:|)([0-9]*)(/|)");
                MatchResult m = s.match();
                
                if (m.groupCount() >= 2) {
                    proxyAddr = m.group(2);
                }
                
                if ((m.groupCount() >= 4) && (!m.group(4).isEmpty()))  {
                    proxyPort = Integer.parseInt(m.group(4));
                }
            } finally {
                s.close();
            }
            
            if (proxyAddr != null) {
                SocketAddress sa = new InetSocketAddress(proxyAddr, proxyPort);
                setProxy(new Proxy(Type.HTTP, sa));
            }
        }
    }
1051867
public void setProxy(String proxyHost, int proxyPort, String username, String password) {
        setProxy(proxyHost, proxyPort);
        proxyAuth = true;
        proxyUser = username;
        proxyPassword = password;
    }
451969
@Override
	protected void onQueueBrowserClose()
	{
		super.onQueueBrowserClose();
		
		try
		{
    		CloseBrowserQuery query = new CloseBrowserQuery();
    		query.setSessionId(session.getId());
    		query.setBrowserId(id);
    		transportEndpoint.blockingRequest(query);
		}
        catch (JMSException e)
        {
            ErrorTools.log(e, log);
        }
	}