geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject [32/51] [partial] incubator-geode git commit: GEODE-77 removing the old jgroups subproject
Date Fri, 21 Aug 2015 21:22:56 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/DBPersistenceManager.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/DBPersistenceManager.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/DBPersistenceManager.java
deleted file mode 100644
index db054a0..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/DBPersistenceManager.java
+++ /dev/null
@@ -1,877 +0,0 @@
-/** Notice of modification as required by the LGPL
- *  This file was modified by Gemstone Systems Inc. on
- *  $Date$
- **/
-package com.gemstone.org.jgroups.persistence;
-
-/**
- * @author Mandar Shinde
- * This class implements the DB storage pattern for the Persistence
- * Manager interface. The implementation is open and can be used (and
- * tested) over more than one databases. It uses a string (VARCHAR)
- * as the key and either BLOB or VARBINARY db-datatype for the
- * serialized objects. THe user has the option to choose his/her own
- * schema over the ones provided.
- */
-
-
-import java.io.Serializable;
-import java.util.Map;
-
-import com.gemstone.org.jgroups.util.GemFireTracer;
-
-
-/**
- * Class will be utilized
- */
-public class DBPersistenceManager implements PersistenceManager {
-
-    protected final GemFireTracer log=GemFireTracer.getLog(this.getClass());
-
-    @Override
-    public void save(Serializable key, Serializable val)
-        throws CannotPersistException {
-      // TODO Auto-generated method stub
-      
-    }
-
-    @Override
-    public Serializable remove(Serializable key) throws CannotRemoveException {
-      // TODO Auto-generated method stub
-      return null;
-    }
-
-    @Override
-    public void saveAll(Map map) throws CannotPersistException {
-      // TODO Auto-generated method stub
-      
-    }
-
-    @Override
-    public Map retrieveAll() throws CannotRetrieveException {
-      // TODO Auto-generated method stub
-      return null;
-    }
-
-    @Override
-    public void clear() throws CannotRemoveException {
-      // TODO Auto-generated method stub
-      
-    }
-
-    @Override
-    public void shutDown() {
-      // TODO Auto-generated method stub
-      
-    }
-
-//    /**
-//     * Default construct
-//     * @param filename absolute filepath
-//     * @exception Exception;
-//     */
-    public DBPersistenceManager(String filename) throws Exception {
-//        String home_dir = null;
-//
-//        // PropertyPermission not granted if running in an untrusted environment with JNLP.
-//        try {
-//            home_dir = System.getProperty("user.home");
-//        }
-//        catch (SecurityException ex1) {
-//        }
-//
-//        // 1. Try ${user.home}/persist.properties
-//        try {
-//            home_dir=home_dir + '/' + filename;
-//            init(new FileInputStream(home_dir));
-//            return;
-//        }
-//        catch(Exception ex) {
-//            ;
-//        }
-//
-//        // 2. Try to find persist.properties from somewhere on the CLASSPATH
-//        try {
-//            InputStream in = ClassPathLoader.getLatest().getResourceAsStream(getClass(), '/' + filename);
-//            if(in != null) {
-//                init(in);
-//                return;
-//            }
-//        }
-//        catch(Exception x) {
-//            if(log.isErrorEnabled()) log.error(JGroupsStrings.DBPersistenceManager_FAILED_READING_DATABASE_PROPERTIES_FROM__0__EXCEPTION_1, new Object[] {filename, x});
-//        }
-//
-//        // 3. Finally maybe the user specified -Dpersist.properties=/home/user/mypersist.properties
-//        try {
-//            home_dir=System.getProperty("persist.properties");
-//            init(new FileInputStream(home_dir));
-//            return;
-//        }
-//        catch(Exception ex) {
-//            ;
-//        }
-//
-//        // 4. If none of the above helped us to find persist.properties, give up and throw an exception
-//        throw new Exception("DBPersistenceManager.DBPersistenceManager(): " +
-//                            "failed reading database properties from " + filename);
-    }
-//
-//
-//    /**
-//     * Duplicate constructor allowing inputstream
-//     * @param input
-//     * @exception Exception
-//     */
-//    public DBPersistenceManager(InputStream input) throws Exception {
-//        init(input);
-//    }
-//
-//
-//    /**
-//     * used to intitiailize complete DB access. THis method will use
-//     * existing database to create schema (if it doesnt exist) and
-//     * get PersistenceManager in usable condition
-//     * @param in
-//     * @exception Exception;
-//     */
-//    protected void init(InputStream in) throws Exception {
-//        list=new Vector();
-//        readProps(in);
-//        loadDriver();
-//
-//        //check conn
-//        Connection conn=this.getConnection();
-//        this.closeConnection(conn);
-//        createDBTables();
-//        retrieveAll(); // work around to make sure, no duplicates are created.
-//        log.error(JGroupsStrings.DBPersistenceManager_DONE_CONSTRUCTING_DB_PERSIST_MANAGER);
-//    }
-//
-//
-//    // TODO list for this implementation
-//    // add constructor for xml file
-//    // add constructor for default
-//
-//
-//    /**
-//     * Saves NV pair as serializable object; 
-//     * creates if new, stores new state if already exists.
-//     * @param key
-//     * @param val
-//     * @exception CannotPersistException;
-//     */
-//    public void save(Serializable key, Serializable val) throws CannotPersistException {
-//        // checking if this is update or new entry
-//        if(!entryExists(key)) {
-//            log.error(JGroupsStrings.DBPersistenceManager_ENTRY_DOESNT_EXIST_FOR__0, key.toString());
-//            try {
-//                addNewEntry(key, val);
-//                list.add(key.toString());
-//                return;
-//            }
-//            catch (VirtualMachineError err) { // GemStoneAddition
-//              SystemFailure.initiateFailure(err);
-//              // If this ever returns, rethrow the error.  We're poisoned
-//              // now, so don't let this thread continue.
-//              throw err;
-//            }
-//            catch(Throwable t1) {
-//              SystemFailure.checkFailure(); // GemStoneAddition
-//                t1.printStackTrace();
-//                //trace here
-//                throw new CannotPersistException(t1, " error adding a completely new entry in to DB ");
-//            }
-//        }// checking entries
-//
-//        // THis is for regular updates to the key,val pair
-//        Connection conn=null;
-//        PreparedStatement prepStat=null;
-//        try {
-//            conn=this.getConnection();
-//            String keyStr=null;
-//            keyStr=key.toString();
-//            byte[] keyBytes=getBytes(key);
-//            byte[] valBytes=getBytes(val);
-//            log.error(JGroupsStrings.DBPersistenceManager_VALUE_IS__0, val);
-//            //use simple execute, do not create prepared statement
-//            prepStat=conn.prepareStatement(updateStat);
-//            prepStat.setString(3, keyStr);
-//            prepStat.setBytes(1, keyBytes);
-//            prepStat.setBytes(2, valBytes);
-//            prepStat.executeQuery();
-//        }
-//        catch (VirtualMachineError err) { // GemStoneAddition
-//          SystemFailure.initiateFailure(err);
-//          // If this ever returns, rethrow the error.  We're poisoned
-//          // now, so don't let this thread continue.
-//          throw err;
-//        }
-//        catch(Throwable t) {
-//          SystemFailure.checkFailure(); // GemStoneAddition
-//            //trace here
-//            t.printStackTrace();
-//            // throw exception here
-//            throw new CannotPersistException(t, "error updating an existing entry in to the database ");
-//        }
-//                // cleanup
-//        finally {
-//            try {
-//                if(prepStat != null) prepStat.close();
-//                this.closeConnection(conn);
-//            }
-//            catch (VirtualMachineError err) { // GemStoneAddition
-//              SystemFailure.initiateFailure(err);
-//              // If this ever returns, rethrow the error.  We're poisoned
-//              // now, so don't let this thread continue.
-//              throw err;
-//            }
-//            catch(Throwable t) {
-//              SystemFailure.checkFailure(); // GemStoneAddition
-//                // trace
-//                conn=null;
-//                prepStat=null;
-//            }
-//        }
-//    }
-//
-//
-//    /**
-//     * Removes existing entry.
-//     * @param key
-//     * @exception CannotRemoveException;
-//     */
-//    public Serializable remove(Serializable key) throws CannotRemoveException {
-//        Connection conn=null;
-//        Statement stat=null;
-//        PreparedStatement prepStat=null;
-//        ResultSet set=null;
-//        Serializable val=null;
-//
-//        try {
-//            conn=this.getConnection();
-//            stat=conn.createStatement();
-//            String exQuery=" select * from replhashmap where key like '" + key.toString() + '\'';
-//            set=stat.executeQuery(exQuery);
-//            set.next();
-//            val=getSerializable(set.getBinaryStream(3));
-//        }
-//        catch (VirtualMachineError err) { // GemStoneAddition
-//          SystemFailure.initiateFailure(err);
-//          // If this ever returns, rethrow the error.  We're poisoned
-//          // now, so don't let this thread continue.
-//          throw err;
-//        }
-//        catch(Throwable t3) {
-//          SystemFailure.checkFailure(); // GemStoneAddition
-//            //trace
-//            t3.printStackTrace();
-//            throw new CannotRemoveException(t3, " Error retrieving value for given key");
-//        }
-//        finally {
-//            try {
-//                if(stat != null) stat.close(); // GemStoneAddition wrong variable
-//                this.closeConnection(conn);
-//            }
-//            catch (VirtualMachineError err) { // GemStoneAddition
-//              SystemFailure.initiateFailure(err);
-//              // If this ever returns, rethrow the error.  We're poisoned
-//              // now, so don't let this thread continue.
-//              throw err;
-//            }
-//            catch(Throwable t) {
-//              SystemFailure.checkFailure(); // GemStoneAddition
-//                // trace
-//                conn=null;
-////                prepStat=null; GemStoneAddition (redundant assignment)
-//            }
-//        }
-//
-//
-//        try {
-//            conn=this.getConnection();
-//            prepStat=conn.prepareStatement(removeStat);
-//            prepStat.setString(1, key.toString());
-//            prepStat.executeQuery();
-//            list.remove(key.toString());
-//        }
-//        catch (VirtualMachineError err) { // GemStoneAddition
-//          SystemFailure.initiateFailure(err);
-//          // If this ever returns, rethrow the error.  We're poisoned
-//          // now, so don't let this thread continue.
-//          throw err;
-//        }
-//        catch(Throwable t) {
-//          SystemFailure.checkFailure(); // GemStoneAddition
-//            //trace here..
-//            t.printStackTrace();
-//            // throw Exception
-//            throw new CannotRemoveException(t, "Could not remove existing entry due to error in jdbc transaction");
-//        }
-//
-//                // cleanup
-//        finally {
-//            try {
-//                set.close();
-//                stat.close();
-//                if(prepStat != null) prepStat.close();
-//                this.closeConnection(conn);
-//            }
-//            catch (VirtualMachineError err) { // GemStoneAddition
-//              SystemFailure.initiateFailure(err);
-//              // If this ever returns, rethrow the error.  We're poisoned
-//              // now, so don't let this thread continue.
-//              throw err;
-//            }
-//            catch(Throwable t) {
-//              SystemFailure.checkFailure(); // GemStoneAddition
-//                // trace
-//                conn=null;
-//                stat=null;
-//            }//end of try..catch
-//        }// end of finally..
-//        return val;
-//    }// end of remove
-//
-//
-//    /**
-//     * Saves all row entries for the map to DB.
-//     * @param map
-//     * @exception CannotPersistException;
-//     */
-//    public synchronized void saveAll(Map map) throws CannotPersistException {
-//        Iterator iter=null;
-//        try {
-////            Set keySet=map.keySet();
-////            iter=keySet.iterator();
-//            iter = map.entrySet().iterator(); // GemStoneAddition make more efficient
-//        }
-//        catch (VirtualMachineError err) { // GemStoneAddition
-//          SystemFailure.initiateFailure(err);
-//          // If this ever returns, rethrow the error.  We're poisoned
-//          // now, so don't let this thread continue.
-//          throw err;
-//        }
-//        catch(Throwable t) {
-//          SystemFailure.checkFailure(); // GemStoneAddition
-//            t.printStackTrace();
-//            //trace here
-//            throw new CannotPersistException(t, "Error with the map entered to saveAll");
-//        }
-//
-//        //Individually saving all
-//        while(iter.hasNext()) {
-//            try {
-////                Serializable key=(Serializable) iter.next();
-////                Serializable val=(Serializable) map.get(key);
-//                Map.Entry entry = (Map.Entry)iter.next(); // GemStoneAddition
-//                Serializable key = (Serializable)entry.getKey();
-//                Serializable val = (Serializable)entry.getValue();
-//
-//                // dont this in same thread, optimization can be added
-//                this.save(key, val);
-//            }
-//            catch (VirtualMachineError err) { // GemStoneAddition
-//              SystemFailure.initiateFailure(err);
-//              // If this ever returns, rethrow the error.  We're poisoned
-//              // now, so don't let this thread continue.
-//              throw err;
-//            }
-//            catch(Throwable t2) {
-//              SystemFailure.checkFailure(); // GemStoneAddition
-//                t2.printStackTrace();
-//                //trace here
-//                continue;
-//            }
-//        }// end of while..
-//    }// end of saveall
-//
-//
-//    /**
-//     * Used to retrieve the persisted map back to its last known state
-//     * @return Map;
-//     * @exception CannotRetrieveException;
-//     */
-//    public synchronized Map retrieveAll() throws CannotRetrieveException {
-//        Connection conn=null;
-//        Statement stat=null;
-//        ResultSet set=null;
-//        Map map=null;
-//        try {
-//            conn=this.getConnection();
-//            stat=conn.createStatement();
-//            set=stat.executeQuery(" select * from replhashmap");
-//            map=retrieveAll(set);
-//        }
-//        catch (VirtualMachineError err) { // GemStoneAddition
-//          SystemFailure.initiateFailure(err);
-//          // If this ever returns, rethrow the error.  We're poisoned
-//          // now, so don't let this thread continue.
-//          throw err;
-//        }
-//        catch(Throwable t) {
-//          SystemFailure.checkFailure(); // GemStoneAddition
-//            //trace here
-//            throw new CannotRetrieveException(t, "Error happened while querying the database for bulk retrieve, try starting DB manually");
-//        }
-//
-//
-//        //finally
-//        try {
-//            stat.close();
-//            this.closeConnection(conn);
-//        }
-//        catch (VirtualMachineError err) { // GemStoneAddition
-//          SystemFailure.initiateFailure(err);
-//          // If this ever returns, rethrow the error.  We're poisoned
-//          // now, so don't let this thread continue.
-//          throw err;
-//        }
-//        catch(Throwable t1) {
-//          SystemFailure.checkFailure(); // GemStoneAddition
-//            // trace it
-//            // ignore
-//        }
-//
-//        return map;
-//    }// end of retrieveall
-//
-//
-//    /**
-//     * Helper method to get get back the map
-//     * @return Map;
-//     * @exception Exception;
-//     */
-//    private Map retrieveAll(ResultSet result) throws Exception {
-//        HashMap map=new HashMap();
-//        while(result.next()) {
-//            InputStream inputStrKey=result.getBinaryStream(2);
-//            InputStream inputStrVal=result.getBinaryStream(3);
-//            Serializable key=getSerializable(inputStrKey);
-//            Serializable val=getSerializable(inputStrVal);
-//            map.put(key, val);
-//            list.add(key.toString());
-//        }// end of while..
-//        return map;
-//    }
-//
-//
-//    /**
-//     * Clears the key-cache as well as all entries
-//     * @exception CannotRemoveException;
-//     */
-//    public void clear() throws CannotRemoveException {
-//        Connection conn=null;
-//        Statement stat=null;
-//        try {
-//            conn=this.getConnection();
-//            stat=conn.createStatement();
-//            stat.executeQuery("delete from replhashmap");
-//        }
-//        catch (VirtualMachineError err) { // GemStoneAddition
-//          SystemFailure.initiateFailure(err);
-//          // If this ever returns, rethrow the error.  We're poisoned
-//          // now, so don't let this thread continue.
-//          throw err;
-//        }
-//        catch(Throwable t) {
-//          SystemFailure.checkFailure(); // GemStoneAddition
-//            //trace here
-//            throw new CannotRemoveException(t, " delete all query failed with existing database");
-//        }
-//
-//        //finally
-//        try {
-//            stat.close();
-//            this.closeConnection(conn);
-//        }
-//        catch (VirtualMachineError err) { // GemStoneAddition
-//          SystemFailure.initiateFailure(err);
-//          // If this ever returns, rethrow the error.  We're poisoned
-//          // now, so don't let this thread continue.
-//          throw err;
-//        }
-//        catch(Throwable t) {
-//          SystemFailure.checkFailure(); // GemStoneAddition
-//            conn=null;
-//            stat=null;
-//        }
-//    }
-//
-//
-//    /**
-//     * Shutting down the database cleanly
-//     */
-//    public void shutDown() {
-//        // non-trivial problem, more research required
-//        // no-op for now..
-//    }
-//
-//
-//
-//    /**
-//     * The private interfaces are used specifically to this manager
-//     */
-//
-//    /**
-//     * Used to enter a completely new row in to the current table
-//     * @param key
-//     * @param val
-//     * @exception CannotPersistException;
-//     */
-//    private void addNewEntry(Serializable key, Serializable val) throws CannotPersistException, CannotConnectException {
-//        Connection conn=getConnection();
-//        try {
-//            PreparedStatement prepStat=conn.prepareStatement(insertStat);
-//            prepStat.setString(1, key.toString());
-//            byte[] keyBytes=getBytes(key);
-//            byte[] valBytes=getBytes(val);
-//            //InputStream keyStream = getBinaryInputStream(key);
-//            //InputStream valStream = getBinaryInputStream(val);
-//            prepStat.setBytes(2, keyBytes);
-//            prepStat.setBytes(3, valBytes);
-//            //prepStat.setBinaryStream(keyStream);
-//            //prepStat.setBinaryStream(valStream);
-//            prepStat.executeQuery();
-//            conn.commit();
-//            log.error(JGroupsStrings.DBPersistenceManager_EXECUTING_INSERT__0, insertStat);
-//        }
-//        catch (VirtualMachineError err) { // GemStoneAddition
-//          SystemFailure.initiateFailure(err);
-//          // If this ever returns, rethrow the error.  We're poisoned
-//          // now, so don't let this thread continue.
-//          throw err;
-//        }
-//        catch(Throwable t) {
-//          SystemFailure.checkFailure(); // GemStoneAddition
-//            //conn.rollback();
-//            t.printStackTrace();
-//            //trace here
-//            throw new CannotPersistException(t, "error adding new entry using creating Db connection and schema");
-//        }
-//    }// end of addentry..
-//
-//
-//    /**
-//     * Gets a binaryinputstream from a serialized object
-//     * @param ser
-//     * @return BinaryInputStream
-//     * @exception Exception
-//     */
-//    private java.io.InputStream getBinaryInputStream(Serializable ser) throws Exception {
-//        ByteArrayOutputStream stream=new ByteArrayOutputStream();
-//        ObjectOutputStream keyoos=new ObjectOutputStream(stream);
-//        keyoos.writeObject(ser);
-//        ByteArrayInputStream pipe=new ByteArrayInputStream(stream.toByteArray());
-//        return pipe;
-//    }// end of stream conversion
-//
-//
-//    /**
-//     * Gets a serializable back from a InputStream
-//     * @param stream
-//     * @return Serializable
-//     * @exception Exception
-//     */
-//    private Serializable getSerializable(java.io.InputStream stream) throws Exception {
-//        ObjectInputStream ooStr=new ObjectInputStream(stream);
-//        Serializable tmp=(Serializable) ooStr.readObject();
-//        return tmp;
-//    }
-//
-//
-//    /**
-//     * Used to enter a completely new row in to the current table
-//     * @param key
-//     * @param val
-//     * @exception CannotPersistException
-//     */
-//    private void addNewEntryGen(Serializable key, Serializable val) throws CannotPersistException, CannotConnectException {
-//        Connection conn=getConnection();
-//        try {
-//            PreparedStatement prepStat=conn.prepareStatement(insertStat);
-//            prepStat.setString(1, key.toString());
-//            prepStat.setBytes(2, getBytes(key));
-//            prepStat.setBytes(3, getBytes(val));
-//            prepStat.executeUpdate();
-//        }
-//        catch (VirtualMachineError err) { // GemStoneAddition
-//          SystemFailure.initiateFailure(err);
-//          // If this ever returns, rethrow the error.  We're poisoned
-//          // now, so don't let this thread continue.
-//          throw err;
-//        }
-//        catch(Throwable t) {
-//          SystemFailure.checkFailure(); // GemStoneAddition
-//            //trace here
-//            throw new CannotPersistException(t, "error adding new entry using creating Db connection and schema");
-//        }
-//    }// end of entering new row gen
-//
-//    /**
-//     * Used to enter a completely new row in to the current table
-//     * @param key
-//     * @param val
-//     * @exception CannotPersistException
-//     */
-//    private void addNewEntryOra(Serializable key, Serializable val) throws CannotPersistException, CannotConnectException {
-//        Connection conn=getConnection();
-//        try {
-//            PreparedStatement prepStat=conn.prepareStatement(insertStat);
-//            prepStat.setString(1, key.toString());
-//            /*InputStream keyBin=*/getBinaryInputStream(key);
-//            /*InputStream keyVal=*/getBinaryInputStream(val);
-//            byte[] keyBytes=getBytes(key);
-//            byte[] valBytes=getBytes(val);
-//            prepStat.setBytes(2, keyBytes);
-//            prepStat.setBytes(3, valBytes);
-//            prepStat.executeBatch();
-//        }
-//        catch (VirtualMachineError err) { // GemStoneAddition
-//          SystemFailure.initiateFailure(err);
-//          // If this ever returns, rethrow the error.  We're poisoned
-//          // now, so don't let this thread continue.
-//          throw err;
-//        }
-//        catch(Throwable t) {
-//          SystemFailure.checkFailure(); // GemStoneAddition
-//            //trace here
-//            throw new CannotPersistException(t, "error adding new entry using creating Db connection and schema");
-//        }
-//    }// end of entering new row ora
-//
-//
-//    /**
-//     * Cache checking
-//     * @param key
-//     * @return boolean
-//     */
-//    private boolean entryExists(Serializable key) {
-//        return list.contains(key.toString());
-//    }
-//
-//
-//    /**
-//     * Conversion helper
-//     * @param ser
-//     * @return byte[]
-//     */
-//    private byte[] getBytes(Serializable ser) throws Exception {
-//        ByteArrayOutputStream stream=new ByteArrayOutputStream();
-//        ObjectOutputStream keyoos=new ObjectOutputStream(stream);
-//        keyoos.writeObject(ser);
-//        byte[] keyBytes=stream.toByteArray();
-//        return keyBytes;
-//    }// end of getBytes
-//
-//
-//
-//
-//    /**
-//     * ALL IMPL below is for INIT purposes
-//     */
-//
-//    /**
-//     * This method will be invoked by defauly by each persistence
-//     * manager to read from a default location or one provided by
-//     * the caller.
-//     * @exception Exception
-//     */
-//    private void readProps(String filePath) throws Exception {
-//        FileInputStream _stream=new FileInputStream(filePath);
-//        props=new Properties();
-//        props.load(_stream);
-//
-//        // using properties to set most used variables
-//        driverName=props.getProperty("jdbc.Driver");
-//        connStr=props.getProperty("jdbc.Conn").trim();
-//        userName=props.getProperty("jdbc.User").trim();
-//        userPass=props.getProperty("jdbc.Pass").trim();
-//        createTable=props.getProperty("jdbc.table").trim();
-//    }
-//
-//
-//    /**
-//     * Duplicate reader using stream instead of dile
-//     * @param input
-//     * @exception Exception
-//     */
-//    private void readProps(InputStream input) throws Exception {
-//        props=new Properties();
-//        props.load(input);
-//
-//        // using properties to set most used variables
-//        driverName=props.getProperty("jdbc.Driver");
-//        connStr=props.getProperty("jdbc.Conn");
-//        userName=props.getProperty("jdbc.User");
-//        userPass=props.getProperty("jdbc.Pass");
-//        createTable=props.getProperty("jdbc.table");
-//    }
-//
-//
-//    /**
-//     * Loads the driver using the driver class name. Drivers can be simply
-//     * loaded by loading the class or by registering specifically using the
-//     * JDBC DriverManager
-//     * @exception Exception
-//     */
-//    private void loadDriver() throws Exception {
-//        // driver classes when loaded load the driver into VM
-//      ClassPathLoader.getLatest().forName(driverName);
-//    }
-//
-//
-//    /**
-//     * Once the driver is loaded, the DB is ready to be connected. This
-//     * method provides a handle to connect to the DB.
-//     * @return Connection
-//     * @exception CannotConnectException
-//     */
-//    private Connection getConnection() throws CannotConnectException {
-//        try {
-//            connStr=connStr.trim();
-//            Connection conn=DriverManager.getConnection(connStr, userName, userPass);
-//            if(log.isInfoEnabled()) log.info("userName=" + userName +
-//                                             ", userPass=" + userPass + ", connStr=" + connStr);
-//            return conn;
-//        }
-//        catch (VirtualMachineError err) { // GemStoneAddition
-//          SystemFailure.initiateFailure(err);
-//          // If this ever returns, rethrow the error.  We're poisoned
-//          // now, so don't let this thread continue.
-//          throw err;
-//        }
-//        catch(Throwable t) {
-//          SystemFailure.checkFailure(); // GemStoneAddition
-//            t.printStackTrace();
-//            //trace here
-//            throw new CannotConnectException(t, "Error in creating connection using provided properties ");
-//        }
-//    }// end of get conn..
-//
-//
-//    /**
-//     * Method is used for closing created connection.
-//     * Pooling is not implemented currently, but will be made available
-//     * as soon as this manager uses large number of transactions
-//     * @param conn
-//     */
-//    private void closeConnection(Connection conn) {
-//        try {
-//            if(conn != null) {
-//                conn.close();
-//                conn=null;
-//            }
-//        }
-//        catch (VirtualMachineError err) { // GemStoneAddition
-//          SystemFailure.initiateFailure(err);
-//          // If this ever returns, rethrow the error.  We're poisoned
-//          // now, so don't let this thread continue.
-//          throw err;
-//        }
-//        catch(Throwable t) {
-//          SystemFailure.checkFailure(); // GemStoneAddition
-//            //trace here
-//            conn=null;
-//        }
-//    }// end of closeConn
-//
-//
-//    /**
-//     * Used to create table provided the DB instance
-//     * @exception CannotCreateSchemaException
-//     * @exception CannotConnectException
-//     */
-//    private void createDBTables() throws CannotCreateSchemaException, CannotConnectException {
-//        Connection conn=this.getConnection();
-//        Statement stat=null;
-//        try {
-//            stat=conn.createStatement();
-//        }
-//        catch(Exception e) {
-//            //trace here..
-//            e.printStackTrace();
-//            throw new CannotConnectException(e, "there was an error in creating statements for persisting data using created connection");
-//        }
-//        try {
-//            /*ResultSet set=*/stat.executeQuery("select * from replhashmap");
-//        }
-//        catch (VirtualMachineError err) { // GemStoneAddition
-//          SystemFailure.initiateFailure(err);
-//          // If this ever returns, rethrow the error.  We're poisoned
-//          // now, so don't let this thread continue.
-//          throw err;
-//        }
-//        catch(Throwable t) {
-//          SystemFailure.checkFailure(); // GemStoneAddition
-//            t.printStackTrace();
-//            //use connection to create new statement
-//            addSchemaToDB(conn);
-//        }// end of out throwable..
-//    }// end of method..
-//
-//
-//    /**
-//     * used to create required table within the DB
-//     * @param conn
-//     * @exception CannotCreateSchemaException
-//     */
-//    private void addSchemaToDB(Connection conn) throws CannotCreateSchemaException {
-//        Statement stat=null;
-////        Statement stat2=null;
-//        try {
-//
-//            stat=conn.createStatement();
-//            log.error(JGroupsStrings.DBPersistenceManager_EXECUTING_QUERY_FOR_ORACLE__0, createTable);
-//// GemStoneAddition - this line commented out due to warnings from Veracode about possible SQL injection attacks
-//            //            stat.executeQuery(createTable);
-//            throw new UnsupportedOperationException("this functionality removed due to possibility of SQL injection attacks");
-//        }
-//        catch (VirtualMachineError err) { // GemStoneAddition
-//          SystemFailure.initiateFailure(err);
-//          // If this ever returns, rethrow the error.  We're poisoned
-//          // now, so don't let this thread continue.
-//          throw err;
-//        }
-//        catch(Throwable t) {
-//          SystemFailure.checkFailure(); // GemStoneAddition
-//            t.printStackTrace();
-//            // trace here
-//            throw new CannotCreateSchemaException(t, "error was using schema with blobs");
-//        }// end of catch
-//
-//                // clean up is required after init
-//        finally {
-//            try {
-//                if(stat != null) stat.close();
-//                this.closeConnection(conn);
-//            }
-//            catch (VirtualMachineError err) { // GemStoneAddition
-//              SystemFailure.initiateFailure(err);
-//              // If this ever returns, rethrow the error.  We're poisoned
-//              // now, so don't let this thread continue.
-//              throw err;
-//            }
-//            catch(Throwable t3) {
-//              SystemFailure.checkFailure(); // GemStoneAddition
-//            }
-//        }// end of finally..
-//    }// end of gen schema..
-//
-//    private Properties props=null;
-//    private String driverName=null;
-//    private String userName=null;
-//    private String userPass=null;
-//    private String connStr=null;
-//    private String createTable=null;
-////    private final boolean oracleDB=false;
-//    private Vector list=null;
-//
-//
-////    private static final String tabName="replhashmap";
-//    private static final String insertStat="insert into replhashmap(key, keyBin, valBin) values  (?, ?, ?)";
-//    private static final String updateStat="update replhashmap set keyBin = ?, valBin = ? where key like ?";
-//    private static final String removeStat=" delete from replhashmap where key like ?";
-////    private static final String createTableGen=" create table replhashmap(key varchar, keyBin varbinary, valBin varbinary)";
-////    private static final String createTableOra=" create table replhashmap ( key varchar2(100), keyBin blob, valBin blob)";
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/FilePersistenceManager.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/FilePersistenceManager.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/FilePersistenceManager.java
deleted file mode 100644
index 6ceb2c5..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/FilePersistenceManager.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/** Notice of modification as required by the LGPL
- *  This file was modified by Gemstone Systems Inc. on
- *  $Date$
- **/
-package  com.gemstone.org.jgroups.persistence;
-
-/**
- * @author Mandar Shinde
- * The class implements the PersistenceManager interface and provides users
- * a file based implementation when required.
- * The state of this class is current NOOP. Implementation will be in place 
- * once a better structure for file based properties will be designed.
- */
-
-
-import java.io.*;
-import java.util.*;
-
-public class FilePersistenceManager implements PersistenceManager
-{
-    private final File file;
-
-    /**
-     * Default constructor
-     */
-    public FilePersistenceManager(String propertiesFilename)
-        throws Exception
-    {
-        Properties properties = new Properties();
-        properties.load(new FileInputStream(propertiesFilename));
-        String path = properties.getProperty(PersistenceFactory.persistProp);
-        file = new File(path);
-        if (!file.createNewFile()) {
-          throw new IOException("Unable to create file " + file.getAbsolutePath()); // GemStoneAddition
-        }
-    }
-
-    /**
-     * Save new NV pair as serializable objects or if already exist; store 
-     * new state 
-     */
-    public void save(Serializable key, Serializable val) throws CannotPersistException
-    {
-        try
-        {
-            Map map = retrieveAll();
-            map.put(key, val);
-            saveAll(map);
-        }
-        catch (CannotRetrieveException e)
-        {
-            throw new CannotPersistException(e, "Unable to pre-load existing store.");
-        }
-    }
-
-    /**
-     * Remove existing NV from being persisted
-     */
-    public Serializable  remove(Serializable key) throws CannotRemoveException
-    {
-        Object o;
-        try
-        {
-            Map map = retrieveAll();
-            o = map.remove(key);
-            saveAll(map);
-        }
-        catch (CannotRetrieveException e)
-        {
-            throw new CannotRemoveException(e, "Unable to pre-load existing store.");
-        }
-        catch (CannotPersistException e)
-        {
-            throw new CannotRemoveException(e, "Unable to pre-load existing store.");
-        }
-        return (Serializable) o;
-    }
-
-
-    /**
-     * Use to store a complete map into persistent state
-     * @exception CannotPersistException;
-     */
-    public void saveAll(Map map) throws CannotPersistException
-    {
-        try
-        {
-            OutputStream fos = new FileOutputStream(file);
-            Properties prop = new Properties();
-            // NB: For some reason Properties.putAll(map) doesn't seem to work - dimc@users.sourceforge.net
-            for (Iterator iterator = map.entrySet().iterator(); iterator.hasNext();)
-            {
-                Map.Entry entry = (Map.Entry) iterator.next();
-                prop.setProperty(entry.getKey().toString(), entry.getValue().toString());
-            }
-            prop.store(fos, null);
-            fos.flush();
-            fos.close();
-        }
-        catch (IOException e)
-        {
-            throw new CannotPersistException(e, "Cannot save to: " + file.getAbsolutePath());
-        }
-    }
-
-
-    /**
-     * Gives back the Map in last known state
-     * @return Map;
-     * @exception CannotRetrieveException;
-     */
-    public Map retrieveAll() throws CannotRetrieveException
-    {
-        try
-        {
-            Properties prop = new Properties();
-            FileInputStream fis = new FileInputStream(file);
-            prop.load(fis);
-            fis.close();
-            return filterLoadedValues(prop);
-        }
-        catch (IOException e)
-        {
-            throw new CannotRetrieveException(e, "Unable to load from file: " + file.getAbsolutePath());
-        }
-    }
-
-    /**
-     * Turns the values into Floats to enable
-     * <code>com.gemstone.org.jgroups.demos.DistributedHashtableDemo</code> to work. 
-     * Subclasses should override this method to convert the incoming map
-     * of string/string key/value pairs into the types they want.  
-     * @param in
-     * @return Map
-     */
-    protected Map filterLoadedValues(Map in)
-    {
-        Map out = new HashMap();
-        for (Iterator iterator = in.entrySet().iterator(); iterator.hasNext();)
-        {
-            Map.Entry entry = (Map.Entry) iterator.next();
-            out.put(entry.getKey().toString(), Float.valueOf(entry.getValue().toString()));
-        }
-        return out;
-    }
-
-
-    /**
-     * Clears the complete NV state from the DB
-     * @exception CannotRemoveException;
-     x*/
-    public void clear() throws CannotRemoveException
-    {
-        try
-        {
-            saveAll(Collections.EMPTY_MAP);
-        }
-        catch (CannotPersistException e)
-        {
-            throw new CannotRemoveException(e, "Unable to clear map.");
-        }
-    }
-
-
-    /**
-     * Used to handle shutdown call the PersistenceManager implementation. 
-     * Persistent engines can leave this implementation empty.
-     */
-    public void shutDown()
-    {
-	return;
-    }
-}// end of class

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/PersistenceFactory.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/PersistenceFactory.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/PersistenceFactory.java
deleted file mode 100644
index 369e9f2..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/PersistenceFactory.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/** Notice of modification as required by the LGPL
- *  This file was modified by Gemstone Systems Inc. on
- *  $Date$
- **/
-package com.gemstone.org.jgroups.persistence;
-
-/**
- * @author Mandar Shinde
- * This class is the factory to get access to any DB based or file based
- * implementation. None of the implementations should expose directly
- * to user for migration purposes
- */
-
-
-import com.gemstone.org.jgroups.util.GemFireTracer;
-import com.gemstone.org.jgroups.util.ExternalStrings;
-import com.gemstone.org.jgroups.util.Util;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.util.Properties;
-
-@SuppressFBWarnings(value="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD",justification="GemFire doesn't use this class")
-public class PersistenceFactory
-  {
-
-    protected final static GemFireTracer log=GemFireTracer.getLog(PersistenceFactory.class);
-
-    /**
-     * Default private constructor// does nothing
-     */
-    private PersistenceFactory()
-    {
-    }
-
-
-    /**
-     * Singular public method to get access to any of the Persistence
-     * Manager implementations. It is important to known at this point
-     * that properties determine the implementation of the Persistence
-     * Manager, there is no direct interface which gives access to 
-     * either DB implemented ot FILE implemented storage API.
-     * @return PersistenceFactory;
-     */
-    public static PersistenceFactory getInstance() {
-        log.error(ExternalStrings.PersistenceFactory_GETTING_FACTORY_INSTANCE);
-        if (_factory == null)
-            _factory = new PersistenceFactory();
-        return _factory;
-    }
-
-    /**
-     * Register a custom persistence manager as opposed to the
-     * {@link FilePersistenceManager} or {@link DBPersistenceManager}.
-     */ 
-    public synchronized void registerManager(PersistenceManager manager)
-    {
-        _manager = manager;
-    }
-
-    /**
-     * Reads the default properties and creates a persistencemanager
-     * The default properties are picked up from the $USER_HOME or 
-     * from the classpath. Default properties are represented by
-     * "persist.properties"
-     * @return PersistenceManager
-     * @exception Exception;
-     */ 
-    public synchronized PersistenceManager createManager() throws Exception {
-        // will return null if not initialized
-        // uses default properties
-        if (_manager == null)
-        {
-            if (checkDB())
-                _manager = createManagerDB(propPath);
-            else
-                _manager = createManagerFile(propPath);
-        }
-        return _manager;
-    }
-
-
-    /**
-     * Duplicated signature to create PersistenceManager to allow user to
-     * provide property path. 
-     * @param filePath complete pathname to get the properties
-     * @return PersistenceManager;
-     * @exception Exception;
-     */
-    public synchronized PersistenceManager createManager (String filePath) throws Exception 
-    {
-        if (_manager == null)
-        {
-            if (checkDB(filePath))
-                _manager = createManagerDB(filePath);
-            else
-                _manager = createManagerFile(filePath);
-        }
-        return _manager;
-    }
-
-
-
-    /**
-     * Internal creator of DB persistence manager, the outside user accesses only
-     * the PersistenceManager interface API
-     */
-    private PersistenceManager createManagerDB(String filePath) throws Exception
-    {
-
-            if(log.isInfoEnabled()) log.info(ExternalStrings.PersistenceFactory_CALLING_DB_PERSIST_FROM_FACTORY__0, filePath);
-        if (_manager == null)
-            _manager = new DBPersistenceManager(filePath);
-        return _manager;
-    }// end of DB persistence
-
-    /**
-     * creates instance of file based persistency manager
-     * @return PersistenceManager
-     */
-    private PersistenceManager createManagerFile(String filePath)
-    {
-
-            if(log.isInfoEnabled()) log.info(ExternalStrings.PersistenceFactory_CREATING_FILE_MANAGER__0, filePath);
-        Properties props;
-
-        try
-        {
-            if (_manager == null)
-            {
-                props=readProps(filePath);
-                String classname=props.getProperty(filePersistMgr);
-                if(classname != null)
-                {
-                    Class cl=Util.loadClass(classname, this.getClass());
-                    Constructor ctor=cl.getConstructor(new Class[]{String.class});
-                    _manager=(PersistenceManager)ctor.newInstance(new Object[]{filePath});
-                }
-                else
-                {
-                    _manager = new FilePersistenceManager(filePath);
-                }
-            }
-            return _manager;
-        }
-        catch (Exception t)
-        {
-            t.printStackTrace();
-            return null;
-        }
-    }// end of file persistence
-    
-
-    /**
-     * checks the default properties for DB/File flag
-     * @return boolean;
-     * @exception Exception;
-     */
-    private boolean checkDB() throws Exception
-    {
-        Properties props=readProps(propPath);
-        String persist = props.getProperty(persistProp);
-        if ("DB".equals(persist))
-            return true;
-        return false;
-    }
-
-
-
-
-    /**
-     * checks the provided properties for DB/File flag
-     * @return boolean;
-     */
-    private boolean checkDB(String filePath) throws Exception
-    {
-        Properties props=readProps(filePath);
-        String persist = props.getProperty(persistProp);
-        if ("DB".equals(persist))
-            return true;
-        return false;
-    }
-
-
-    Properties readProps(String fileName) throws IOException
-    {
-        Properties props;
-        FileInputStream _stream = new FileInputStream(fileName);
-        props=new Properties();
-        props.load(_stream);
-        return props;
-    }
-
-    private static PersistenceManager _manager = null;
-    private static PersistenceFactory _factory = null;
-   
-
-    /* Please set this according to configuration */
-    final static String propPath = "persist.properties";
-    final static String persistProp = "persist";
-
-    /** The class that implements a file-based PersistenceManager */
-    final static String filePersistMgr="filePersistMgr";
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/PersistenceManager.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/PersistenceManager.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/PersistenceManager.java
deleted file mode 100644
index 60e3071..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/PersistenceManager.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/** Notice of modification as required by the LGPL
- *  This file was modified by Gemstone Systems Inc. on
- *  $Date$
- **/
-package com.gemstone.org.jgroups.persistence;
-
-/**
- * @author Mandar Shinde
- * This interface defines the interface that needs to be implemented to
- * persist any Map(Serializable) object. Primary usage would be users who
- * need to store the state of a given NV for fault tolerance.
- */
-
-
-import java.io.Serializable;
-import java.util.Map;
-
-
-public interface PersistenceManager
-{
-
-    /**
-     * Save new NV pair as serializable objects or if already exist; store 
-     * new state 
-     * @param key
-     * @param val
-     * @exception CannotPersistException; 
-     */
-    void save(Serializable key, Serializable val) throws CannotPersistException;
-
-    /**
-     * Remove existing NV from being persisted
-     * @param key value
-     * @return Serializable; gives back the value
-     * @exception CannotRemoveException;
-     */
-    Serializable  remove(Serializable key) throws CannotRemoveException;
-
-
-    /**
-     * Use to store a complete map into persistent state
-     * @param map
-     * @exception CannotPersistException;
-     */
-    void saveAll(Map map) throws CannotPersistException;
-
-    
-    /**
-     * Gives back the Map in last known state
-     * @return Map;
-     * @exception CannotRetrieveException;
-     */
-    Map retrieveAll() throws CannotRetrieveException;
-
-
-    /**
-     * Clears the complete NV state from the DB
-     * @exception CannotRemoveException;
-     */
-    void clear() throws CannotRemoveException;
-
-
-    /**
-     * Used to handle shutdown call the PersistenceManager implementation. 
-     * Persistent engines can leave this implementation empty.
-     */
-    void shutDown();
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/package.html
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/package.html b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/package.html
deleted file mode 100644
index 6b8e414..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/persistence/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<HTML>
-	<BODY>
-		Provides features for storing information to a database or file.
-	</BODY>
-</HTML>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/primarychanges.txt
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/primarychanges.txt b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/primarychanges.txt
deleted file mode 100644
index b616145..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/primarychanges.txt
+++ /dev/null
@@ -1,80 +0,0 @@
-Here are some of the larger Jgroups issues addressed by GemStone:
-
-1) concurrent programming errors
-  * lack of use of volatile or synchronization in many places
-  * removal of (thread != null && thread.isAlive()) anitpattern
-  * notify/wait races, especially in PingSender/PingWaiter during discovery
-  * lack of interrupt handling (inability to forcibly shut down the stack)
-
-2) discovery problems, primarily in pbcast.ClientGMSImpl.join(), but also
-   in PingWaiter response collection.  These usually lead to the formation
-   of multiple subgroups when there are large numbers of new members joining.
-
-3) failure to contact GossipServer during startup must disallow start of stack
-
-4) race condition between GossipServer.getmbrs and GossipServer.join
-   (atomicity of join operation)
-
-5) lack of SSL support in GossipServer/GossipClient
-
-6) GossipServer restart can cause discovery problems - should persist state
-   and attempt recovery from other servers
-
-7) NIC failure in client can cause GossipServer to hang
-
-8) UNICAST is far too slow, requiring context switches to receive an ACK
-   (added new DirAck protocol).  There were also race conditions in UNICAST
-   handling of messages from new or departed members.  These changes were
-   given to the JGroups dev group.
-
-9) FC (flow control) protocol is subject to hangs, has skewed perception of
-   debt
-
-10) too many threads in stack, requiring context switches (stack configuration)
-
-11) too many clock probes, causing user/kernel delays
-
-12) a member that is kicked out of the group fails to realize the fact,
-    leading to hang
-
-13) delivery of messages to application is too slow (added Receiver interface
-    and contributed this to the jgroups dev group)
-
-14) FD failure detection prone to false positives when stack isn't being used
-    much
-
-15) FD_SOCK failure detection should have controlled shutdown protocol
-    (solution contributed to jgroups dev group)
-
-16) jgroups shutdown does not stop timer thread (thread leak)
-
-17) jgroups threads missing last-chance exception handlers (solution contributed
-    to jgroups dev group)
-
-18) jgroups does not handle out-of-memory (being addressed in GemFire Fraser
-    release)
-
-19) In the FD protocol, a member that is not in the group should not be able
-    to suspect a member that is in the group
-
-20) mixed use of FD/FD_SOCK should raise an alert
-
-21) record statistics on JGroups stack performance for customer support
-    analysis
-
-22) view management thread should allow multiple join/leave in one view
-    change (this has also been addressed by the JGroups dev group)
-
-23) need ability to find a random available port for automated testing
-
-24) JGroups payload serialization is too slow (tie in GemFire DataSerializable
-    support)
-
-25) FRAG/FRAG2 protocols subject to race conditions at startup, may hold onto
-    fragments that are never delivered to applications.  Similar problem in
-    UNICAST.
-
-26) FD_SOCK should have a faster failure mode when socket connections are broken
-
-27) jgroups stack startup is too slow (xml parsing)
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/protocols/AUTH.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/protocols/AUTH.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/protocols/AUTH.java
deleted file mode 100644
index cc31e17..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/protocols/AUTH.java
+++ /dev/null
@@ -1,438 +0,0 @@
-package com.gemstone.org.jgroups.protocols;
-
-import java.io.Serializable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-import com.gemstone.org.jgroups.Address;
-import com.gemstone.org.jgroups.Event;
-import com.gemstone.org.jgroups.Message;
-import com.gemstone.org.jgroups.View;
-import com.gemstone.org.jgroups.ViewId;
-import com.gemstone.org.jgroups.protocols.pbcast.GMS;
-import com.gemstone.org.jgroups.protocols.pbcast.JoinRsp;
-import com.gemstone.org.jgroups.stack.IpAddress;
-import com.gemstone.org.jgroups.stack.Protocol;
-import com.gemstone.org.jgroups.util.ExternalStrings;
-import com.gemstone.org.jgroups.util.GFLogWriter;
-
-/**
- * 
- * AUTH is used to provide a layer of authentication to JGroups, to prevent
- * random members from joining a group. Members have to pass authentication to
- * join a group, otherwise they will be rejected.
- * 
- * This allows you to define pluggable security that defines if a node should be
- * allowed to join a group. AUTH sits below the GMS protocol and listens for
- * JOIN REQUEST messages. When a JOIN REQUEST is received it tries to find an
- * <code>AuthHeader</code> object, to obtain credentials of a joiner VM.
- * 
- * When authentication is successful, the message is simply passed up the stack
- * to the GMS protocol. When it fails, the AUTH protocol creates a JOIN RESPONSE
- * message with a failure string and passes it back down the stack. This failure
- * string informs the client of the reason for failure. Clients will then fail
- * to join the group and will throw a
- * <code> AuthenticationFailedException</code>. If this error string is null
- * then authentication is considered to have passed.
- * 
- * This allows pluggable authentication mechanisms, abstracted from the core of
- * JGroups, to be configured to secure and lock down who can join a group.
- * 
- * 
- * @author Yogesh Mahajan
- * @since 5.5
- */
-public class AUTH extends Protocol {
-
-  /** Name of the protocol */
-  public static final String name = "AUTH";
-
-  /** Flag to indicate a join request */
-  private static final int JOIN_REQ_MSG = 1;
-
-  /** Flag to indicate a new VIEW message */
-  private static final int VIEW_MSG = 2;
-
-  /** Flag to indicate a VIEW_SYNC message */
-  private static final int VIEW_SYNC_MSG = 3;
-
-  /** Flag to indicate a VIEW_CHANGE event */
-  private static final int VIEW_CHANGE_EVT = 4;
-
-  /** Flag to indicate a SET_LOCAL_ADDRESS event */
-  private static final int SET_LOCAL_ADDRESS_EVT = 5;
-
-  /** Address of this host */
-  Address local_addr = null;
-  
-  /** guards view processing */
-  private final Object viewLock = new Object();
-  
-  /** current view ID, guarded by viewLock */
-  private ViewId vid;
-
-  /**
-   * Checks the auth header. When the header authenticated successfully, it just
-   * passes up the join request and pbcast.GMS will accept the join and sends
-   * the header GMS.GmsHeader.JOIN_RSP containing a pbcast.JoinRsp back.
-   * 
-   * When the authentication is not successful the AUTH protocol answers the
-   * GMS.GmsHeader.JOIN_REQ itself and sends back a GMS.GmsHeader.JOIN_RSP
-   * containing a pbcast.JoinRsp object with an error message.
-   */
-  @Override
-  public void up(Event evt) {
-
-    String authenticator = System
-        .getProperty("gemfire.sys." // DistributionConfigImpl.SECURITY_SYSTEM_PREFIX
-            +  "security-peer-authenticator"); //DistributionConfig.SECURITY_PEER_AUTHENTICATOR_NAME);
-    boolean isSecure = (authenticator != null && authenticator.length() != 0);
-    if (isSecure) {
-      String failMsg = null;
-      int hdrType = getHeaderType(evt);
-      String msgType = null;
-      Message msg = null;
-      AuthHeader authHeader = null;
-      switch (hdrType) {
-        case JOIN_REQ_MSG:
-          msgType = "JOIN_REQ";
-          msg = (Message)evt.getArg();
-          authHeader = (AuthHeader)msg.getHeader(AUTH.name);
-          failMsg = verifyCredentials(authenticator,
-              authHeader != null ? authHeader.getCredentials() : null, msg
-                  .getSrc(), msgType + " message");
-          break;
-          
-        case VIEW_MSG:
-          msgType = "VIEW";
-          msg = (Message)evt.getArg();
-          // ignore the view if its got an old lamport time
-          View gview = msg.getObject();
-          synchronized(viewLock) {
-            if (vid != null && vid.compareTo(gview.getVid()) >= 0) {
-              break;
-            }
-          }
-          authHeader = (AuthHeader)msg.getHeader(AUTH.name);
-          failMsg = verifyCredentials(authenticator,
-              authHeader != null ? authHeader.getCredentials() : null, msg
-                  .getSrc(), msgType + " message");
-          break;
-          
-        case VIEW_SYNC_MSG:
-          msgType = "VIEW_SYNC";
-          msg = (Message)evt.getArg();
-          View v = msg.getObject();
-          // ignore the view if its got an old lamport time
-          synchronized(viewLock) {
-            if (vid != null && vid.compare(v.getVid()) >= 0) {
-              break;
-            }
-          }
-          authHeader = (AuthHeader)msg.getHeader(AUTH.name);
-          failMsg = verifyCredentials(authenticator,
-              authHeader != null ? authHeader.getCredentials() : null, msg
-                  .getSrc(), msgType + " message");
-          break;
-
-        case VIEW_CHANGE_EVT:
-          synchronized(viewLock) {
-            View newView = (View)evt.getArg();
-            vid = newView.getVid(); // save for later use
-            Properties credentials = (Properties)newView.getAdditionalData();
-            if (credentials == null) {
-              failMsg = ExternalStrings
-                        .AUTH_MISSING_CREDENTIALS_IN_MEMBERSHIP_VIEW_CHANGE
-                        .toLocalizedString();
-            }
-            else {
-              failMsg = verifyCredentials(authenticator, credentials, newView
-                  .getCreator(), "VIEW_CHANGE event");
-            }
-          }
-          break;
-
-        case SET_LOCAL_ADDRESS_EVT:
-          this.local_addr = (Address)evt.getArg();
-          break;
-      }
-      if (failMsg == null) {
-        passUp(evt);
-      }
-      else {
-        passDown(getFailureEvent(evt, failMsg, hdrType));
-      }
-    }
-    else { // non secure mode
-      passUp(evt);
-    }
-  }
-
-  /**
-   * When pbcast.GMS sends a join request (a GMS.GmsHeader.JOIN_REQ header) AUTH
-   * just places the credential for the authentication in its
-   * <code>AuthHeader</code>. The join message will be sent to the
-   * coordinator
-   */
-  @SuppressWarnings("fallthrough") // GemStoneAddition
-  @Override
-  public void down(Event evt) {
-
-    String authInit = System
-        .getProperty("gemfire.sys." // DistributionConfigImpl.SECURITY_SYSTEM_PREFIX
-            +  "security-peer-auth-init"); // DistributionConfig.SECURITY_PEER_AUTH_INIT_NAME);
-    boolean isSecure = (authInit != null && authInit.length() != 0);
-    if (isSecure) {
-      int hdrType = getHeaderType(evt);
-      GFLogWriter securityLogger = log.getSecurityLogWriter();
-      Properties credentials;
-      String msgType = null;
-      switch (hdrType) {
-        case JOIN_REQ_MSG:
-//          if (msgType == null) GemStoneAddition (can only be null) 
-          {
-            msgType = "JOIN_REQ";
-          }
-          // Fall through to perform the same processing as VIEW
-        // FALL THRU (GemStoneAddition)
-        case VIEW_MSG:
-          if (msgType == null) {
-            msgType = "VIEW";
-          }
-          // Fall through to perform the same processing as VIEW_SYNC
-        // FALL THRU (GemStoneAddition)
-        case VIEW_SYNC_MSG:
-          if (msgType == null) {
-            msgType = "VIEW_SYNC";
-          }
-          // found a join or view request message - now add an AUTH Header
-          Message msg = (Message)evt.getArg();
-          // create a new AuthHeader to store the credentials
-          AuthHeader authHeader = new AuthHeader();
-          credentials = getCredentials(authInit, msg.getDest(), msgType
-              + " message");
-          if (credentials != null) {
-            try {
-              authHeader.setCredentials(credentials);
-            }
-            catch (IllegalArgumentException e) {
-              securityLogger.severe(
-                ExternalStrings.AUTH_SECURITY_CREDENTIALS_ARE_TOO_LARGE_TO_TRANSMIT_0, e);
-            }
-            // Add AuthHeader to the msg
-            msg.putHeader(AUTH.name, authHeader);
-            // successful put AuthHeader
-          }
-          break;
-
-        case VIEW_CHANGE_EVT:
-          synchronized(viewLock) {
-            View v = (View)evt.getArg();
-            vid = v.getVid(); // save the Lamport time-stamp for later use
-            credentials = getCredentials(authInit, v.getVid().getCoordAddress(),
-                "VIEW_CHANGE message");
-            try {
-              v.setAdditionalData(credentials);
-            }
-            catch (IllegalArgumentException e) {
-              securityLogger
-                  .severe(ExternalStrings
-                          .AUTH_CREDENTIALS_TOO_LARGE_TO_TRANSMIT_0, 
-                          e.getLocalizedMessage());
-            }
-          }
-          break;
-      }
-    }
-    passDown(evt);
-  }
-
-  @Override
-  public final String getName() {
-    return AUTH.name;
-  }
-
-  /**
-   * Filter the security properties from java properties removing the leading
-   * {@link DistributionConfigImpl#SECURITY_SYSTEM_PREFIX} from them.
-   * 
-   * @return the security properties from the java properties
-   */
-  private Properties getSecurityProperties() {
-
-    Properties props = (Properties)System.getProperties().clone(); // for bug 46822
-    Properties securityProps = new Properties();
-    final String secPrefix =  "gemfire.sys.security-";
-    Iterator propIter = props.entrySet().iterator();
-    while (propIter.hasNext()) {
-      Map.Entry propEntry = (Map.Entry)propIter.next();
-      String propKey = (String)propEntry.getKey();
-      if (propKey.startsWith(secPrefix)) {
-        securityProps.setProperty(propKey
-            .substring("gemfire.sys.".length()),
-            (String)propEntry.getValue());
-      }
-    }
-    return securityProps;
-  }
-
-  /**
-   * Obtain the credentials using the provided AuthInitialize method.
-   * 
-   * @return credentials using the provided AuthInitialized method or null in
-   *         case of failure
-   */
-  private Properties getCredentials(String authInitMethod, Address dest,
-      String eventStr) {
-
-    Properties credentials = null;
-    Properties secProps = getSecurityProperties();
-    GFLogWriter securityLogWriter = log.getSecurityLogWriter();
-    try {
-      credentials = stack.gfPeerFunctions.getCredentials(authInitMethod, secProps,
-          dest, true, log.getLogWriter(),
-          securityLogWriter);
-    }
-    catch (Exception ex) {
-      securityLogWriter.warning(
-        ExternalStrings.AUTH_FAILED_TO_OBTAIN_CREDENTIALS_IN_0_USING_AUTHINITIALIZE_1_2,
-        new Object[] {eventStr, authInitMethod, ex.getLocalizedMessage()});
-    }
-    return credentials;
-  }
-
-  /**
-   * Check the credentials and return a failure message if invalid.
-   * 
-   * @return failure message if credentials could not be verified; null if valid
-   *         credentials
-   */
-  private String verifyCredentials(String authenticator,
-      Properties credentials, Address src, String eventStr) {
-
-    String failMsg = null;
-    GFLogWriter securityLogWriter = log.getSecurityLogWriter();
-    if (credentials != null) {
-      // Now we have the credentials we need to validate it
-      try {
-          stack.gfPeerFunctions.verifyCredentials(authenticator, credentials,
-              getSecurityProperties(), log.getLogWriter(), 
-              securityLogWriter,
-              src);
-
-      }
-      catch (Exception ex) {
-        securityLogWriter.warning(
-          ExternalStrings.AUTH_AUTHENTICATION_FAILED_FOR_0_FROM_1_USING_AUTHENTICATOR_2_3,
-          new Object[] {eventStr, src, authenticator, ex.getLocalizedMessage()}, ex);
-          failMsg = ExternalStrings.AUTH_AUTHENTICATION_FAILED_FOR_0_SEE_COORDINATOR_1_LOGS_FOR_DETAILS.toLocalizedString(new Object[] {eventStr, this.local_addr});
-      }
-    }
-    else {
-      // No credentials - need to send failure message
-      securityLogWriter.warning(
-        ExternalStrings.AUTH_FAILED_TO_FIND_CREDENTIALS_IN_0_FROM_1_USING_AUTHENTICATOR_2,
-        new Object[] {eventStr, src, authenticator});
-      failMsg = ExternalStrings.AUTH_FAILED_TO_FIND_CREDENTIALS_IN_0_SEE_COORDINATOR_1_LOGS_FOR_DETAILS.toLocalizedString(new Object[] {eventStr, this.local_addr } );
-    }
-    return failMsg;
-  }
-
-  /**
-   * Used to return a header type for the event. Right now handles JOIN_REQ,
-   * VIEW, VIEW_SYNC messages and VIEW_CHANGE, SET_LOCAL_ADDRESS events.
-   * 
-   * @param evt
-   *                The event object passed in to AUTH
-   * @return The type of event object or -1 if the event is not handled.
-   */
-  private int getHeaderType(Event evt) {
-
-    switch (evt.getType()) {
-      case Event.MSG:
-        Message msg = (Message)evt.getArg();
-        VIEW_SYNC.ViewSyncHeader vsyncHdr = (VIEW_SYNC.ViewSyncHeader)msg
-            .getHeader(VIEW_SYNC.name);
-        if (vsyncHdr != null
-            && vsyncHdr.type == VIEW_SYNC.ViewSyncHeader.VIEW_SYNC) {
-          return VIEW_SYNC_MSG;
-        }
-        GMS.GmsHeader gmsHdr = (GMS.GmsHeader)msg.getHeader(GMS.name);
-        if (gmsHdr == null) {
-          return -1;
-        }
-        switch (gmsHdr.getType()) {
-          case GMS.GmsHeader.JOIN_REQ:
-            return JOIN_REQ_MSG;
-          case GMS.GmsHeader.VIEW:
-            return VIEW_MSG;
-          default:
-            return -1;
-        }
-
-      case Event.VIEW_CHANGE:
-        return VIEW_CHANGE_EVT;
-
-      case Event.SET_LOCAL_ADDRESS:
-        return SET_LOCAL_ADDRESS_EVT;
-    }
-    return -1;
-  }
-
-  /**
-   * Used to create failed JOIN_RSP and VIEW messages to pass back down the
-   * stack
-   * 
-   * @param evt
-   *                The source event
-   * @param message
-   *                The failure message to send back to the joiner
-   * @return An Event containing the failure message
-   */
-  private Event getFailureEvent(Event evt, String message, int hdrType) {
-
-    Address src = null;
-    View recvView;
-    GMS.GmsHeader gmsHeader = null;
-    Serializable messagePayload = null;
-    GFLogWriter securityLogger = log.getSecurityLogWriter();
-    switch (hdrType) {
-      case JOIN_REQ_MSG:
-        messagePayload = new JoinRsp(message);
-        gmsHeader = new GMS.GmsHeader(GMS.GmsHeader.JOIN_RSP);
-        src = ((Message)evt.getArg()).getSrc();
-        break;
-
-      case VIEW_MSG:
-        // Fall through since both VIEW and VIEW_SYNC send back the same
-        // VIEW_ACK message
-      case VIEW_SYNC_MSG:
-        Message recvMsg = (Message)evt.getArg();
-        recvView = recvMsg.getObject();
-        try {
-          recvView.setAdditionalData(message);
-        }
-        catch (IllegalArgumentException e) {
-          securityLogger.severe(ExternalStrings.AUTH_CREDENTIALS_TOO_LARGE_TO_TRANSMIT_0, e.getLocalizedMessage());
-        }
-        gmsHeader = new GMS.GmsHeader(GMS.GmsHeader.VIEW_ACK);
-        messagePayload = recvView;
-        src = recvMsg.getSrc();
-        break;
-
-      case VIEW_CHANGE_EVT:
-        recvView = (View)evt.getArg();
-        recvView.setAdditionalData(message);
-        gmsHeader = new GMS.GmsHeader(GMS.GmsHeader.VIEW_ACK);
-        messagePayload = recvView;
-        src = recvView.getCreator();
-        break;
-    }
-    Message msg = new Message(src, this.local_addr, null);
-    msg.putHeader(GMS.name, gmsHeader);
-    msg.setObject(messagePayload);
-    return new Event(Event.MSG, msg);
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/protocols/AUTOCONF.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/protocols/AUTOCONF.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/protocols/AUTOCONF.java
deleted file mode 100644
index 52a1b00..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/protocols/AUTOCONF.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/** Notice of modification as required by the LGPL
- *  This file was modified by Gemstone Systems Inc. on
- *  $Date$
- **/
-// $Id: AUTOCONF.java,v 1.15 2005/08/11 12:43:47 belaban Exp $
-
-package com.gemstone.org.jgroups.protocols;
-
-
-import com.gemstone.org.jgroups.Event;
-import com.gemstone.org.jgroups.stack.Protocol;
-import com.gemstone.org.jgroups.util.ExternalStrings;
-
-import java.io.IOException;
-import java.net.DatagramPacket;
-import java.net.DatagramSocket;
-import java.net.InetAddress;
-import java.util.HashMap;
-import java.util.Properties;
-
-
-/**
- * Senses the network configuration when it is initialized (in init()) and sends a CONFIG event up
- * and down the stack. The CONFIG event contains a hashmap, with strings as keys (e.g. "frag_size")
- * and Objects as values. Certain protocols can set some of their properties when receiving the CONFIG
- * event.
- * <p>
- * This protocol should be placed above the transport protocol (e.g. UDP). It is not needed for TCP.
- * <p>
- * Example: senses the network send and receive buffers, plus the max size of a message to be sent and
- * generates a CONFIG event containing "frag_size", "send_buf_size" and "receive_buf_size" keys.
- * 
- * @author Bela Ban
- */
-public class AUTOCONF extends Protocol  {
-    final HashMap config=new HashMap();
-    static int num_iterations=10; // to find optimal frag_size
-
-    /** Number of bytes to subtract from computed fragmentation size, due to (a) headers and
-     * (b) serialization overhead */
-    static int frag_overhead=1000;
-
-
-    @Override // GemStoneAddition
-    public String getName() {
-        return "AUTOCONF";
-    }
-
-
-    @Override // GemStoneAddition
-    public void init() throws Exception {
-        senseNetworkConfiguration();
-        if(log.isDebugEnabled()) log.debug("configuration is\n" + config);
-    }
-
-    @Override // GemStoneAddition
-    public void start() throws Exception {
-        if(config != null && config.size() > 0) {
-            Event config_evt=new Event(Event.CONFIG, config);
-            passDown(config_evt);
-            passUp(config_evt);
-        }
-    }
-
-
-    /**
-     * Setup the Protocol instance acording to the configuration string
-     */
-    @Override // GemStoneAddition
-    public boolean setProperties(Properties props) {
-        String str;
-
-        super.setProperties(props);
-        str=props.getProperty("num_iterations");
-        if(str != null) {
-            num_iterations=Integer.parseInt(str);
-            props.remove("num_iterations");
-        }
-
-        str=props.getProperty("frag_overhead");
-        if(str != null) {
-            frag_overhead=Integer.parseInt(str);
-            props.remove("frag_overhead");
-        }
-
-        if(props.size() > 0) {
-            log.error(ExternalStrings.AUTOCONF_AUTOCONFSETPROPERTIES_THE_FOLLOWING_PROPERTIES_ARE_NOT_RECOGNIZED__0, props);
-            return false;
-        }
-        return true;
-    }
-
-
-    /**
-     * Leave empty: no up_thread will be created, but the up_thread of the neighbor below us will be used
-     */
-    @Override // GemStoneAddition
-    public void startUpHandler() {
-    }
-
-    /**
-     * Leave empty: no down_thread will be created, but the down_thread of the neighbor above us will be used
-     */
-    @Override // GemStoneAddition
-    public void startDownHandler() {
-    }
-
-
-    /* -------------------------------------- Private metods ------------------------------------------- */
-    void senseNetworkConfiguration() {
-        int max_frag_size=senseMaxFragSize();
-        if(max_frag_size <= 0) {
-            if(log.isErrorEnabled()) log.error(ExternalStrings.AUTOCONF_MAX_FRAG_SIZE_IS_INVALID__0, max_frag_size);
-        }
-        else
-            config.put("frag_size", Integer.valueOf(max_frag_size));
-        senseMaxSendBufferSize(config);
-        senseMaxReceiveBufferSize(config);
-    }
-
-    public static int senseMaxFragSizeStatic() {
-        return new AUTOCONF().senseMaxFragSize();
-    }
-
-    /**
-     * Tries to find out the max number of bytes in a DatagramPacket we can send by sending increasingly
-     * larger packets, until there is an exception (e.g., java.io.IOException: message too long).
-     */
-    public int senseMaxFragSize() {
-        int max_send=32000;
-        int upper;
-        int lower=0;
-        int highest_failed=-1;
-        DatagramSocket sock;
-        byte[] buf;
-        DatagramPacket packet;
-        InetAddress local_addr;
-
-
-        try {
-            sock=new DatagramSocket();
-            local_addr=InetAddress.getLocalHost();
-        }
-        catch(Exception ex) {
-            if(warn) log.warn("failed creating DatagramSocket: " + ex);
-            return 0;
-        }
-
-        try {
-            upper=max_send;
-            for(int i=0; i < num_iterations && lower < upper; i++) { // iterations to approximate frag_size
-                try {
-                    buf=new byte[upper];
-                    // System.out.println("** upper=" + upper + " (lower=" + lower + ")");
-                    packet=new DatagramPacket(buf, buf.length, local_addr, 9);
-                    sock.send(packet);
-                    lower=Math.max(lower, upper);
-                    upper=upper * 2;
-                    if(highest_failed > -1)
-                        upper=Math.min(highest_failed, upper);
-                }
-                catch(IOException io_ex) {
-                    if(highest_failed > -1)
-                        highest_failed=Math.min(highest_failed, upper); // never exceed max_upper
-                    else
-                        highest_failed=upper;
-                    upper=(upper + lower) / 2;
-                }
-                catch(RuntimeException ex) {
-                    if(warn) log.warn("exception=" + ex);
-                    break;
-                }
-            }
-
-            /** Reduce the frag_size a bit to prevent packets that are too large (see bug #854887) */
-            lower-=frag_overhead;
-            if(log.isDebugEnabled()) log.debug("frag_size=" + lower);
-            return lower;
-        }
-        finally {
-            if(sock != null)
-                sock.close();
-        }
-    }
-
-
-    void senseMaxSendBufferSize(HashMap map) {
-        DatagramSocket sock;
-        int max_size=4096, retval=max_size;
-
-        if(map != null && map.containsKey("frag_size)"))
-            max_size=((Integer)map.get("frag_size")).intValue();
-
-        try {
-            sock=new DatagramSocket();
-            while(max_size < 1000000) {
-                sock.setSendBufferSize(max_size);
-                if((retval=sock.getSendBufferSize()) < max_size)
-                    return;
-                max_size*=2;
-            }
-        }
-        catch (VirtualMachineError err) { // GemStoneAddition
-          // If this ever returns, rethrow the error.  We're poisoned
-          // now, so don't let this thread continue.
-          throw err;
-        }
-        catch(Throwable ex) {
-            if(log.isErrorEnabled()) log.error("failed getting the max send buffer size: " + ex +
-                    ". Defaulting to " + retval);
-        }
-        finally {
-            map.put("send_buf_size", Integer.valueOf(retval));
-        }
-    }
-
-
-
-    void senseMaxReceiveBufferSize(HashMap map) {
-        DatagramSocket sock;
-        int max_size=4096, retval=max_size;
-
-        try {
-            sock=new DatagramSocket();
-            while(max_size < 1000000) {
-                sock.setReceiveBufferSize(max_size);
-                if((retval=sock.getReceiveBufferSize()) < max_size)
-                    return;
-                max_size*=2;
-            }
-        }
-        catch(Exception ex) {
-            if(log.isErrorEnabled()) log.error("failed getting the max send buffer size: " + ex +
-                    ". Defaulting to " + retval);
-        }
-        finally {
-            map.put("recv_buf_size", Integer.valueOf(retval));
-        }
-    }
-
-
-    /* ----------------------------------- End of Private metods --------------------------------------- */
-
-//    public static void main(String[] args) {
-//        int frag_size=new AUTOCONF().senseMaxFragSize();
-//        System.out.println("frag_size: " + frag_size);
-//    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8b2ea77d/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/protocols/AuthHeader.java
----------------------------------------------------------------------
diff --git a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/protocols/AuthHeader.java b/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/protocols/AuthHeader.java
deleted file mode 100755
index cf36f6a..0000000
--- a/gemfire-jgroups/src/main/java/com/gemstone/org/jgroups/protocols/AuthHeader.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/** Notice of modification as required by the LGPL
- *  This file was modified by Gemstone Systems Inc. on
- *  $Date$
- **/
-package com.gemstone.org.jgroups.protocols;
-
-import java.io.*;
-import java.util.Properties;
-
-import com.gemstone.org.jgroups.Header;
-import com.gemstone.org.jgroups.JChannel;
-import com.gemstone.org.jgroups.util.ExternalStrings;
-import com.gemstone.org.jgroups.util.Streamable;
-
-/**
- * 
- * AuthHeader stores credentials of a joiner vm to pass it to the coordinator
- * 
- * @author Yogesh Mahajan
- * @since 5.5
- * 
- */
-public class AuthHeader extends Header implements Streamable {
-
-  private static final long serialVersionUID = 1L;
-
-  private byte[] credentials = null;
-
-  public static final String USER_NAME = "security-username";
-
-  public static final String PASSWORD = "security-password";
-  
-//  public static int MAX_CREDENTIAL_SIZE = 50000;
-
-  public void readFrom(DataInputStream in) throws IOException,
-      IllegalAccessException, InstantiationException {
-    try {
-      this.credentials = JChannel.getGfFunctions().readByteArray(in);
-    }
-    catch (Exception ex) {
-      this.credentials = new byte[1];
-    }
-  }
-
-  public void writeTo(DataOutputStream out) throws IOException {
-    if (this.credentials == null) {
-      this.credentials = new byte[1];
-    }
-    JChannel.getGfFunctions().writeByteArray(this.credentials, out);
-  }
-
-  public void readExternal(ObjectInput in) throws IOException,
-      ClassNotFoundException {
-    this.credentials = JChannel.getGfFunctions().readByteArray(in);
-  }
-
-  public void writeExternal(ObjectOutput out) throws IOException {
-    JChannel.getGfFunctions().writeByteArray(this.credentials, out);
-  }
-
-  public void setCredentials(Properties credentials) {
-    try {
-      ByteArrayOutputStream bas = new ByteArrayOutputStream(10000);
-      ObjectOutputStream oos = new ObjectOutputStream(bas);
-      JChannel.getGfFunctions().writeProperties(credentials, oos);
-//      if( bas.size() > MAX_CREDENTIAL_SIZE) {
-//          throw new IllegalArgumentException(
-//            JGroupsStrings.AuthHeader_SERIALIZED_CREDENTIAL_SIZE_0_EXCEEDS_MAXIMUM_OF_1.toLocalizedString(new Object[] {Integer.valueOf(bas.size()), Integer.valueOf(MAX_CREDENTIAL_SIZE) }));
-//      }
-      oos.flush();
-      this.credentials = bas.toByteArray();
-      
-    }
-    catch (IOException e) {
-        // ignore - this will happen again when the view is serialized
-        // for transmission
-    }
-  }
-
-  public Properties getCredentials() {
-    Properties retProp = new Properties();
-    try {
-      ByteArrayInputStream bas = new ByteArrayInputStream(credentials);
-      ObjectInputStream ois = new ObjectInputStream(bas);
-      retProp = JChannel.getGfFunctions().readProperties(ois);
-    }
-    catch (ClassNotFoundException e) {
-    	
-    }
-    catch (IOException e) {
-      // ignore - instead return properties with zero size
-      // security properties are optional, if expected in
-      // the other end anyway connectivity will fail.
-    }
-    return retProp;
-  }
-
-  @Override // GemStoneAddition
-  public long size(short version) {
-      return this.credentials==null? 0 : this.credentials.length;
-  }
-
-  @Override // GemStoneAddition
-  public String toString() {
-    return "[AuthHeader : " + getCredentials() + "]";
-  }
-
-}


Mime
View raw message