edu.internet2.middleware.grouper.attr.value
Class AttributeAssignValue

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

public class AttributeAssignValue
extends GrouperAPI
implements GrouperHasContext, Hib3GrouperVersioned, XmlImportableMultiple<AttributeAssignValue>

value of an attribute assignment (could be multi-valued based on the attributeDef

Author:
mchyzer
See Also:
Serialized Form

Nested Class Summary
static class AttributeAssignValue.AttributeAssignValueType
           
 
Field Summary
static String COLUMN_ATTRIBUTE_ASSIGN_ID
          column
static String COLUMN_CONTEXT_ID
          column
static String COLUMN_CREATED_ON
          column
static String COLUMN_ID
          column
static String COLUMN_LAST_UPDATED
          column
static String COLUMN_VALUE_FLOATING
          column
static String COLUMN_VALUE_INTEGER
          column
static String COLUMN_VALUE_MEMBER_ID
          column
static String COLUMN_VALUE_STRING
          column
static String FIELD_ATTRIBUTE_ASSIGN_ID
          constant for field name for: attributeAssignId
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_ID
          constant for field name for: id
static String FIELD_LAST_UPDATED_DB
          constant for field name for: lastUpdatedDb
static String FIELD_VALUE_FLOATING
          constant for field name for: valueFloating
static String FIELD_VALUE_INTEGER
          constant for field name for: valueInteger
static String FIELD_VALUE_MEMBER_ID
          constant for field name for: valueMemberId
static String FIELD_VALUE_STRING
          constant for field name for: valueString
static String TABLE_GROUPER_ATTRIBUTE_ASSIGN_VALUE
          name of the groups attribute def table in the db
 
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
AttributeAssignValue()
           
 
Method Summary
 void assignValue(AttributeAssignValue attributeAssignValue)
          clear all the values
 void assignValue(Object value)
          assign a value to any type
 void assignValue(Object value, AttributeDef attributeDef)
          assign a value to any type
 void clearValue()
          clear all the values
 AttributeAssignValue clone()
          deep clone the fields in this object
static String dateToString(Date date)
          convert a date to a string using the standard web service pattern yyyy/MM/dd HH:mm:ss.SSS Note that HH is 0-23
 AttributeAssignValue 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 record
 AttributeAssign getAttributeAssign()
          get the attribute assign
 String getAttributeAssignId()
          attribute assignment in this value assignment
 String getContextId()
          context id of the transaction
 Timestamp getCreatedOn()
          when created
 Long getCreatedOnDb()
          when created
 AttributeAssignValue.AttributeAssignValueType getCurrentAssignValueType()
          get the type of this value
 String getId()
          id of this attribute def
 Timestamp getLastUpdated()
          when last updated
 Long getLastUpdatedDb()
          when last updated
 Object getValue()
          get the value whatever it is or null if none
 Double getValueFloating()
          floating point value
 String getValueFriendly()
          get value string value
 Long getValueInteger()
          integer value
 String getValueMemberId()
          memberId value (for subjects)
 String getValueString()
          string value
 void internalSetAttributeAssign(AttributeAssign attributeAssign1)
          set this for caching
 void onPostDelete(HibernateSession hibernateSession)
          after a delete occurs
 void onPostSave(HibernateSession hibernateSession)
          after a save (insert) occurs
 void onPostUpdate(HibernateSession hibernateSession)
          after an update occurs
 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
 boolean sameValue(AttributeAssignValue attributeAssignValue)
          if the argument has the same value as this
 void saveOrUpdate()
          save or update this object
 void setAttributeAssignId(String attributeAssignId1)
          attribute assignment in this value assignment
 void setContextId(String contextId1)
          context id of the transaction
 void setCreatedOn(Timestamp createdOn1)
          when created
 void setCreatedOnDb(Long createdOn1)
          when created
 void setId(String id1)
          id of this attribute def
 void setLastUpdated(Timestamp lastUpdated1)
          when last updated
 void setLastUpdatedDb(Long lastUpdated1)
          when last updated
 void setValueFloating(Double valueFloating1)
          floating point value
 void setValueInteger(Long valueInteger1)
          integer value
 void setValueMemberId(String valueMemberId1)
          memberId value (for subjects)
 void setValueString(String valueString1)
          string value
static Date stringToDate(String dateString)
          convert a string to a date using the standard web service pattern Note that HH is 0-23
 String toString()
           
 String valueString()
          whatever the type, return the string value
 String valueString(boolean convertTimestampToFriendly)
          whatever the type, return the string value
 void xmlCopyBusinessPropertiesToExisting(AttributeAssignValue existingRecord)
          copy business (non update) properties to an existing record
 boolean xmlDifferentBusinessProperties(AttributeAssignValue other)
          see if the non update cols are different (e.g.
 boolean xmlDifferentUpdateProperties(AttributeAssignValue other)
          see if the update cols are different (e.g.
 String xmlGetId()
          set id key in db
 AttributeAssignValue xmlRetrieveByIdOrKey(Collection<String> idsToIgnore)
          retrieve from db by id or key.
 AttributeAssignValue xmlSaveBusinessProperties(AttributeAssignValue 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
 XmlExportAttributeAssignValue xmlToExportAttributeAssignValue(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, onSave, onUpdate, setHibernateVersionNumber
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TABLE_GROUPER_ATTRIBUTE_ASSIGN_VALUE

public static final String TABLE_GROUPER_ATTRIBUTE_ASSIGN_VALUE
name of the groups attribute def table in the db

See Also:
Constant Field Values

COLUMN_CONTEXT_ID

public static final String COLUMN_CONTEXT_ID
column

See Also:
Constant Field Values

COLUMN_CREATED_ON

public static final String COLUMN_CREATED_ON
column

See Also:
Constant Field Values

COLUMN_LAST_UPDATED

public static final String COLUMN_LAST_UPDATED
column

See Also:
Constant Field Values

COLUMN_ID

public static final String COLUMN_ID
column

See Also:
Constant Field Values

COLUMN_VALUE_STRING

public static final String COLUMN_VALUE_STRING
column

See Also:
Constant Field Values

COLUMN_VALUE_FLOATING

public static final String COLUMN_VALUE_FLOATING
column

See Also:
Constant Field Values

COLUMN_VALUE_INTEGER

public static final String COLUMN_VALUE_INTEGER
column

See Also:
Constant Field Values

COLUMN_VALUE_MEMBER_ID

public static final String COLUMN_VALUE_MEMBER_ID
column

See Also:
Constant Field Values

COLUMN_ATTRIBUTE_ASSIGN_ID

public static final String COLUMN_ATTRIBUTE_ASSIGN_ID
column

See Also:
Constant Field Values

FIELD_ATTRIBUTE_ASSIGN_ID

public static final String FIELD_ATTRIBUTE_ASSIGN_ID
constant for field name for: attributeAssignId

See Also:
Constant Field Values

FIELD_CONTEXT_ID

public static final String FIELD_CONTEXT_ID
constant for field name for: contextId

See Also:
Constant Field Values

FIELD_CREATED_ON_DB

public static final String FIELD_CREATED_ON_DB
constant for field name for: createdOnDb

See Also:
Constant Field Values

FIELD_ID

public static final String FIELD_ID
constant for field name for: id

See Also:
Constant Field Values

FIELD_LAST_UPDATED_DB

public static final String FIELD_LAST_UPDATED_DB
constant for field name for: lastUpdatedDb

See Also:
Constant Field Values

FIELD_VALUE_FLOATING

public static final String FIELD_VALUE_FLOATING
constant for field name for: valueFloating

See Also:
Constant Field Values

FIELD_VALUE_INTEGER

public static final String FIELD_VALUE_INTEGER
constant for field name for: valueInteger

See Also:
Constant Field Values

FIELD_VALUE_MEMBER_ID

public static final String FIELD_VALUE_MEMBER_ID
constant for field name for: valueMemberId

See Also:
Constant Field Values

FIELD_VALUE_STRING

public static final String FIELD_VALUE_STRING
constant for field name for: valueString

See Also:
Constant Field Values
Constructor Detail

AttributeAssignValue

public AttributeAssignValue()
Method Detail

clone

public AttributeAssignValue 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:
Object.clone()

getValueFloating

public Double getValueFloating()
floating point value

Returns:
floating point value

setValueFloating

public void setValueFloating(Double valueFloating1)
floating point value

Parameters:
valueFloating1 -

assignValue

public void assignValue(Object value)
assign a value to any type

Parameters:
value -

assignValue

public void assignValue(Object value,
                        AttributeDef attributeDef)
assign a value to any type

Parameters:
value -
attributeDef -

valueString

public String valueString()
whatever the type, return the string value

Returns:
value

getValueFriendly

public String getValueFriendly()
get value string value

Returns:
value string friendly

valueString

public String valueString(boolean convertTimestampToFriendly)
whatever the type, return the string value

Parameters:
convertTimestampToFriendly - true to convert timestamps to yyyy/MM/dd HH:mm:ss.SSS as opposed to numbers of millis since 1970
Returns:
value

dateToString

public static String dateToString(Date date)
convert a date to a string using the standard web service pattern yyyy/MM/dd HH:mm:ss.SSS Note that HH is 0-23

Parameters:
date -
Returns:
the string, or null if the date is null

stringToDate

public static Date stringToDate(String dateString)
convert a string to a date using the standard web service pattern Note that HH is 0-23

Parameters:
dateString -
Returns:
the string, or null if the date was null

clearValue

public void clearValue()
clear all the values


assignValue

public void assignValue(AttributeAssignValue attributeAssignValue)
clear all the values

Parameters:
attributeAssignValue -

saveOrUpdate

public void saveOrUpdate()
save or update this object


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 def

Returns:
id

setId

public void setId(String id1)
id of this attribute def

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 -

getAttributeAssignId

public String getAttributeAssignId()
attribute assignment in this value assignment

Returns:
the attributeNameId

getAttributeAssign

public AttributeAssign getAttributeAssign()
get the attribute assign

Returns:
the attribute assign

setAttributeAssignId

public void setAttributeAssignId(String attributeAssignId1)
attribute assignment in this value assignment

Parameters:
attributeAssignId1 - the attributeNameId to set

getValueString

public String getValueString()
string value

Returns:
the valueString

setValueString

public void setValueString(String valueString1)
string value

Parameters:
valueString1 - the valueString to set

getValueInteger

public Long getValueInteger()
integer value

Returns:
the valueInteger

setValueInteger

public void setValueInteger(Long valueInteger1)
integer value

Parameters:
valueInteger1 - the valueInteger to set

getValueMemberId

public String getValueMemberId()
memberId value (for subjects)

Returns:
the valueMemberId

setValueMemberId

public void setValueMemberId(String valueMemberId1)
memberId value (for subjects)

Parameters:
valueMemberId1 - the valueMemberId to set

xmlToExportAttributeAssignValue

public XmlExportAttributeAssignValue xmlToExportAttributeAssignValue(GrouperVersion grouperVersion)
convert to xml bean for export

Parameters:
grouperVersion -
Returns:
xml bean

xmlRetrieveByIdOrKey

public AttributeAssignValue 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<AttributeAssignValue>
Parameters:
idsToIgnore - these are ids already processed, do not pick these
Returns:
the object or null if not found
See Also:
XmlImportableMultiple.xmlRetrieveByIdOrKey(java.util.Collection)

xmlCopyBusinessPropertiesToExisting

public void xmlCopyBusinessPropertiesToExisting(AttributeAssignValue existingRecord)
Description copied from interface: XmlImportableBase
copy business (non update) properties to an existing record

Specified by:
xmlCopyBusinessPropertiesToExisting in interface XmlImportableBase<AttributeAssignValue>
See Also:
XmlImportableBase.xmlCopyBusinessPropertiesToExisting(java.lang.Object)

xmlDifferentBusinessProperties

public boolean xmlDifferentBusinessProperties(AttributeAssignValue other)
Description copied from interface: XmlImportableBase
see if the non update cols are different (e.g. name)

Specified by:
xmlDifferentBusinessProperties in interface XmlImportableBase<AttributeAssignValue>
Parameters:
other - the one to compare with
Returns:
true if so
See Also:
XmlImportableBase.xmlDifferentBusinessProperties(java.lang.Object)

xmlDifferentUpdateProperties

public boolean xmlDifferentUpdateProperties(AttributeAssignValue other)
Description copied from interface: XmlImportableBase
see if the update cols are different (e.g. last updated)

Specified by:
xmlDifferentUpdateProperties in interface XmlImportableBase<AttributeAssignValue>
Parameters:
other - the one to compare with
Returns:
true if so
See Also:
XmlImportableBase.xmlDifferentUpdateProperties(java.lang.Object)

xmlSaveBusinessProperties

public AttributeAssignValue xmlSaveBusinessProperties(AttributeAssignValue existingRecord)
Description copied from interface: XmlImportableBase
save the business properties (not update properties)

Specified by:
xmlSaveBusinessProperties in interface XmlImportableBase<AttributeAssignValue>
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:
XmlImportableBase.xmlSaveBusinessProperties(java.lang.Object)

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<AttributeAssignValue>
See Also:
XmlImportableBase.xmlSaveUpdateProperties()

delete

public void delete()
delete this record


toString

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

xmlGetId

public String xmlGetId()
Description copied from interface: XmlImportableBase
set id key in db

Specified by:
xmlGetId in interface XmlImportableBase<AttributeAssignValue>
Returns:
id
See Also:
XmlImportableBase.xmlGetId()

xmlSetId

public void xmlSetId(String theId)
Description copied from interface: XmlImportableBase
set id key in db

Specified by:
xmlSetId in interface XmlImportableBase<AttributeAssignValue>
See Also:
XmlImportableBase.xmlSetId(java.lang.String)

xmlToString

public String xmlToString()
Description copied from interface: XmlImportableBase
convert to string for log

Specified by:
xmlToString in interface XmlImportableBase<AttributeAssignValue>
Returns:
the string value for log
See Also:
XmlImportableBase.xmlToString()

sameValue

public boolean sameValue(AttributeAssignValue attributeAssignValue)
if the argument has the same value as this

Parameters:
attributeAssignValue -
Returns:
if the argument has the same value as this

getValue

public Object getValue()
get the value whatever it is or null if none

Returns:
the value

getCurrentAssignValueType

public AttributeAssignValue.AttributeAssignValueType getCurrentAssignValueType()
get the type of this value

Returns:
the type of this value

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:
GrouperAPI.onPostDelete(edu.internet2.middleware.grouper.hibernate.HibernateSession)

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:
HibGrouperLifecycle.onPostSave(edu.internet2.middleware.grouper.hibernate.HibernateSession)

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:
HibGrouperLifecycle.onPostUpdate(HibernateSession)

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:
GrouperAPI.onPreDelete(edu.internet2.middleware.grouper.hibernate.HibernateSession)

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:
GrouperAPI.onPreSave(edu.internet2.middleware.grouper.hibernate.HibernateSession)

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:
GrouperAPI.onPreUpdate(edu.internet2.middleware.grouper.hibernate.HibernateSession)

dbVersion

public AttributeAssignValue 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:
GrouperAPI.dbVersionDifferentFields()

internalSetAttributeAssign

public void internalSetAttributeAssign(AttributeAssign attributeAssign1)
set this for caching

Parameters:
attributeAssign1 -