當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。