Package edu.internet2.middleware.grouper
Class Field
java.lang.Object
edu.internet2.middleware.grouper.GrouperAPI
edu.internet2.middleware.grouper.Field
- All Implemented Interfaces:
HibGrouperLifecycle,Hib3GrouperVersioned,GrouperCloneable,GrouperHasContext,GrouperUtil.FieldValuable,XmlImportable<Field>,XmlImportableBase<Field>,Serializable,Comparable<Field>,org.hibernate.classic.Lifecycle
public class Field
extends GrouperAPI
implements Comparable<Field>, GrouperHasContext, Hib3GrouperVersioned, XmlImportable<Field>
Schema specification for a Group attribute or list.
Reference to members list is: Group.getDefaultList()
- Version:
- $Id: Field.java,v 1.48 2009-09-24 18:07:16 shilen Exp $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringcolstatic final Stringuuid col in dbstatic final Stringcolstatic final Stringcolstatic final Stringcolstatic final Stringold uuid id col for id conversionstatic final Stringold id col for id conversionstatic final Stringcolstatic final Stringcolstatic final Stringcolstatic final Stringconstant for field name for: dbVersionstatic final Stringconstant for field name for: namestatic final Stringfield name for adminsstatic final Stringfield name for attr adminsstatic final Stringfield name for attrDefAttrReadersstatic final Stringfield name for attrDefAttrUpdatersstatic final Stringfield name for attr optinsstatic final Stringfield name for attr optoutsstatic final Stringfield name for attr readersstatic final Stringfield name for attr updatersstatic final Stringfield name for attr viewersstatic final Stringfield name for creatorsstatic final Stringfield name for groupAttrReadersstatic final Stringfield name for groupAttrUpdatersstatic final Stringfield name for optinsstatic final Stringfield name for optoutsstatic final Stringfield name for readersstatic final Stringfield name for stemAdminsstatic final Stringfield name for stemAttrReadersstatic final Stringfield name for stemAttrUpdatersstatic final Stringfield name for stemViewersstatic final Stringfield name for stemmersstatic final Stringfield name for updatersstatic final Stringfield name for viewersstatic final Stringconstant for field name for: readPrivilegestatic final Stringconstant for field name for: typestatic final Stringconstant for field name for: uuidstatic final Stringconstant for field name for: writePrivilegestatic final Stringconstant for property name for: internalIdstatic final Stringconstant for property name for: uuidstatic final longstatic final Stringtable name for fieldsFields inherited from class edu.internet2.middleware.grouper.GrouperAPI
COLUMN_HIBERNATE_VERSION_NUMBER, dbVersion, FIELD_HIBERNATE_VERSION_NUMBER, INITIAL_VERSION_NUMBERFields inherited from interface org.hibernate.classic.Lifecycle
NO_VETO, VETO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<Field>calculateInheritedPrivileges(Collection<Field> fields, boolean includeInheritedPrivileges) see if there are inherited privileges to also includeclone()deep clone the fields in this objectintsave the state when retrieving from DBnote, these are massaged so that name, extension, etc look like normal fields.voidtake a snapshot of the data since this is what is in the dbbooleanstatic StringfieldNames(Collection<Field> collection) print out a collection of fieldscontext id of the transactiongetGroupType(boolean exceptionIfNoGroupType) getId()return the uuidget the fields that this field implies by inheritancegetName()getType()getUuid()inthashCode()static Fieldinternal_addField(GrouperSession s, String name, FieldType type, Privilege read, Privilege write, boolean exceptionIfExists, boolean updateIfExists, boolean[] changedArray, String uuid) add a field if it is not already therebooleansee if this is a list of members field for attributeDefsbooleanDeprecated.booleansee if this is a list of members field for groupsbooleansee if this is privilege field for groupsbooleansee if this is a list of members field for groupsbooleanbooleansee if this is a list of members field for stemsvoidonPostDelete(HibernateSession hibernateSession) after a delete occursvoidonPostSave(HibernateSession hibernateSession) after a save (insert) occursvoidonPostUpdate(HibernateSession hibernateSession) after an update occursvoidonPreDelete(HibernateSession hibernateSession) before a delete (insert) occursvoidonPreSave(HibernateSession hibernateSession) before a save (insert) occursvoidonPreUpdate(HibernateSession hibernateSession) before an update occursvoidsetContextId(String contextId1) context id of the transactionvoidsetInternalId(Long internalId) voidvoidsetReadPrivilege(Privilege readPrivilege) voidsetReadPrivilege(String readPrivilege) voidvoidsetTypeString(String type) voidvoidsetWritePrivilege(Privilege writePrivilege) voidsetWritePrivilege(String writePrivilege) voidstore()store this object to the DB.toString()voidxmlCopyBusinessPropertiesToExisting(Field existingRecord) copy business (non update) properties to an existing recordbooleansee if the non update cols are different (e.g. name)booleansee if the update cols are different (e.g. last updated)xmlGetId()set id key in dbretrieve from db by id or key.xmlSaveBusinessProperties(Field existingRecord) save the business properties (not update properties)voidsave the udpate properties (e.g. last updated).voidset id key in dbxmlToExportField(GrouperVersion grouperVersion) convert to xml bean for exportconvert to string for logMethods inherited from class edu.internet2.middleware.grouper.GrouperAPI
dbVersionClear, dbVersionIsDifferent, fieldValue, getHibernateVersionNumber, onDelete, onLoad, onSave, onUpdate, setHibernateVersionNumber
-
Field Details
-
FIELD_NAME_CREATORS
field name for creators- See Also:
-
FIELD_NAME_STEMMERS
field name for stemmers- See Also:
-
FIELD_NAME_VIEWERS
field name for viewers- See Also:
-
FIELD_NAME_ATTR_VIEWERS
field name for attr viewers- See Also:
-
FIELD_NAME_ADMINS
field name for admins- See Also:
-
FIELD_NAME_ATTR_ADMINS
field name for attr admins- See Also:
-
FIELD_NAME_READERS
field name for readers- See Also:
-
FIELD_NAME_ATTR_READERS
field name for attr readers- See Also:
-
FIELD_NAME_UPDATERS
field name for updaters- See Also:
-
FIELD_NAME_ATTR_UPDATERS
field name for attr updaters- See Also:
-
FIELD_NAME_OPTINS
field name for optins- See Also:
-
FIELD_NAME_ATTR_OPTINS
field name for attr optins- See Also:
-
FIELD_NAME_OPTOUTS
field name for optouts- See Also:
-
FIELD_NAME_ATTR_OPTOUTS
field name for attr optouts- See Also:
-
FIELD_NAME_GROUP_ATTR_READERS
field name for groupAttrReaders- See Also:
-
FIELD_NAME_GROUP_ATTR_UPDATERS
field name for groupAttrUpdaters- See Also:
-
FIELD_NAME_ATTR_DEF_ATTR_READERS
field name for attrDefAttrReaders- See Also:
-
FIELD_NAME_ATTR_DEF_ATTR_UPDATERS
field name for attrDefAttrUpdaters- See Also:
-
FIELD_NAME_STEM_ATTR_READERS
field name for stemAttrReaders- See Also:
-
FIELD_NAME_STEM_VIEWERS
field name for stemViewers- See Also:
-
FIELD_NAME_STEM_ATTR_UPDATERS
field name for stemAttrUpdaters- See Also:
-
FIELD_NAME_STEM_ADMINS
field name for stemAdmins- See Also:
-
COLUMN_ID
col- See Also:
-
COLUMN_INTERNAL_ID
col- See Also:
-
COLUMN_NAME
col- See Also:
-
COLUMN_READ_PRIVILEGE
col- See Also:
-
COLUMN_TYPE
col- See Also:
-
COLUMN_WRITE_PRIVILEGE
col- See Also:
-
COLUMN_CONTEXT_ID
col- See Also:
-
TABLE_GROUPER_FIELDS
table name for fields- See Also:
-
COLUMN_FIELD_UUID
uuid col in db- See Also:
-
COLUMN_OLD_ID
old id col for id conversion- See Also:
-
COLUMN_OLD_FIELD_UUID
old uuid id col for id conversion- See Also:
-
FIELD_DB_VERSION
constant for field name for: dbVersion- See Also:
-
FIELD_NAME
constant for field name for: name- See Also:
-
FIELD_READ_PRIVILEGE
constant for field name for: readPrivilege- See Also:
-
FIELD_TYPE
constant for field name for: type- See Also:
-
FIELD_UUID
constant for field name for: uuid- See Also:
-
FIELD_WRITE_PRIVILEGE
constant for field name for: writePrivilege- See Also:
-
PROPERTY_UUID
constant for property name for: uuid- See Also:
-
PROPERTY_INTERNAL_ID
constant for property name for: internalId- See Also:
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
-
Constructor Details
-
Field
public Field()
-
-
Method Details
-
getImpliedFields
get the fields that this field implies by inheritance- Returns:
- the fields, note, dont change the list after you get it
-
isPrivilege
public boolean isPrivilege()- Returns:
- if this field is a privilege
-
getId
return the uuid- Returns:
- uuid
-
calculateInheritedPrivileges
public static Collection<Field> calculateInheritedPrivileges(Collection<Field> fields, boolean includeInheritedPrivileges) see if there are inherited privileges to also include- Returns:
- the inherited fields
-
fieldNames
print out a collection of fields- Parameters:
collection-- Returns:
- the field names comma separated
-
getContextId
context id of the transaction- Returns:
- context id
-
setContextId
context id of the transaction- Specified by:
setContextIdin interfaceGrouperHasContext- Parameters:
contextId1-
-
getInternalId
- Returns:
-
setInternalId
- Parameters:
internalId-
-
isStemListField
public boolean isStemListField()see if this is a list of members field for stems- Returns:
- true if stem list field
-
isAttributeDefListField
public boolean isAttributeDefListField()see if this is a list of members field for attributeDefs- Returns:
- true if attribute def list field
-
isGroupListField
public boolean isGroupListField()see if this is a list of members field for groups- Returns:
- true if group list field
-
isGroupAccessField
public boolean isGroupAccessField()see if this is privilege field for groups- Returns:
- true if group access list field
-
isEntityListField
public boolean isEntityListField()see if this is a list of members field for groups- Returns:
- true if group list field
-
getType
- Returns:
- field type
-
getReadPriv
- Returns:
- privilege
-
getWritePriv
- Returns:
- privilege
-
equals
-
getName
- Returns:
- name
- Since:
- 1.2.0
-
getReadPrivilege
- Returns:
- read privilege
- Since:
- 1.2.0
-
getTypeString
- Returns:
- type string
- Since:
- 1.2.0
-
getUuid
- Returns:
- uuid
- Since:
- 1.2.0
-
getWritePrivilege
- Returns:
- write privilege
- Since:
- 1.2.0
-
hashCode
public int hashCode() -
setName
- Parameters:
name-- Since:
- 1.2.0
-
setReadPrivilege
- Parameters:
readPrivilege-- Since:
- 1.2.0
-
setReadPrivilege
- Parameters:
readPrivilege-- Since:
- 1.2.0
-
setType
- Parameters:
type-- Since:
- 1.2.0
-
setTypeString
- Parameters:
type-- Since:
- 1.2.0
-
isAttributeName
public boolean isAttributeName()Deprecated.see if this field is an attribute name- Returns:
- true if so
-
setUuid
- Parameters:
uuid-- Since:
- 1.2.0
-
setWritePrivilege
- Parameters:
writePrivilege-- Since:
- 1.2.0
-
setWritePrivilege
- Parameters:
writePrivilege-- Since:
- 1.2.0
-
toString
-
onPostDelete
Description copied from interface:HibGrouperLifecycleafter a delete occurs- Specified by:
onPostDeletein interfaceHibGrouperLifecycle- Overrides:
onPostDeletein classGrouperAPI- See Also:
-
onPostSave
Description copied from interface:HibGrouperLifecycleafter a save (insert) occurs- Specified by:
onPostSavein interfaceHibGrouperLifecycle- Overrides:
onPostSavein classGrouperAPI- See Also:
-
onPostUpdate
Description copied from interface:HibGrouperLifecycleafter an update occurs- Specified by:
onPostUpdatein interfaceHibGrouperLifecycle- Overrides:
onPostUpdatein classGrouperAPI- See Also:
-
onPreDelete
Description copied from interface:HibGrouperLifecyclebefore a delete (insert) occurs- Specified by:
onPreDeletein interfaceHibGrouperLifecycle- Overrides:
onPreDeletein classGrouperAPI- See Also:
-
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:
-
dbVersion
save the state when retrieving from DB- Overrides:
dbVersionin classGrouperAPI- Returns:
- the dbVersion
-
dbVersionDifferentFields
note, these are massaged so that name, extension, etc look like normal fields. access with fieldValue()- Overrides:
dbVersionDifferentFieldsin classGrouperAPI- Returns:
- a set of attributes changed, or empty set if none
- 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:
-
store
public void store()store this object to the DB. -
xmlCopyBusinessPropertiesToExisting
Description copied from interface:XmlImportableBasecopy business (non update) properties to an existing record- Specified by:
xmlCopyBusinessPropertiesToExistingin interfaceXmlImportableBase<Field>- See Also:
-
xmlDifferentBusinessProperties
Description copied from interface:XmlImportableBasesee if the non update cols are different (e.g. name)- Specified by:
xmlDifferentBusinessPropertiesin interfaceXmlImportableBase<Field>- Parameters:
other- the one to compare with- Returns:
- true if so
- See Also:
-
xmlDifferentUpdateProperties
Description copied from interface:XmlImportableBasesee if the update cols are different (e.g. last updated)- Specified by:
xmlDifferentUpdatePropertiesin interfaceXmlImportableBase<Field>- Parameters:
other- the one to compare with- Returns:
- true if so
- See Also:
-
xmlRetrieveByIdOrKey
Description copied from interface:XmlImportableretrieve from db by id or key. throws exception if duplicate- Specified by:
xmlRetrieveByIdOrKeyin interfaceXmlImportable<Field>- Returns:
- the object or null if not found
- See Also:
-
xmlSaveBusinessProperties
Description copied from interface:XmlImportableBasesave the business properties (not update properties)- Specified by:
xmlSaveBusinessPropertiesin interfaceXmlImportableBase<Field>- 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:XmlImportableBasesave the udpate properties (e.g. last updated). Note, this is done with a sql update statement, not with hibernate- Specified by:
xmlSaveUpdatePropertiesin interfaceXmlImportableBase<Field>- See Also:
-
xmlToExportField
convert to xml bean for export- Parameters:
grouperVersion-- Returns:
- xml bean
-
xmlGetId
Description copied from interface:XmlImportableBaseset id key in db- Specified by:
xmlGetIdin interfaceXmlImportableBase<Field>- Returns:
- id
- See Also:
-
xmlSetId
Description copied from interface:XmlImportableBaseset id key in db- Specified by:
xmlSetIdin interfaceXmlImportableBase<Field>- See Also:
-
xmlToString
Description copied from interface:XmlImportableBaseconvert to string for log- Specified by:
xmlToStringin interfaceXmlImportableBase<Field>- Returns:
- the string value for log
- See Also:
-
getGroupType
- Parameters:
exceptionIfNoGroupType-- Returns:
- group type
-
getGroupType
- Returns:
- group type
-
compareTo
- Specified by:
compareToin interfaceComparable<Field>- See Also:
-
internal_addField
public static Field internal_addField(GrouperSession s, String name, FieldType type, Privilege read, Privilege write, boolean exceptionIfExists, boolean updateIfExists, boolean[] changedArray, String uuid) throws InsufficientPrivilegeException, SchemaException add a field if it is not already there- Parameters:
s-name-type-read-write-exceptionIfExists-updateIfExists-changedArray- is an array of 1 if you want to know if this method changed anything, else nulluuid-- Returns:
- the field
- Throws:
InsufficientPrivilegeExceptionSchemaException
-