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.api;
025
026 /**
027 * Provides all database privilege specific metadata.
028 *
029 * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
030 */
031 public interface Privilege extends CoreMetaData {
032
033 /**
034 * Returns privilege type
035 *
036 * @return privilege type
037 */
038 PrivilegeType getPrivilegeType();
039
040 /**
041 * Sets privilege type
042 *
043 * @param privilegeType the privilege type
044 */
045 void setPrivilegeType( PrivilegeType privilegeType );
046
047 /**
048 * Return grantor of access (may be <code>null</code>)
049 *
050 * @return grantor of access (may be <code>null</code>)
051 */
052 String getGrantor();
053
054 /**
055 * Sets grantor of access (may be <code>null</code>)
056 *
057 * @param grantor the grantor of access (may be <code>null</code>)
058 */
059 void setGrantor( String grantor );
060
061 /**
062 * Return grantee of access (may be <code>null</code>)
063 *
064 * @return grantee of access (may be <code>null</code>)
065 */
066 String getGrantee();
067
068 /**
069 * Sets grantee of access (may be <code>null</code>)
070 *
071 * @param grantee the grantee of access (may be <code>null</code>)
072 */
073 void setGrantee( String grantee );
074
075 /**
076 * Return name of access allowed (SELECT, INSERT, UPDATE, REFRENCES, ...)
077 *
078 * @return name of access allowed (SELECT, INSERT, UPDATE, REFRENCES, ...)
079 */
080 String getName();
081
082 /**
083 * Sets name of access allowed (SELECT, INSERT, UPDATE, REFRENCES, ...)
084 *
085 * @param name the name of access allowed (SELECT, INSERT, UPDATE, REFRENCES, ...)
086 */
087 void setName( String name );
088
089 /**
090 * Return true if grantee is permitted to grant to others, false otherwise (even if unknown).
091 *
092 * @return true if grantee is permitted to grant to others, false otherwise (even if unknown).
093 */
094 Boolean isGrantable();
095
096 /**
097 * Sets true if grantee is permitted to grant to others, false otherwise (even if unknown).
098 *
099 * @param grantable true if grantee is permitted to grant to others, false otherwise (even if unknown).
100 */
101 void setGrantable( Boolean grantable );
102
103 /**
104 * Return true if it is unknown: grantee is permitted to grant to others or not
105 *
106 * @return true if it is unknown: grantee is permitted to grant to others or not
107 */
108 Boolean isUnknownGrantable();
109
110 /**
111 * sets true if it is unknown: grantee is permitted to grant to others or not
112 *
113 * @param unknownGrantable true if it is unknown: grantee is permitted to grant to others or not
114 */
115 void setUnknownGrantable( Boolean unknownGrantable );
116 }