Java Code Examples for org.apache.brooklyn.api.mgmt.Task#equals()

The following examples show how to use org.apache.brooklyn.api.mgmt.Task#equals() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ActivityResource.java    From brooklyn-server with Apache License 2.0 5 votes vote down vote up
private Collection<? extends TaskSummary> getBackgroundedChildren(Task<?> t) {
    Entity entity = BrooklynTaskTags.getContextEntity(t);
    List<TaskSummary> result = MutableList.of();
    if (entity!=null) {
        Set<Task<?>> tasks = BrooklynTaskTags.getTasksInEntityContext(mgmt().getExecutionManager(), entity);
        for (Task<?> ti: tasks) {
            if (t.equals(ti.getSubmittedByTask())) {
                result.add(TaskTransformer.fromTask(ui.getBaseUriBuilder()).apply(ti));
            }
        }
    }
    return result;
}
 
Example 2
Source File: Tasks.java    From brooklyn-server with Apache License 2.0 4 votes vote down vote up
public static Task<?> getFinalProxyTarget(Task<?> task) {
    if (task==null) return null;
    Task<?> proxy = ((TaskInternal<?>)task).getProxyTarget();
    if (proxy==null || proxy.equals(task)) return task;
    return getFinalProxyTarget(proxy);
}
 
Example 3
Source File: LocalEntityManager.java    From brooklyn-server with Apache License 2.0 4 votes vote down vote up
private boolean hasTaskAsAncestor(Task<?> t, Task<?> potentialAncestor) {
    if (t==null || potentialAncestor==null) return false;
    if (t.equals(potentialAncestor)) return true;
    return hasTaskAsAncestor(t.getSubmittedByTask(), potentialAncestor);
}