• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java DockerCertificateException类的典型用法和代码示例

java 12次浏览

本文整理汇总了Java中com.spotify.docker.client.DockerCertificateException的典型用法代码示例。如果您正苦于以下问题:Java DockerCertificateException类的具体用法?Java DockerCertificateException怎么用?Java DockerCertificateException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

DockerCertificateException类属于com.spotify.docker.client包,在下文中一共展示了DockerCertificateException类的22个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setUp

点赞 3

import com.spotify.docker.client.DockerCertificateException; //导入依赖的package包/类
@Before
public void setUp() throws com.spotify.docker.client.DockerException, InterruptedException,
    DockerCertificateException {

    dockerClient = mock(DockerClient.class);

    writer = new ByteBufferLogSteamWriter();

    streamer = new DockerStreamer(writer, dockerClient);

    testLogStream = new TestableLogStream();

    when(dockerClient
        .exec(SOME_CONTAINER_ID, "sh", "-c", streamer.getMonitorCmd(
            SOME_LOG_LOCATION))).thenReturn(
        testLogStream);
}
 

开发者ID:triforkse,
项目名称:logstash-mesos,
代码行数:18,
代码来源:DockerStreamerTest.java

示例2: getInstance

点赞 3

import com.spotify.docker.client.DockerCertificateException; //导入依赖的package包/类
static public Dockerus getInstance() {
    if (DockerusAuto.instance == null) {
        try {
            DockerusAuto.instance = Dockerus.getInstance();
            DockerusAuto.instance.me();
        } catch (DockerCertificateException | InterruptedException | DockerException e) {
            try {
                DockerusAuto.instance = DockerusDummy.getInstance();
            } catch (DockerCertificateException e1) {
                System.err.println("LOL THIS SHOULDN'T FAIL BECAUSE FAILING IS NOT IMPLEMENTED!!!111");
                e1.printStackTrace();
            }
        }
    }
    return DockerusAuto.instance;
}
 

开发者ID:KathrynJaneway,
项目名称:PBFT-JAVA,
代码行数:17,
代码来源:DockerusAuto.java

示例3: normalFunction

点赞 3

import com.spotify.docker.client.DockerCertificateException; //导入依赖的package包/类
/**
 * The row 15 to 27 from the algorithm.
 * @throws DockerException
 * @throws InterruptedException
 * @throws UnsupportedEncodingException
 * @throws DockerCertificateException
 */
public void normalFunction() throws DockerException, InterruptedException, UnsupportedEncodingException, DockerCertificateException {
    Sender sender = new Sender();
    initStore = new ArrayList();

    sender.sendMessage(new InitMessage(((int) System.currentTimeMillis()/sequencelength), DockerusAuto.getInstance().getNumber(), ToDO.getSensorValue()));  //UNixtimestampe

    if(this.leader == DockerusAuto.getInstance().getNumber()){
        if(this.initStore.size() >= DockerusAuto.getInstance().getHostnames(true).size() - (1/3)){  //TODO: (int) 1/3 == 0
            float median = (float) Median.calculateMedian(this.initStore);
            sender.sendMessage(
                    new ProposeMessage(
                            (int) System.currentTimeMillis()/sequencelength,
                            DockerusAuto.getInstance().getNumber(),
                            DockerusAuto.getInstance().getNumber(),
                            median,
                            initStore
                    )
            );
        }
        //notify soll auf timeout oder genügend nachrichten warten

    }
}
 

开发者ID:KathrynJaneway,
项目名称:PBFT-JAVA,
代码行数:31,
代码来源:NormalCase.java

示例4: broadcast

点赞 3

import com.spotify.docker.client.DockerCertificateException; //导入依赖的package包/类
/**
 * Send broadcast messages in the network of registered nodes.
 * @param message String with the specific message (init, void...).
 * @throws UnsupportedEncodingException
 * @throws DockerCertificateException
 * @throws DockerException
 * @throws InterruptedException
 */
public void broadcast(String message) throws UnsupportedEncodingException, DockerCertificateException, DockerException, InterruptedException {
    List<String> otherHostnames = DockerusAuto.getInstance().getHostnames(true);
    message += "\n";
    msg = "ANSWER " + message.length() + "\n" + message;
    byte[] msgBytes = msg.getBytes("UTF-8");
    for (String nodeHost: otherHostnames){
        Boolean sent = false;
        while(!sent){
            try {
                Socket socket = new Socket(nodeHost, 4458);  //open a socket port 4458, and the nodeHost names of the other hosts
                DataOutputStream dataStream = new DataOutputStream(socket.getOutputStream()); //to send messages
                dataStream.write(msgBytes); //write the messages at the datastream
                sent = true;
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
 

开发者ID:KathrynJaneway,
项目名称:PBFT-JAVA,
代码行数:28,
代码来源:Sender.java

示例5: DockerWrapper

点赞 3

import com.spotify.docker.client.DockerCertificateException; //导入依赖的package包/类
/**
 * Constructor.
 * @param dockerHost String. The docker host ex: https://something:2376
 * @param certPath String. The certificate path
 * @param feedBackLevel String. The logging level: q = ERROR, v = DEBUG, i = info (default)
 * @throws DockerCertificateException
 */
public DockerWrapper(String dockerHost, String certPath, String feedBackLevel) throws DockerCertificateException {
	this.dockerHost = dockerHost;
	this.certPath = certPath;
	this.docker = DefaultDockerClient.builder()
		    .uri(URI.create(this.dockerHost))
		    .dockerCertificates(new DockerCertificates(Paths.get(this.certPath)))
		    .build();
	if (feedBackLevel.equalsIgnoreCase("q")) {
		Logger.getRootLogger().setLevel(Level.ERROR);
		logger.setLevel(Level.ERROR);
	}
	else if (feedBackLevel.equalsIgnoreCase("v")) {
			Logger.getRootLogger().setLevel(Level.DEBUG);
			logger.setLevel(Level.DEBUG);
	}
}
 

开发者ID:cleuton,
项目名称:servkeeper,
代码行数:24,
代码来源:DockerWrapper.java

示例6: test

点赞 3

import com.spotify.docker.client.DockerCertificateException; //导入依赖的package包/类
@Test
public void test() throws DockerCertificateException, DockerException, InterruptedException, IOException {
	String dockerHost = "https://192.168.59.103:2376";
	String certPath = "/Users/cleutonsampaio/.boot2docker/certs/boot2docker-vm";
	DockerWrapper dw = new DockerWrapper(dockerHost, certPath, "i");
	ServerAddress sa = new ServerAddress("localhost", 3001);
	Instance si = dw.up(sa,3000,
			"/Users/cleutonsampaio/Documents/projetos/dockertest",
			"signatureimage",
			"signatureserver");
	assertTrue(si != null);
	assertTrue(si.isRunning());
	assertTrue(si.getId() != null);
	boolean retorno = dw.delete(si);
	assertTrue(retorno);
	assertFalse(si.isRunning());
	assertTrue(si.getId() == null);
}
 

开发者ID:cleuton,
项目名称:servkeeper,
代码行数:19,
代码来源:TestDockerWrapperCreateDelete.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)