示例#1
0
  public void setBaseUrls(ServerSiteUrlConfig siteUrl, ServerSiteUrlConfig secureSiteUrl) {
    CruiseConfig config = loadForEdit();

    config.setServerConfig(
        new ServerConfig(
            config.server().security(), config.server().mailHost(), siteUrl, secureSiteUrl));
    writeConfigFile(config);
  }
示例#2
0
 public void addAdminRoles(String... roleNames) {
   CruiseConfig cruiseConfig = loadForEdit();
   AdminsConfig adminsConfig = cruiseConfig.server().security().adminsConfig();
   for (String roleName : roleNames) {
     adminsConfig.add(new AdminRole(new CaseInsensitiveString(roleName)));
   }
   writeConfigFile(cruiseConfig);
 }
示例#3
0
 public void setupMailHost() {
   CruiseConfig config = loadForEdit();
   config
       .server()
       .setMailHost(
           new MailHost(
               "10.18.3.171",
               25,
               "cruise2",
               "password",
               true,
               false,
               "*****@*****.**",
               "*****@*****.**"));
   writeConfigFile(config);
 }
示例#4
0
 public boolean isSecurityEnabled() {
   CruiseConfig cruiseConfig = loadForEdit();
   return cruiseConfig.server().isSecurityEnabled();
 }
示例#5
0
 public void addRole(Role role) {
   CruiseConfig config = loadForEdit();
   config.server().security().addRole(role);
   writeConfigFile(config);
 }
示例#6
0
 public void addMailHost(MailHost mailHost) {
   CruiseConfig config = loadForEdit();
   config.server().updateMailHost(mailHost);
   writeConfigFile(config);
 }
示例#7
0
 public void addSecurity(SecurityConfig securityConfig) {
   CruiseConfig config = loadForEdit();
   config.server().useSecurity(securityConfig);
   writeConfigFile(config);
 }
示例#8
0
 public void updateArtifactRoot(String path) {
   CruiseConfig cruiseConfig = loadForEdit();
   cruiseConfig.server().updateArtifactRoot(path);
   writeConfigFile(cruiseConfig);
 }
示例#9
0
 public void setArtifactsDir(String artifactsDir) {
   CruiseConfig cruiseConfig = loadForEdit();
   cruiseConfig.server().setArtifactsDir(artifactsDir);
   writeConfigFile(cruiseConfig);
 }