001    package org.kuali.common.deploy.appserver.tomcat;
002    
003    import org.kuali.common.util.Assert;
004    
005    public final class TomcatUser {
006    
007            private final String home;
008            private final String name;
009            private final String group;
010            private final String owner;
011    
012            public static class Builder {
013    
014                    // Required
015                    private final String home;
016                    private final String name;
017    
018                    // Optional
019                    private String group;
020                    private String owner;
021    
022                    public Builder(String home, String name) {
023                            this.home = home;
024                            this.name = name;
025                            this.group = name;
026                            this.owner = name;
027                    }
028    
029                    public Builder group(String group) {
030                            this.group = group;
031                            return this;
032                    }
033    
034                    public Builder owner(String owner) {
035                            this.owner = owner;
036                            return this;
037                    }
038    
039                    public TomcatUser build() {
040                            Assert.noBlanks(home, name, group, owner);
041                            return new TomcatUser(this);
042                    }
043    
044            }
045    
046            private TomcatUser(Builder builder) {
047                    this.home = builder.home;
048                    this.name = builder.name;
049                    this.group = builder.group;
050                    this.owner = builder.owner;
051            }
052    
053            public String getHome() {
054                    return home;
055            }
056    
057            public String getName() {
058                    return name;
059            }
060    
061            public String getGroup() {
062                    return group;
063            }
064    
065            public String getOwner() {
066                    return owner;
067            }
068    
069    }