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


Java CloudConductorException类代码示例

本文整理汇总了Java中de.cinovo.cloudconductor.api.lib.exceptions.CloudConductorException的典型用法代码示例。如果您正苦于以下问题:Java CloudConductorException类的具体用法?Java CloudConductorException怎么用?Java CloudConductorException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CloudConductorException类属于de.cinovo.cloudconductor.api.lib.exceptions包,在下文中一共展示了CloudConductorException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeYumRepo

import de.cinovo.cloudconductor.api.lib.exceptions.CloudConductorException; //导入依赖的package包/类
/**
 * @throws CloudConductorException thrown if yum url retrieval fails
 * @throws IOException thrown if file couln't be generated
 */
public static void writeYumRepo() throws CloudConductorException, IOException {
	String yumName = System.getProperty(AgentVars.YUM_NAME_PROP);
	String fileName = AgentVars.YUM_REPO_FOLDER + yumName + AgentVars.YUM_REPO_ENDING;
	try (FileWriter writer = new FileWriter(new File(fileName))) {
		writer.append("[");
		writer.append(yumName);
		writer.append("]");
		writer.append(System.lineSeparator());
		writer.append("name=" + yumName + " deploy repository");
		writer.append(System.lineSeparator());
		writer.append("failovermethod=priority");
		writer.append(System.lineSeparator());
		writer.append("baseurl=");
		writer.append(ServerCom.getYumPath());
		writer.append(System.lineSeparator());
		writer.append("enabled=0");
		writer.append(System.lineSeparator());
		writer.append("metadata_expire=1h");
		writer.append(System.lineSeparator());
		writer.append("gpgcheck=0");
		writer.append(System.lineSeparator());
		writer.flush();
		writer.close();
	}
}
 
开发者ID:cinovo,项目名称:cloudconductor-agent-redhat,代码行数:30,代码来源:FileHelper.java

示例2: run

import de.cinovo.cloudconductor.api.lib.exceptions.CloudConductorException; //导入依赖的package包/类
@Override
public void run() {
	FilesJob.LOGGER.debug("Started FilesJob");
	// only run if no other blocking job is currently running
	if (AgentState.filesExecutionLock.tryLock()) {
		try {
			new ConfigFileHandler().run();
		} catch (ExecutionError e) {
			if (e.getCause() instanceof CloudConductorException) {
				FilesJob.LOGGER.debug(e.getMessage(), e);
			}
		} finally {
			AgentState.filesExecutionLock.unlock();
		}
	}
	FilesJob.LOGGER.debug("Started FilesJob");
}
 
开发者ID:cinovo,项目名称:cloudconductor-agent-redhat,代码行数:18,代码来源:FilesJob.java

示例3: collectRunningServices

import de.cinovo.cloudconductor.api.lib.exceptions.CloudConductorException; //导入依赖的package包/类
private List<String> collectRunningServices() throws ExecutionError {
	Set<Service> services = null;
	try {
		services = ServerCom.getServices();
	} catch (CloudConductorException e) {
		throw new ExecutionError(e);
	}
	
	List<String> runningServices = new ArrayList<String>();
	ScriptExecutor serviceStateHandler = ScriptExecutor.generateCheckServiceState(services);
	serviceStateHandler.execute();
	try (Scanner s = new Scanner(serviceStateHandler.getResult())) {
		while (s.hasNextLine()) {
			runningServices.add(s.next().trim());
		}
	}
	
	return runningServices;
}
 
开发者ID:cinovo,项目名称:cloudconductor-agent-redhat,代码行数:20,代码来源:ServiceHandler.java

示例4: run

import de.cinovo.cloudconductor.api.lib.exceptions.CloudConductorException; //导入依赖的package包/类
@Override
public void run() {
	DirectoriesJob.LOGGER.debug("Started Directory Job");
	
	if (AgentState.directoryExecutionLock.tryLock()) {
		try {
			new DirectoryHandler().run();
		} catch (ExecutionError e) {
			if (e.getCause() instanceof CloudConductorException) {
				DirectoriesJob.LOGGER.debug(e.getMessage(), e);
			}
		} finally {
			AgentState.directoryExecutionLock.unlock();
		}
	}
	DirectoriesJob.LOGGER.debug("finished Directory Job");
}
 
