Package org.xmlBlaster.client

Examples of org.xmlBlaster.client.I_XmlBlasterAccess.connect()


{
   public HelloWorld(String[] args) {
      try {
         I_XmlBlasterAccess con = new XmlBlasterAccess(args);

         con.connect(null, null);    // Login to xmlBlaster as "guest"

         MsgUnit[] msgs = con.get("<key oid='__cmd:?freeMem'/>", null);

         System.out.println("\nHelloWorld: xmlBlaster has currently " +
                new String(msgs[0].getContent()) + " bytes of free memory\n");
View Full Code Here


               String key = (String)it.next();
               qos.addClientProperty(key, connectQosClientPropertyMap.get(key).toString());
            }
         }
         log.info("ConnectQos is " + qos.toXml());
         ConnectReturnQos crq = con.connect(qos, null)// Login to xmlBlaster
         log.info("Connect success as " + crq.toXml());
        
         MsgUnit[] msgs = null;
         if (queryOid != null) {
            // http://www.xmlblaster.org/xmlBlaster/doc/requirements/engine.qos.queryspec.QueueQuery.html
View Full Code Here

         // Check if other name or password was given on command line:
         String name = glob.getProperty().get("session.name", "HelloWorldVolatile2");
         String passwd = glob.getProperty().get("passwd", "secret");

         ConnectQos connectQos = new ConnectQos(glob, name, passwd);
         con.connect(connectQos, this)// Login to xmlBlaster, register for updates

         // Subscribe for the volatile message
         SubscribeKey sk = new SubscribeKey(glob, "HelloWorldVolatile2");
         SubscribeQos sq = new SubscribeQos(glob);
         SubscribeReturnQos subRet = con.subscribe(sk, sq);
View Full Code Here

      String user="ADMIN/1";
      String passwd="secret";
      try {
         Global gAdmin = glob.getClone(null);
         connAdmin = gAdmin.getXmlBlasterAccess();
         connAdmin.connect(new ConnectQos(gAdmin, user, passwd), null);
         GetKey gk = new GetKey(glob, command);
         GetQos gq = new GetQos(glob);
         MsgUnit[] msgs = connAdmin.get(gk, gq);
         return msgs;
      }
View Full Code Here

    */
   private final void doSomething() {
      try {
         I_XmlBlasterAccess con = new XmlBlasterAccess(new String[0]);

         con.connect(null, null);    // Login to xmlBlaster

         MsgUnit[] msgs = con.get("<key oid='__cmd:?freeMem'/>", null);

         System.out.println("\n###ClientPlugin###: xmlBlaster has currently " +
                new String(msgs[0].getContent()) + " bytes of free memory\n");
View Full Code Here

            queryType = "XPATH";
         else
            usage("Please enter a query string");

         I_XmlBlasterAccess con = glob.getXmlBlasterAccess();
         con.connect(null, null);


         String xmlKey = "<key oid='' queryType='" + queryType + "'>\n" +
                            queryString +
                         "</key>";
View Full Code Here

   public void testStop() {
      try {
         I_XmlBlasterAccess con = this.glob.getXmlBlasterAccess();

         ConnectQos qos = new ConnectQos(glob, "joe", "secret");
         con.connect(qos, null);

         con.publish(new MsgUnit("<key oid='__cmd:?exit=0'/>", "".getBytes(), "<qos/>"));

         con.disconnect(null);
View Full Code Here

         try {
            Global glob2 = this.glob.getClone(null);
            I_XmlBlasterAccess con2 = glob2.getXmlBlasterAccess();
            ConnectQos connectQos = new ConnectQos(glob2, "joe", "secret");
            con2.connect(connectQos, null);
            fail("No connection expected");
         }
         catch(org.xmlBlaster.util.XmlBlasterException e) {
            System.err.println("Success, connection not possible any more");
         }
View Full Code Here

               String key = (String)it.next();
               qos.addClientProperty(key, connectQosClientPropertyMap.get(key).toString());
            }
         }
         log.info("ConnectQos is " + qos.toXml());
         ConnectReturnQos crq = con.connect(qos, new I_Callback() {
      public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) throws XmlBlasterException {
        try {
          log.info("Received '" + updateKey.getOid() + "':" + new String(content, "UTF-8"));
        } catch (UnsupportedEncodingException e) {
          log.severe("Update failed: " + e.toString());
View Full Code Here

      try {
         if (!prepareClient(this.view.drawing())) return this.isRunning;

         I_XmlBlasterAccess con = global.getXmlBlasterAccess();
         ConnectQos qos = new ConnectQos(this.global, /*drawing.getTitle()*/ name, "secret");
         con.connect(qos, this)// Login to xmlBlaster, register for updates

         this.isRunning = true;
     
         if (this.cmdInstances.size() > 0) {
            MonitorCommand[] oidCommands = (MonitorCommand[])this.cmdInstances.values().toArray(new MonitorCommand[this.cmdInstances.size()]);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.