uPortal 2.4.1
API Documentation

org.jasig.portal
Class EntityTypes

java.lang.Object
  extended byorg.jasig.portal.EntityTypes

public class EntityTypes
extends java.lang.Object

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.

Version:
$Revision: 1.15.2.1 $
Author:
Dan Ellentuck
See Also:
IBasicEntity

Field Summary
static java.lang.Class GROUP_ENTITY_TYPE
           
static java.lang.Class LEAF_ENTITY_TYPE
           
static int NULL_TYPE_ID
           
 
Method Summary
 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.
 void deleteEntityType(java.lang.Class type)
          Synchronize on update lock to serialize adds, deletes and updates while letting reads proceed.
 java.util.Iterator getAllEntityTypeIDs()
           
 java.util.Iterator getAllEntityTypes()
           
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.
static void refresh()
          Interface to the entity types cache.
 void setEntityTypesByID(java.util.Map m)
           
 void setEntityTypesByType(java.util.Map m)
           
static EntityTypes singleton()
           
 void updateEntityType(java.lang.Class type, java.lang.String newDescription)
          Synchronize on update lock to serialize adds, deletes and updates while letting reads proceed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_TYPE_ID

public static int NULL_TYPE_ID

GROUP_ENTITY_TYPE

public static java.lang.Class GROUP_ENTITY_TYPE

LEAF_ENTITY_TYPE

public static java.lang.Class LEAF_ENTITY_TYPE
Method Detail

addIfNecessary

public static void addIfNecessary(java.lang.Class newType,
                                  java.lang.String description)
                           throws java.lang.Exception
Add the new type if it does not already exist.

Throws:
java.lang.Exception

addEntityTypeIfNecessary

public void addEntityTypeIfNecessary(java.lang.Class newType,
                                     java.lang.String description)
                              throws java.lang.Exception
Check if we have the type in our cache. If not, re-retrieve. Someone might have added it since we last retrieved. If the type is not found, try to add it to the store. If the add is not successful, re-retrieve again. If the type is still not found, rethrow the SQLException. Synchronize on update lock to serialize adds, deletes and updates while letting reads proceed.

Throws:
java.lang.Exception

deleteEntityType

public void deleteEntityType(java.lang.Class type)
                      throws java.sql.SQLException
Synchronize on update lock to serialize adds, deletes and updates while letting reads proceed.

Throws:
java.sql.SQLException

getAllEntityTypeIDs

public java.util.Iterator getAllEntityTypeIDs()
Returns:
java.util.Iterator

getAllEntityTypes

public java.util.Iterator getAllEntityTypes()
Returns:
java.util.Iterator

getDescriptiveName

public static java.lang.String getDescriptiveName(java.lang.Class type)
Interface to the entity types cache.

Returns:
java.lang.String

getDescriptiveNameForType

public java.lang.String getDescriptiveNameForType(java.lang.Class type)
Interface to the entity types cache.

Returns:
java.lang.String

getEntityIDFromType

public java.lang.Integer getEntityIDFromType(java.lang.Class type)
Interface to the entity types cache.

Returns:
java.lang.Integer

getEntityType

public static java.lang.Class getEntityType(java.lang.Integer typeID)
Interface to the entity types cache.

Returns:
java.lang.Class

getEntityTypeFromID

public java.lang.Class getEntityTypeFromID(java.lang.Integer id)
Interface to the entity types cache.

Returns:
java.lang.Class

getEntityTypeID

public static java.lang.Integer getEntityTypeID(java.lang.Class type)
Interface to the entity types cache.

Returns:
java.lang.Class

refresh

public static void refresh()
Interface to the entity types cache.


setEntityTypesByID

public void setEntityTypesByID(java.util.Map m)

setEntityTypesByType

public void setEntityTypesByType(java.util.Map m)

singleton

public static EntityTypes singleton()
Returns:
org.jasig.portal.groups.EntityTypes

updateEntityType

public void updateEntityType(java.lang.Class type,
                             java.lang.String newDescription)
                      throws java.lang.Exception
Synchronize on update lock to serialize adds, deletes and updates while letting reads proceed.

Throws:
java.lang.Exception

uPortal 2.4.1
API Documentation