开发者ID:cinovo,项目名称:cloudconductor-agent-redhat,代码行数:18,代码来源:DirectoriesJob.java

示例5: getTemplate

import de.cinovo.cloudconductor.api.lib.exceptions.CloudConductorException; //导入依赖的package包/类
/**
 * @return the template for this agent
 * @throws CloudConductorException error if retrieval fails
 */
public static Template getTemplate() throws CloudConductorException {
	try {
		return ServerCom.agent.getTemplate(AgentState.info().getTemplate());
	} catch (RuntimeException e) {
		throw new CloudConductorException(e.getMessage());
	}
}
 
开发者ID:cinovo,项目名称:cloudconductor-agent-redhat,代码行数:12,代码来源:ServerCom.java

示例6: getConfig

import de.cinovo.cloudconductor.api.lib.exceptions.CloudConductorException; //导入依赖的package包/类
/**
 * @return the config for this agent
 * @throws CloudConductorException error if retrieval fails
 */
public static Map<String, String> getConfig() throws CloudConductorException {
	try {
		return ServerCom.config.getConfig(AgentState.info().getTemplate(), AgentVars.SERVICE_NAME);
	} catch (RuntimeException e) {
		throw new CloudConductorException(e.getMessage());
	}
}
 
开发者ID:cinovo,项目名称:cloudconductor-agent-redhat,代码行数:12,代码来源:ServerCom.java

示例7: getYumPath

import de.cinovo.cloudconductor.api.lib.exceptions.CloudConductorException; //导入依赖的package包/类
/**
 * @return the yum repo path
 * @throws CloudConductorException error if retrieval fails
 */
public static String getYumPath() throws CloudConductorException {
	try {
		Template template = ServerCom.getTemplate();
		return template.getYum();
	} catch (RuntimeException e) {
		throw new CloudConductorException(e.getMessage());
	}
}
 
开发者ID:cinovo,项目名称:cloudconductor-agent-redhat,代码行数:13,代码来源:ServerCom.java

示例8: getServices

import de.cinovo.cloudconductor.api.lib.exceptions.CloudConductorException; //导入依赖的package包/类
/**
 * @return the services of the host
 * @throws CloudConductorException thrown if communication with cloudconductor failed
 */
public static Set<Service> getServices() throws CloudConductorException {
	try {
		String template = AgentState.info().getTemplate();
		return ServerCom.agent.getServices(template);
	} catch (RuntimeException e) {
		throw new CloudConductorException(e.getMessage());
	}
}
 
开发者ID:cinovo,项目名称:cloudconductor-agent-redhat,代码行数:13,代码来源:ServerCom.java

示例9: getSSHKeys

import de.cinovo.cloudconductor.api.lib.exceptions.CloudConductorException; //导入依赖的package包/类
/**
 * @return the ssh keys
 * @throws CloudConductorException thrown if communication with cloudconductor failed
 */
public static Set<SSHKey> getSSHKeys() throws CloudConductorException {
	try {
		String template = AgentState.info().getTemplate();
		return ServerCom.agent.getSSHKeys(template);
	} catch (RuntimeException e) {
		throw new CloudConductorException(e.getMessage());
	}
}
 
开发者ID:cinovo,项目名称:cloudconductor-agent-redhat,代码行数:13,代码来源:ServerCom.java

示例10: notifyRunningServices

import de.cinovo.cloudconductor.api.lib.exceptions.CloudConductorException; //导入依赖的package包/类
/**
 * @param req the service update req
 * @return the response
 * @throws CloudConductorException thrown if communication with cloudconductor failed
 */
