com.knowgate.acl
Class ACLGroup

java.lang.Object
  extended bycom.knowgate.dataobjs.DBPersist
      extended bycom.knowgate.acl.ACLGroup
All Implemented Interfaces:
java.util.Map

public final class ACLGroup
extends DBPersist

Security Role Groups

Version:
3.0

Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
static short ClassId
           
 
Fields inherited from class com.knowgate.dataobjs.DBPersist
AllVals, sAuditCls, sAuditUsr, sTransactId
 
Constructor Summary
ACLGroup()
          Default constructor.
ACLGroup(java.lang.String sGroupUId)
          Construct object and set gu_acl_group field.
 
Method Summary
 int addACLUser(JDCConnection oConn, java.lang.String sIdUser)
          Add User to Group.
 int addACLUsers(JDCConnection oConn, java.lang.String sUserList)
          Add Users to Group.
 int clearACLUsers(JDCConnection oConn)
          Remove all users from this group.
static boolean delete(JDCConnection oConn, java.lang.String sGroupGUID)
          Delete Group
static java.lang.String getIdFromName(java.sql.Connection oConn, int iDomainId, java.lang.String sGroupNm)
          Get Group Unique Id.
static java.lang.String getIdFromName(JDCConnection oConn, int iDomainId, java.lang.String sGroupNm)
          Get Group Unique Id.
 int removeACLUser(JDCConnection oConn, java.lang.String sIdUser)
          Remove User from Group.
 boolean store(JDCConnection oConn)
          Store a register at database representing this instance of DBPersist
 
Methods inherited from class com.knowgate.dataobjs.DBPersist
allcaps, allcaps, changelog, clear, clone, containsKey, containsValue, delete, entrySet, exists, get, get, getAuditClassName, getCreationDate, getDate, getDateFormated, getDateShort, getDecimal, getDecimalFormated, getDouble, getDoubleFormated, getFloat, getFloatFormated, getInt, getInteger, getItemMap, getItems, getShort, getString, getStringNull, getTable, getTable, getTableName, getTime, getTimeOfDay, getTimestamp, getUIdFromName, isEmpty, isNull, iterator, keySet, load, load, parseXML, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, putAll, putAll, remove, remove, replace, replace, replace, replace, setAuditTransact, setAuditUser, size, toLowerCase, toUpperCase, toXML, toXML, toXML, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

ClassId

public static final short ClassId
See Also:
Constant Field Values
Constructor Detail

ACLGroup

public ACLGroup()
Default constructor.


ACLGroup

public ACLGroup(java.lang.String sGroupUId)
Construct object and set gu_acl_group field. Object is not fully loaded from database.

Parameters:
sGroupUId - Group Unique Identifier
Method Detail

store

public boolean store(JDCConnection oConn)
              throws java.sql.SQLException
Description copied from class: DBPersist

Store a register at database representing this instance of DBPersist

Insertions and updates : The store method automatically manages register insertions and updates. If the stored object already exists at database then it is updated, if it does not exists then it is inserted. A primary key violation error is never thrown so ther is no need to call delete() method before re-writing an existing object.

NULL fields : All values not set calling put() methods for DBPersist will be assumed to be NULL. If a not nullable field is not set then an SQLException will be raised.
On storing an already existing object all values will we overwrited, so is a DBPersist is not fully loaded before storing it, values not set by calling put() methods that already were present at database will be lost.

Overrides:
store in class DBPersist
Parameters:
oConn - Database Connection
Returns:
true is register was stored for the first time, false if register already existed.
Throws:
java.sql.SQLException

addACLUser

public int addACLUser(JDCConnection oConn,
                      java.lang.String sIdUser)
               throws java.sql.SQLException

Add User to Group.

Insert new register at k_x_group_user table.

Parameters:
oConn - Database Connection
sIdUser - User Unique Identifier.
Throws:
java.sql.SQLException - May throw a primary key constraint violation is user already belongs to group.

addACLUsers

public int addACLUsers(JDCConnection oConn,
                       java.lang.String sUserList)
                throws java.sql.SQLException

Add Users to Group.

Insert new registers at k_x_group_user table.

Parameters:
oConn - Database Connection
sUserList - A string of comma delimited User GUIDs that must be added to this ACLGroup.
Throws:
java.sql.SQLException - May throw a primary key constraint violation is user already belongs to group.

removeACLUser

public int removeACLUser(JDCConnection oConn,
                         java.lang.String sIdUser)
                  throws java.sql.SQLException

Remove User from Group.

remove register from k_x_group_user table.

Parameters:
oConn - Database Connection
sIdUser - User Unique Identifier.
Throws:
java.sql.SQLException

clearACLUsers

public int clearACLUsers(JDCConnection oConn)
                  throws java.sql.SQLException

Remove all users from this group.

Delete registers from k_x_group_user

Parameters:
oConn - Database connection
Throws:
java.sql.SQLException

getIdFromName

public static java.lang.String getIdFromName(java.sql.Connection oConn,
                                             int iDomainId,
                                             java.lang.String sGroupNm)
                                      throws java.sql.SQLException

Get Group Unique Id. from its name.

This method executes a SQL query with a ResultSet

Parameters:
oConn - Connection Database Connection
iDomainId - int Domain Identifier to with Group belongs
sGroupNm - String Group Name
Returns:
Group Unique Identifier or null if no group with such name was found at given domain.
Throws:
java.sql.SQLException
Since:
3.0

getIdFromName

public static java.lang.String getIdFromName(JDCConnection oConn,
                                             int iDomainId,
                                             java.lang.String sGroupNm)
                                      throws java.sql.SQLException

Get Group Unique Id. from its name.

This method calls k_sp_get_group_id stored procedure.

Parameters:
oConn - JDCConnection
iDomainId - int Domain Identifier to with Group belongs
sGroupNm - Group Name
Returns:
Group String Unique Identifier or null if no group with such name was found at given domain.
Throws:
java.sql.SQLException

delete

public static boolean delete(JDCConnection oConn,
                             java.lang.String sGroupGUID)
                      throws java.sql.SQLException

Delete Group

Call k_sp_del_group stored procedure

Parameters:
oConn - Database Connection
sGroupGUID - Group Unique Identifier
Throws:
java.sql.SQLException