Package org.xmlBlaster.client

Examples of org.xmlBlaster.client.I_XmlBlasterAccess


      }
   }
  
   private void sendStatusInformation(String status) throws Exception {
      log.info("send status information '" + status + "'");
      I_XmlBlasterAccess conn = this.global.getXmlBlasterAccess();
      PublishKey pubKey = new PublishKey(this.global, this.statusTopic);
      Destination destination = new Destination(new SessionName(this.global, this.slaveSessionId));
      destination.forceQueuing(true);
      PublishQos pubQos = new PublishQos(this.global, destination);
      pubQos.setPersistent(true);
      MsgUnit msg = new MsgUnit(pubKey, status.getBytes(), pubQos);
      conn.publish(msg);
   }
View Full Code Here


      MsgUnit msgUnit = new MsgUnit(xmlKey, (byte[])null, unSubscribeQos.getData());
      NodeMasterInfo nodeMasterInfo = getConnection(publisherSession, msgUnit);
      if (nodeMasterInfo == null)
         return null;
      I_XmlBlasterAccess con =  nodeMasterInfo.getClusterNode().getXmlBlasterAccess();
      if (con == null) {
         if (log.isLoggable(Level.FINE)) log.fine("forwardUnSubscribe - Nothing to forward");
         return null;
      }

      return con.unSubscribe(new UnSubscribeKey(this.glob, xmlKey), new UnSubscribeQos(this.glob, unSubscribeQos.getData()));
   }
View Full Code Here

      MsgUnit msgUnit = new MsgUnit(xmlKey, new byte[0], getQos.getData());
      NodeMasterInfo nodeMasterInfo = getConnection(publisherSession, msgUnit);
      if (nodeMasterInfo == null)
         return null;
      I_XmlBlasterAccess con =  nodeMasterInfo.getClusterNode().getXmlBlasterAccess();
      if (con == null) {
         if (log.isLoggable(Level.FINE)) log.fine("forwardGet - Nothing to forward");
         return null;
      }

      return con.get(new GetKey(glob, xmlKey), new GetQos(glob, getQos.getData()));
   }
View Full Code Here

      MsgUnit msgUnit = new MsgUnit(xmlKey, new byte[0], eraseQos.getData());
      NodeMasterInfo nodeMasterInfo = getConnection(publisherSession, msgUnit);
      if (nodeMasterInfo == null)
         return null;
      I_XmlBlasterAccess con =  nodeMasterInfo.getClusterNode().getXmlBlasterAccess();
      if (con == null) {
         if (log.isLoggable(Level.FINE)) log.fine("forwardErase - Nothing to forward");
         return null;
      }

      return con.erase(new EraseKey(glob, xmlKey), new EraseQos(glob, eraseQos.getData()));
   }
View Full Code Here

    *
    * @see org.xmlBlaster.contrib.replication.I_ReplSlave#requestInitialData()
    */
   public void requestInitialData(String dbWatcherSessionId, boolean onlyRegister) throws Exception {
      log.info(this.name + " sends now an initial update request to the Master '" + dbWatcherSessionId + "'");
      I_XmlBlasterAccess conn = this.global.getXmlBlasterAccess();
      // no oid for this ptp message
      PublishKey pubKey = new PublishKey(this.global, REQUEST_INITIAL_DATA_TOPIC);
      Destination destination = new Destination(new SessionName(this.global, dbWatcherSessionId));
      destination.forceQueuing(true);
      PublishQos pubQos = new PublishQos(this.global, destination);
      pubQos.addClientProperty(ReplicationConstants.SLAVE_NAME, this.slaveSessionId);
      pubQos.addClientProperty(ReplicationConstants.REPL_VERSION, this.ownVersion);
      if (this.initialFilesLocation != null)
         pubQos.addClientProperty(ReplicationConstants.INITIAL_FILES_LOCATION, this.initialFilesLocation);
      pubQos.setPersistent(true);
      if (onlyRegister)
         pubQos.addClientProperty(ReplicationConstants.INITIAL_UPDATE_ONLY_REGISTER, onlyRegister);
      MsgUnit msg = new MsgUnit(pubKey, ReplicationConstants.REPL_REQUEST_UPDATE.getBytes(), pubQos);
      conn.publish(msg);
   }
View Full Code Here

         long clearedMsg = session.clearCallbackQueue();
         log.info("clearing of callback queue: '" + clearedMsg + "' where removed since a cancel request was done");

         // sending the cancel op to the DbWatcher
         log.info(this.name + " sends now a cancel request to the Master '" + this.dbWatcherSessionName + "'");
         I_XmlBlasterAccess conn = this.global.getXmlBlasterAccess();
         // no oid for this ptp message
         PublishKey pubKey = new PublishKey(this.global, REQUEST_CANCEL_UPDATE_TOPIC);
         Destination destination = new Destination(new SessionName(this.global, this.dbWatcherSessionName));
         destination.forceQueuing(true);
         PublishQos pubQos = new PublishQos(this.global, destination);
         pubQos.addClientProperty(ReplicationConstants.SLAVE_NAME, this.slaveSessionId);
         pubQos.setPersistent(false);
         MsgUnit msg = new MsgUnit(pubKey, ReplicationConstants.REPL_REQUEST_CANCEL_UPDATE.getBytes(), pubQos);
         conn.publish(msg);
         // TODO Check this since it could mess up the current status if one is exaclty finished now
         //setStatus(STATUS_NORMAL);
         setStatus(STATUS_INCONSISTENT);
         changeLastMessage("Initial Update interrupted by the ADMIN");
      }
View Full Code Here

   /**
    * Force a async ping to re-check connection to server. Status change is got
    * asynchronously via registerConnectionListener()
    */
   public void ping() {
      I_XmlBlasterAccess xb = null;
      try {
         xb = getXmlBlasterAccess();
      } catch (XmlBlasterException e) {
         e.printStackTrace();
      }
      if (xb != null)
         xb.ping();
   }
View Full Code Here

   }
  
   public I_Queue getConnectionQueue() {
      if (isLocalNode())
         return null;
      I_XmlBlasterAccess con = null;
      try {
         con = getXmlBlasterAccess();
      } catch (XmlBlasterException e) {
         e.printStackTrace();
         return null;
      }
      if (con != null) {
         return con.getQueue();
      }
      return null;
   }
View Full Code Here

    * @return null if not known
    */
   public SessionName getRemoteSessionName() {
      if (isLocalNode())
         return null;
      I_XmlBlasterAccess con = null;
      try {
         con = getXmlBlasterAccess();
      } catch (XmlBlasterException e) {
         e.printStackTrace();
         return null;
View Full Code Here

    * @return null if not known
    */
   public SessionName getSessionName() {
      if (isLocalNode())
         return null;
      I_XmlBlasterAccess con = null;
      try {
         con = getXmlBlasterAccess();
      } catch (XmlBlasterException e) {
         e.printStackTrace();
         return null;
      }
      if (con != null)
         return con.getSessionName();
      return null;
   }
View Full Code Here

TOP

Related Classes of org.xmlBlaster.client.I_XmlBlasterAccess

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.