From: <jbo...@li...> - 2006-07-10 19:02:07
|
Author: estebanschifman Date: 2006-07-10 15:02:01 -0400 (Mon, 10 Jul 2006) New Revision: 4973 Removed: labs/jbossesb/trunk/ESBCore/common/src/org/jboss/soa/esb/helpers/persist/AbstractBobjStore.java Log: Remove unnecessary references to internal objects used in the object store Deleted: labs/jbossesb/trunk/ESBCore/common/src/org/jboss/soa/esb/helpers/persist/AbstractBobjStore.java =================================================================== --- labs/jbossesb/trunk/ESBCore/common/src/org/jboss/soa/esb/helpers/persist/AbstractBobjStore.java 2006-07-10 18:27:02 UTC (rev 4972) +++ labs/jbossesb/trunk/ESBCore/common/src/org/jboss/soa/esb/helpers/persist/AbstractBobjStore.java 2006-07-10 19:02:01 UTC (rev 4973) @@ -1,197 +0,0 @@ -/* -* JBoss, Home of Professional Open Source -* Copyright 2006, JBoss Inc., and individual contributors as indicated -* by the @authors tag. See the copyright.txt in the distribution for a -* full listing of individual contributors. -* -* This is free software; you can redistribute it and/or modify it -* under the terms of the GNU Lesser General Public License as -* published by the Free Software Foundation; either version 2.1 of -* the License, or (at your option) any later version. -* -* This software is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this software; if not, write to the Free -* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -* 02110-1301 USA, or see the FSF site: http://www.fsf.org. -*/ - -package org.jboss.soa.esb.helpers.persist; - -import org.jboss.soa.esb.util.BaseBusinessObject; - -public abstract class AbstractBobjStore -{ - public static AbstractBobjStore getInstance() - { throw new UnsupportedOperationException( - "getInstance() must be implemented in the derived class"); - } //__________________________________ - - /** - * Array of BobjStore objects. - * @return AbstractBobjStore[] - */ - public abstract AbstractBobjStore[] getBobjStoreTable(); - - /** - * String names for BobjStoreTable. - * @return String[] - */ - public abstract String[] getBobjStoreIndex(); - - protected String m_sSnapType , m_sSnapTbl , m_sLocTbl, m_sClass; - protected boolean m_bEncrypt=false; - - /** - * Snapshot type getter - The value assigned to this attribute will help if - * standard SQL queries are required to surf the Object Store's snapshot tables - * @return String - Value of snapshot type - * @see ItfStorable#getSnapType() - */ - public String getSnapType() { return m_sSnapType; } - /** - * Snapshot tablename getter - The value assigned to this attribute is the - * name of the snapshot table for this object - * @return String - name of SQL table where snapshots of objects will be stored - * @see ItfStorable#getSnapTable() - */ - public String getSnapTable() { return m_sSnapTbl; } - /** - * Locator tablename getter - Locator table are also called index tables. - * The value assigned to this attribute is the name of the locator table for - * this object - * @return String - name of SQL table where locators for objects will be stored - * @see ItfStorable#getLocatorTable() - * @see BusinessObject#getObjLocator() - */ - public String getLocatorTable() { return m_sLocTbl; } - /** - * Encryption requirement getter - * @return boolean - true if Objects stored using this descriptor have to be - * encrypted - decrypted at storage/retrieval time - */ - public boolean isEncrypted() { return m_bEncrypt; } - /** - * Static helper method to obtain the snapshot type by index mnemonic - * @param p_i int - Index of descriptor in static descriptor table - * @return String - * @see BobjStore#getSnapType() - * @see BobjStore#getIndex(Class) - */ - public String getSnapType(int p_i) { return getBobjStoreTable()[p_i].m_sSnapType; } - /** - * Static helper method to obtain the snapshot SQL tablename by index mnemonic - * @param p_i int - Index of descriptor in static descriptor table - * @return String - * @see BobjStore#getSnapTable() - * @see BobjStore#getIndex(Class) - */ - public String getSnapTable(int p_i) { return getBobjStoreTable()[p_i].m_sSnapTbl; } - /** - * Static helper method to obtain the locator SQL tablename by index mnemonic - * @param p_i int - Index of descriptor in static descriptor table - * @return String - * @see BobjStore#getLocatorTable() - * @see BobjStore#getIndex(Class) - */ - public String getLocatorTable(int p_i){ return getBobjStoreTable()[p_i].m_sLocTbl; } - - /** - * - */ - protected AbstractBobjStore() {} - - /** - * Constructor using all fields required by a BobjStore object - * @param p_sSnapType String - Snapshot type - * @param p_sSnapTbl String - Snapshot SQL tablename - * @param p_sLocTbl String - Locator SQL tablename (may be null - No locator table) - * @param p_sCls String - Class name excluding package prefix - * @param p_bCrypt boolean - Does data have to be encrypted in the snap table ? - * @see ItfStorable - * @see BusinessObject#classNm() - */ - protected AbstractBobjStore (String p_sSnapType,String p_sSnapTbl, String p_sLocTbl - ,String p_sCls, boolean p_bCrypt) - { m_sSnapType = p_sSnapType; - m_sSnapTbl = p_sSnapTbl; - m_sLocTbl = p_sLocTbl; - m_sClass = p_sCls; - m_bEncrypt = p_bCrypt; - } //________________________________ - - /** - * Constructor for non encrypted BobjStore - * @param p_sSnapType String - * @param p_sSnapTbl String - * @param p_sLocTbl String - * @param p_sCls String - * @see BobjStore#BobjStore(String,String,String,String,boolean) - */ - protected AbstractBobjStore (String p_sSnapType,String p_sSnapTbl, String p_sLocTbl - ,String p_sCls) - { this(p_sSnapType,p_sSnapTbl,p_sLocTbl,p_sCls,false); - } //________________________________ - - /** - * Index in static descriptor table for objects of class <arg 1> - * @param p_oCls Class - BusinessObject class to search for in descriptor table - * @throws Exception - * @return int - index in static descriptor table - */ - public int getIndex (Class p_oCls) throws Exception - { String sClassName = p_oCls.getName() - .substring(1+p_oCls.getName().lastIndexOf(".")); - for (int i1 = 0; i1 < getBobjStoreTable().length; i1++) - if (getBobjStoreIndex()[i1].equals(sClassName)) return i1; - throw new Exception("No BobjStore for class "+p_oCls.getName()); - } //__________________________________ - /** - * Get a BobjStore object that describes persistence details for objects of - * class <arg 1> - * @param p_sClassName String Classname to search for in descriptor table - * @return BobjStore - A descriptor that will provide persistence info - * @see PersistHandler - * @see BobjStore#getStore(BusinessObject) - */ - public AbstractBobjStore getStore (String p_sClassName) - { if (null == p_sClassName) return null; - for (int i1 = 0; i1 < getBobjStoreTable().length; i1++) - { String sTblCls = getBobjStoreIndex()[i1]; - if (p_sClassName.equals(sTblCls)) return getStore(i1); - } - return null; - } //__________________________________ - - /** - * Get a BobjStore object that describes persistence details for the - * object specified in arg 1 - * @param p_o BusinessObject The object whose storage descriptor is requested - * @return BobjStore - A descriptor that will provide persistence info - * @see PersistHandler - * @see BobjStore#getStore(String) - */ - public AbstractBobjStore getStore (BaseBusinessObject p_o) - { return (null != p_o) ? getStore(p_o.classNm()) : null; - } //__________________________________ - - /** - * Get a BobjStore object by mnemonic name (index in the static descriptor table) - * @param p_i int - typically a mnemonic name will be used (see CQ3 constants) - * @return BobjStore - A descriptor that will provide persistence info - * @see PersistHandler - * @see BobjStore#getStore(String) - */ - public AbstractBobjStore getStore (int p_i) - { - AbstractBobjStore oRet = getBobjStoreTable()[p_i]; - - try { return (AbstractBobjStore)oRet.clone(); } - catch (Exception e) {return oRet;} - } //________________________________ - -} //____________________________________________________________________________ |