001    /**
002     * 
003     */
004    package de.jw.cloud42.webapp;
005    
006    import org.jboss.seam.ScopeType;
007    import org.jboss.seam.annotations.Name;
008    import org.jboss.seam.annotations.Scope;
009    
010    /**
011     * Simple backing bean for creating a new permission. Holds the values entered in the UI.
012     * Also provides default values for a new permission.
013     * 
014     * @author fbitzer
015     *
016     */
017    @Name("permissionConfiguration")
018    @Scope(ScopeType.SESSION)
019    public class PermissionConfiguration {
020            
021            /**
022             * The group for which the permissionConfiguration applies
023             */
024            private String editedGroup;
025            
026            private String cidr = "0.0.0.0/0";
027            
028            private String source = "cidr";
029            
030            private String protocol = "tcp";
031            
032            //must be Integer so that it is nullable (for validation in the UI)
033            private Integer fromPort = 1;
034            private Integer toPort = 65535;
035            
036            /**
037             * the source user id
038             */
039            private String user;
040            
041            private String group;
042    
043            /**
044             * @return the cidr
045             */
046            public String getCidr() {
047                    return cidr;
048            }
049    
050            /**
051             * @param cidr the cidr to set
052             */
053            public void setCidr(String cidr) {
054                    this.cidr = cidr;
055            }
056    
057            /**
058             * @return the source
059             */
060            public String getSource() {
061                    return source;
062            }
063    
064            /**
065             * @param source the source to set
066             */
067            public void setSource(String source) {
068                    this.source = source;
069            }
070    
071            /**
072             * @return the protocol
073             */
074            public String getProtocol() {
075                    return protocol;
076            }
077    
078            /**
079             * @param protocol the protocol to set
080             */
081            public void setProtocol(String protocol) {
082                    this.protocol = protocol;
083            }
084    
085            /**
086             * @return the fromPort
087             */
088            public Integer getFromPort() {
089                    return fromPort;
090            }
091    
092            /**
093             * @param fromPort the fromPort to set
094             */
095            public void setFromPort(Integer fromPort) {
096                    this.fromPort = fromPort;
097            }
098    
099            /**
100             * @return the toPort
101             */
102            public Integer getToPort() {
103                    return toPort;
104            }
105    
106            /**
107             * @param toPort the toPort to set
108             */
109            public void setToPort(Integer toPort) {
110                    this.toPort = toPort;
111            }
112    
113            /**
114             * @return the user
115             */
116            public String getUser() {
117                    return user;
118            }
119    
120            /**
121             * @param user the user to set
122             */
123            public void setUser(String user) {
124                    this.user = user;
125            }
126    
127            /**
128             * @return the group
129             */
130            public String getGroup() {
131                    return group;
132            }
133    
134            /**
135             * @param group the group to set
136             */
137            public void setGroup(String group) {
138                    this.group = group;
139            }
140    
141            /**
142             * @return the editedGroup
143             */
144            public String getEditedGroup() {
145                    return editedGroup;
146            }
147    
148            /**
149             * @param editedGroup the editedGroup to set
150             */
151            public void setEditedGroup(String editedGroup) {
152                    this.editedGroup = editedGroup;
153            }
154            
155            
156    
157    }