Package org.xmlBlaster.engine.qos

Examples of org.xmlBlaster.engine.qos.ConnectQosServer


         if (receiveReply(receiver, udp) == false) {
            if (MethodName.CONNECT == receiver.getMethodName()) {
               // TODO: crypt.importMessage(receiver.getQos()); see also ClientDispatchConnection.java:440
               Socket socket = this.sock;
               if (socket == null) return; // Is possible when EOF arrived inbetween
               ConnectQosServer conQos = new ConnectQosServer(driver.getGlobal(), receiver.getQos());
               if (conQos.getSecurityQos() == null)
                  throw new XmlBlasterException(glob, ErrorCode.USER_SECURITY_AUTHENTICATION_ILLEGALARGUMENT, ME, "connect() without securityQos");
               conQos.getSecurityQos().setClientIp (socket.getInetAddress().getHostAddress());

               conQos.setAddressServer(getAddressServer());
               setLoginName(conQos.getSessionName().getRelativeName());
               if (this.callCoreInSeparateThread) {
                  Thread.currentThread().setName("XmlBlaster.HandleClient");
               }
               else {
                  Thread.currentThread().setName("XmlBlaster.socket"+ (this.driver.isSSL()?".SSL":"") + ".tcpListener-" + conQos.getUserId());
               }
               this.ME = this.driver.getType() + "-HandleClient-" + this.loginName;


               // getInetAddress().toString() does no reverse DNS lookup (no blocking danger) ...
               log.info(ME+": Client connected, coming from host=" + socket.getInetAddress().toString() + " port=" + socket.getPort());

               CallbackAddress[] cbArr = conQos.getSessionCbQueueProperty().getCallbackAddresses();
               for (int ii=0; cbArr!=null && ii<cbArr.length; ii++) {
                  SocketUrl cbUrl = new SocketUrl(glob, cbArr[ii].getRawAddress());
                  SocketUrl remoteUrl = new SocketUrl(glob, socket.getInetAddress().getHostAddress(), socket.getPort());
                  if (this.addressServer != null) {
                     this.addressServer.setRemoteAddress(remoteUrl);
View Full Code Here


      org.xmlBlaster.client.qos.ConnectQos connectQos = new org.xmlBlaster.client.qos.ConnectQos(glob);
      connectQos.addCallbackAddress(cbAddress);
      connectQos.loadClientPlugin("htpasswd", "1.0", loginName, passwd);
      connectQos.getSessionQos().setSessionTimeout(0L);
      ConnectQosServer connectQosServer = new ConnectQosServer(glob, connectQos.getData());
      connectQosServer.setAddressServer(this.addressServer);
      ConnectReturnQosServer returnQos = this.authenticate.connect(connectQosServer);
      sessionId = returnQos.getSecretSessionId();

      log.info("Started successfully JDBC driver with loginName=" + loginName);
   }
View Full Code Here

      }
      else {
         subjectInfo = getOrCreateSubjectInfoByName(sessionName, false, subject, new CbQueueProperty(getGlobal(), Constants.RELATING_SUBJECT, null));
      }

      ConnectQosServer connectQosServer = new ConnectQosServer(glob, connectQos.getData());
      SessionInfo sessionInfo = subjectInfo.getOrCreateSessionInfo(sessionName, connectQosServer);
      if (!sessionInfo.isInitialized()) {
         sessionInfo.init(subjectInfo, session, connectQosServer);
      }
View Full Code Here

      }
      event = null;
   }
  
   private void updateConnectQos(SessionInfo sessionInfo, ConnectQosServer newConnectQos) throws XmlBlasterException {
      ConnectQosServer previousConnectQosServer = sessionInfo.getConnectQos();
     
      sessionInfo.updateConnectQos(newConnectQos);
     
      try {
         I_ClientListener[] clientListenerArr = getClientListenerArr();
View Full Code Here

    */
   public String connect(String qos_literal)
                        throws RemoteException, XmlBlasterException
   {
      String returnValue = null;
      ConnectQosServer connectQos = new ConnectQosServer(glob, qos_literal);
      if (log.isLoggable(Level.FINER)) log.finer("Entering connect(qos=" + qos_literal + ")");
      connectQos.setAddressServer(this.addressServer);
      ConnectReturnQosServer returnQos = authenticate.connect(connectQos);
      returnValue = returnQos.toXml();

      return returnValue;
   }
View Full Code Here

         receiver.setBounceObject(BOUNCE_MAILTO_KEY, receiver.getBounceObject(BOUNCE_MAILFROM_KEY));
        
         // super.receiveReply() processes all invocations, only connect()/disconnect() we do locally ...
         if (super.receiveReply(receiver, udp) == false) {
            if (MethodName.CONNECT == receiver.getMethodName()) {
               ConnectQosServer conQos = new ConnectQosServer(this.glob, receiver.getQos());
               conQos.setAddressServer(getAddressServer());
               ConnectReturnQosServer retQos = this.authenticate.connect(conQos);
               //As we are a singleton there is no need to remember the secretSessionId of this client
               receiver.setSecretSessionId(retQos.getSecretSessionId()); // executeResponse needs it
               executeResponse(receiver, retQos.toXml(), SocketUrl.SOCKET_TCP);
             }
View Full Code Here

                     "Login failed: please use no null arguments for login()"));
      }

      try {
         // Extend qos to contain security credentials ...
         ConnectQosServer loginQos = new ConnectQosServer(glob, qos_literal);
         loginQos.loadClientPlugin(null, null, loginName, passwd);

         // No login using the connect() method ...
         ConnectReturnQosServer returnQos = connectIntern(loginQos.toXml());

         // Build return handle ...
         ServerRef ref = returnQos.getServerRef();
         if (ref == null) {
            throw OrbInstanceFactory.convert(new org.xmlBlaster.util.XmlBlasterException(glob,
View Full Code Here

    * @see org.xmlBlaster.authentication.I_ClientListener#sessionAdded(org.xmlBlaster.authentication.ClientEvent)
    */
   public synchronized void sessionAdded(ClientEvent e) throws XmlBlasterException {
      if (e == null)
         throw new XmlBlasterException(this.global, ErrorCode.INTERNAL_UNKNOWN, "ReplManagerPlugin.sessionAdded with null event object");
      ConnectQosServer connQos = e.getConnectQos();
     
      // code for the DbWatchers here
      String replId = connQos.getData().getClientProperty(REPL_PREFIX_KEY, (String)null);
      if (replId == null || replId.length() < 1)
         log.fine("the client property '" + REPL_PREFIX_KEY + "' must be defined but is empty");
      else { // then it is a DbWatcher which is used for replication
         I_Info info = new ClientPropertiesInfo(connQos.getData().getClientProperties());
         String relativeName = e.getSessionInfo().getSessionName().getRelativeName();
         register(relativeName, replId, info);
      }
      // code for DbWatchers ends here
     
      if (!hasUsAsDispatchPlugin(connQos))
         return;
      log.fine("Connecting with qos : " + connQos.toXml());
      String sessionName = e.getSessionInfo().getSessionName().getRelativeName();
      log.info("addition of session for '" + sessionName +"' occured");
      synchronized (this.replSlaveMap) {
         if (!this.replSlaveMap.containsKey(sessionName)) {
            I_ReplSlave slave = new ReplSlave(this.global, this, sessionName, connQos.getData());
            try {
               slave.setDispatcher(false, false); // stop dispatcher without persisting the information
            }
            catch (Exception ex) {
               log.warning("Could not set the dispatcher for '" + sessionName + "' to false when adding the session");
View Full Code Here

    * @see org.xmlBlaster.authentication.I_ClientListener#sessionPreRemoved(org.xmlBlaster.authentication.ClientEvent)
    */
   public void sessionPreRemoved(ClientEvent e) throws XmlBlasterException {
      if (e == null)
         throw new XmlBlasterException(this.global, ErrorCode.INTERNAL_UNKNOWN, "ReplManagerPlugin.sessionAdded with null event object");
      ConnectQosServer connQos = e.getConnectQos();
     
      // code for the DbWatcher
      String replId = connQos.getData().getClientProperty(REPL_PREFIX_KEY, (String)null);
      if (replId == null || replId.length() < 1)
         log.fine("the client property '" + REPL_PREFIX_KEY + "' must be defined but is empty");
      else { // then it is a DbWatcher used for replication
         String relativeName = e.getSessionInfo().getSessionName().getRelativeName();
         unregister(relativeName, replId);
View Full Code Here

    *
    * It checks if the event is for one of our guys and dispatches the call to them
    * @see org.xmlBlaster.engine.I_SubscriptionListener#subscriptionAdd(org.xmlBlaster.engine.SubscriptionEvent)
    */
   public synchronized void subscriptionAdd(SubscriptionEvent e) throws XmlBlasterException {
      ConnectQosServer connQos = e.getSubscriptionInfo().getSessionInfo().getConnectQos();
      if (!hasUsAsDispatchPlugin(connQos))
         return;
     
      String relativeSessionName = e.getSubscriptionInfo().getSessionInfo().getSessionName().getRelativeName();
      log.info("addition of subscription for '" + relativeSessionName +"' occured");
View Full Code Here

TOP

Related Classes of org.xmlBlaster.engine.qos.ConnectQosServer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.