本文整理汇总了Java中org.apache.kylin.metadata.project.ProjectInstance.getName方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectInstance.getName方法的具体用法?Java ProjectInstance.getName怎么用?Java ProjectInstance.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.kylin.metadata.project.ProjectInstance
的用法示例。
在下文中一共展示了ProjectInstance.getName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createProject
import org.apache.kylin.metadata.project.ProjectInstance; //导入方法依赖的package包/类
@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN)
public ProjectInstance createProject(ProjectInstance newProject) throws IOException {
Message msg = MsgPicker.getMsg();
String projectName = newProject.getName();
String description = newProject.getDescription();
LinkedHashMap<String, String> overrideProps = newProject.getOverrideKylinProps();
ProjectInstance currentProject = getProjectManager().getProject(projectName);
if (currentProject != null) {
throw new BadRequestException(String.format(msg.getPROJECT_ALREADY_EXIST(), projectName));
}
String owner = SecurityContextHolder.getContext().getAuthentication().getName();
ProjectInstance createdProject = getProjectManager().createProject(projectName, owner, description,
overrideProps);
accessService.init(createdProject, AclPermission.ADMINISTRATION);
logger.debug("New project created.");
return createdProject;
}
示例2: updateCube
import org.apache.kylin.metadata.project.ProjectInstance; //导入方法依赖的package包/类
public CubeDesc updateCube(CubeInstance cube, CubeDesc desc, ProjectInstance project) throws IOException {
aclEvaluate.hasProjectWritePermission(cube.getProjectInstance());
Message msg = MsgPicker.getMsg();
String projectName = project.getName();
desc.setDraft(false);
try {
if (cube.getSegments().size() != 0 && !cube.getDescriptor().consistentWith(desc)) {
throw new BadRequestException(String.format(msg.getINCONSISTENT_CUBE_DESC(), desc.getName()));
}
desc = updateCubeAndDesc(cube, desc, projectName, true);
} catch (AccessDeniedException accessDeniedException) {
throw new ForbiddenException(msg.getUPDATE_CUBE_NO_RIGHT());
}
if (!desc.getError().isEmpty()) {
throw new BadRequestException(desc.getErrorMsg());
}
return desc;
}
示例3: updateProject
import org.apache.kylin.metadata.project.ProjectInstance; //导入方法依赖的package包/类
@RequestMapping(value = "", method = { RequestMethod.PUT }, produces = { "application/json" })
@ResponseBody
public ProjectInstance updateProject(@RequestBody ProjectRequest projectRequest) {
String formerProjectName = projectRequest.getFormerProjectName();
if (StringUtils.isEmpty(formerProjectName)) {
throw new InternalErrorException("A project name must be given to update a project");
}
ProjectInstance projectDesc = deserializeProjectDesc(projectRequest);
ProjectInstance updatedProj = null;
try {
ProjectInstance currentProject = projectService.getProjectManager().getProject(formerProjectName);
if (currentProject == null) {
throw new InternalErrorException("The project named " + formerProjectName + " does not exists");
}
if (projectDesc.getName().equals(currentProject.getName())) {
updatedProj = projectService.updateProject(projectDesc, currentProject);
} else {
throw new IllegalStateException("Rename project is not supported yet, from " + formerProjectName
+ " to " + projectDesc.getName());
}
} catch (Exception e) {
logger.error("Failed to deal with the request.", e);
throw new InternalErrorException(e.getLocalizedMessage());
}
return updatedProj;
}
示例4: hasPermission
import org.apache.kylin.metadata.project.ProjectInstance; //导入方法依赖的package包/类
@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN + " or hasPermission(#currentProject, 'ADMINISTRATION')")
public ProjectInstance updateProject(ProjectInstance newProject, ProjectInstance currentProject)
throws IOException {
String newProjectName = newProject.getName();
String newDescription = newProject.getDescription();
LinkedHashMap<String, String> overrideProps = newProject.getOverrideKylinProps();
ProjectInstance updatedProject = getProjectManager().updateProject(currentProject, newProjectName,
newDescription, overrideProps);
logger.debug("Project updated.");
return updatedProject;
}
示例5: getProjectOfCube
import org.apache.kylin.metadata.project.ProjectInstance; //导入方法依赖的package包/类
public String getProjectOfCube(String cubeName) {
for (ProjectInstance p : getProjectManager().listAllProjects()) {
if (p.containsRealization(RealizationType.CUBE, cubeName))
return p.getName();
}
return null;
}
示例6: getProjectOfModel
import org.apache.kylin.metadata.project.ProjectInstance; //导入方法依赖的package包/类
public String getProjectOfModel(String modelName) {
for (ProjectInstance p : getProjectManager().listAllProjects()) {
if (p.containsModel(modelName))
return p.getName();
}
return null;
}