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 String
comment of the propertystatic final String
if this is a password or for whatever other reason is encryptedstatic final String
config file hierarchy, e.g.static final String
config file, e.g.static final String
key of the propertystatic final String
if there is more data than fits in the column this is the 0 indexed orderstatic final String
value of the propertystatic final String
size of the config valuestatic final String
value when it's too big for config_valuestatic final String
for built in configs, this is the index that will identify if the database configs should be replaced from the java codestatic final String
hibernate versionstatic final String
db uuid for this rowstatic final String
millis since 1970 this row was last updatedstatic final String
static final String
constant for field name for: configCommentstatic final String
constant for field name for: configEncryptedstatic final String
constant for field name for: configFileHierarchystatic final String
constant for field name for: configFileNamestatic final String
constant for field name for: configKeystatic final String
constant for field name for: configSequencestatic final String
constant for field name for: configValuestatic final String
constant for field name for: configValueBytesstatic final String
constant for field name for: configValueClobstatic final String
constant for field name for: configVersionIndexstatic final String
constant for field name for: contextIdstatic final String
constant for field name for: idstatic final String
constant for field name for: lastUpdatedDbstatic final String
name 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_NUMBER
Fields inherited from interface org.hibernate.classic.Lifecycle
NO_VETO, VETO
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear
(GrouperCacheDatabaseClearInput grouperCacheDatabaseClearInput) clear the cache when the database tells us tostatic void
clear the cache when the database tells us toclone()
deep clone the fields in this objectint
compareTo
(GrouperConfigHibernate otherConfig) 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 configdbVersionDifferentFields
(boolean failIfNull) void
take a snapshot of the data since this is what is in the dbvoid
delete()
delete this objectboolean
if this is a password or for whatever other reason is encrypted, T|Fconfig file, e.g.key of the propertyint
if 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 propertyint
for 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 updatedint
hashCode()
boolean
if this is a password or for whatever other reason is encryptedstatic boolean
isPassword
(ConfigFileName configFileName, ConfigItemMetadata configItemMetadata, String key, String value, boolean hasValue, Boolean userSelectedPassword) see if password based on various factorsstatic boolean
isPasswordHelper
(ConfigFileName configFileName, ConfigItemMetadata configItemMetadata, String key, String value, boolean hasValue, Boolean userSelectedPassword) see if password based on various factorsstatic boolean
isPasswordHelper
(ConfigItemMetadata configItemMetadata) see if password based on various factorsstatic boolean
isPasswordHelper
(ConfigItemMetadata configItemMetadata, String propertyValueString) if the value is a file and it exists, then this is not a password to be escapedvoid
onPreSave
(HibernateSession hibernateSession) before a save (insert) occursvoid
onPreUpdate
(HibernateSession hibernateSession) before an update occursstatic void
retrieve value.void
saveOrUpdate
(boolean addNew) save or update this objectvoid
setConfigComment
(String configComment1) void
setConfigEncrypted
(boolean configEncrypted1) if this is a password or for whatever other reason is encryptedvoid
setConfigEncryptedDb
(String theConfigEncrypted) if this is a password or for whatever other reason is encryptedvoid
setConfigFileHierarchy
(ConfigFileHierarchy configFileHierarchyEnum) void
setConfigFileHierarchyDb
(String configFileHierarchy) void
setConfigFileName
(ConfigFileName configFileName) config file, e.g.void
setConfigFileNameDb
(String configFileName) config file, e.g.void
setConfigKey
(String configKey1) key of the propertyvoid
setConfigSequence
(int configSequence1) if there is more data than fits in the column this is the 0 indexed ordervoid
setConfigValueBytes
(Long configValueBytes) size of config value in bytesvoid
setConfigValueClob
(String configValueClob1) clob value of the propertyvoid
setConfigValueClobDb
(String configValueClob1) value of the propertyvoid
setConfigValueDb
(String configValue1) value of the propertyvoid
setConfigVersionIndex
(int configVersionIndex1) for built in configs, this is the index that will identify if the database configs should be replaced from the java codevoid
setContextId
(String contextId1) set context idvoid
void
setLastUpdated
(Timestamp lastUpdated1) when last updatedvoid
setLastUpdatedDb
(Long lastUpdated1) when last updatedvoid
setValueToSave
(String value) set config value to save.void
truncate()
make sure this object will fit in the DBstatic void
update 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:HibGrouperLifecycle
before a save (insert) occurs- Specified by:
onPreSave
in interfaceHibGrouperLifecycle
- Overrides:
onPreSave
in classGrouperAPI
- See Also:
-
onPreUpdate
Description copied from interface:HibGrouperLifecycle
before an update occurs- Specified by:
onPreUpdate
in interfaceHibGrouperLifecycle
- Overrides:
onPreUpdate
in 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:
dbVersionReset
in classGrouperAPI
-
clone
deep clone the fields in this object- Specified by:
clone
in interfaceGrouperCloneable
- Specified by:
clone
in classGrouperAPI
- Returns:
- the clone of the object
- See Also:
-
equals
-
compareTo
- Specified by:
compareTo
in 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:
clear
in interfaceGrouperCacheDatabaseClear
-
clearConfigsInMemory
public static void clearConfigsInMemory()clear the cache when the database tells us to
-