edu.internet2.middleware.grouper.audit
Class AuditType

java.lang.Object
  extended by edu.internet2.middleware.grouper.GrouperAPI
      extended by edu.internet2.middleware.grouper.audit.AuditType
All Implemented Interfaces:
HibGrouperLifecycle, Hib3GrouperVersioned, GrouperCloneable, GrouperUtil.FieldValuable, XmlImportable<AuditType>, XmlImportableBase<AuditType>, Serializable, org.hibernate.classic.Lifecycle

public class AuditType
extends GrouperAPI
implements Hib3GrouperVersioned, XmlImportable<AuditType>

type of audit

See Also:
Serialized Form

Field Summary
static String FIELD_ACTION_NAME
          constant for field name for: actionName
static String FIELD_AUDIT_CATEGORY
          constant for field name for: auditCategory
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_LABEL_INT01
          constant for field name for: labelInt01
static String FIELD_LABEL_INT02
          constant for field name for: labelInt02
static String FIELD_LABEL_INT03
          constant for field name for: labelInt03
static String FIELD_LABEL_INT04
          constant for field name for: labelInt04
static String FIELD_LABEL_INT05
          constant for field name for: labelInt05
static String FIELD_LABEL_STRING01
          constant for field name for: labelString01
static String FIELD_LABEL_STRING02
          constant for field name for: labelString02
static String FIELD_LABEL_STRING03
          constant for field name for: labelString03
static String FIELD_LABEL_STRING04
          constant for field name for: labelString04
static String FIELD_LABEL_STRING05
          constant for field name for: labelString05
static String FIELD_LABEL_STRING06
          constant for field name for: labelString06
static String FIELD_LABEL_STRING07
          constant for field name for: labelString07
static String FIELD_LABEL_STRING08
          constant for field name for: labelString08
static String FIELD_LAST_UPDATED_DB
          constant for field name for: lastUpdatedDb
static String TABLE_GROUPER_AUDIT_TYPE
          name of the grouper audit type 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
AuditType()
          empty constructor
AuditType(String auditCategory1, String actionName1, String labelInt01a, String... labelStrings)
          construct with more params
 
