Class DashboardIdentityUtils
- java.lang.Object
-
- fr.paris.lutece.plugins.mydashboard.modules.identity.util.DashboardIdentityUtils
-
public class DashboardIdentityUtils extends Object
class to help managing identity feature
-
-
Field Summary
Fields Modifier and Type Field Description static StringDASHBOARD_APP_CODEstatic StringSESSION_ERROR_MESSAGEstatic StringSESSION_INFO_MESSAGEstatic StringSESSION_SN_NAME
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DashboardIdentityconvertToDashboardIdentity(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity)return an dashboardIdentity from a identityDtoDashboardIdentityconvertToDashboardIdentity(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.contract.ServiceContractSearchResponse contractSearchResponse)return an dashboardIdentity from a identityDtofr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDtoconvertToIdentityDto(DashboardIdentity dashboardIdentity, boolean bOnlyMandatory)return an identityDto from a DashboardIdentityvoidfilterByCertifier(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity)Drop attributes from IdentityDto if there is a certificate.List<String>getAllSuspiciousIdentityRules()Gets all rulesDashboardIdentitygetCurrentDashboardIdentityInSession(javax.servlet.http.HttpServletRequest request)fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDtogetIdentity(String strConnectionId)return identitySearchResponse from strConnectionIdstatic DashboardIdentityUtilsgetInstance()Map<String,String>getMapAttributeKeyMatch()StringgetMessageInSession(boolean bErrorMessage, boolean bRemoveAttribute, javax.servlet.http.HttpServletRequest request)Get message in the sessionStringgetNumericServiceNameInSession(javax.servlet.http.HttpServletRequest request)Get name of numeric service in the sessionfr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthorgetOwnerRequestAuthor()Gets the owner request author.StringgetRedirectUrlAfterCompletionInSession(javax.servlet.http.HttpServletRequest request)List<String>getSuspiciousIdentityNotStrictRules()Gets not strict rulesList<String>getSuspiciousIdentityStrictRules()Gets strict rulesDashboardIdentityinitMandatoryAttributeForCompletionIdentity(DashboardIdentity completionIdentity, String strOriginActionCompletion)Set mandatory attribute for completion identitystatic booleanisDashboardAttributeCertified(DashboardAttribute dashboardAttribute)return true if the attribute have a level of certification > declaratifbooleanisMandatoryAttribute(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.contract.ServiceContractSearchResponse contractSearchResponse, String identityAttributeKey)Return true if the attribute is mandatorybooleanisMandatoryCompletionCreateAndCompletionAccount(Map.Entry<String,String> attribute)Return true if the attribute is mandatory for create account completionbooleanisMandatoryCompletionModifyAccount(Map.Entry<String,String> attribute)Return true if the attribute is mandatory for modify account completionbooleanneedCertification(DashboardIdentity dashboardIdentity, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.contract.ServiceContractSearchResponse contractSearchResponse, List<String> strAttributesNeedFC, int nLevelMin)voidpopulateDashboardIdentity(DashboardIdentity identity, javax.servlet.http.HttpServletRequest request)populaite DashboardIdentity from the requestvoidsetCurrentDashboardIdentityInSession(javax.servlet.http.HttpServletRequest request, DashboardIdentity dashboardIdentity)voidsetMessageInSession(String strMessage, boolean bErrorMessage, javax.servlet.http.HttpServletRequest request)Set message in the sessionvoidsetNumericServiceNameInSession(String strServiceNumericName, javax.servlet.http.HttpServletRequest request)Set Numeric service name in sessionvoidsetRedirectUrlAfterCompletionInSession(String strPage, String strView, javax.servlet.http.HttpServletRequest request)voidupdateDashboardIdentityInSession(DashboardIdentity currentDasboardIdentity, DashboardIdentity dasboardIdentitySession)Update dashboardIdentity in the sessionvoidupdateIdentity(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity)Update Identity from an IdentityDto.
-
-
-
Field Detail
-
DASHBOARD_APP_CODE
public static final String DASHBOARD_APP_CODE
-
SESSION_ERROR_MESSAGE
public static final String SESSION_ERROR_MESSAGE
- See Also:
- Constant Field Values
-
SESSION_INFO_MESSAGE
public static final String SESSION_INFO_MESSAGE
- See Also:
- Constant Field Values
-
SESSION_SN_NAME
public static final String SESSION_SN_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static DashboardIdentityUtils getInstance()
-
convertToDashboardIdentity
public DashboardIdentity convertToDashboardIdentity(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity)
return an dashboardIdentity from a identityDto- Parameters:
identitySearchResponse- identitySearchResponse to convert- Returns:
- dashboardIdentity initialized from provided identityDto
-
convertToDashboardIdentity
public DashboardIdentity convertToDashboardIdentity(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.contract.ServiceContractSearchResponse contractSearchResponse)
return an dashboardIdentity from a identityDto- Parameters:
identity- identityDto to convertcontractSearchResponse- The App contract- Returns:
- dashboardIdentity initialized from provided identityDto
-
needCertification
public boolean needCertification(DashboardIdentity dashboardIdentity, fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.contract.ServiceContractSearchResponse contractSearchResponse, List<String> strAttributesNeedFC, int nLevelMin)
-
convertToIdentityDto
public fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto convertToIdentityDto(DashboardIdentity dashboardIdentity, boolean bOnlyMandatory)
return an identityDto from a DashboardIdentity- Parameters:
dashboardIdentity- dashboardIdentity to convertbOnlyMandatory- true the IdentitityDTO must contains only Mandatory informations- Returns:
- identityDto initialized from provided dashboardIdentity
-
isMandatoryAttribute
public boolean isMandatoryAttribute(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.contract.ServiceContractSearchResponse contractSearchResponse, String identityAttributeKey)Return true if the attribute is mandatory- Parameters:
contractSearchResponse-identityAttributeKey-- Returns:
- true if the attribute key is mandatory
-
populateDashboardIdentity
public void populateDashboardIdentity(DashboardIdentity identity, javax.servlet.http.HttpServletRequest request)
populaite DashboardIdentity from the request- Parameters:
identity- the DashboardIdentityrequest- the HttpServletRequest
-
filterByCertifier
public void filterByCertifier(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity)
Drop attributes from IdentityDto if there is a certificate. This is used to not update identity when a certificate is found.- Parameters:
identity-
-
getIdentity
public fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto getIdentity(String strConnectionId)
return identitySearchResponse from strConnectionId- Parameters:
strConnectionId- user connection id- Returns:
- IdentitySearchResponse
- Throws:
fr.paris.lutece.portal.service.security.UserNotSignedException
-
updateIdentity
public void updateIdentity(fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.IdentityDto identity) throws fr.paris.lutece.portal.service.util.AppExceptionUpdate Identity from an IdentityDto.- Parameters:
identityDto- identity Data transfer Object- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityNotFoundException- the identity not found exceptionfr.paris.lutece.portal.service.util.AppException- the app exception
-
getOwnerRequestAuthor
public fr.paris.lutece.plugins.identitystore.v3.web.rs.dto.common.RequestAuthor getOwnerRequestAuthor()
Gets the owner request author.- Returns:
- the owner request author
-
getCurrentDashboardIdentityInSession
public DashboardIdentity getCurrentDashboardIdentityInSession(javax.servlet.http.HttpServletRequest request)
- Parameters:
request-- Returns:
-
setCurrentDashboardIdentityInSession
public void setCurrentDashboardIdentityInSession(javax.servlet.http.HttpServletRequest request, DashboardIdentity dashboardIdentity)- Parameters:
request-dashboardIdentity-
-
getRedirectUrlAfterCompletionInSession
public String getRedirectUrlAfterCompletionInSession(javax.servlet.http.HttpServletRequest request)
- Parameters:
request-- Returns:
-
setRedirectUrlAfterCompletionInSession
public void setRedirectUrlAfterCompletionInSession(String strPage, String strView, javax.servlet.http.HttpServletRequest request)
- Parameters:
strRedirectXPage-request-
-
getNumericServiceNameInSession
public String getNumericServiceNameInSession(javax.servlet.http.HttpServletRequest request)
Get name of numeric service in the session- Parameters:
request-- Returns:
- the name of numeric service in the session
-
setNumericServiceNameInSession
public void setNumericServiceNameInSession(String strServiceNumericName, javax.servlet.http.HttpServletRequest request)
Set Numeric service name in session- Parameters:
strServiceNumericName-request-
-
getMessageInSession
public String getMessageInSession(boolean bErrorMessage, boolean bRemoveAttribute, javax.servlet.http.HttpServletRequest request)
Get message in the session- Parameters:
bErrorMessage- ( set true if is a error message and false if is a info message )bRemoveAttribute-request-request-- Returns:
- the message in session
-
setMessageInSession
public void setMessageInSession(String strMessage, boolean bErrorMessage, javax.servlet.http.HttpServletRequest request)
Set message in the session- Parameters:
strMessage-bErrorMessage- ( set true if is a error message and false if is a info message )request-
-
getAllSuspiciousIdentityRules
public List<String> getAllSuspiciousIdentityRules()
Gets all rules- Returns:
-
getSuspiciousIdentityStrictRules
public List<String> getSuspiciousIdentityStrictRules()
Gets strict rules- Returns:
- list of strict rules
-
getSuspiciousIdentityNotStrictRules
public List<String> getSuspiciousIdentityNotStrictRules()
Gets not strict rules- Returns:
- list of not strict rules
-
initMandatoryAttributeForCompletionIdentity
public DashboardIdentity initMandatoryAttributeForCompletionIdentity(DashboardIdentity completionIdentity, String strOriginActionCompletion)
Set mandatory attribute for completion identity
-
isMandatoryCompletionCreateAndCompletionAccount
public boolean isMandatoryCompletionCreateAndCompletionAccount(Map.Entry<String,String> attribute)
Return true if the attribute is mandatory for create account completion- Parameters:
attribute-- Returns:
- true if the attributie is mandatory
-
isMandatoryCompletionModifyAccount
public boolean isMandatoryCompletionModifyAccount(Map.Entry<String,String> attribute)
Return true if the attribute is mandatory for modify account completion- Parameters:
attribute-- Returns:
- true if the attribute is mandatory
-
updateDashboardIdentityInSession
public void updateDashboardIdentityInSession(DashboardIdentity currentDasboardIdentity, DashboardIdentity dasboardIdentitySession)
Update dashboardIdentity in the session- Parameters:
currentDasboardIdentity-currentDasboardIdentity- in session
-
isDashboardAttributeCertified
public static boolean isDashboardAttributeCertified(DashboardAttribute dashboardAttribute)
return true if the attribute have a level of certification > declaratif- Parameters:
dashboardAttribute-- Returns:
-
-