Commits

dloy  committed a74c828

Remove extend for LinkedHashList - exception in later Java
Add Remote io exception

  • Participants
  • Parent commits 740238c

Comments (0)

Files changed (3)

File core/src/main/java/org/cdlib/mrt/utility/LinkedHashList.java

  * @author dloy
  */
 public class LinkedHashList<K,V>
-    extends LinkedHashMap<K,Vector>
     implements Serializable
 {
-    protected Vector<V> vector = null;
+    protected LinkedHashMap<K,Vector<V>> hash = null;
+    
     //protected LinkedHashMap<K, Vector> map = null;
     public LinkedHashList() {
-        super();
+        hash = new LinkedHashMap<K,Vector<V>>();
     }
     public LinkedHashList(int cnt) {
-        super(cnt);
+        hash = new LinkedHashMap<K,Vector<V>>(cnt);
     }
 
     /**
      */
     public void put(K key, V value)
     {
-        Vector<V> ret = super.get(key);
+        if (value == null) return;
+        Vector<V> ret = hash.get(key);
         if (ret == null) {
             ret = new Vector<V>();
-            super.put(key, ret);
+            hash.put(key, ret);
         }
         ret.add(value);
     }
      */
     public Vector<V> get(K key)
     {
-        Vector<V> ret = super.get(key);
+        Vector<V> ret = hash.get(key);
         return ret;
     }
 
     public V getFirstElement(K key)
     {
-        Vector<V> ret = super.get(key);
+        Vector<V> ret = hash.get(key);
         if (ret == null) return null;
         V value = ret.firstElement();
         return value;
      */
     public int getCnt(K key)
     {
-        Vector<V> ret = super.get(key);
+        Vector<V> ret = hash.get(key);
         if (ret == null) return 0;
         return ret.size();
     }
      * Return a list of keys for this hash
      * @return
      */
-    @Override
     public Set<K> keySet()
     {
-        return super.keySet();
+        return hash.keySet();
+    }
+    
+    public int size()
+    {
+        return hash.size();
     }
 }

File core/src/main/java/org/cdlib/mrt/utility/TException.java

     }
 
     /**
+     * Attempt to read or write to remote external IO service fails
+     */
+    public static class REMOTE_IO_SERVICE_EXCEPTION extends TException
+    {
+        public REMOTE_IO_SERVICE_EXCEPTION(Exception ex)
+        {
+            super(TExceptionEnum.SQL_EXCEPTION, ex);
+        }
+        public REMOTE_IO_SERVICE_EXCEPTION(String msg)
+        {
+            super(TExceptionEnum.REMOTE_IO_SERVICE_EXCEPTION, msg);
+        }
+        public REMOTE_IO_SERVICE_EXCEPTION(String msg, Exception ex)
+        {
+            super(TExceptionEnum.REMOTE_IO_SERVICE_EXCEPTION, msg, ex);
+        }
+    }
+
+    /**
      * SQL_EXCEPTION subclass
      * See TExceptionEnum value for description
      */

File core/src/main/java/org/cdlib/mrt/utility/TExceptionEnum.java

 
     SQL_EXCEPTION("SQL exception", 500),
 
+    REMOTE_IO_SERVICE_EXCEPTION("Attempt to read or write to remote IO service fails", 500),
+
     REQUEST_ITEM_EXISTS("Request fails because element already exists", 404),
 
     REQUESTED_ITEM_NOT_FOUND("Request contains element that cannot be located", 404),