Search in sources :

Example 1 with Set

use of org.hsqldb_voltpatches.lib.Set in project voltdb by VoltDB.

the class Grantee method nonReservedVisibleGrantees.

/**
     * Set of all non-reserved visible grantees, including self. <p>
     *
     * For grantees with admin, this is all grantees.
     * For regular grantees, this is self plus all roles granted directly
     * or indirectly. <P>
     *
     * @param andPublic when <tt>true</tt> retains the reserved PUBLIC grantee
     */
public Set nonReservedVisibleGrantees(boolean andPublic) {
    Set grantees = visibleGrantees();
    GranteeManager gm = granteeManager;
    grantees.remove(gm.dbaRole);
    grantees.remove(GranteeManager.systemAuthorisation);
    if (!andPublic) {
        grantees.remove(gm.publicRole);
    }
    return grantees;
}
Also used : HashSet(org.hsqldb_voltpatches.lib.HashSet) OrderedHashSet(org.hsqldb_voltpatches.lib.OrderedHashSet) Set(org.hsqldb_voltpatches.lib.Set)

Example 2 with Set

use of org.hsqldb_voltpatches.lib.Set in project voltdb by VoltDB.

the class DatabaseInformationFull method insertRoles.

private void insertRoles(Table t, Grantee role, boolean isGrantable) {
    final int grantee = 0;
    final int role_name = 1;
    final int is_grantable = 2;
    PersistentStore store = database.persistentStoreCollection.getStore(t);
    if (isGrantable) {
        Set roles = database.getGranteeManager().getRoleNames();
        Iterator it = roles.iterator();
        while (it.hasNext()) {
            String roleName = (String) it.next();
            Object[] row = t.getEmptyRowData();
            row[grantee] = role.getNameString();
            row[role_name] = roleName;
            row[is_grantable] = "YES";
            t.insertSys(store, row);
        }
    } else {
        OrderedHashSet roles = role.getDirectRoles();
        for (int i = 0; i < roles.size(); i++) {
            String roleName = (String) roles.get(i);
            Object[] row = t.getEmptyRowData();
            row[grantee] = role.getNameString();
            row[role_name] = roleName;
            row[is_grantable] = Tokens.T_NO;
            t.insertSys(store, row);
            role = database.getGranteeManager().getRole(roleName);
            insertRoles(t, role, isGrantable);
        }
    }
}
Also used : SchemaObjectSet(org.hsqldb_voltpatches.SchemaObjectSet) HashSet(org.hsqldb_voltpatches.lib.HashSet) Set(org.hsqldb_voltpatches.lib.Set) OrderedHashSet(org.hsqldb_voltpatches.lib.OrderedHashSet) Iterator(org.hsqldb_voltpatches.lib.Iterator) WrapperIterator(org.hsqldb_voltpatches.lib.WrapperIterator) PersistentStore(org.hsqldb_voltpatches.persist.PersistentStore) OrderedHashSet(org.hsqldb_voltpatches.lib.OrderedHashSet) SchemaObject(org.hsqldb_voltpatches.SchemaObject) Constraint(org.hsqldb_voltpatches.Constraint)

Example 3 with Set

use of org.hsqldb_voltpatches.lib.Set in project voltdb by VoltDB.

the class HsqlDatabaseProperties method getUserDefinedPropertyData.

public Set getUserDefinedPropertyData() {
    Set set = new HashSet();
    Iterator it = meta.values().iterator();
    while (it.hasNext()) {
        Object[] row = (Object[]) it.next();
        if (((Integer) row[indexType]).intValue() == SET_PROPERTY) {
            set.add(row);
        }
    }
    return set;
}
Also used : Set(org.hsqldb_voltpatches.lib.Set) HashSet(org.hsqldb_voltpatches.lib.HashSet) Iterator(org.hsqldb_voltpatches.lib.Iterator) HashSet(org.hsqldb_voltpatches.lib.HashSet)

Aggregations

HashSet (org.hsqldb_voltpatches.lib.HashSet)3 Set (org.hsqldb_voltpatches.lib.Set)3 Iterator (org.hsqldb_voltpatches.lib.Iterator)2 OrderedHashSet (org.hsqldb_voltpatches.lib.OrderedHashSet)2 Constraint (org.hsqldb_voltpatches.Constraint)1 SchemaObject (org.hsqldb_voltpatches.SchemaObject)1 SchemaObjectSet (org.hsqldb_voltpatches.SchemaObjectSet)1 WrapperIterator (org.hsqldb_voltpatches.lib.WrapperIterator)1 PersistentStore (org.hsqldb_voltpatches.persist.PersistentStore)1