当前位置: 首页>>代码示例>>Java>>正文


Java Project.getId方法代码示例

本文整理汇总了Java中azkaban.project.Project.getId方法的典型用法代码示例。如果您正苦于以下问题:Java Project.getId方法的具体用法?Java Project.getId怎么用?Java Project.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在azkaban.project.Project的用法示例。


在下文中一共展示了Project.getId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ajaxFetchFlowInfo

import azkaban.project.Project; //导入方法依赖的package包/类
private void ajaxFetchFlowInfo(HttpServletRequest req,
                               HttpServletResponse resp, HashMap<String, Object> ret, User user,
                               String projectName, String flowId) throws ServletException {
    Project project =
            getProjectAjaxByPermission(ret, projectName, user, Type.READ);
    if (project == null) {
        ret.put("erro", "Project " + projectName + " doesn't exist.");
        return;
    }

    Flow flow = project.getFlow(flowId);
    if (flow == null) {
        ret.put("error", "Error loading flow. Flow " + flowId
                + " doesn't exist in " + projectName);
        return;
    }

    ret.put("successEmails", flow.getSuccessEmails());
    ret.put("failureEmails", flow.getFailureEmails());

    Schedule sflow = null;
    try {
        for (Schedule sched : scheduleManager.getSchedules()) {
            if (sched.getProjectId() == project.getId()
                    && sched.getFlowName().equals(flowId)) {
                sflow = sched;
                break;
            }
        }
    } catch (ScheduleManagerException e) {
        // TODO Auto-generated catch block
        throw new ServletException(e);
    }

    if (sflow != null) {
        ret.put("scheduled", sflow.getNextExecTime());
    }
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:39,代码来源:ExecutorServlet.java

示例2: toSimplifiedProjects

import azkaban.project.Project; //导入方法依赖的package包/类
/**
 * A simple helper method that converts a List<Project> to List<SimplifiedProject>
 * 
 * @param projects
 * @return
 */
private List<SimplifiedProject> toSimplifiedProjects(List<Project> projects) {
  List<SimplifiedProject> simplifiedProjects = new ArrayList<>();
  for (Project p : projects) {
    SimplifiedProject sp =
        new SimplifiedProject(p.getId(), p.getName(),
            p.getLastModifiedUser(), p.getCreateTimestamp(),
            p.getUserPermissions(), p.getGroupPermissions());
    simplifiedProjects.add(sp);
  }
  return simplifiedProjects;
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:18,代码来源:ProjectServlet.java

示例3: ExecutableFlow

import azkaban.project.Project; //导入方法依赖的package包/类
public ExecutableFlow(Project project, Flow flow) {
  this.projectId = project.getId();
  this.projectName = project.getName();
  this.version = project.getVersion();
  this.scheduleId = -1;
  this.lastModifiedTimestamp = project.getLastModifiedTimestamp();
  this.lastModifiedUser = project.getLastModifiedUser();
  this.setFlow(project, flow);
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:10,代码来源:ExecutableFlow.java

示例4: ajaxFetchFlowInfo

import azkaban.project.Project; //导入方法依赖的package包/类
private void ajaxFetchFlowInfo(HttpServletRequest req, HttpServletResponse resp, HashMap<String, Object> ret, User user, String projectName, String flowId) throws ServletException {
	Project project = getProjectAjaxByPermission(ret, projectName, user, Type.READ);
	if (project == null) {
		return;
	}
	
	Flow flow = project.getFlow(flowId);
	if (flow == null) {
		ret.put("error", "Error loading flow. Flow " + flowId + " doesn't exist in " + projectName);
		return;
	}
	
	ret.put("successEmails", flow.getSuccessEmails());
	ret.put("failureEmails", flow.getFailureEmails());
	
	Schedule sflow = null;
	try {
		for (Schedule sched: scheduleManager.getSchedules()) {
			if (sched.getProjectId() == project.getId() && sched.getFlowName().equals(flowId)) {
				sflow = sched;
				break;
			}
		}
	} catch (ScheduleManagerException e) {
		// TODO Auto-generated catch block
		throw new ServletException(e);
	}
	
	if (sflow != null) {
		ret.put("scheduled", sflow.getNextExecTime());
	}
}
 
开发者ID:zhizhounq,项目名称:azkaban-customization,代码行数:33,代码来源:ExecutorServlet.java

示例5: ExecutableFlow

import azkaban.project.Project; //导入方法依赖的package包/类
public ExecutableFlow(Project project, Flow flow) {
	this.projectId = project.getId();
	this.version = project.getVersion();
	this.scheduleId = -1;

	this.setFlow(project, flow);
}
 
开发者ID:zhizhounq,项目名称:azkaban-customization,代码行数:8,代码来源:ExecutableFlow.java


注:本文中的azkaban.project.Project.getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。