Package org.xmlBlaster.util.qos

Examples of org.xmlBlaster.util.qos.ClientProperty


            conn.setAutoCommit(false);
            try {
               for (int i=0; i < rows.size(); i++) {
                  SqlRow row = (SqlRow)rows.get(i);
                  ClientProperty oldRowProp = new ClientProperty(ReplicationConstants.OLD_CONTENT_ATTR, null, null, row.toXml("", false));
                  row.setAttribute(oldRowProp);
                  try {
                     I_Parser parser = new SqlInfoParser();
                     parser.init(this.info);
                     int ret = desc.update(conn, row, parser);
View Full Code Here


         character.setLength(0);
         Thread.dumpStack();
         return true;
      }
      if (this.allowedTagNames.contains(name)) {
         this.clientProperty = new ClientProperty(attrs.getValue("name"), attrs.getValue("type"), attrs.getValue("encoding"));
         this.inClientProperty++;
         character.setLength(0);
         return true;
      }
      return false;
View Full Code Here

            log.warning("could not delete the file '" + completeFilename + "' please delete it manually");
      }
   }
  
   private void deleteFiles(Map attrMap) {
      ClientProperty filenameProp =  (ClientProperty)attrMap.get(ReplicationConstants.FILENAME_ATTR);
      String filename = null;
      if (filenameProp != null)
         filename = filenameProp.getStringValue();
      if (filename != null && filename.length() > 0) {
         deleteFiles(filename);
      }
      else
         log.warning("Could not cleanup since the '" + ReplicationConstants.FILENAME_ATTR + "' attribute was not set");
View Full Code Here

  
   /**
    * This is invoked for dump files
    */
   private void updateDump(String topic, InputStream is, Map attrMap) throws Exception {
      ClientProperty prop = (ClientProperty)attrMap.get(FILENAME_ATTR);
      String filename = null;
      if (prop == null) {
         log.warning("The property '" + FILENAME_ATTR + "' has not been found. Will choose an own temporary one");
         filename = "tmpFilename.dmp";
      }
      else
         filename = prop.getStringValue();
      log.info("'" + topic + "' dumping file '" + filename + "' on '" + this.importLocation + "'");
      // will now write to the file system
      this.callback.update(topic, is, attrMap);
      // and now perform an import of the DB
      int seqNumber = -1;
View Full Code Here

   private void updateManualTransfer(String topic, InputStream is, Map attrMap) throws Exception {
   }

  
   public void update(String topic, InputStream is, Map attrMap) throws Exception {
      ClientProperty dumpProp = (ClientProperty)attrMap.get(ReplicationConstants.DUMP_ACTION);
      ClientProperty endToRemoteProp = (ClientProperty)attrMap.get(ReplicationConstants.INITIAL_DATA_END_TO_REMOTE);
      ClientProperty endOfTransition = (ClientProperty)attrMap.get(ReplicationConstants.END_OF_TRANSITION);

      if (endOfTransition != null && endOfTransition.getBooleanValue()) {
         deleteFiles(attrMap);
      }
      else if (dumpProp != null)
         updateDump(topic, is, attrMap);
      else if (endToRemoteProp != null)
View Full Code Here

   protected Map clientPropertiesToMap(Map clp) {
      Map attrMap = new TreeMap();
      Iterator it = clp.keySet().iterator();
      while (it.hasNext()) {
         String key = (String)it.next();
         ClientProperty prop = (ClientProperty)clp.get(key);
         attrMap.put(key, prop.getStringValue());
      }
      return attrMap;
   }
View Full Code Here

   
    * @param key the key of the attribute
    * @return the ClientProperty object associated with the key, or if none found, null is returned.
    */
   public ClientProperty getAttribute(String key) {
      ClientProperty prop = (ClientProperty)this.attributes.get(key);
      if (!this.caseSensitive && prop == null) {
         prop = (ClientProperty)this.attributes.get(key.toLowerCase());
         if (prop == null)
            prop = (ClientProperty)this.attributes.get(key.toUpperCase());
      }
View Full Code Here

   /**
    * Stores the String as a new value. The passed String is directly transformed into a ClientProperty object.
    * @param value the value to store as an attribute.
    */
   public void setAttribute(String key, String value) {
      ClientProperty prop = new ClientProperty(key, null, null, value);
      SqlRow.storeProp(prop, this.attributes, this.attributeKeys);
   }
View Full Code Here

      String[] colNames = row.getColumnNames();
      StringBuffer buf = new StringBuffer(256);
      buf.append(" WHERE ");
      boolean firstHit = true;
      for (int i=0; i < colNames.length; i++) {
         ClientProperty colContent = row.getColumn(colNames[i]);
         SqlColumn sqlCol = getColumn(colNames[i]);
         if (sqlCol == null) {
            log.info("column '" + colNames[i] + "' not found, will ignore it");
            continue;
         }
         // if ((sqlCol.isPrimaryKey() || !hasPk()) && sqlCol.isSearchable()) {
         boolean isNull = colContent.getType() != null && Constants.TYPE_NULL.equals(colContent.getType());
         if (canAddColToSearch(sqlCol)) {
            if (firstHit)
               firstHit = false;
            else
               buf.append("AND ");
View Full Code Here

      StringBuffer buf1 = new StringBuffer(256);
      StringBuffer buf2 = new StringBuffer(256);
      buf1.append(" ( ");
      boolean firstHit = true;
      for (int i=0; i < colNames.length; i++) {
         ClientProperty colContent = row.getColumn(colNames[i]);
         if (getColumn(colNames[i]) != null) {
            searchEntries.add(colContent);
            if (firstHit) {
               firstHit = false;
            }
View Full Code Here

TOP

Related Classes of org.xmlBlaster.util.qos.ClientProperty

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.