|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.EntityTypes
public class EntityTypes
This class provides access to the entity types used by IBasicEntities
and the classes in org.jasig.portal.groups
and
org.jasig.portal.concurrency
.
Each type is associated with an Integer
used to represent the
type in the portal data store. This class translates between the
Integer
and Class
values.
IBasicEntity
Nested Class Summary | |
---|---|
private class |
EntityTypes.EntityType
|
Field Summary | |
---|---|
private static java.lang.String |
DESCRIPTIVE_NAME_COLUMN
|
private static java.lang.String |
ENTITY_TYPE_TABLE
|
private java.util.Map |
entityTypesByID
|
private java.util.Map |
entityTypesByType
|
static java.lang.Class |
GROUP_ENTITY_TYPE
|
static java.lang.Class |
LEAF_ENTITY_TYPE
|
private static org.apache.commons.logging.Log |
log
|
static int |
NULL_TYPE_ID
|
private static EntityTypes |
singleton
|
private static java.lang.String |
TYPE_ID_COLUMN
|
private static java.lang.String |
TYPE_NAME_COLUMN
|
private java.lang.Object |
updateLock
|
Constructor Summary | |
---|---|
private |
EntityTypes(javax.sql.DataSource ds)
|
Method Summary | |
---|---|
private void |
addEntityType(java.lang.Class newType,
java.lang.String description)
Add the new type if it does not already exist in the cache. |
void |
addEntityTypeIfNecessary(java.lang.Class newType,
java.lang.String description)
Check if we have the type in our cache. |
static void |
addIfNecessary(java.lang.Class newType,
java.lang.String description)
Add the new type if it does not already exist. |
private java.util.Map |
cloneHashMap(java.util.Map m)
|
void |
deleteEntityType(java.lang.Class type)
Synchronize on update lock to serialize adds, deletes and updates while letting reads proceed. |
private void |
deleteEntityType(EntityTypes.EntityType et)
delete EntityType from the store. |
private static java.lang.String |
getAllColumnNames()
|
java.util.Iterator |
getAllEntityTypeIDs()
|
java.util.Iterator |
getAllEntityTypes()
|
private static java.lang.String |
getDeleteEntityTypeSql()
|
static java.lang.String |
getDescriptiveName(java.lang.Class type)
Interface to the entity types cache. |
java.lang.String |
getDescriptiveNameForType(java.lang.Class type)
Interface to the entity types cache. |
java.lang.Integer |
getEntityIDFromType(java.lang.Class type)
Interface to the entity types cache. |
static java.lang.Class |
getEntityType(java.lang.Integer typeID)
Interface to the entity types cache. |
java.lang.Class |
getEntityTypeFromID(java.lang.Integer id)
Interface to the entity types cache. |
static java.lang.Integer |
getEntityTypeID(java.lang.Class type)
Interface to the entity types cache. |
private java.util.Map |
getEntityTypesByID()
|
private java.util.Map |
getEntityTypesByType()
|
private static java.lang.String |
getInsertEntityTypeSql()
|
private int |
getNextKey()
|
private static java.lang.String |
getSelectEntityTypesSql()
|
private static java.lang.String |
getUpdateEntityTypeSql()
|
private void |
initialize()
Cache entityTypes. |
private void |
initialize(java.sql.Connection conn)
|
private void |
initialize(javax.sql.DataSource ds)
|
private void |
initializeCaches()
Cache entityTypes. |
private void |
insertEntityType(EntityTypes.EntityType et)
Cache entityTypes. |
private void |
primAddEntityType(EntityTypes.EntityType et)
Copy on write to prevent ConcurrentModificationExceptions. |
private void |
primRemoveEntityType(EntityTypes.EntityType et)
Copy on write to prevent ConcurrentModificationExceptions. |
static void |
refresh()
Interface to the entity types cache. |
void |
setEntityTypesByID(java.util.Map m)
|
void |
setEntityTypesByType(java.util.Map m)
|
static EntityTypes |
singleton()
|
static EntityTypes |
singleton(javax.sql.DataSource ds)
|
void |
updateEntityType(java.lang.Class type,
java.lang.String newDescription)
Synchronize on update lock to serialize adds, deletes and updates while letting reads proceed. |
private void |
updateEntityType(EntityTypes.EntityType et)
Cache entityTypes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log log
private static EntityTypes singleton
private java.util.Map entityTypesByID
private java.util.Map entityTypesByType
private java.lang.Object updateLock
private static java.lang.String ENTITY_TYPE_TABLE
private static java.lang.String TYPE_ID_COLUMN
private static java.lang.String TYPE_NAME_COLUMN
private static java.lang.String DESCRIPTIVE_NAME_COLUMN
public static int NULL_TYPE_ID
public static java.lang.Class GROUP_ENTITY_TYPE
public static java.lang.Class LEAF_ENTITY_TYPE
Constructor Detail |
---|
private EntityTypes(javax.sql.DataSource ds)
Method Detail |
---|
public static void addIfNecessary(java.lang.Class newType, java.lang.String description) throws java.lang.Exception
java.lang.Exception
private void addEntityType(java.lang.Class newType, java.lang.String description) throws java.lang.Exception
java.lang.Exception
public void addEntityTypeIfNecessary(java.lang.Class newType, java.lang.String description) throws java.lang.Exception
java.lang.Exception
public void deleteEntityType(java.lang.Class type) throws java.sql.SQLException
java.sql.SQLException
private void deleteEntityType(EntityTypes.EntityType et) throws java.sql.SQLException
java.sql.SQLException
private static java.lang.String getAllColumnNames()
public java.util.Iterator getAllEntityTypeIDs()
public java.util.Iterator getAllEntityTypes()
private static java.lang.String getDeleteEntityTypeSql()
public static java.lang.String getDescriptiveName(java.lang.Class type)
public java.lang.String getDescriptiveNameForType(java.lang.Class type)
public java.lang.Integer getEntityIDFromType(java.lang.Class type)
public static java.lang.Class getEntityType(java.lang.Integer typeID)
public java.lang.Class getEntityTypeFromID(java.lang.Integer id)
public static java.lang.Integer getEntityTypeID(java.lang.Class type)
private java.util.Map getEntityTypesByID()
private java.util.Map cloneHashMap(java.util.Map m)
private java.util.Map getEntityTypesByType()
private static java.lang.String getInsertEntityTypeSql()
private int getNextKey() throws java.lang.Exception
java.lang.Exception
private static java.lang.String getSelectEntityTypesSql()
private static java.lang.String getUpdateEntityTypeSql()
private void initialize(javax.sql.DataSource ds)
private void initialize(java.sql.Connection conn)
private void initialize()
private void initializeCaches()
private void insertEntityType(EntityTypes.EntityType et) throws java.sql.SQLException
java.sql.SQLException
private void primAddEntityType(EntityTypes.EntityType et)
private void primRemoveEntityType(EntityTypes.EntityType et)
public static void refresh()
public void setEntityTypesByID(java.util.Map m)
public void setEntityTypesByType(java.util.Map m)
public static EntityTypes singleton()
public static EntityTypes singleton(javax.sql.DataSource ds)
public void updateEntityType(java.lang.Class type, java.lang.String newDescription) throws java.lang.Exception
java.lang.Exception
private void updateEntityType(EntityTypes.EntityType et) throws java.sql.SQLException
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |