com.wm.app.tn.db
Class BizDocAttributeStore

java.lang.Object
  extended by com.wm.app.tn.db.BizDocAttributeStore

public class BizDocAttributeStore
extends java.lang.Object

Attribute-based operations on the shared datastore. This class must be initialized with a call to fillCache. Subsequent calls to list or get will only refer to the in-memory cache. Insert, update and remove operations are write-through -- they will affect the cache and the database.


Constructor Summary
BizDocAttributeStore()
           
 
Method Summary
static boolean disable(java.lang.String id)
          For internal use only
static boolean enable(java.lang.String id)
          For internal use only
static void fillCache(boolean includeDeleted)
          For internal use only
static BizDocAttribute get(java.lang.String id)
          Get an attribute from the cache.
static BizDocAttribute get(java.lang.String id, boolean returnDeleted)
          Get a (possibly deleted) attribute from the cache.
static BizDocAttribute getByName(java.lang.String name, boolean returnDeleted)
          Get an attribute definition by name
static boolean insert(BizDocAttribute a)
          For internal use only
static java.util.Enumeration list(boolean includeDeleted)
          List attributes in the cache.
static java.util.Enumeration listSystemAttributes()
           
static java.lang.String[] listTypesForAttribute(java.lang.String a_id)
          For internal use only
static java.lang.String[] queryAttributes(java.lang.String regexName)
           
static boolean setPersist(java.lang.String id, boolean persist)
          For internal use only
static boolean update(BizDocAttribute a)
          For internal use only
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BizDocAttributeStore

public BizDocAttributeStore()
Method Detail

fillCache

public static void fillCache(boolean includeDeleted)
                      throws DatastoreException
For internal use only

Throws:
DatastoreException

listSystemAttributes

public static java.util.Enumeration listSystemAttributes()
                                                  throws DatastoreException
Throws:
DatastoreException

list

public static java.util.Enumeration list(boolean includeDeleted)
List attributes in the cache.

Parameters:
includeDeleted - should attribute definitions that are marked as deleted be included in the listing? (this is meaningless if such attributes were not fetched)
Returns:
an Enumeration of BizDocAttributes

get

public static BizDocAttribute get(java.lang.String id)
Get an attribute from the cache.

Parameters:
id - the ID of the attribute to fetch
Returns:
the attribute in question (null if there's no such attribute, or if the specified attribute is marked as deleted)

get

public static BizDocAttribute get(java.lang.String id,
                                  boolean returnDeleted)
Get a (possibly deleted) attribute from the cache.

Parameters:
id - the ID of the attribute to fetch
returnDeleted - if the attribute in question exists but is deleted, should it be returned anyway? (meaningless if deleted attributes were not initially fetched)
Returns:
the attribute in question (null if there's no such attribute)

getByName

public static BizDocAttribute getByName(java.lang.String name,
                                        boolean returnDeleted)
Get an attribute definition by name

Parameters:
name - the name of the attribute to fetch
returnDeleted - if the attribute in question exists but is deleted, should it be returned anyway? (meaningless if deleted attributes were not initially fetched)
Returns:
the attribute in question (null if there's no such attribute)

insert

public static boolean insert(BizDocAttribute a)
                      throws DatastoreException
For internal use only

Throws:
DatastoreException

listTypesForAttribute

public static java.lang.String[] listTypesForAttribute(java.lang.String a_id)
                                                throws DatastoreException
For internal use only

Throws:
DatastoreException

update

public static boolean update(BizDocAttribute a)
                      throws DatastoreException
For internal use only

Throws:
DatastoreException

disable

public static boolean disable(java.lang.String id)
                       throws DatastoreException
For internal use only

Throws:
DatastoreException

enable

public static boolean enable(java.lang.String id)
                      throws DatastoreException
For internal use only

Throws:
DatastoreException

setPersist

public static boolean setPersist(java.lang.String id,
                                 boolean persist)
                          throws DatastoreException
For internal use only

Throws:
DatastoreException

queryAttributes

public static java.lang.String[] queryAttributes(java.lang.String regexName)
                                          throws com.wm.app.b2b.server.ServiceException,
                                                 java.sql.SQLException,
                                                 java.io.IOException
Throws:
com.wm.app.b2b.server.ServiceException
java.sql.SQLException
java.io.IOException