Class GrouperConfigHibernate
java.lang.Object
edu.internet2.middleware.grouper.GrouperAPI
edu.internet2.middleware.grouper.cfg.dbConfig.GrouperConfigHibernate
- All Implemented Interfaces:
GrouperCacheDatabaseClear,HibGrouperLifecycle,Hib3GrouperVersioned,GrouperCloneable,GrouperUtil.FieldValuable,Serializable,Comparable<GrouperConfigHibernate>,org.hibernate.classic.Lifecycle
public class GrouperConfigHibernate
extends GrouperAPI
implements Hib3GrouperVersioned, Comparable<GrouperConfigHibernate>, GrouperCacheDatabaseClear
database configuration
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringcomment of the propertystatic final Stringif this is a password or for whatever other reason is encryptedstatic final Stringconfig file hierarchy, e.g.static final Stringconfig file, e.g.static final Stringkey of the propertystatic final Stringif there is more data than fits in the column this is the 0 indexed orderstatic final Stringvalue of the propertystatic final Stringsize of the config valuestatic final Stringvalue when it's too big for config_valuestatic final Stringfor built in configs, this is the index that will identify if the database configs should be replaced from the java codestatic final Stringhibernate versionstatic final Stringdb uuid for this rowstatic final Stringmillis since 1970 this row was last updatedstatic final Stringstatic final Stringconstant for field name for: configCommentstatic final Stringconstant for field name for: configEncryptedstatic final Stringconstant for field name for: configFileHierarchystatic final Stringconstant for field name for: configFileNamestatic final Stringconstant for field name for: configKeystatic final Stringconstant for field name for: configSequencestatic final Stringconstant for field name for: configValuestatic final Stringconstant for field name for: configValueBytesstatic final Stringconstant for field name for: configValueClobstatic final Stringconstant for field name for: configVersionIndexstatic final Stringconstant for field name for: contextIdstatic final Stringconstant for field name for: idstatic final Stringconstant for field name for: lastUpdatedDbstatic final Stringname of the table in the database.Fields inherited from class edu.internet2.middleware.grouper.GrouperAPI
dbVersion, FIELD_DB_VERSION, FIELD_HIBERNATE_VERSION_NUMBER, INITIAL_VERSION_NUMBERFields inherited from interface org.hibernate.classic.Lifecycle
NO_VETO, VETO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear(GrouperCacheDatabaseClearInput grouperCacheDatabaseClearInput) clear the cache when the database tells us tostatic voidclear the cache when the database tells us toclone()deep clone the fields in this objectintcompareTo(GrouperConfigHibernate otherConfig) static voidcreateNewPITGrouperConfigHibernate(String auditEntryId, String newActiveStatus, GrouperConfigHibernate config, String previousConfigValue, String previousConfigValueClob) create a new PIT grouper config entry in the database based on the grouper configdbVersionDifferentFields(boolean failIfNull) voidtake a snapshot of the data since this is what is in the dbvoiddelete()delete this objectbooleanif this is a password or for whatever other reason is encrypted, T|Fconfig file, e.g.key of the propertyintif there is more data than fits in the column this is the 0 indexed ordersize of config value in bytesclob value of the propertyclob value of the propertyvalue of the propertyintfor built in configs, this is the index that will identify if the database configs should be replaced from the java codegetId()when last updatedwhen last updatedinthashCode()booleanif this is a password or for whatever other reason is encryptedstatic booleanisPassword(ConfigFileName configFileName, ConfigItemMetadata configItemMetadata, String key, String value, boolean hasValue, Boolean userSelectedPassword) see if password based on various factorsstatic booleanisPasswordHelper(ConfigFileName configFileName, ConfigItemMetadata configItemMetadata, String key, String value, boolean hasValue, Boolean userSelectedPassword) see if password based on various factorsstatic booleanisPasswordHelper(ConfigItemMetadata configItemMetadata) see if password based on various factorsstatic booleanisPasswordHelper(ConfigItemMetadata configItemMetadata, String propertyValueString) if the value is a file and it exists, then this is not a password to be escapedvoidonPreSave(HibernateSession hibernateSession) before a save (insert) occursvoidonPreUpdate(HibernateSession hibernateSession) before an update occursstatic voidretrieve value.voidsaveOrUpdate(boolean addNew) save or update this objectvoidsetConfigComment(String configComment1) voidsetConfigEncrypted(boolean configEncrypted1) if this is a password or for whatever other reason is encryptedvoidsetConfigEncryptedDb(String theConfigEncrypted) if this is a password or for whatever other reason is encryptedvoidsetConfigFileHierarchy(ConfigFileHierarchy configFileHierarchyEnum) voidsetConfigFileHierarchyDb(String configFileHierarchy) voidsetConfigFileName(ConfigFileName configFileName) config file, e.g.voidsetConfigFileNameDb(String configFileName) config file, e.g.voidsetConfigKey(String configKey1) key of the propertyvoidsetConfigSequence(int configSequence1) if there is more data than fits in the column this is the 0 indexed ordervoidsetConfigValueBytes(Long configValueBytes) size of config value in bytesvoidsetConfigValueClob(String configValueClob1) clob value of the propertyvoidsetConfigValueClobDb(String configValueClob1) value of the propertyvoidsetConfigValueDb(String configValue1) value of the propertyvoidsetConfigVersionIndex(int configVersionIndex1) for built in configs, this is the index that will identify if the database configs should be replaced from the java codevoidsetContextId(String contextId1) set context idvoidvoidsetLastUpdated(Timestamp lastUpdated1) when last updatedvoidsetLastUpdatedDb(Long lastUpdated1) when last updatedvoidsetValueToSave(String value) set config value to save.voidtruncate()make sure this object will fit in the DBstatic voidupdate last updated if something changedMethods inherited from class edu.internet2.middleware.grouper.GrouperAPI
dbVersion, dbVersionClear, dbVersionDifferentFields, dbVersionIsDifferent, fieldValue, getHibernateVersionNumber, onDelete, onLoad, onPostDelete, onPostSave, onPostUpdate, onPreDelete, onSave, onUpdate, setHibernateVersionNumber
-
Field Details
-
ESCAPED_PASSWORD
- See Also:
-
COLUMN_ID
db uuid for this row- See Also:
-
FIELD_CONFIG_COMMENT
constant for field name for: configComment- See Also:
-
FIELD_CONFIG_ENCRYPTED
constant for field name for: configEncrypted- See Also:
-
FIELD_CONFIG_FILE_HIERARCHY
constant for field name for: configFileHierarchy- See Also:
-
FIELD_CONFIG_FILE_NAME
constant for field name for: configFileName- See Also:
-
FIELD_CONFIG_KEY
constant for field name for: configKey- See Also:
-
FIELD_CONFIG_SEQUENCE
constant for field name for: configSequence- See Also:
-
FIELD_CONFIG_VALUE
constant for field name for: configValue- See Also:
-
FIELD_CONFIG_VALUE_CLOB
constant for field name for: configValueClob- See Also:
-
FIELD_CONFIG_VALUE_BYTES
constant for field name for: configValueBytes- See Also:
-
FIELD_CONFIG_VERSION_INDEX
constant for field name for: configVersionIndex- See Also:
-
FIELD_CONTEXT_ID
constant for field name for: contextId- See Also:
-
FIELD_ID
constant for field name for: id- See Also:
-
FIELD_LAST_UPDATED_DB
constant for field name for: lastUpdatedDb- See Also:
-
COLUMN_HIBERNATE_VERSION_NUMBER
hibernate version- See Also:
-
COLUMN_CONFIG_KEY
key of the property- See Also:
-
COLUMN_CONFIG_VALUE
value of the property- See Also:
-
COLUMN_CONFIG_VALUE_CLOB
value when it's too big for config_value- See Also:
-
COLUMN_CONFIG_VALUE_BYTES
size of the config value- See Also:
-
COLUMN_CONFIG_COMMENT
comment of the property- See Also:
-
COLUMN_CONFIG_SEQUENCE
if there is more data than fits in the column this is the 0 indexed order- See Also:
-
COLUMN_CONFIG_FILE_NAME
config file, e.g. grouper.properties- See Also:
-
COLUMN_CONFIG_FILE_HIERARCHY
config file hierarchy, e.g. BASE, INSTITUTION, ENVIRONMENT, GROUPER_ENGINE- See Also:
-
COLUMN_LAST_UPDATED
millis since 1970 this row was last updated- See Also:
-
COLUMN_CONFIG_VERSION_INDEX
for built in configs, this is the index that will identify if the database configs should be replaced from the java code- See Also:
-
COLUMN_CONFIG_ENCRYPTED
if this is a password or for whatever other reason is encrypted- See Also:
-
TABLE_GROUPER_CONFIG
name of the table in the database.- See Also:
-
-
Constructor Details
-
GrouperConfigHibernate
public GrouperConfigHibernate()
-
-
Method Details
-
onPreSave
Description copied from interface:HibGrouperLifecyclebefore a save (insert) occurs- Specified by:
onPreSavein interfaceHibGrouperLifecycle- Overrides:
onPreSavein classGrouperAPI- See Also:
-
onPreUpdate
Description copied from interface:HibGrouperLifecyclebefore an update occurs- Specified by:
onPreUpdatein interfaceHibGrouperLifecycle- Overrides:
onPreUpdatein classGrouperAPI- See Also:
-
getLastUpdated
when last updated- Returns:
- timestamp
-
getLastUpdatedDb
when last updated- Returns:
- timestamp
-
setLastUpdated
when last updated- Parameters:
lastUpdated1-
-
setLastUpdatedDb
when last updated- Parameters:
lastUpdated1-
-
getConfigVersionIndex
public int getConfigVersionIndex()for built in configs, this is the index that will identify if the database configs should be replaced from the java code- Returns:
- the configVersionIndex
-
setConfigVersionIndex
public void setConfigVersionIndex(int configVersionIndex1) for built in configs, this is the index that will identify if the database configs should be replaced from the java code- Parameters:
configVersionIndex1- the configVersionIndex to set
-
getConfigValueDb
value of the property- Returns:
- the configValue
-
retrieveValue
retrieve value. based on the size, it will be retrieved from config_value or config_value_clob- Returns:
-
setValueToSave
set config value to save. based on the size, it will be saved in config_value or config_value_clob- Parameters:
value-
-
setConfigValueDb
value of the property- Parameters:
configValue1- the configValue to set
-
getConfigValueClobDb
clob value of the property- Returns:
- the configValueClob
-
getConfigValueClob
clob value of the property- Returns:
- the configValueClob
-
setConfigValueClobDb
value of the property- Parameters:
configValueClob1- the configValueClob to set
-
getConfigValueBytes
size of config value in bytes- Returns:
- the configValueBytes
-
setConfigValueBytes
size of config value in bytes- Parameters:
the- configValueBytes
-
getConfigSequence
public int getConfigSequence()if there is more data than fits in the column this is the 0 indexed order- Returns:
- the configSequence
-
setConfigSequence
public void setConfigSequence(int configSequence1) if there is more data than fits in the column this is the 0 indexed order- Parameters:
configSequence1- the configSequence to set
-
getConfigKey
key of the property- Returns:
- the configKey
-
setConfigKey
key of the property- Parameters:
configKey1- the configKey to set
-
getConfigFileNameDb
config file, e.g. grouper.properties- Returns:
- the configFileName
-
setConfigFileNameDb
config file, e.g. grouper.properties- Parameters:
configFileName- the configFileName to set
-
getConfigFileHierarchyDb
- Returns:
- the configFileHierarchy
-
setConfigFileHierarchyDb
- Parameters:
configFileHierarchy- the configFileHierarchy to set
-
getConfigFileHierarchy
- Returns:
- the configFileHierarchy
-
setConfigFileHierarchy
- Parameters:
configFileHierarchyEnum- the configFileHierarchy to set
-
getConfigComment
- Returns:
- the configComment
-
setConfigComment
- Parameters:
configComment1- the configComment to set
-
getConfigEncryptedDb
if this is a password or for whatever other reason is encrypted, T|F- Returns:
- if config encrypted
-
setConfigEncryptedDb
if this is a password or for whatever other reason is encrypted- Parameters:
theConfigEncrypted-
-
isConfigEncrypted
public boolean isConfigEncrypted()if this is a password or for whatever other reason is encrypted- Returns:
- the configEncrypted
-
setConfigEncrypted
public void setConfigEncrypted(boolean configEncrypted1) if this is a password or for whatever other reason is encrypted- Parameters:
configEncrypted1- the configEncrypted to set
-
setId
- Parameters:
id1- the id to set
-
getId
- Returns:
- id
-
getContextId
- Returns:
- context id
-
setContextId
set context id- Parameters:
contextId1-
-
createNewPITGrouperConfigHibernate
public static void createNewPITGrouperConfigHibernate(String auditEntryId, String newActiveStatus, GrouperConfigHibernate config, String previousConfigValue, String previousConfigValueClob) create a new PIT grouper config entry in the database based on the grouper config- Parameters:
auditEntryId-config-
-
saveOrUpdate
public void saveOrUpdate(boolean addNew) save or update this object -
isPassword
public static boolean isPassword(ConfigFileName configFileName, ConfigItemMetadata configItemMetadata, String key, String value, boolean hasValue, Boolean userSelectedPassword) see if password based on various factors- Parameters:
configFileName- if known or null if notconfigItemMetadata- if known or null if notkey- or null if not knownvalue- if there is one at this point or null if nothasValue- true if there is a value, false if notuserSelectedPassword- true if the user selected that this is a password. null if NA- Returns:
- true if password
-
isPasswordHelper
see if password based on various factors- Parameters:
configItemMetadata-- Returns:
- true if password
-
isPasswordHelper
public static boolean isPasswordHelper(ConfigItemMetadata configItemMetadata, String propertyValueString) if the value is a file and it exists, then this is not a password to be escaped- Parameters:
configItemMetadata-propertyValueString-- Returns:
- true if should be escaped
-
isPasswordHelper
public static boolean isPasswordHelper(ConfigFileName configFileName, ConfigItemMetadata configItemMetadata, String key, String value, boolean hasValue, Boolean userSelectedPassword) see if password based on various factors- Parameters:
configFileName-configItemMetadata-key-value-hasValue-userSelectedPassword-- Returns:
- true if password
-
delete
public void delete()delete this object -
registerDatabaseCache
public static void registerDatabaseCache() -
updateLastUpdated
public static void updateLastUpdated()update last updated if something changed -
truncate
public void truncate()make sure this object will fit in the DB -
setConfigValueClob
clob value of the property- Parameters:
configValueClob1- the configValueClob to set
-
dbVersionDifferentFields
- Parameters:
failIfNull-- Returns:
- the set of different fields
- See Also:
-
dbVersionReset
public void dbVersionReset()take a snapshot of the data since this is what is in the db- Overrides:
dbVersionResetin classGrouperAPI
-
clone
deep clone the fields in this object- Specified by:
clonein interfaceGrouperCloneable- Specified by:
clonein classGrouperAPI- Returns:
- the clone of the object
- See Also:
-
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<GrouperConfigHibernate>- See Also:
-
hashCode
public int hashCode() -
setConfigFileName
config file, e.g. grouper.properties- Parameters:
configFileName- the configFileName to set
-
getConfigFileName
- Returns:
- the configFileName
-
clear
clear the cache when the database tells us to- Specified by:
clearin interfaceGrouperCacheDatabaseClear
-
clearConfigsInMemory
public static void clearConfigsInMemory()clear the cache when the database tells us to
-