public static ServiceStatesChanges notifyRunningServices(ServiceStates req) throws CloudConductorException {
	try {
		String template = AgentState.info().getTemplate();
		String host = AgentState.info().getHost();
		String uuid= AgentState.info().getUuid();
		return ServerCom.agent.notifyServiceState(template, host, req, uuid);
	} catch (RuntimeException e) {
		throw new CloudConductorException(e.getMessage());
	}
}
 
开发者ID:cinovo,项目名称:cloudconductor-agent-redhat,代码行数:16,代码来源:ServerCom.java

示例11: notifyInstalledPackages

import de.cinovo.cloudconductor.api.lib.exceptions.CloudConductorException; //导入依赖的package包/类
/**
 * @param installedPackages the installed packages
 * @return the response
 * @throws CloudConductorException thrown if communication with cloudconductor failed
 */
public static PackageStateChanges notifyInstalledPackages(PackageState installedPackages) throws CloudConductorException {
	try {
		String template = AgentState.info().getTemplate();
		String host = AgentState.info().getHost();
		String uuid= AgentState.info().getUuid();
		return ServerCom.agent.notifyPackageState(template, host, installedPackages, uuid);
	} catch (RuntimeException e) {
		throw new CloudConductorException(e.getMessage());
	}
}
 
开发者ID:cinovo,项目名称:cloudconductor-agent-redhat,代码行数:16,代码来源:ServerCom.java

示例12: heartBeat

import de.cinovo.cloudconductor.api.lib.exceptions.CloudConductorException; //导入依赖的package包/类
/**
 * @return the response
 * @throws CloudConductorException thrown if communication with cloudconductor failed
 */
public static AgentOptions heartBeat() throws CloudConductorException {
	try {
		String template = AgentState.info().getTemplate();
		String host = AgentState.info().getHost();
		String uuid= AgentState.info().getUuid();
		String agentName = AgentState.info().getAgent();
		return ServerCom.agent.heartBeat(template, host, agentName, uuid);
	} catch (RuntimeException e) {
		throw new CloudConductorException(e.getMessage());
	}
}
 
开发者ID:cinovo,项目名称:cloudconductor-agent-redhat,代码行数:16,代码来源:ServerCom.java

示例13: getDirectories

import de.cinovo.cloudconductor.api.lib.exceptions.CloudConductorException; //导入依赖的package包/类
/**
 * @return the response
 * @throws CloudConductorException thrown if communication with cloudconductor failed
 */
public static Set<Directory> getDirectories() throws CloudConductorException {
	try {
		String template = AgentState.info().getTemplate();
		return ServerCom.directory.getDirectoryByTemplate(template);
	} catch (RuntimeException e) {
		throw new CloudConductorException(e.getMessage());
	}
	
}
 
开发者ID:cinovo,项目名称:cloudconductor-agent-redhat,代码行数:14,代码来源:ServerCom.java

示例14: getDirectoryMode

import de.cinovo.cloudconductor.api.lib.exceptions.CloudConductorException; //导入依赖的package包/类
/**
 *
 * @param dirName the directory name
 * @return directory "filemode"
 * @throws CloudConductorException thrown if communication with cloudconductor failed
 */
public static String getDirectoryMode(String dirName) throws CloudConductorException {
	try {
		return ServerCom.agent.getDirectoryFileMode(dirName);
	} catch (RuntimeException e) {
		throw new CloudConductorException(e.getMessage());
	}
}
 
开发者ID:cinovo,项目名称:cloudconductor-agent-redhat,代码行数:14,代码来源:ServerCom.java

示例15: getFileMode

import de.cinovo.cloudconductor.api.lib.exceptions.CloudConductorException; //导入依赖的package包/类
/**
 *
 * @param fileName the file name
 * @return get file filemode
 * @throws CloudConductorException thrown if communication with cloudconductor failed
 */
public static String getFileMode(String fileName) throws CloudConductorException {
	try {
		return ServerCom.agent.getFileFileMode(fileName);
	} catch (RuntimeException e) {
		throw new CloudConductorException(e.getMessage());
	}
}
 
开发者ID:cinovo,项目名称:cloudconductor-agent-redhat,代码行数:14,代码来源:ServerCom.java


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