|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.wabit.WabitUtils
public class WabitUtils
| Constructor Summary | |
|---|---|
WabitUtils()
|
|
| Method Summary | ||
|---|---|---|
static void |
addRecursivelyWithTransaction(WabitObject parent,
WabitObject child)
This inserts a child into it's parent and does that for all the hierarchy recursively. |
|
static CleanupExceptions |
cleanupWabitObject(WabitObject o)
This method will recursively clean up this object and all of its descendants. |
|
static void |
displayCleanupErrors(CleanupExceptions cleanupObject,
ca.sqlpower.util.UserPrompterFactory upf)
This method will display the cleanup errors to the user. |
|
static
|
findByUuid(WabitObject root,
java.lang.String uuid,
java.lang.Class<T> expectedType)
Locates the WabitObject inside the root wabit object which has the given UUID, returning null if the item is not found. |
|
static java.util.List<WabitObject> |
getAncestorList(WabitObject o)
This method returns a list of all of the ancestors of the given WabitObject. |
|
static WabitSession |
getSession(WabitObject o)
Walks up the parent chain of WabitObjects and returns the WabitSession that these objects belong to. |
|
static WabitWorkspace |
getWorkspace(WabitObject o)
Walks up the parent chain of WabitObjects and returns the WabitWorkspace that these objects belong to or null if the workspace does not exist. |
|
static void |
listenToHierarchy(WabitObject root,
WabitListener wcl)
Adds the given listeners to the hierarchy of Wabit objects rooted at root. |
|
static void |
logCleanupErrors(CleanupExceptions cleanupObject)
Logs the exceptions and errors. |
|
static boolean |
nullSafeEquals(java.lang.Object o1,
java.lang.Object o2)
Checks if the two arguments o1 and o2 are equal to each other, either because both are null, or because o1.equals(o2). |
|
static void |
printSubtree(java.io.PrintWriter out,
WabitObject startWith)
Prints the subtree rooted at the given WabitObject to the given output stream. |
|
static java.lang.String |
randomWabitUUID()
Generates a new UUID in the format suitable for use with any WabitObject's UUID property. |
|
static java.lang.String |
serviceInfoSummary(WabitServerInfo si)
Returns the human-readable summary of the given service info object. |
|
static void |
unlistenToHierarchy(WabitObject root,
WabitListener wcl)
Removes the given listeners from the hierarchy of Wabit objects rooted at root. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WabitUtils()
| Method Detail |
|---|
public static void listenToHierarchy(WabitObject root,
WabitListener wcl)
root.
root - The object at the top of the subtree to listen to. Must not be
null.wcl - The Wabit child listener to add to root and all its
WabitObject descendants. If you do not want Wabit child
events, you can provide null for this parameter.
public static void unlistenToHierarchy(WabitObject root,
WabitListener wcl)
root.
root - The object at the top of the subtree to unlisten to. Must not
be null.wcl - The Wabit child listener to remove from root and all its
WabitObject descendants. If you do not want to unlisten to
Wabit child events, you can provide null for this parameter.public static java.lang.String serviceInfoSummary(WabitServerInfo si)
si - The service info to summarize.
public static boolean nullSafeEquals(java.lang.Object o1,
java.lang.Object o2)
o1 - One object or null reference to compareo2 - The other object or null reference to comparepublic static java.util.List<WabitObject> getAncestorList(WabitObject o)
WabitObject. The order of the ancestors is such that the highest
ancestor is at the start of the list and the parent of the object itself
is at the end of the list.
public static CleanupExceptions cleanupWabitObject(WabitObject o)
o - The object to clean up, including its dependencies.
public static void displayCleanupErrors(@Nonnull
CleanupExceptions cleanupObject,
ca.sqlpower.util.UserPrompterFactory upf)
public static void logCleanupErrors(@Nonnull
CleanupExceptions cleanupObject)
public static WabitWorkspace getWorkspace(WabitObject o)
o - The object to follow the parent chain.
WabitWorkspace that contains the given WabitObject and all of its
children or null if the given object is not in a workspace.public static WabitSession getSession(WabitObject o)
SessionNotFoundException if the object is not attached to a
session.
o - The object to follow the parent chain.
public static <T extends WabitObject> T findByUuid(WabitObject root,
java.lang.String uuid,
java.lang.Class<T> expectedType)
T - The expected type of the itemuuid - The UUID of the itemexpectedType - The type of the item with the given UUID. If you are uncertain
what type of object it is, or you do not want a
ClassCastException in case the item is of the wrong type, use
WabitObject.class for this parameter.
public static void addRecursivelyWithTransaction(WabitObject parent,
WabitObject child)
parent - child - public static java.lang.String randomWabitUUID()
public static void printSubtree(java.io.PrintWriter out,
WabitObject startWith)
out - the target of the debug information (often System.out)startWith - the root object for the dump
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||