Class InterfolioUser
java.lang.Object
edu.internet2.middleware.grouper.app.interfolio.InterfolioUser
Model object for an Interfolio user, used to back the mock service.
Interfolio identifies a person by two ids: the stable cross-product "pid" (returned by the IAM
create and the byc users/search), and a byc-internal "id". The provisioner keys on the pid.
The user also carries the immutable institution_user_id (UID/PennKey), saml_id (pennkey@upenn.edu),
user_type, name and email, plus two booleans tracking whether the user is subscribed to the RPT and
FS products (toggled by the byc subscribe/unsubscribe endpoints).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassignAttributesFromIamJson(com.fasterxml.jackson.databind.JsonNode jsonNode) Populate the user's account attributes from a JSON body (the IAM create/update body).static voidcreateTableInterfolioUser(DdlVersionBean ddlVersionBean, Database database) DDL for the mock table.static InterfolioUserfromProvisioningEntity(ProvisioningEntity targetEntity) Build from a Grouper provisioning entity (the target entity attributes).getBycId()getEmail()getFs()getPid()getRpt()booleanbooleanbooleanmatchesSearchTerm(String searchTerm) Does this user match the given byc search term?voidvoidvoidsetFirstName(String firstName) voidvoidsetInstitutionUserId(String institutionUserId) voidsetLastName(String lastName) voidvoidvoidvoidsetSubscribedFs(boolean subscribed) voidsetSubscribedRpt(boolean subscribed) voidsetUserType(String userType) com.fasterxml.jackson.databind.node.ObjectNodeThe IAM create/update response shape: { pid, first_name, last_name, email, institution_user_id, user_type }.Convert to a Grouper provisioning entity.com.fasterxml.jackson.databind.node.ObjectNodeThe byc users/search result shape for one user.toString()
-
Constructor Details
-
InterfolioUser
public InterfolioUser()
-
-
Method Details
-
getPid
-
setPid
-
getBycId
-
setBycId
-
getInstitutionUserId
-
setInstitutionUserId
-
getSamlId
-
setSamlId
-
getUserType
-
setUserType
-
getFirstName
-
setFirstName
-
getLastName
-
setLastName
-
getEmail
-
setEmail
-
getRpt
-
setRpt
-
getFs
-
setFs
-
isSubscribedRpt
public boolean isSubscribedRpt() -
setSubscribedRpt
public void setSubscribedRpt(boolean subscribed) -
isSubscribedFs
public boolean isSubscribedFs() -
setSubscribedFs
public void setSubscribedFs(boolean subscribed) -
assignAttributesFromIamJson
public void assignAttributesFromIamJson(com.fasterxml.jackson.databind.JsonNode jsonNode) Populate the user's account attributes from a JSON body (the IAM create/update body).- Parameters:
jsonNode- parsed request body
-
toIamUserJson
public com.fasterxml.jackson.databind.node.ObjectNode toIamUserJson()The IAM create/update response shape: { pid, first_name, last_name, email, institution_user_id, user_type }. Note saml_id is intentionally not echoed (matches the real API).- Returns:
- the IAM user JSON
-
toSearchResultJson
public com.fasterxml.jackson.databind.node.ObjectNode toSearchResultJson()The byc users/search result shape for one user. Includes id and pid, name, email, and the (empty) role/unit/title arrays the real endpoint returns; does NOT include institution_user_id or saml_id (matches the real API).- Returns:
- the search-result JSON
-
matchesSearchTerm
Does this user match the given byc search term? A blank term matches everyone (the real endpoint returns the whole roster when no term is passed); otherwise match (case-insensitive substring) against email, institution_user_id, first or last name.- Parameters:
searchTerm- the term, possibly blank/null- Returns:
- true if the user matches
-
toProvisioningEntity
Convert to a Grouper provisioning entity. The id is the pid; the account attributes become target entity attributes. Note: when built from a byc users/search result, institution_user_id / saml_id / user_type are not populated (that endpoint omits them).- Returns:
- the provisioning entity
-
fromProvisioningEntity
Build from a Grouper provisioning entity (the target entity attributes).- Parameters:
targetEntity- the provisioning entity- Returns:
- the Interfolio user
-
createTableInterfolioUser
DDL for the mock table.- Parameters:
ddlVersionBean- ddl version beandatabase- database
-
toString
-