psdi.common.role

Class MaxRole

  • All Implemented Interfaces:
    java.rmi.Remote, MaxRoleRemote, MboConstants, MboRemote, MaxRemoteProxy


    public class MaxRole
    extends Mbo
    implements MaxRoleRemote
    A role stands in for a person or people or just email addresses. Resolving a role returns a MboSet of Person which may contain one or many records. Some roles can only be resolved to email addresses. All roles that resolve to Person records can also resolve to email addresses of those people. There are a number of ways to set how the role will be resolved. The type of the role determines role resolution.

    This is a system level object.

    The key attribute for this object is MaxRole .

    The attributes in this object are as follows:

    Attribute Name Description
    Type Type of the role. Valid types are PERSON, PERSONGROUP, CUSTOM, DATASET, USERDATA, EMAILADDRESS. These values are defined in the domain RoleType.
    Value Role definition.
    When Type is PERSON, value is a Person Identifier. The role resolves to a single person.
    When Type is PERSONGROUP, value is PersonGroup Identifier. The role is resolved using the person group and the IsBroadcast flag.
    When Type is CUSTOM, value is the name of a custom role class which implements the CustomRoleInterface. The return of this class is treated as if PersonID or PersonGroup was set, depending on the type of Mbo returned.
    When Type is DATASET, value consists of a dot-notation relationship (optional) and an attribute name of the current object which is used to generates a list of Person ids or email addresses.
    When Type is USERDATA, value consists of a dot-notatjion relationship (optional) and an attribute name of the login user which generates a list of Person Ids or email addresses.
    When Type is EMAILADDRESS, value consists an email address.
    Description Role description.
    IsBroadcast When set, all primary members of a person group are included in the role resolution, otherwise only the current responsible person is included.
    IsEmailDataSet When set, this value says the value represent email addresses, not PersonIDs. Also when set, the role is only resolveable to email addresses.
    ObjectName Name of the object this role works with. If null, this role is available for use with all objects. This attribute is required for DataSet roles.
    Parameter Used to pass additional information to the object created when a role with a classname is evaluated.
    MaxRole Unique identifier of this role.

    • Constructor Detail

      • MaxRole

        public MaxRole(MboSet ms)
                throws MXException,
                       java.rmi.RemoteException
        Construct the MaxRole object
        Throws:
        MXException
        java.rmi.RemoteException
    • Method Detail

      • setFieldFlags

        public void setFieldFlags()
                           throws MXException,
                                  java.rmi.RemoteException
        Depending on the type of the role, some fields are read only.
        Parameters:
        type - Role type of this MaxRole.
        Throws:
        MXException
        java.rmi.RemoteException
      • getGroupPeople

        public PersonSetRemote getGroupPeople(PersonGroupRemote group,
                                              MboRemote mbo)
                                       throws java.rmi.RemoteException,
                                              MXException
        Return the set of Person based upon the group and the IsBroadcast flag.
        Parameters:
        group - The group to work from.
        mbo - The mbo on whose behalf we are resolving this PersonGroup.
        Returns:
        The PersonSet.
        Throws:
        java.rmi.RemoteException
        MXException
      • getPerson

        public PersonSetRemote getPerson(java.lang.String pid)
                                  throws java.rmi.RemoteException,
                                         MXException
        Fetches the Person Mbo for a PersonID.
        Parameters:
        pid - The PersonID.
        Returns:
        The MboSet containing just the PersonID.
        Throws:
        java.rmi.RemoteException
        MXException
      • personEmail

        public java.lang.String personEmail(MboRemote person)
                                     throws java.rmi.RemoteException,
                                            MXException
        Gives the email address for a person.
        Returns:
        The person's Email Address or "" if the person doesn't have an email address.
        Throws:
        java.rmi.RemoteException
        MXException
      • resolveToEmail

        public java.lang.String[] resolveToEmail(MboRemote mbo)
                                          throws MXException,
                                                 java.rmi.RemoteException
        Returns an array of email addresses which correspond to the role.
        Specified by:
        resolveToEmail in interface MaxRoleRemote
        Parameters:
        mbo - The mbo on whose behalf we are resolving the role for. Used as a starting point for DataSet.
        Returns:
        The array of email addresses
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        (MboRemote)
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        Description copied from class: Mbo
        Can the object be deleted ? This is object specific and should be overridden.
        Overrides:
        canDelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • init

        public void init()
                  throws MXException
        Description copied from class: Mbo
        Called by the framework when the Mbo has been constructed and the MboValues have been initialized. This can be overridden by the programmer to provide any custom initialization they would like to do.
        Overrides:
        init in class Mbo
        Throws:
        MXException
      • skipCopyField

        protected boolean skipCopyField(MboValueInfo mvi)
                                 throws java.rmi.RemoteException,
                                        MXException
        Overrides the skipCopyField() in the Mbo. While this MaxRole MBO is being copied, this method checks if each attribute needs to be copied by using the data from the static HashSet skipFieldCopy. This method also checks whether certain attributes whose "to copy or not to copy" status is instance-specific and cannot be added to the static HashSet should be copied for this object.
        Overrides:
        skipCopyField in class Mbo
        Parameters:
        MboValueInfo - object of the MboValue that needs to be copied.
        Returns:
        true if the field does not need to be copied. Otherwise, false is returned.
        Throws:
        java.rmi.RemoteException
        MXException
      • isAttribute

        public boolean isAttribute(java.lang.String value)
                            throws java.rmi.RemoteException
        Specified by:
        isAttribute in interface MaxRoleRemote
        Throws:
        java.rmi.RemoteException
        See Also:
        (String)