Method Summary
 GrouperAPI clone()
          deep clone the fields in this object
 void copyArgFieldIntoThis(AuditType auditType)
          copy the argument into this
 boolean equals(Object obj)
           
 boolean equalsDeep(AuditType auditType)
          see if one audit type is the same as another (not looking at last update, id, etc)
 String getActionName()
          action within the audit category
 String getAuditCategory()
          category of audit
 String getContextId()
          context id ties multiple db changes
 Timestamp getCreatedOn()
          when created
 Long getCreatedOnDb()
          when created
 String getId()
          uuid of row
 String getLabelInt01()
          label for int01
 String getLabelInt02()
          label for int02
 String getLabelInt03()
          label for int03
 String getLabelInt04()
          label for int04
 String getLabelInt05()
          label for int05
 String getLabelString01()
          label for string01
 String getLabelString02()
          label for string02
 String getLabelString03()
          label for string03
 String getLabelString04()
          label for string04
 String getLabelString05()
          label for string05
 String getLabelString06()
          label for the string06 field
 String getLabelString07()
          label for the string07 field
 String getLabelString08()
          label for the string08 field
 Timestamp getLastUpdated()
          when last updated
 Long getLastUpdatedDb()
          when last updated
 int hashCode()
           
 Set<String> labels()
          labels for this type
 void onPreSave(HibernateSession hibernateSession)
          before a save (insert) occurs
 void onPreUpdate(HibernateSession hibernateSession)
          before an update occurs
 String retrieveAuditEntryFieldForLabel(String label)
          get the field in audit entry for this label
 String retrieveAuditEntryFieldForLabel(String label, boolean exceptionIfNotFound)
          get the field in audit entry for this label
 void setActionName(String actionName)
          action within the audit category
 void setAuditCategory(String auditType1)
          category of audit
 void setContextId(String contextId1)
          context id ties multiple db changes
 void setCreatedOn(Timestamp createdOn1)
          when created
 void setCreatedOnDb(Long createdOn1)
          when created
 void setId(String id1)
          uuid of row
 void setLabelInt01(String labelInt01a)
          label for int01
 void setLabelInt02(String labelInt02a)
          label for int02
 void setLabelInt03(String labelInt03a)
          label for int03
 void setLabelInt04(String labelInt04a)
          label for int04
 void setLabelInt05(String labelInt05)
          label for int05
 void setLabelString01(String labelString01a)
          label for string01
 void setLabelString02(String labelString02a)
          label for string02
 void setLabelString03(String labelString03a)
          label for string03
 void setLabelString04(String labelString04a)
          label for string04
 void setLabelString05(String labelString05a)
          label for string05
 void setLabelString06(String labelString06a)
          label for the string06 field
 void setLabelString07(String labelString07a)
          label for the string07 field
 void setLabelString08(String labelString08a)
          label for the string08 field
 void setLastUpdated(Timestamp lastUpdated1)
          when last updated
 void setLastUpdatedDb(Long lastUpdated1)
          when last updated
 String toString()
           
 String toStringDeep()
          the string repre
 void truncate()
          make sure this object will fit in the DB
 void xmlCopyBusinessPropertiesToExisting(AuditType existingRecord)
          copy business (non update) properties to an existing record
 boolean xmlDifferentBusinessProperties(AuditType other)
          see if the non update cols are different (e.g.
 boolean xmlDifferentUpdateProperties(AuditType other)
          see if the update cols are different (e.g.
 String xmlGetId()
          set id key in db
 XmlImportable<AuditType> xmlRetrieveByIdOrKey()
          retrieve from db by id or key.
 AuditType xmlSaveBusinessProperties(AuditType 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
 XmlExportAuditType xmlToExportAuditType(GrouperVersion grouperVersion)
          convert to xml bean for export
 String xmlToString()
          convert to string for log
 
Methods inherited from class edu.internet2.middleware.grouper.GrouperAPI
dbVersion, dbVersionClear, dbVersionDifferentFields, dbVersionIsDifferent, dbVersionReset, fieldValue, getHibernateVersionNumber, onDelete, onLoad, onPostDelete, onPostSave, onPostUpdate, onPreDelete, onSave, onUpdate, setHibernateVersionNumber
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FIELD_ACTION_NAME

public static final String FIELD_ACTION_NAME
constant for field name for: actionName

See Also:
Constant Field Values

FIELD_AUDIT_CATEGORY

public static final String FIELD_AUDIT_CATEGORY
constant for field name for: auditCategory

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_LABEL_INT01

public static final String FIELD_LABEL_INT01
constant for field name for: labelInt01

See Also:
Constant Field Values

FIELD_LABEL_INT02

public static final String FIELD_LABEL_INT02
constant for field name for: labelInt02

See Also:
Constant Field Values

FIELD_LABEL_INT03

public static final String FIELD_LABEL_INT03
constant for field name for: labelInt03

See Also:
Constant Field Values

FIELD_LABEL_INT04

public static final String FIELD_LABEL_INT04
constant for field name for: labelInt04

See Also:
Constant Field Values

FIELD_LABEL_INT05

public static final String FIELD_LABEL_INT05
constant for field name for: labelInt05

See Also:
Constant Field Values

FIELD_LABEL_STRING01

public static final String FIELD_LABEL_STRING01
constant for field name for: labelString01

See Also:
Constant Field Values

FIELD_LABEL_STRING02

public static final String FIELD_LABEL_STRING02
constant for field name for: labelString02

See Also:
Constant Field Values

FIELD_LABEL_STRING03

public static final String FIELD_LABEL_STRING03
constant for field name for: labelString03

See Also:
Constant Field Values

FIELD_LABEL_STRING04

public static final String FIELD_LABEL_STRING04
constant for field name for: labelString04

See Also:
Constant Field Values

FIELD_LABEL_STRING05

public static final String FIELD_LABEL_STRING05
constant for field name for: labelString05

See Also:
Constant Field Values

FIELD_LABEL_STRING06

public static final String FIELD_LABEL_STRING06
constant for field name for: labelString06

See Also:
Constant Field Values

FIELD_LABEL_STRING07

public static final String FIELD_LABEL_STRING07
constant for field name for: labelString07

See Also:
Constant Field Values

FIELD_LABEL_STRING08

public static final String FIELD_LABEL_STRING08
constant for field name for: labelString08

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

TABLE_GROUPER_AUDIT_TYPE

public static final String TABLE_GROUPER_AUDIT_TYPE
name of the grouper audit type table in the db

See Also:
Constant Field Values
Constructor Detail

AuditType

public AuditType()
empty constructor


AuditType

public AuditType(String auditCategory1,
                 String actionName1,
                 String labelInt01a,
                 String... labelStrings)
construct with more params

Parameters:
auditCategory1 -
actionName1 -
labelInt01a -
labelStrings - up to 8 label strings
Method Detail

equalsDeep

public boolean equalsDeep(AuditType auditType)
see if one audit type is the same as another (not looking at last update, id, etc)

Parameters:
auditType -
Returns:
true if equals, false if not

labels

public Set<String> labels()
labels for this type

Returns:
the labels

retrieveAuditEntryFieldForLabel

public String retrieveAuditEntryFieldForLabel(String label)
get the field in audit entry for this label

Parameters:
label -
Returns:
the field

retrieveAuditEntryFieldForLabel

public String retrieveAuditEntryFieldForLabel(String label,
                                              boolean exceptionIfNotFound)
get the field in audit entry for this label

Parameters:
label -
exceptionIfNotFound - true if exception if not found
Returns:
the field

copyArgFieldIntoThis

public void copyArgFieldIntoThis(AuditType auditType)
copy the argument into this

Parameters:
auditType -

toStringDeep

public String toStringDeep()
the string repre

Returns:
string

toString

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

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

getId

public String getId()
uuid of row

Returns:
id

setId

public void setId(String id1)
uuid of row

Parameters:
id1 -

getAuditCategory

public String getAuditCategory()
category of audit

Returns:
audit type

setAuditCategory

public void setAuditCategory(String auditType1)
category of audit

Parameters:
auditType1 -

getActionName

public String getActionName()
action within the audit category

Returns:
the action name

setActionName

public void setActionName(String actionName)
action within the audit category

Parameters:
actionName -

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 -

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)

getLabelString01

public String getLabelString01()
label for string01

Returns:
label

setLabelString01

public void setLabelString01(String labelString01a)
label for string01

Parameters:
labelString01a -

getLabelString02

public String getLabelString02()
label for string02

Returns:
label

setLabelString02

public void setLabelString02(String labelString02a)
label for string02

Parameters:
labelString02a -

getLabelString03

public String getLabelString03()
label for string03

Returns:
label

setLabelString03

public void setLabelString03(String labelString03a)
label for string03

Parameters:
labelString03a -

getLabelString04

public String getLabelString04()
label for string04

Returns:
label

setLabelString04

public void setLabelString04(String labelString04a)
label for string04

Parameters:
labelString04a -

getLabelString05

public String getLabelString05()
label for string05

Returns:
label

setLabelString05

public void setLabelString05(String labelString05a)
label for string05

Parameters:
labelString05a -

getContextId

public String getContextId()
context id ties multiple db changes

Returns:
id

setContextId

public void setContextId(String contextId1)
context id ties multiple db changes

Parameters:
contextId1 -

getLabelInt01

public String getLabelInt01()
label for int01

Returns:
label

setLabelInt01

public void setLabelInt01(String labelInt01a)
label for int01

Parameters:
labelInt01a -

getLabelInt02

public String getLabelInt02()
label for int02

Returns:
label

setLabelInt02

public void setLabelInt02(String labelInt02a)
label for int02

Parameters:
labelInt02a -

getLabelInt03

public String getLabelInt03()
label for int03

Returns:
label

setLabelInt03

public void setLabelInt03(String labelInt03a)
label for int03

Parameters:
labelInt03a -

getLabelInt04

public String getLabelInt04()
label for int04

Returns:
label

setLabelInt04

public void setLabelInt04(String labelInt04a)
label for int04

Parameters:
labelInt04a -

getLabelInt05

public String getLabelInt05()
label for int05

Returns:
label

setLabelInt05

public void setLabelInt05(String labelInt05)
label for int05

Parameters:
labelInt05 -

truncate

public void truncate()
make sure this object will fit in the DB


getLabelString06

public String getLabelString06()
label for the string06 field

Returns:
label

setLabelString06

public void setLabelString06(String labelString06a)
label for the string06 field

Parameters:
labelString06a -

getLabelString07

public String getLabelString07()
label for the string07 field

Returns:
label

setLabelString07

public void setLabelString07(String labelString07a)
label for the string07 field

Parameters:
labelString07a -

getLabelString08

public String getLabelString08()
label for the string08 field

Returns:
label

setLabelString08

public void setLabelString08(String labelString08a)
label for the string08 field

Parameters:
labelString08a -

clone

public GrouperAPI clone()
Description copied from class: GrouperAPI
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:
GrouperAPI.clone()

xmlRetrieveByIdOrKey

public XmlImportable<AuditType> xmlRetrieveByIdOrKey()
Description copied from interface: XmlImportable
retrieve from db by id or key. throws exception if duplicate

Specified by:
xmlRetrieveByIdOrKey in interface XmlImportable<AuditType>
Returns:
the object or null if not found
See Also:
XmlImportable.xmlRetrieveByIdOrKey()

xmlCopyBusinessPropertiesToExisting

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

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

xmlDifferentBusinessProperties

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

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

xmlDifferentUpdateProperties

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

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

xmlGetId

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

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

xmlSaveBusinessProperties

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

Specified by:
xmlSaveBusinessProperties in interface XmlImportableBase<AuditType>
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<AuditType>
See Also:
XmlImportableBase.xmlSaveUpdateProperties()

xmlSetId

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

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

xmlToExportAuditType

public XmlExportAuditType xmlToExportAuditType(GrouperVersion grouperVersion)
convert to xml bean for export

Parameters:
grouperVersion -
Returns:
xml bean

xmlToString

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

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