001    /*
002     * JBoss DNA (http://www.jboss.org/dna)
003     * See the COPYRIGHT.txt file distributed with this work for information
004     * regarding copyright ownership.  Some portions may be licensed
005     * to Red Hat, Inc. under one or more contributor license agreements.
006     * See the AUTHORS.txt file in the distribution for a full listing of 
007     * individual contributors. 
008     *
009     * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
010     * is licensed to you under the terms of the GNU Lesser General Public License as
011     * published by the Free Software Foundation; either version 2.1 of
012     * the License, or (at your option) any later version.
013     *
014     * JBoss DNA is distributed in the hope that it will be useful,
015     * but WITHOUT ANY WARRANTY; without even the implied warranty of
016     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017     * Lesser General Public License for more details.
018     *
019     * You should have received a copy of the GNU Lesser General Public
020     * License along with this software; if not, write to the Free
021     * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
022     * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
023     */
024    package org.jboss.dna.common.jdbc.model.spi;
025    
026    import org.jboss.dna.common.jdbc.model.api.Privilege;
027    import org.jboss.dna.common.jdbc.model.api.PrivilegeType;
028    
029    /**
030     * Provides all database privilege specific metadata.
031     * 
032     * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
033     */
034    public class PrivilegeBean extends CoreMetaDataBean implements Privilege {
035        private static final long serialVersionUID = -163129768802977718L;
036        private PrivilegeType privilegeType;
037        private String grantor;
038        private String grantee;
039        private String name;
040        private Boolean grantable;
041        private Boolean unknownGrantable;
042    
043        /**
044         * Default constructor
045         */
046        public PrivilegeBean() {
047        }
048    
049        /**
050         * Returns privilege type
051         * 
052         * @return privilege type
053         */
054        public PrivilegeType getPrivilegeType() {
055            return privilegeType;
056        }
057    
058        /**
059         * Sets privilege type
060         * 
061         * @param privilegeType the privilege type
062         */
063        public void setPrivilegeType( PrivilegeType privilegeType ) {
064            this.privilegeType = privilegeType;
065        }
066    
067        /**
068         * Return grantor of access (may be <code>null</code>)
069         * 
070         * @return grantor of access (may be <code>null</code>)
071         */
072        public String getGrantor() {
073            return grantor;
074        }
075    
076        /**
077         * Sets grantor of access (may be <code>null</code>)
078         * 
079         * @param grantor the grantor of access (may be <code>null</code>)
080         */
081        public void setGrantor( String grantor ) {
082            this.grantor = grantor;
083        }
084    
085        /**
086         * Return grantee of access (may be <code>null</code>)
087         * 
088         * @return grantee of access (may be <code>null</code>)
089         */
090        public String getGrantee() {
091            return grantee;
092        }
093    
094        /**
095         * Sets grantee of access (may be <code>null</code>)
096         * 
097         * @param grantee the grantee of access (may be <code>null</code>)
098         */
099        public void setGrantee( String grantee ) {
100            this.grantee = grantee;
101        }
102    
103        /**
104         * Return name of access allowed (SELECT, INSERT, UPDATE, REFRENCES, ...)
105         * 
106         * @return name of access allowed (SELECT, INSERT, UPDATE, REFRENCES, ...)
107         */
108        public String getName() {
109            return name;
110        }
111    
112        /**
113         * Sets name of access allowed (SELECT, INSERT, UPDATE, REFRENCES, ...)
114         * 
115         * @param name the name of access allowed (SELECT, INSERT, UPDATE, REFRENCES, ...)
116         */
117        public void setName( String name ) {
118            this.name = name;
119        }
120    
121        /**
122         * Return true if grantee is permitted to grant to others, false otherwise (even if unknown).
123         * 
124         * @return true if grantee is permitted to grant to others, false otherwise (even if unknown).
125         */
126        public Boolean isGrantable() {
127            return grantable;
128        }
129    
130        /**
131         * Sets true if grantee is permitted to grant to others, false otherwise (even if unknown).
132         * 
133         * @param grantable true if grantee is permitted to grant to others, false otherwise (even if unknown).
134         */
135        public void setGrantable( Boolean grantable ) {
136            this.grantable = grantable;
137        }
138    
139        /**
140         * Return true if it is unknown: grantee is permitted to grant to others or not
141         * 
142         * @return true if it is unknown: grantee is permitted to grant to others or not
143         */
144        public Boolean isUnknownGrantable() {
145            return unknownGrantable;
146        }
147    
148        /**
149         * sets true if it is unknown: grantee is permitted to grant to others or not
150         * 
151         * @param unknownGrantable true if it is unknown: grantee is permitted to grant to others or not
152         */
153        public void setUnknownGrantable( Boolean unknownGrantable ) {
154            this.unknownGrantable = unknownGrantable;
155        }
156    }