001package io.ebean.docker.commands;
002
003import java.util.Properties;
004
005public class NuoDBConfig extends DbConfig {
006
007  private String network = "nuodb-net";
008  private String sm1 = "sm";
009  private String te1 = "te";
010  private String labels = "node localhost";
011
012  private int port2 = 48004;
013  private int internalPort2 = 48004;
014  private int port3 = 48005;
015  private int internalPort3 = 48005;
016
017  public NuoDBConfig(String version, Properties properties) {
018    this(version);
019    setProperties(properties);
020  }
021
022  public NuoDBConfig(String version) {
023    super("nuodb", 8888, 8888, version);
024    this.containerName = platform;
025    this.image = "nuodb/nuodb-ce:" + version;
026    this.adminUsername = "dba";
027    this.adminPassword = "dba";
028    // for testing purposes generally going to use single 'testdb'
029    // and different apps have different schema
030    this.dbName = "testdb";
031  }
032
033  public NuoDBConfig() {
034    this("4.0");
035  }
036
037  @Override
038  public String summary() {
039    return "port:" + port + " db:" + dbName + " schema:" + schema + " user:" + username + "/" + password;
040  }
041
042  public String jdbcUrl() {
043    return "jdbc:com.nuodb://localhost/" + getDbName();
044  }
045
046  public int getPort2() {
047    return port2;
048  }
049
050  public void setPort2(int port2) {
051    this.port2 = port2;
052  }
053
054  public int getInternalPort2() {
055    return internalPort2;
056  }
057
058  public void setInternalPort2(int internalPort2) {
059    this.internalPort2 = internalPort2;
060  }
061
062  public int getPort3() {
063    return port3;
064  }
065
066  public void setPort3(int port3) {
067    this.port3 = port3;
068  }
069
070  public int getInternalPort3() {
071    return internalPort3;
072  }
073
074  public void setInternalPort3(int internalPort3) {
075    this.internalPort3 = internalPort3;
076  }
077
078  public String getNetwork() {
079    return network;
080  }
081
082  public NuoDBConfig setNetwork(String network) {
083    this.network = network;
084    return this;
085  }
086
087  public String getSm1() {
088    return sm1;
089  }
090
091  public NuoDBConfig setSm1(String sm1) {
092    this.sm1 = sm1;
093    return this;
094  }
095
096  public String getTe1() {
097    return te1;
098  }
099
100  public NuoDBConfig setTe1(String te1) {
101    this.te1 = te1;
102    return this;
103  }
104
105  public String getLabels() {
106    return labels;
107  }
108
109  public NuoDBConfig setLabels(String labels) {
110    this.labels = labels;
111    return this;
112  }
113
114}