Class DefaultAuthorityGroupContextStrategy

    • Constructor Detail

      • DefaultAuthorityGroupContextStrategy

        public DefaultAuthorityGroupContextStrategy()
    • Method Detail

      • isResettable

        public boolean isResettable()
        Description copied from interface: CockpitConfigurationContextStrategy
        Checks if value of strategy's attribute should be reset up to original value after match.

        Search algorithm after a match looks for parent contexts. There is a possibility, that some of attributes should be reset to original value before looking for parents (i.e. module).

        Specified by:
        isResettable in interface CockpitConfigurationContextStrategy
        Returns:
        true if value should be reset
      • hasParentContexts

        protected boolean hasParentContexts​(AuthorityGroup authorityGroup,
                                            java.lang.String currentUser,
                                            java.lang.String principal)
      • isStamped

        protected boolean isStamped​(java.lang.String context)
      • extractAuthorityGroup

        protected java.lang.String extractAuthorityGroup​(java.lang.String context)
      • extractUser

        protected java.lang.String extractUser​(java.lang.String context)
      • removeStamp

        protected java.lang.String removeStamp​(java.lang.String context)
      • removeStamp

        protected java.lang.String removeStamp​(java.lang.String context,
                                               java.lang.String type)
      • removeStamp

        protected java.lang.String removeStamp​(java.lang.String context,
                                               java.util.function.Predicate<java.lang.String> test)
      • getStamp

        protected java.lang.String getStamp​(java.lang.String context)
      • getStamp

        protected java.lang.String getStamp​(java.lang.String context,
                                            java.lang.String type)
      • getStamp

        protected java.lang.String getStamp​(java.lang.String context,
                                            java.util.function.Predicate<java.lang.String> test)
      • getStampedValuePattern

        protected java.util.regex.Pattern getStampedValuePattern()
      • getParentContexts

        protected java.util.List<java.lang.String> getParentContexts​(AuthorityGroup authorityGroup,
                                                                     java.lang.String currentUser,
                                                                     java.lang.String principal)
      • stampParentValue

        protected java.lang.String stampParentValue​(java.lang.String value,
                                                    java.lang.String stamp)
      • valueMatches

        public boolean valueMatches​(java.lang.String contextValue,
                                    java.lang.String value)
        Description copied from interface: CockpitConfigurationContextStrategy
        Checks if provided value matches the one defined in configuration context.
        Specified by:
        valueMatches in interface CockpitConfigurationContextStrategy
        Parameters:
        contextValue - value defined in configuration context
        value - value to be checked
        Returns:
        true if provided value matches the one defined in configuration context
      • getPrincipals

        protected java.util.List<java.lang.String> getPrincipals​(java.lang.String contextValue)
      • singleValueMatches

        protected boolean singleValueMatches​(java.lang.String contextValue,
                                             java.lang.String value)
      • setAuthorityGroupService

        public void setAuthorityGroupService​(AuthorityGroupService authorityGroupService)
      • setCockpitUserService

        public void setCockpitUserService​(CockpitUserService cockpitUserService)