11package io .cos .cas .osf .model ;
22
33import io .cos .cas .osf .authentication .support .DelegationProtocol ;
4+ import io .cos .cas .osf .authentication .support .SsoAvailability ;
45
56import lombok .Getter ;
67import lombok .NoArgsConstructor ;
1415import java .util .Date ;
1516
1617/**
17- * This is {@link OsfInstitution}.
18+ * This is {@link OsfInstitution}. It maps to a subset of columns in the OSF DB table {@code osf_instittuion}.
19+ * This subset is required to support institution SSO for CAS and OSF.
1820 *
1921 * @author Longze Chen
2022 * @since 21.0.0
@@ -40,27 +42,47 @@ public class OsfInstitution extends AbstractOsfModel {
4042 @ Column (name = "logout_url" )
4143 private String logoutUrl ;
4244
45+ /**
46+ * Maps to column {@code delegation_protocol} of table {@code osf_instittuion} in OSF database.
47+ */
4348 @ Column (name = "delegation_protocol" )
4449 private String delegationProtocol ;
4550
51+ /**
52+ * Maps to column {@code sso_availability} of table {@code osf_instittuion} in OSF database.
53+ */
54+ @ Column (name = "sso_availability" )
55+ private String ssoAvailability ;
56+
4657 @ Column (name = "is_deleted" )
4758 private Boolean deleted ;
4859
49- @ Column (name = "sso_in_progress" )
50- private Boolean ssoInProgress ;
51-
5260 @ Temporal (TemporalType .TIMESTAMP )
5361 @ Column (name = "deactivated" )
5462 private Date dateDeactivated ;
5563
5664 @ Column (name = "support_email" , nullable = false )
5765 private String supportEmail ;
5866
67+ /**
68+ * @return the institution's delegation protocol.
69+ */
5970 public DelegationProtocol getDelegationProtocol () {
6071 try {
6172 return DelegationProtocol .getType (delegationProtocol );
6273 } catch (final IllegalArgumentException e ) {
6374 return null ;
6475 }
6576 }
77+
78+ /**
79+ * @return the institution's SSO Availability.
80+ */
81+ public SsoAvailability getSsoAvailability () {
82+ try {
83+ return SsoAvailability .getType (ssoAvailability );
84+ } catch (final IllegalArgumentException e ) {
85+ return null ;
86+ }
87+ }
6688}
0 commit comments