|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.internet2.middleware.grouper.GrouperAPI edu.internet2.middleware.grouper.attr.assign.AttributeAssignActionSet
public class AttributeAssignActionSet
Make a directed graph of attribute assign actions. e.g. "admin" implies "read" and "write". RegistryReset.internal_resetRegistryAndAddTestSubjects(); exit; grouperSession = GrouperSession.startRootSession(); root = StemFinder.findRootStem(this.grouperSession); top = this.root.addChildStem("top", "top display name"); -or- top = StemFinder.findByName(grouperSession, "top"); role = top.addChildRole("role", "role"); //make a permission definition permissionDef = top.addChildAttributeDef("permissionDef", AttributeDefType.perm); //make a permission name permissionName = top.addChildAttributeDefName(permissionDef, "permission", "permission"); //set the list of allowed actions for this permission definition permissionDef.getAttributeDefActionDelegate().configureActionList("admin,read,write"); admin = permissionDef.getAttributeDefActionDelegate().allowedAction("admin", true); read = permissionDef.getAttributeDefActionDelegate().allowedAction("read", true); write = permissionDef.getAttributeDefActionDelegate().allowedAction("write", true); //if someone has admin, then they have read or write admin.getAttributeAssignActionSetDelegate().addToAttributeAssignActionSet(read); admin.getAttributeAssignActionSetDelegate().addToAttributeAssignActionSet(write); //assign admin permission to a role role.getPermissionRoleDelegate().assignRolePermission("admin", permissionName); //assign the role to a user role.addMember(SubjectFinder.findById("test.subject.0")); //see what permissions that user has (true is returned to all) GrouperDAOFactory.getFactory().getPermissionEntry().hasPermissionBySubjectIdSourceIdActionAttributeDefName("test.subject.0", "jdbc", "admin", "top:permission"); GrouperDAOFactory.getFactory().getPermissionEntry().hasPermissionBySubjectIdSourceIdActionAttributeDefName("test.subject.0", "jdbc", "read", "top:permission"); GrouperDAOFactory.getFactory().getPermissionEntry().hasPermissionBySubjectIdSourceIdActionAttributeDefName("test.subject.0", "jdbc", "write", "top:permission");
Field Summary | |
---|---|
static String |
COLUMN_CONTEXT_ID
column |
static String |
COLUMN_CREATED_ON
column |
static String |
COLUMN_DEPTH
column |
static String |
COLUMN_ID
column |
static String |
COLUMN_IF_HAS_ATTR_ASSN_ACTION_ID
column |
static String |
COLUMN_LAST_UPDATED
column |
static String |
COLUMN_PARENT_ATTR_ASSN_ACTION_ID
column |
static String |
COLUMN_THEN_HAS_ATTR_ASSN_ACTION_ID
column |
static String |
COLUMN_TYPE
column |
static String |
FIELD_CONTEXT_ID
constant for field name for: contextId |
static String |
FIELD_CREATED_ON_DB
constant for field name for: createdOnDb |
static String |
FIELD_DEPTH
constant for field name for: depth |
static String |
FIELD_ID
constant for field name for: id |
static String |
FIELD_IF_HAS_ATTR_ASSIGN_ACTION_ID
constant for field name for: ifHasAttributeAssignActionId |
static String |
FIELD_LAST_UPDATED_DB
constant for field name for: lastUpdatedDb |
static String |
FIELD_PARENT_ATTR_ASSIGN_ACTION_SET_ID
constant for field name for: parentAttrAssignActionSetId |
static String |
FIELD_THEN_HAS_ATTR_ASSIGN_ACTION_ID
constant for field name for: thenHasAttributeAssignActionId |
static String |
FIELD_TYPE
constant for field name for: type |
static String |
TABLE_GROUPER_ATTR_ASSIGN_ACTION_SET
name of the groups attribute assign action set |
Fields inherited from class edu.internet2.middleware.grouper.GrouperAPI |
---|
COLUMN_HIBERNATE_VERSION_NUMBER, FIELD_DB_VERSION, FIELD_HIBERNATE_VERSION_NUMBER, INITIAL_VERSION_NUMBER |
Fields inherited from interface org.hibernate.classic.Lifecycle |
---|
NO_VETO, VETO |
Constructor Summary | |
---|---|
AttributeAssignActionSet()
|
Method Summary | |
---|---|
int |
__getDepth()
depth of this relationship (0 means self, 1 means one hop, 2 means 2 hops, etc) |
String |
__getId()
if of this object |
GrouperSetElement |
__getIfHasElement()
if has this element then has another element |
String |
__getIfHasElementId()
if has this element id then has another element id |
GrouperSet |
__getParentGrouperSet()
get the parent set the parent is the relationship leading up to this relationship. |
String |
__getParentGrouperSetId()
parent set id |
GrouperSetElement |
__getThenHasElement()
has this element if it has another |
String |
__getThenHasElementId()
has this element Id if it has another id |
void |
__setParentGrouperSetId(String grouperSetId)
set the parent id of this set. |
GrouperAPI |
clone()
deep clone the fields in this object |
AttributeAssignActionSet |
dbVersion()
save the state when retrieving from DB |
Set<String> |
dbVersionDifferentFields()
see which fields have changed compared to the DB state (last known) note that attributes will print out: attribute__attributeName |
void |
dbVersionReset()
take a snapshot of the data since this is what is in the db |
void |
delete()
delete this object |
boolean |
equals(Object other)
|
static AttributeAssignActionSet |
findInCollection(Collection<AttributeAssignActionSet> attributeDefNameSets,
String ifHasId,
String thenHasId,
int depth,
boolean exceptionIfNull)
find an attribute def name set, better be here |
String |
getContextId()
context id of the transaction |
Timestamp |
getCreatedOn()
when created |
Long |
getCreatedOnDb()
when created |
int |
getDepth()
|
String |
getId()
|
String |
getIfHasAttrAssignActionId()
|
AttributeAssignAction |
getIfHasAttributeAssignAction()
|
Timestamp |
getLastUpdated()
when last updated |
Long |
getLastUpdatedDb()
when last updated |
String |
getParentAttrAssignActionSetId()
for self, or immediate, just use this id. |
AttributeAssignActionSet |
getParentAttributeDefSet()
|
String |
getThenHasAttrAssignActionId()
|
AttributeAssignAction |
getThenHasAttributeAssignAction()
|
AttributeAssignActionType |
getType()
|
String |
getTypeDb()
get string value of type for hibernate |
int |
hashCode()
|
void |
onPreDelete(HibernateSession hibernateSession)
before a delete (insert) occurs |
void |
onPreSave(HibernateSession hibernateSession)
before a save (insert) occurs |
void |
onPreUpdate(HibernateSession hibernateSession)
before an update occurs |
void |
saveOrUpdate()
save or update this object |
void |
setContextId(String contextId)
set context id |
void |
setCreatedOn(Timestamp createdOn1)
when created |
void |
setCreatedOnDb(Long createdOn1)
when created |
void |
setDepth(int depth)
set depth |
void |
setId(String id)
set id |
void |
setIfHasAttrAssignActionId(String memberAttributeAssignActionId)
Set attribute def name id for the child |
void |
setLastUpdated(Timestamp lastUpdated1)
when last updated |
void |
setLastUpdatedDb(Long lastUpdated1)
when last updated |
void |
setParentAttrAssignActionSetId(String parentId1)
for self, or immediate, just use this id. |
void |
setThenHasAttrAssignActionId(String ownerAttributeDefId)
Set attribute def id for the owner |
void |
setType(AttributeAssignActionType type1)
set group set assignment type |
void |
setTypeDb(String type1)
set group set assignment type |
String |
toString()
|
void |
xmlCopyBusinessPropertiesToExisting(AttributeAssignActionSet existingRecord)
copy business (non update) properties to an existing record |
boolean |
xmlDifferentBusinessProperties(AttributeAssignActionSet other)
see if the non update cols are different (e.g. |
boolean |
xmlDifferentUpdateProperties(AttributeAssignActionSet other)
see if the update cols are different (e.g. |
String |
xmlGetId()
set id key in db |
AttributeAssignActionSet |
xmlRetrieveByIdOrKey()
retrieve from db by id or key. |
AttributeAssignActionSet |
xmlSaveBusinessProperties(AttributeAssignActionSet existingRecord)
save the business properties (not update properties) |
void |
xmlSaveUpdateProperties()
save the udpate properties (e.g. |
void |
xmlSetId(String theId)
set id key in db |
XmlExportAttributeAssignActionSet |
xmlToExportAttributeAssignActionSet(GrouperVersion grouperVersion)
convert to xml bean for export |
String |
xmlToString()
convert to string for log |
Methods inherited from class edu.internet2.middleware.grouper.GrouperAPI |
---|
dbVersionClear, dbVersionIsDifferent, fieldValue, getHibernateVersionNumber, onDelete, onLoad, onPostDelete, onPostSave, onPostUpdate, onSave, onUpdate, setHibernateVersionNumber |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String TABLE_GROUPER_ATTR_ASSIGN_ACTION_SET
public static final String COLUMN_CONTEXT_ID
public static final String COLUMN_CREATED_ON
public static final String COLUMN_LAST_UPDATED
public static final String COLUMN_ID
public static final String COLUMN_DEPTH
public static final String COLUMN_IF_HAS_ATTR_ASSN_ACTION_ID
public static final String COLUMN_THEN_HAS_ATTR_ASSN_ACTION_ID
public static final String COLUMN_PARENT_ATTR_ASSN_ACTION_ID
public static final String COLUMN_TYPE
public static final String FIELD_CONTEXT_ID
public static final String FIELD_CREATED_ON_DB
public static final String FIELD_DEPTH
public static final String FIELD_ID
public static final String FIELD_IF_HAS_ATTR_ASSIGN_ACTION_ID
public static final String FIELD_LAST_UPDATED_DB
public static final String FIELD_PARENT_ATTR_ASSIGN_ACTION_SET_ID
public static final String FIELD_THEN_HAS_ATTR_ASSIGN_ACTION_ID
public static final String FIELD_TYPE
Constructor Detail |
---|
public AttributeAssignActionSet()
Method Detail |
---|
public String toString()
toString
in class Object
Object.toString()
public static AttributeAssignActionSet findInCollection(Collection<AttributeAssignActionSet> attributeDefNameSets, String ifHasId, String thenHasId, int depth, boolean exceptionIfNull)
attributeDefNameSets
- ifHasId
- thenHasId
- depth
- is the depth expectingexceptionIfNull
-
public boolean equals(Object other)
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public GrouperAPI clone()
GrouperAPI
clone
in interface GrouperCloneable
clone
in class GrouperAPI
Object.clone()
public AttributeAssignActionSet getParentAttributeDefSet()
public AttributeAssignAction getIfHasAttributeAssignAction()
public AttributeAssignAction getThenHasAttributeAssignAction()
public String getId()
public void setId(String id)
id
- public void setContextId(String contextId)
contextId
- public String getParentAttrAssignActionSetId()
public void setParentAttrAssignActionSetId(String parentId1)
parentId1
- public String getThenHasAttrAssignActionId()
public void setThenHasAttrAssignActionId(String ownerAttributeDefId)
ownerAttributeDefId
- public String getIfHasAttrAssignActionId()
public void setIfHasAttrAssignActionId(String memberAttributeAssignActionId)
memberAttributeAssignActionId
- public AttributeAssignActionType getType()
public String getTypeDb()
public void setType(AttributeAssignActionType type1)
type1
- public void setTypeDb(String type1)
type1
- public int getDepth()
public void setDepth(int depth)
depth
- public String getContextId()
public Timestamp getCreatedOn()
public Long getCreatedOnDb()
public Timestamp getLastUpdated()
public Long getLastUpdatedDb()
public void saveOrUpdate()
saveOrUpdate
in interface GrouperSet
public void delete()
delete
in interface GrouperSet
public void setCreatedOnDb(Long createdOn1)
createdOn1
- public void setCreatedOn(Timestamp createdOn1)
createdOn1
- public void setLastUpdated(Timestamp lastUpdated1)
lastUpdated1
- public void setLastUpdatedDb(Long lastUpdated1)
lastUpdated1
- public String __getId()
GrouperSet
__getId
in interface GrouperSet
GrouperSet.__getId()
public String __getIfHasElementId()
GrouperSet
__getIfHasElementId
in interface GrouperSet
GrouperSet.__getIfHasElementId()
public String __getThenHasElementId()
GrouperSet
__getThenHasElementId
in interface GrouperSet
GrouperSet.__getThenHasElementId()
public int __getDepth()
GrouperSet
__getDepth
in interface GrouperSet
GrouperSet.__getDepth()
public GrouperSetElement __getIfHasElement()
GrouperSet
__getIfHasElement
in interface GrouperSet
GrouperSet.__getIfHasElement()
public GrouperSetElement __getThenHasElement()
GrouperSet
__getThenHasElement
in interface GrouperSet
GrouperSet.__getThenHasElement()
public void __setParentGrouperSetId(String grouperSetId)
GrouperSet
__setParentGrouperSetId
in interface GrouperSet
GrouperSet.__setParentGrouperSetId(java.lang.String)
public GrouperSet __getParentGrouperSet()
GrouperSet
__getParentGrouperSet
in interface GrouperSet
GrouperSet.__getParentGrouperSet()
public String __getParentGrouperSetId()
GrouperSet
__getParentGrouperSetId
in interface GrouperSet
GrouperSet.__getParentGrouperSetId()
public void xmlCopyBusinessPropertiesToExisting(AttributeAssignActionSet existingRecord)
XmlImportableBase
xmlCopyBusinessPropertiesToExisting
in interface XmlImportableBase<AttributeAssignActionSet>
XmlImportableBase.xmlCopyBusinessPropertiesToExisting(java.lang.Object)
public boolean xmlDifferentBusinessProperties(AttributeAssignActionSet other)
XmlImportableBase
xmlDifferentBusinessProperties
in interface XmlImportableBase<AttributeAssignActionSet>
other
- the one to compare with
XmlImportableBase.xmlDifferentBusinessProperties(java.lang.Object)
public boolean xmlDifferentUpdateProperties(AttributeAssignActionSet other)
XmlImportableBase
xmlDifferentUpdateProperties
in interface XmlImportableBase<AttributeAssignActionSet>
other
- the one to compare with
XmlImportableBase.xmlDifferentUpdateProperties(java.lang.Object)
public AttributeAssignActionSet xmlRetrieveByIdOrKey()
XmlImportable
xmlRetrieveByIdOrKey
in interface XmlImportable<AttributeAssignActionSet>
XmlImportable.xmlRetrieveByIdOrKey()
public AttributeAssignActionSet xmlSaveBusinessProperties(AttributeAssignActionSet existingRecord)
XmlImportableBase
xmlSaveBusinessProperties
in interface XmlImportableBase<AttributeAssignActionSet>
existingRecord
- null if insert, the object if exists in DB
generally just copy the hibernate version number, and last updated to the
object and store it
XmlImportableBase.xmlSaveBusinessProperties(java.lang.Object)
public void xmlSaveUpdateProperties()
XmlImportableBase
xmlSaveUpdateProperties
in interface XmlImportableBase<AttributeAssignActionSet>
XmlImportableBase.xmlSaveUpdateProperties()
public XmlExportAttributeAssignActionSet xmlToExportAttributeAssignActionSet(GrouperVersion grouperVersion)
grouperVersion
-
public String xmlGetId()
XmlImportableBase
xmlGetId
in interface XmlImportableBase<AttributeAssignActionSet>
XmlImportableBase.xmlGetId()
public void xmlSetId(String theId)
XmlImportableBase
xmlSetId
in interface XmlImportableBase<AttributeAssignActionSet>
XmlImportableBase.xmlSetId(java.lang.String)
public String xmlToString()
XmlImportableBase
xmlToString
in interface XmlImportableBase<AttributeAssignActionSet>
XmlImportableBase.xmlToString()
public void onPreSave(HibernateSession hibernateSession)
HibGrouperLifecycle
onPreSave
in interface HibGrouperLifecycle
onPreSave
in class GrouperAPI
GrouperAPI.onPreSave(HibernateSession)
public void onPreDelete(HibernateSession hibernateSession)
HibGrouperLifecycle
onPreDelete
in interface HibGrouperLifecycle
onPreDelete
in class GrouperAPI
GrouperAPI.onPreDelete(HibernateSession)
public void onPreUpdate(HibernateSession hibernateSession)
HibGrouperLifecycle
onPreUpdate
in interface HibGrouperLifecycle
onPreUpdate
in class GrouperAPI
GrouperAPI.onPreUpdate(HibernateSession)
public AttributeAssignActionSet dbVersion()
dbVersion
in class GrouperAPI
public void dbVersionReset()
dbVersionReset
in class GrouperAPI
public Set<String> dbVersionDifferentFields()
GrouperAPI
dbVersionDifferentFields
in class GrouperAPI
GrouperAPI.dbVersionDifferentFields()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |