Class ExternalSubject
java.lang.Object
edu.internet2.middleware.grouper.GrouperAPI
edu.internet2.middleware.grouper.externalSubjects.ExternalSubject
- All Implemented Interfaces:
HibGrouperLifecycle
,Hib3GrouperVersioned
,GrouperCloneable
,GrouperHasContext
,GrouperUtil.FieldValuable
,Serializable
,org.hibernate.classic.Lifecycle
database object for external subject
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
column name for context idstatic final String
column name for create timestatic final String
column name for creator member idstatic final String
column name for descriptionstatic final String
column name for disabled timestatic final String
column name for emailstatic final String
column name for enabledstatic final String
column name for identifierstatic final String
column name for institutionstatic final String
column name for modifier member idstatic final String
column name for modify timestatic final String
column name for namestatic final String
column name for searchStringLowerstatic final String
column name for uuidstatic final String
column name for vettedEmailAddressesstatic final String
constant for field name for: contextIdstatic final String
constant for field name for: createTimestatic final String
constant for field name for: creatorMemberIdstatic final String
constant for field name for: descriptionstatic final String
constant for field name for: disabledTimestatic final String
constant for field name for: emailstatic final String
constant for field name for: enabledstatic final String
constant for field name for: identifierstatic final String
constant for field name for: institutionstatic final String
constant for field name for: modifierMemberIdstatic final String
constant for field name for: modifyTimestatic final String
constant for field name for: namestatic final String
constant for field name for: searchStringLowerstatic final String
constant for field name for: uuidstatic final String
constant for field name for: vettedEmailAddressesstatic final String
table name for external subjectsFields inherited from class edu.internet2.middleware.grouper.GrouperAPI
COLUMN_HIBERNATE_VERSION_NUMBER, dbVersion, FIELD_DB_VERSION, FIELD_HIBERNATE_VERSION_NUMBER, INITIAL_VERSION_NUMBER
Fields inherited from interface org.hibernate.classic.Lifecycle
NO_VETO, VETO
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addVettedEmailAddress
(String vettedEmailAddress) add a vetted email address and store this object if necessaryboolean
assignAttribute
(String attributeName, String attributeValue) assign an attribute to this subject, change value if already exists, add if notclone()
deep clone the fields in this objectvoid
delete()
delete this object from the DB.contextId links to audit tablesGet creation time for this subject.long
description, which is generated from other attributeswhen this was disabled, or when it will be disabled, millis from 1970when this was disabled, or when it will be disabledgetEmail()
email addressif this is enabledthe thing that the subject uses to logininstitution where the user is fromGet modify time for this subject.long
getName()
name of subjectsearch string to find a subject, in all lower casegetUuid()
uuid for rowcomma separated vetted email addressesstatic int
fix enabled and disabled memberships, and return the count of how many were fixedstatic int
fix enabled and disabled memberships, and return the count of how many were fixedboolean
if this is enabledstatic void
notifyWatcherAboutRegistration
(String identifier, String emailAddressToNotify, String emailAddressOfInvitee) notify watcher about a registration.void
onPreSave
(HibernateSession hibernateSession) before a save (insert) occursvoid
onPreUpdate
(HibernateSession hibernateSession) before an update occursboolean
removeAttribute
(String attributeName) remove an attributeretrieveAttribute
(String attributeName, boolean exceptionIfNotFound) get an attributes for this subjectget all attributes for this subjectretrieveFieldValue
(String fieldOrAttributeName) get the value by field name or attributevoid
setContextId
(String contextId1) contextId links to audit tablesvoid
setCreateTimeDb
(long createTime1) create timevoid
setCreatorMemberId
(String creatorMemberId1) member id of creatorvoid
setDescription
(String description1) description, which is generated from other attributesvoid
setDisabledTime
(Date theDisabledTime1) when this was disabled, or when it will be disabled, millis from 1970void
setDisabledTimeDb
(Long disabledTime1) when this was disabled, or when it will be disabledvoid
email addressvoid
setEnabled
(boolean enabled1) if this is enabledvoid
setEnabledDb
(String enabled1) if this is enabled, T or Fvoid
setIdentifier
(String identifier1) the thing that the subject uses to loginvoid
setInstitution
(String institution1) institution where the user is fromvoid
setModifierMemberId
(String modifierMemberId1) member id of modifiervoid
setModifyTimeDb
(long modifyTime1) last time modifiedvoid
name of subjectvoid
setSearchStringLower
(String searchStringLower1) search string to find a subject, in all lower casevoid
uuid for rowvoid
setVettedEmailAddresses
(String vettedEmailAddresses1) comma separated vetted email addressesstatic String
sourceId()
source id for external subjectsstatic String
source name for external subjectsvoid
store()
store this object to the DB.void
store
(Set<ExternalSubjectAttribute> externalSubjectAttributes, String externalSubjectInviteName, boolean validateAttributes, boolean autoaddGroups, boolean fromRecalcDaemon) store this object to the DB.static boolean
subjectCanEditExternalUser
(Subject subject) see if someone is allowed to edit, cache for 1 minute, note, this method has no securitytoString()
void
validate that the identifier is ok, based on grouper.propertiesMethods inherited from class edu.internet2.middleware.grouper.GrouperAPI
dbVersion, dbVersionClear, dbVersionDifferentFields, dbVersionIsDifferent, dbVersionReset, fieldValue, getHibernateVersionNumber, onDelete, onLoad, onPostDelete, onPostSave, onPostUpdate, onPreDelete, onSave, onUpdate, setHibernateVersionNumber
-
Field Details
-
TABLE_GROUPER_EXT_SUBJ
table name for external subjects- See Also:
-
COLUMN_CONTEXT_ID
column name for context id- See Also:
-
COLUMN_DESCRIPTION
column name for description- See Also:
-
COLUMN_DISABLED_TIME
column name for disabled time- See Also:
-
COLUMN_EMAIL
column name for email- See Also:
-
COLUMN_ENABLED
column name for enabled- See Also:
-
COLUMN_IDENTIFIER
column name for identifier- See Also:
-
COLUMN_INSTITUTION
column name for institution- See Also:
-
COLUMN_NAME
column name for name- See Also:
-
COLUMN_SEARCH_STRING_LOWER
column name for searchStringLower- See Also:
-
COLUMN_VETTED_EMAIL_ADDRESSES
column name for vettedEmailAddresses- See Also:
-
COLUMN_UUID
column name for uuid- See Also:
-
COLUMN_CREATE_TIME
column name for create time- See Also:
-
COLUMN_CREATOR_MEMBER_ID
column name for creator member id- See Also:
-
COLUMN_MODIFY_TIME
column name for modify time- See Also:
-
COLUMN_MODIFIER_MEMBER_ID
column name for modifier member id- See Also:
-
FIELD_CONTEXT_ID
constant for field name for: contextId- See Also:
-
FIELD_CREATE_TIME
constant for field name for: createTime- See Also:
-
FIELD_CREATOR_MEMBER_ID
constant for field name for: creatorMemberId- See Also:
-
FIELD_DESCRIPTION
constant for field name for: description- See Also:
-
FIELD_DISABLED_TIME
constant for field name for: disabledTime- See Also:
-
FIELD_EMAIL
constant for field name for: email- See Also:
-
FIELD_ENABLED
constant for field name for: enabled- See Also:
-
FIELD_IDENTIFIER
constant for field name for: identifier- See Also:
-
FIELD_INSTITUTION
constant for field name for: institution- See Also:
-
FIELD_MODIFIER_MEMBER_ID
constant for field name for: modifierMemberId- See Also:
-
FIELD_MODIFY_TIME
constant for field name for: modifyTime- See Also:
-
FIELD_NAME
constant for field name for: name- See Also:
-
FIELD_SEARCH_STRING_LOWER
constant for field name for: searchStringLower- See Also:
-
FIELD_VETTED_EMAIL_ADDRESSES
constant for field name for: vettedEmailAddresses- See Also:
-
FIELD_UUID
constant for field name for: uuid- See Also:
-
-
Constructor Details
-
ExternalSubject
public ExternalSubject()
-
-
Method Details
-
getVettedEmailAddresses
comma separated vetted email addresses- Returns:
- comma separated vetted email addresses
-
setVettedEmailAddresses
comma separated vetted email addresses- Parameters:
vettedEmailAddresses1
-
-
notifyWatcherAboutRegistration
public static void notifyWatcherAboutRegistration(String identifier, String emailAddressToNotify, String emailAddressOfInvitee) notify watcher about a registration. If there is a problem, just log the exception- Parameters:
identifier
-emailAddressToNotify
-emailAddressOfInvitee
-
-
addVettedEmailAddress
add a vetted email address and store this object if necessary- Parameters:
vettedEmailAddress
-
-
getDisabledTimeDb
when this was disabled, or when it will be disabled- Returns:
- the millis from 1970
-
setDisabledTimeDb
when this was disabled, or when it will be disabled- Parameters:
disabledTime1
-
-
getDisabledTime
when this was disabled, or when it will be disabled, millis from 1970- Returns:
- disabled time
-
setDisabledTime
when this was disabled, or when it will be disabled, millis from 1970- Parameters:
theDisabledTime1
-
-
isEnabled
public boolean isEnabled()if this is enabled- Returns:
- true if enabled
-
getEnabledDb
if this is enabled- Returns:
- T or F
-
setEnabled
public void setEnabled(boolean enabled1) if this is enabled- Parameters:
enabled1
-
-
setEnabledDb
if this is enabled, T or F- Parameters:
enabled1
-
-
getContextId
contextId links to audit tables- Returns:
- context id
-
getSearchStringLower
search string to find a subject, in all lower case- Returns:
- search string lower
-
setSearchStringLower
search string to find a subject, in all lower case- Parameters:
searchStringLower1
-
-
getUuid
uuid for row- Returns:
- uuid
-
setUuid
uuid for row- Parameters:
uuid1
-
-
getIdentifier
the thing that the subject uses to login- Returns:
- identifier
-
setIdentifier
the thing that the subject uses to login- Parameters:
identifier1
-
-
getName
name of subject- Returns:
- name
-
setName
name of subject- Parameters:
name1
-
-
getDescription
description, which is generated from other attributes- Returns:
- description
-
setDescription
description, which is generated from other attributes- Parameters:
description1
-
-
getEmail
email address- Returns:
-
setEmail
email address- Parameters:
email1
-
-
getInstitution
institution where the user is from- Returns:
- institution
-
setInstitution
institution where the user is from- Parameters:
institution1
-
-
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:
-
setContextId
contextId links to audit tables- Specified by:
setContextId
in interfaceGrouperHasContext
- Parameters:
contextId1
-
-
getCreateTime
Get creation time for this subject.- Returns:
Date
that this subject was created.
-
getCreateTimeDb
public long getCreateTimeDb()- Returns:
- create time
-
getCreatorMemberId
- Returns:
- creator
-
getModifierMemberId
- Returns:
- the modifier member id
-
setCreateTimeDb
public void setCreateTimeDb(long createTime1) create time- Parameters:
createTime1
-
-
setCreatorMemberId
member id of creator- Parameters:
creatorMemberId1
-
-
setModifierMemberId
member id of modifier- Parameters:
modifierMemberId1
-
-
setModifyTimeDb
public void setModifyTimeDb(long modifyTime1) last time modified- Parameters:
modifyTime1
-
-
getModifyTime
Get modify time for this subject.- Returns:
Date
that this subject was created.
-
getModifyTimeDb
public long getModifyTimeDb()- Returns:
- modify time
-
subjectCanEditExternalUser
see if someone is allowed to edit, cache for 1 minute, note, this method has no security- Parameters:
subject
-- Returns:
- true if allowed to edit
-
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:
-
store
public void store()store this object to the DB. -
retrieveFieldValue
get the value by field name or attribute- Parameters:
fieldOrAttributeName
-- Returns:
- the value
-
store
public void store(Set<ExternalSubjectAttribute> externalSubjectAttributes, String externalSubjectInviteName, boolean validateAttributes, boolean autoaddGroups, boolean fromRecalcDaemon) store this object to the DB.- Parameters:
externalSubjectAttributes
- null to not worry, not null to affect the external subject attributes tooexternalSubjectInviteName
- is a variable you could put in the URL to pass to the hook so you can add the users to custom groups or whatnotvalidateAttributes
- if required attributes should be validatedautoaddGroups
- if groups should be auto-added (e.g. not from daemon)fromRecalcDaemon
- if the recalc daemon is doing the storing
-
validateIdentifier
public void validateIdentifier()validate that the identifier is ok, based on grouper.properties -
sourceName
source name for external subjects- Returns:
- name
-
sourceId
source id for external subjects- Returns:
- id
-
delete
public void delete()delete this object from the DB. -
internal_fixDisabled
public static int internal_fixDisabled()fix enabled and disabled memberships, and return the count of how many were fixed- Returns:
- the number of records affected
-
internal_daemonCalcFields
public static int internal_daemonCalcFields()fix enabled and disabled memberships, and return the count of how many were fixed- Returns:
- the number of records affected
-
assignAttribute
assign an attribute to this subject, change value if already exists, add if not- Parameters:
attributeName
-attributeValue
-- Returns:
- true if changed anything, false if not
-
retrieveAttributes
get all attributes for this subject- Returns:
- the attributes
-
retrieveAttribute
public ExternalSubjectAttribute retrieveAttribute(String attributeName, boolean exceptionIfNotFound) get an attributes for this subject- Parameters:
attributeName
-exceptionIfNotFound
-- Returns:
- the attributes
-
toString
-
removeAttribute
remove an attribute- Parameters:
attributeName
-- Returns:
- true if did anything
-