Class LocalTriggerManager.ScriptDynamicGroupBean

  • All Implemented Interfaces:
    mks.frame.triggers.ScriptExposableBean
    Enclosing class:
    LocalTriggerManager

    public static class LocalTriggerManager.ScriptDynamicGroupBean
    extends LocalTriggerManager.ScriptPrincipalBean
    implements mks.frame.triggers.ScriptExposableBean
    Bean which encompasses a dynamic group. A dynamic group is a group whose membership dynamically changes as the value of the project field changes.

    Use the getDynamicGroupBean method on the imServerBean to obtain a handle to one of these beans.

    • Constructor Detail

      • ScriptDynamicGroupBean

        public ScriptDynamicGroupBean​(mks.ci.server.engine.DynamicGroup dynamicGroup,
                                      int userId,
                                      java.sql.Connection c)
        Create a new DynamicGroupBean
        Parameters:
        dynamicGroup - the dynamic group in question
        userId - the current userId
        c - the database connection
    • Method Detail

      • getUsers

        public java.lang.String[] getUsers​(java.lang.String project)
                                    throws mks.frame.triggers.TriggerException
        Returns the users in this group given the project provided
        Parameters:
        project - The project to use as a context for the dynamic group
        Returns:
        the users in this group given the project provided
        Throws:
        mks.frame.triggers.TriggerException - If the project does not exist.
      • getGroups

        public java.lang.String[] getGroups​(java.lang.String project)
                                     throws mks.frame.triggers.TriggerException
        Returns the group members in this group given the project provided
        Parameters:
        project - The project to use as a context for the dynamic group
        Returns:
        the group members in this group given the project provided
        Throws:
        mks.frame.triggers.TriggerException - If the project does not exist.
      • getExposedName

        public java.lang.String getExposedName()
        Get the name of this bean: imDynamicGroupBean
        Specified by:
        getExposedName in interface mks.frame.triggers.ScriptExposableBean
        Specified by:
        getExposedName in class ScriptBaseBean
        Returns:
        the bean name: imDynamicGroupBean.
      • isUserMemberOf

        public boolean isUserMemberOf​(java.lang.String userName,
                                      java.lang.String project)
                               throws mks.frame.triggers.TriggerException
        Verifies if a user is a member of dynamic group for the specified project.
        Parameters:
        userName - The current user name
        project - The project to use as a context for the dynamic group. Note that a null project means to use an unspecified project with project id of 0.
        Returns:
        true if the user is member of dynamic group for the project.
        Throws:
        mks.frame.triggers.TriggerException - If the project does not exist.