Package org.kuali.rice.krad.util
Class LegacyUtils
java.lang.Object
org.kuali.rice.krad.util.LegacyUtils
Exposes legacy detection functionality statically.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic <T> TdoInLegacyContext(String documentId, UserSession userSession, Callable<T> callable) Performs the specifiedCallableinside of both the legacy context (if necessary as dependent on thedocumentId) and in newGlobalVariablesas specified by the givenuserSession.static <T> TdoInLegacyContext(Callable<T> callable) Performs the specifiedCallableinside of the legacy context.static voidstatic booleanstatic booleanisKnsDocumentEntry(DocumentEntry documentEntry) Indicates whether or not the given DocumentEntry represents a legacy KNS document entry.static booleanstatic booleanisKradDataManaged(Class<?> type) Indicates whether the given type is managed by the non-legacy data framework.static booleanReturn whether the legacy data framework is enabledstatic booleanisLegacyManaged(Class<?> type) Indicates whether the given type is managed by the legacy data framework.static booleanReturn whether objects of the given class should be handled via the legacy data frameworkstatic booleanuseLegacyForObject(Object dataObject) Return whether the object should be handled via the legacy data framework
-
Method Details
-
isLegacyManaged
Indicates whether the given type is managed by the legacy data framework. Note that it's possible for a given type to managed by both the legacy and the non-legacy data framework, in which case this method will return true as well.- Parameters:
type- the type to check- Returns:
- true if managed by the legacy framework, false otherwise
-
isKradDataManaged
Indicates whether the given type is managed by the non-legacy data framework. Note that it's possible for a given type to managed by both the legacy and the non-legacy data framework, in which case this method will return true as well.- Parameters:
type- the type to check- Returns:
- true if managed by the non-legacy krad-data framework, false otherwise
-
isKnsDocumentEntry
Indicates whether or not the given DocumentEntry represents a legacy KNS document entry.- Parameters:
documentEntry- the document entry to check- Returns:
- true if the given entry is a KNS entry, false otherwise
-
isKnsEnabled
public static boolean isKnsEnabled() -
isLegacyDataFrameworkEnabled
public static boolean isLegacyDataFrameworkEnabled()Return whether the legacy data framework is enabled- Returns:
- whether the legacy data framework is enabled
-
useLegacy
Return whether objects of the given class should be handled via the legacy data framework- Parameters:
dataObjectClass- the data object class- Returns:
- whether objects of the given class should be handled via the legacy data framework
-
useLegacyForObject
Return whether the object should be handled via the legacy data framework- Parameters:
dataObject- the data object- Returns:
- whether the object should be handled via the legacy data framework
-
isInLegacyContext
public static boolean isInLegacyContext()- Returns:
- whether we are currently in a legacy calling context
-
beginLegacyContext
public static void beginLegacyContext() -
endLegacyContext
public static void endLegacyContext() -
doInLegacyContext
Performs the specifiedCallableinside of the legacy context.- Type Parameters:
T- the return type of the callable- Parameters:
callable- the method to call inside of the new contexts- Returns:
- the result of the callable
- Throws:
Exception- any exception thrown during the execution of the context
-
doInLegacyContext
public static <T> T doInLegacyContext(String documentId, UserSession userSession, Callable<T> callable) throws Exception Performs the specifiedCallableinside of both the legacy context (if necessary as dependent on thedocumentId) and in newGlobalVariablesas specified by the givenuserSession.- Type Parameters:
T- the return type of the callable- Parameters:
documentId- id of the document for which to establish the data contextuserSession- the new user session to establishcallable- the method to call inside of the new contexts- Returns:
- the result of the callable
- Throws:
Exception- any exception thrown during the execution of the context
-