Class AttributeAssign

java.lang.Object
edu.internet2.middleware.grouper.GrouperAPI
edu.internet2.middleware.grouper.attr.assign.AttributeAssign
All Implemented Interfaces:
AttributeAssignable, HibGrouperLifecycle, Hib3GrouperVersioned, GrouperCloneable, GrouperHasContext, GrouperUtil.FieldValuable, XmlImportableBase<AttributeAssign>, XmlImportableMultiple<AttributeAssign>, Serializable, org.hibernate.classic.Lifecycle

assignment of an attribute
See Also:
  • Field Details

  • Constructor Details

    • AttributeAssign

      public AttributeAssign()
    • AttributeAssign

      public AttributeAssign(Stem ownerStem, String theAction, AttributeDefName theAttributeDefName, String uuid)
      create an attribute assign, including a uuid
      Parameters:
      ownerStem -
      theAction -
      theAttributeDefName -
      uuid -
    • AttributeAssign

      public AttributeAssign(AttributeDef ownerAttributeDef, String theAction, AttributeDefName theAttributeDefName, String uuid)
      create an attribute assign, including a uuid
      Parameters:
      ownerAttributeDef -
      theAction -
      theAttributeDefName -
      uuid - is uuid or null if generated
    • AttributeAssign

      public AttributeAssign(Group ownerGroup, String theAction, AttributeDefName theAttributeDefName, String uuid)
      create an attribute assign, including a uuid
      Parameters:
      ownerGroup -
      theAction -
      theAttributeDefName -
      uuid - is the uuid or null if generated
    • AttributeAssign

      public AttributeAssign(Group ownerGroup, Member ownerMember, String theAction, AttributeDefName theAttributeDefName, String uuid)
      create an attribute assign, including a uuid. This is for an immediate or effective membership
      Parameters:
      ownerGroup -
      ownerMember -
      theAction -
      theAttributeDefName -
      uuid -
    • AttributeAssign

      public AttributeAssign(AttributeAssign ownerAttributeAssign, String theAction, AttributeDefName theAttributeDefName, String uuid)
      create an attribute assign, including a uuid
      Parameters:
      ownerAttributeAssign -
      theAction -
      theAttributeDefName -
      uuid - to use or null for generated
    • AttributeAssign

      public AttributeAssign(Membership ownerMembership, String theAction, AttributeDefName theAttributeDefName, String uuid)
      create an attribute assign, including a uuid
      Parameters:
      ownerMembership -
      theAction -
      theAttributeDefName -
      uuid -
    • AttributeAssign

      public AttributeAssign(Member ownerMember, String theActionId, AttributeDefName theAttributeDefName, String uuid)
      create an attribute assign, including a uuid
      Parameters:
      ownerMember -
      theActionId -
      theAttributeDefName -
      uuid - is the uuid or null for generated
  • Method Details

    • saveOrUpdate

      public void saveOrUpdate()
      save or update this object
    • saveOrUpdate

      public void saveOrUpdate(boolean checkSecurity)
      save or update this object
      Parameters:
      checkSecurity -
    • attributeAssignDeletes

      public static Set<AttributeAssign> attributeAssignDeletes()
      Returns:
      if in delete
    • delete

      public void delete()
      delete this object
    • clone

      public AttributeAssign clone()
      deep clone the fields in this object
      Specified by:
      clone in interface GrouperCloneable
      Specified by:
      clone in class GrouperAPI
      Returns:
      the clone of the object
      See Also:
    • getAttributeAssignDelegatable

      public AttributeAssignDelegatable getAttributeAssignDelegatable()
      get the enum for delegatable, do not return null
      Returns:
      the attributeAssignDelegatable
    • getAttributeAssignDelegatableDb

      public String getAttributeAssignDelegatableDb()
      internal method for hibernate to persist this enum
      Returns:
      the string value (enum name)
    • setAttributeAssignDelegatableDb

      public void setAttributeAssignDelegatableDb(String theAttributeAssignDelegatableDb)
      internal method for hibernate to set if delegatable
      Parameters:
      theAttributeAssignDelegatableDb -
    • setAttributeAssignDelegatable

      public void setAttributeAssignDelegatable(AttributeAssignDelegatable attributeAssignDelegatable1)
      Parameters:
      attributeAssignDelegatable1 - the attributeAssignDelegatable to set
    • getAttributeAssignType

      public AttributeAssignType getAttributeAssignType()
      get the enum for delegatable, should not return null
      Returns:
      the attributeAssignDelegatable
    • getAttributeAssignTypeDb

      public String getAttributeAssignTypeDb()
      internal method for hibernate to persist this enum
      Returns:
      the string value (enum name)
    • setAttributeAssignTypeDb

      public void setAttributeAssignTypeDb(String theAttributeAssignTypeDb)
      internal method for hibernate to set if delegatable
      Parameters:
      theAttributeAssignTypeDb -
    • setAttributeAssignType

      public void setAttributeAssignType(AttributeAssignType attributeAssignType1)
      Parameters:
      attributeAssignType1 - the attributeAssignDelegatable to set
    • setDisallowed

      public void setDisallowed(boolean disallowed1)
      if this is a permission, then if this permission assignment is allowed or not
      Parameters:
      disallowed1 - the allowed to set
    • setDisallowedDb

      public void setDisallowedDb(String disallowed1)
      if this is a permission, then if this permission assignment is allowed or not
      Parameters:
      disallowed1 - the allowed to set
    • getDisallowedDb

      public String getDisallowedDb()
      if this is a permission, then if this permission assignment is allowed or not
      Returns:
      the allowed
    • isDisallowed

      public boolean isDisallowed()
      if this is a permission, then if this permission assignment is allowed or not
      Returns:
      if allowed
    • getAttributeAssignActionId

      public String getAttributeAssignActionId()
      action for this assignment (e.g. assign). Generally this will be AttributeDef.ACTION_DEFAULT. action must exist in AttributeDef.actions
      Returns:
      the action
    • internalSetAttributeDefName

      public void internalSetAttributeDefName(AttributeDefName attributeDefName1)
      set this for caching
      Parameters:
      attributeDefName1 -
    • internalSetAttributeDef

      public void internalSetAttributeDef(AttributeDef attributeDef1)
      set this for caching
      Parameters:
      attributeDef1 -
    • getAttributeDefName

      public AttributeDefName getAttributeDefName()
      Returns:
      attributeDefName
    • getAttributeAssignAction

      public AttributeAssignAction getAttributeAssignAction()
      Returns:
      attributeAssignAction
    • getAttributeDef

      public AttributeDef getAttributeDef()
      Returns:
      attributeDef
    • getAttributeDelegate

      public AttributeAssignAttrAssignDelegate getAttributeDelegate()
      Description copied from interface: AttributeAssignable
      get the logic delegate
      Specified by:
      getAttributeDelegate in interface AttributeAssignable
      Returns:
      the delegate
    • setAttributeAssignActionId

      public void setAttributeAssignActionId(String theActionId)
      default is "assign" actions must contain only alphanumeric or underscore, case sensitive e.g. id for read,write,admin
      Parameters:
      theActionId -
    • getContextId

      public String getContextId()
      context id of the transaction
      Returns:
      context id
    • setContextId

      public void setContextId(String contextId1)
      context id of the transaction
      Specified by:
      setContextId in interface GrouperHasContext
      Parameters:
      contextId1 -
    • getId

      public String getId()
      id of this attribute assign
      Returns:
      id
    • setId

      public void setId(String id1)
      id of this attribute assign
      Parameters:
      id1 -
    • getLastUpdated

      public Timestamp getLastUpdated()
      when last updated
      Returns:
      timestamp
    • getLastUpdatedDb

      public Long getLastUpdatedDb()
      when last updated
      Returns:
      timestamp
    • setLastUpdated

      public void setLastUpdated(Timestamp lastUpdated1)
      when last updated
      Parameters:
      lastUpdated1 -
    • setLastUpdatedDb

      public void setLastUpdatedDb(Long lastUpdated1)
      when last updated
      Parameters:
      lastUpdated1 -
    • getCreatedOn

      public Timestamp getCreatedOn()
      when created
      Returns:
      timestamp
    • getCreatedOnDb

      public Long getCreatedOnDb()
      when created
      Returns:
      timestamp
    • setCreatedOn

      public void setCreatedOn(Timestamp createdOn1)
      when created
      Parameters:
      createdOn1 -
    • setCreatedOnDb

      public void setCreatedOnDb(Long createdOn1)
      when created
      Parameters:
      createdOn1 -
    • getNotes

      public String getNotes()
      notes about this assignment, free-form text
      Returns:
      the notes
    • setNotes

      public void setNotes(String notes1)
      notes about this assignment, free-form text
      Parameters:
      notes1 -
    • getAttributeDefNameId

      public String getAttributeDefNameId()
      attribute name in this assignment
      Returns:
      the attributeNameId
    • setAttributeDefNameId

      public void setAttributeDefNameId(String attributeDefNameId1)
      attribute name in this assignment
      Parameters:
      attributeDefNameId1 - the attributeNameId to set
    • getOwnerAttributeAssignId

      public String getOwnerAttributeAssignId()
      if this is an attribute assign attribute, this is the foreign key
      Returns:
      the ownerAttributeAssignId
    • setOwnerAttributeAssignId

      public void setOwnerAttributeAssignId(String ownerAttributeAssignId1)
      if this is an attribute assign attribute, this is the foreign key
      Parameters:
      ownerAttributeAssignId1 - the ownerAttributeAssignId to set
    • getOwnerAttributeDefId

      public String getOwnerAttributeDefId()
      if this is an attribute def attribute, this is the foreign key
      Returns:
      the ownerAttributeDefId
    • setOwnerAttributeDefId

      public void setOwnerAttributeDefId(String ownerAttributeDefId1)
      if this is an attribute def attribute, this is the foreign key
      Parameters:
      ownerAttributeDefId1 - the ownerAttributeDefId to set
    • getOwnerGroupId

      public String getOwnerGroupId()
      if this is a group attribute, this is the foreign key
      Returns:
      the ownerAttributeGroupId
    • getOwnerGroup

      public Group getOwnerGroup()
      if this is a group attribute, this is the foreign key
      Returns:
      the ownerGroup
    • getOwnerMembership

      public Membership getOwnerMembership()
      if this is a membership attribute, this is the foreign key
      Returns:
      the ownerMembership
    • getOwnerMember

      public Member getOwnerMember()
      if this is a member attribute, this is the foreign key
      Returns:
      the ownerMember
    • getOwnerAttributeAssign

      public AttributeAssign getOwnerAttributeAssign()
      if this is a attribute assign attribute, this is the foreign key
      Returns:
      the ownerAttributeAssign
    • getOwnerAttributeDef

      public AttributeDef getOwnerAttributeDef()
      if this is a attributeDef attribute, this is the foreign key
      Returns:
      the ownerAttributeDef
    • getOwnerImmediateMembership

      public Membership getOwnerImmediateMembership()
      if this is a membership attribute, this is the foreign key
      Returns:
      the ownerAttributeDef
    • getOwnerStem

      public Stem getOwnerStem()
      if this is a stem attribute, this is the foreign key
      Returns:
      the ownerStem
    • getOwnerStemFailsafe

      public Stem getOwnerStemFailsafe()
      if this is a stem attribute, this is the foreign key
      Returns:
      the ownerStem
    • setOwnerGroupId

      public void setOwnerGroupId(String ownerAttributeGroupId1)
      if this is a group attribute, this is the foreign key
      Parameters:
      ownerAttributeGroupId1 - the ownerAttributeGroupId to set
    • getOwnerMemberId

      public String getOwnerMemberId()
      if this is a member attribute, this is the foreign key
      Returns:
      the ownerAttributeMemberId
    • setOwnerMemberId

      public void setOwnerMemberId(String ownerAttributeMemberId1)
      if this is a member attribute, this is the foreign key
      Parameters:
      ownerAttributeMemberId1 - the ownerAttributeMemberId to set
    • getOwnerMembershipId

      public String getOwnerMembershipId()
      if this is a membership attribute, this is the foreign key
      Returns:
      the ownerAttributeMembershipId
    • setOwnerMembershipId

      public void setOwnerMembershipId(String ownerAttributeMembershipId1)
      if this is a membership attribute, this is the foreign key
      Parameters:
      ownerAttributeMembershipId1 - the ownerAttributeMembershipId to set
    • getOwnerStemId

      public String getOwnerStemId()
      if this is a stem attribute, this is the foreign key
      Returns:
      the ownerAttributeStemId
    • setOwnerStemId

      public void setOwnerStemId(String ownerAttributeStemId1)
      if this is a stem attribute, this is the foreign key
      Parameters:
      ownerAttributeStemId1 - the ownerAttributeStemId to set
    • internal_isEnabledUsingTimestamps

      public boolean internal_isEnabledUsingTimestamps()
      should this be enabled or disabled based on timestamps
      Returns:
      the enabled
    • isEnabled

      public boolean isEnabled()
      Returns:
      true if this attribute assignment is enabled
    • getEnabledDb

      public String getEnabledDb()
      true or false for if this assignment is enabled (e.g. might have expired)
      Returns:
      the enabled
    • setEnabledDb

      public void setEnabledDb(String enabled1)
      true or false for if this assignment is enabled (e.g. might have expired)
      Parameters:
      enabled1 - the enabled to set
    • setEnabled

      public void setEnabled(boolean enabled1)
      true or false for if this assignment is enabled (e.g. might have expired)
      Parameters:
      enabled1 - the enabled to set
    • getEnabledTimeDb

      public Long getEnabledTimeDb()
      if there is a date here, and it is in the future, this assignment is disabled until that time
      Returns:
      the enabledTimeDb
    • setEnabledTimeDb

      public void setEnabledTimeDb(Long enabledTimeDb1)
      if there is a date here, and it is in the future, this assignment is disabled until that time
      Parameters:
      enabledTimeDb1 - the enabledTimeDb to set
    • getDisabledTimeDb

      public Long getDisabledTimeDb()
      if there is a date here, and it is in the past, this assignment is disabled
      Returns:
      the disabledTimeDb
    • setDisabledTimeDb

      public void setDisabledTimeDb(Long disabledTimeDb1)
      if there is a date here, and it is in the past, this assignment is disabled
      Parameters:
      disabledTimeDb1 - the disabledTimeDb to set
    • getEnabledTime

      public Timestamp getEnabledTime()
      if there is a date here, and it is in the future, this assignment is disabled until that time
      Returns:
      the enabledTimeDb
    • setEnabledTime

      public void setEnabledTime(Timestamp enabledTimeDb1)
      if there is a date here, and it is in the future, this assignment is disabled until that time
      Parameters:
      enabledTimeDb1 - the enabledTimeDb to set
    • getDisabledTime

      public Timestamp getDisabledTime()
      if there is a date here, and it is in the past, this assignment is disabled
      Returns:
      the disabledTimeDb
    • setDisabledTime

      public void setDisabledTime(Timestamp disabledTimeDb1)
      if there is a date here, and it is in the past, this assignment is disabled
      Parameters:
      disabledTimeDb1 - the disabledTimeDb to set
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also:
    • xmlCopyBusinessPropertiesToExisting

      public void xmlCopyBusinessPropertiesToExisting(AttributeAssign existingRecord)
      Description copied from interface: XmlImportableBase
      copy business (non update) properties to an existing record
      Specified by:
      xmlCopyBusinessPropertiesToExisting in interface XmlImportableBase<AttributeAssign>
      See Also:
    • xmlDifferentBusinessProperties

      public boolean xmlDifferentBusinessProperties(AttributeAssign other)
      Description copied from interface: XmlImportableBase
      see if the non update cols are different (e.g. name)
      Specified by:
      xmlDifferentBusinessProperties in interface XmlImportableBase<AttributeAssign>
      Parameters:
      other - the one to compare with
      Returns:
      true if so
      See Also:
    • xmlDifferentUpdateProperties

      public boolean xmlDifferentUpdateProperties(AttributeAssign other)
      Description copied from interface: XmlImportableBase
      see if the update cols are different (e.g. last updated)
      Specified by:
      xmlDifferentUpdateProperties in interface XmlImportableBase<AttributeAssign>
      Parameters:
      other - the one to compare with
      Returns:
      true if so
      See Also:
    • xmlSaveBusinessProperties

      public AttributeAssign xmlSaveBusinessProperties(AttributeAssign existingRecord)
      Description copied from interface: XmlImportableBase
      save the business properties (not update properties)
      Specified by:
      xmlSaveBusinessProperties in interface XmlImportableBase<AttributeAssign>
      Parameters:
      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
      Returns:
      the new object or existing
      See Also:
    • xmlSaveUpdateProperties

      public void xmlSaveUpdateProperties()
      Description copied from interface: XmlImportableBase
      save the udpate properties (e.g. last updated). Note, this is done with a sql update statement, not with hibernate
      Specified by:
      xmlSaveUpdateProperties in interface XmlImportableBase<AttributeAssign>
      See Also:
    • xmlRetrieveByIdOrKey

      public AttributeAssign xmlRetrieveByIdOrKey(Collection<String> idsToIgnore)
      Description copied from interface: XmlImportableMultiple
      retrieve from db by id or key. throws exception if duplicate
      Specified by:
      xmlRetrieveByIdOrKey in interface XmlImportableMultiple<AttributeAssign>
      Parameters:
      idsToIgnore - these are ids already processed, do not pick these
      Returns:
      the object or null if not found
      See Also:
    • xmlToExportAttributeAssign

      public XmlExportAttributeAssign xmlToExportAttributeAssign(GrouperVersion grouperVersion)
      convert to xml bean for export
      Parameters:
      grouperVersion -
      Returns:
      xml bean
    • xmlGetId

      public String xmlGetId()
      Description copied from interface: XmlImportableBase
      set id key in db
      Specified by:
      xmlGetId in interface XmlImportableBase<AttributeAssign>
      Returns:
      id
      See Also:
    • xmlSetId

      public void xmlSetId(String theId)
      Description copied from interface: XmlImportableBase
      set id key in db
      Specified by:
      xmlSetId in interface XmlImportableBase<AttributeAssign>
      See Also:
    • xmlToString

      public String xmlToString()
      Description copied from interface: XmlImportableBase
      convert to string for log
      Specified by:
      xmlToString in interface XmlImportableBase<AttributeAssign>
      Returns:
      the string value for log
      See Also:
    • retrieveAttributeAssignable

      public AttributeAssignable retrieveAttributeAssignable()
      get the delegate that relates the object with the the assignment
      Returns:
      the delegate
    • retrieveAttributeAssignDelegate

      public AttributeAssignBaseDelegate retrieveAttributeAssignDelegate()
      get the delegate that relates the object with the the assignment
      Returns:
      the delegate
    • getValueDelegate

      public AttributeAssignValueDelegate getValueDelegate()
      Returns:
      the value delegate
    • getAttributeValueDelegate

      public AttributeValueDelegate getAttributeValueDelegate()
      this delegate works on attributes and values at the same time
      Specified by:
      getAttributeValueDelegate in interface AttributeAssignable
      Returns:
      the delegate
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      Returns:
      hashcode
    • retrieveAttributeDefs

      public static Set<AttributeDef> retrieveAttributeDefs(Collection<AttributeAssign> attributeAssigns)
      retrieve a set of attributeDefs based on some assignments
      Parameters:
      attributeAssigns -
      Returns:
      the set of attributeDefs
    • onPostDelete

      public void onPostDelete(HibernateSession hibernateSession)
      Description copied from interface: HibGrouperLifecycle
      after a delete occurs
      Specified by:
      onPostDelete in interface HibGrouperLifecycle
      Overrides:
      onPostDelete in class GrouperAPI
      See Also:
    • onPostSave

      public void onPostSave(HibernateSession hibernateSession)
      Description copied from interface: HibGrouperLifecycle
      after a save (insert) occurs
      Specified by:
      onPostSave in interface HibGrouperLifecycle
      Overrides:
      onPostSave in class GrouperAPI
      See Also:
    • onPostUpdate

      public void onPostUpdate(HibernateSession hibernateSession)
      Description copied from interface: HibGrouperLifecycle
      after an update occurs
      Specified by:
      onPostUpdate in interface HibGrouperLifecycle
      Overrides:
      onPostUpdate in class GrouperAPI
      See Also:
    • onPreDelete

      public void onPreDelete(HibernateSession hibernateSession)
      Description copied from interface: HibGrouperLifecycle
      before a delete (insert) occurs
      Specified by:
      onPreDelete in interface HibGrouperLifecycle
      Overrides:
      onPreDelete in class GrouperAPI
      See Also:
    • onPreSave

      public void onPreSave(HibernateSession hibernateSession)
      Description copied from interface: HibGrouperLifecycle
      before a save (insert) occurs
      Specified by:
      onPreSave in interface HibGrouperLifecycle
      Overrides:
      onPreSave in class GrouperAPI
      See Also:
    • onPreUpdate

      public void onPreUpdate(HibernateSession hibernateSession)
      Description copied from interface: HibGrouperLifecycle
      before an update occurs
      Specified by:
      onPreUpdate in interface HibGrouperLifecycle
      Overrides:
      onPreUpdate in class GrouperAPI
      See Also:
    • getOwnerSingleId

      public String getOwnerSingleId()
      if it is possible to get a single ownerid (i.e. not any_mem), then do that here
      Returns:
      the single owner id
    • isHasSingleId

      public boolean isHasSingleId()
      if there is a single id
      Returns:
      true if has a single id
    • deleteAndStore

      public void deleteAndStore()
      delete this attribute assignment (and child objects) and recommit it (which will not have the child objects or will have this time)
    • dbVersion

      public AttributeAssign dbVersion()
      save the state when retrieving from DB
      Overrides:
      dbVersion in class GrouperAPI
      Returns:
      the dbVersion
    • dbVersionReset

      public void dbVersionReset()
      take a snapshot of the data since this is what is in the db
      Overrides:
      dbVersionReset in class GrouperAPI
    • dbVersionDifferentFields

      public Set<String> dbVersionDifferentFields()
      Description copied from class: GrouperAPI
      see which fields have changed compared to the DB state (last known) note that attributes will print out: attribute__attributeName
      Overrides:
      dbVersionDifferentFields in class GrouperAPI
      Returns:
      a set of attributes changed, or empty set if none
      See Also: