Class PolicyModelImpl

    • Constructor Detail

      • PolicyModelImpl

        public PolicyModelImpl​(jakarta.servlet.http.HttpServletRequest req,
                               Map map)
        Creates a simple model using default resource bundle.
        Parameters:
        req - HTTP Servlet Request
        map - of user information
    • Method Detail

      • cachePolicy

        public String cachePolicy​(String policyName,
                                  String description,
                                  boolean isReferral,
                                  boolean isActive)
                           throws AMConsoleException
        Caches a policy. Returns the cache ID of the policy object.
        Specified by:
        cachePolicy in interface PolicyModel
        Parameters:
        policyName - Name of policy.
        description - Description of policy.
        isReferral - true if policy is referral typed.
        isActive - true if policy is active.
        Returns:
        cache ID of the policy object.
        Throws:
        AMConsoleException - if policy cannot be cached.
      • cachePolicy

        public String cachePolicy​(String realmName,
                                  String policyName)
                           throws AMConsoleException
        Caches an existing policy. Returns the cache ID of the policy object.
        Specified by:
        cachePolicy in interface PolicyModel
        Parameters:
        realmName - Name of realm.
        policyName - Name of policy.
        Returns:
        cache ID of the policy object.
        Throws:
        AMConsoleException - if policy cannot be cached.
      • getPolicyNames

        public Set getPolicyNames​(String realmName,
                                  String filter)
                           throws AMConsoleException
        Returns policy names that are under a realm.
        Specified by:
        getPolicyNames in interface PolicyModel
        Parameters:
        realmName - Name of realm.
        filter - Filter string.
        Returns:
        policy names that are under a realm.
        Throws:
        AMConsoleException - if policy names cannot be returned.
      • deletePolicies

        public void deletePolicies​(String realmName,
                                   Set names)
                            throws AMConsoleException
        Deletes policies.
        Specified by:
        deletePolicies in interface PolicyModel
        Parameters:
        realmName - Name of realm that contains these policies.
        names - Set of policy names to be deleted.
        Throws:
        AMConsoleException - if policies cannot be deleted.
      • canCreateRule

        public boolean canCreateRule​(Policy policy,
                                     String realmName)
        Returns true if rule can be created in a policy.
        Specified by:
        canCreateRule in interface PolicyModel
        Parameters:
        policy - Policy object.
        realmName - Realm Name.
        Returns:
        true if rule can be created in a policy.
      • getServiceTypeNames

        public Map getServiceTypeNames()
        Returns all registered service type names. Map of service name to its localized name.
        Specified by:
        getServiceTypeNames in interface PolicyModel
        Returns:
        all registered service type names.
      • getActionSchemas

        public Set getActionSchemas​(Policy policy,
                                    String realmName,
                                    String name,
                                    boolean withResourceName)
        Returns action schemas of service type. name.
        Specified by:
        getActionSchemas in interface PolicyModel
        Parameters:
        policy - Policy object.
        realmName - Realm Name.
        name - Name of Service Type.
        withResourceName - true for action names for resource name.
        Returns:
        action schemas of service type.
      • getActionSchemaLocalizedName

        public String getActionSchemaLocalizedName​(String name,
                                                   ActionSchema actionSchema)
        Returns localized name of action schema.
        Specified by:
        getActionSchemaLocalizedName in interface PolicyModel
        Parameters:
        name - Name of Service Type.
        actionSchema - Action Schema.
        Returns:
        localized name of action schema.
      • getChoiceValues

        public com.iplanet.jato.view.html.OptionList getChoiceValues​(String name,
                                                                     ActionSchema actionSchema)
        Returns a option list of possible choices.
        Specified by:
        getChoiceValues in interface PolicyModel
        Parameters:
        name - Name of Service Type.
        actionSchema - Action Schema.
        Returns:
        a option list of possible choices.
      • requiredResourceName

        public boolean requiredResourceName​(Policy policy,
                                            String realmName,
                                            String name)
        Returns true if service type requires resource name.
        Specified by:
        requiredResourceName in interface PolicyModel
        Parameters:
        policy - Policy object.
        realmName - Realm Name.
        name - Name of Service Type.
        Returns:
        true if service type requires resource name.
      • notRequiredResourceName

        public boolean notRequiredResourceName​(Policy policy,
                                               String realmName,
                                               String name)
        Returns true if service type does not require resource name.
        Specified by:
        notRequiredResourceName in interface PolicyModel
        Parameters:
        policy - Policy object.
        realmName - Realm Name.
        name - Name of Service Type.
        Returns:
        true if service typedoes not require resource name.
      • canCreateNewResource

        public boolean canCreateNewResource​(String realmName,
                                            String svcTypeName)
        Returns true of new resource can be created under a realm of a given service type.
        Specified by:
        canCreateNewResource in interface PolicyModel
        Parameters:
        realmName - Name of Realm.
        svcTypeName - Name of Service Type.
        Returns:
        true of new resource can be created under a realm of a given service type.
      • getManagedResources

        public List getManagedResources​(String realmName,
                                        String serviceTypeName)
        Returns a list of managed resource names.
        Specified by:
        getManagedResources in interface PolicyModel
        Parameters:
        realmName - Name of realm.
        serviceTypeName - Name of service type.
        Returns:
        a list of managed resource names.
      • getActiveReferralTypes

        public Map getActiveReferralTypes​(String realmName)
        Returns a map of active referral types for a realm to its display name.
        Specified by:
        getActiveReferralTypes in interface PolicyModel
        Parameters:
        realmName - Name of Realm.
        Returns:
        a map of active referral types for a realm to its display name.
      • getReferralSyntax

        public Syntax getReferralSyntax​(String realmName,
                                        String referralType)
        Returns syntax for a referral.
        Specified by:
        getReferralSyntax in interface PolicyModel
        Parameters:
        realmName - Name of Realm.
        referralType - Name of referral type.
        Returns:
        syntax for a referral.
      • getReferralPossibleValues

        public ValidValues getReferralPossibleValues​(String realmName,
                                                     String referralType,
                                                     String filter)
        Returns a set of possible values for a referral type.
        Specified by:
        getReferralPossibleValues in interface PolicyModel
        Parameters:
        realmName - Name of Realm.
        referralType - Name of Referral Type.
        filter - wildcards for filtering the results.
        Returns:
        a set of possible values for a referral type.
      • getReferralViewBeanURL

        public String getReferralViewBeanURL​(String realmName,
                                             String referralTypeName)
        Returns properties view bean URL of a referral.
        Specified by:
        getReferralViewBeanURL in interface PolicyModel
        Parameters:
        realmName - Name of realm.
        referralTypeName - Name of Referral Type.
        Returns:
        properties view bean URL of a referral.
      • getDisplayNameForReferralValues

        public Map getDisplayNameForReferralValues​(String realmName,
                                                   String referralTypeName,
                                                   Set values)
        Returns a map of values to localized label.
        Specified by:
        getDisplayNameForReferralValues in interface PolicyModel
        Parameters:
        realmName - Name of realm.
        referralTypeName - Name of referral Type.
        values - Valid values.
        Returns:
        a map of values to localized label.
      • getActiveSubjectTypes

        public QueryResults getActiveSubjectTypes​(String realmName)
        Returns a map of active subject types for a realm to its display name.
        Specified by:
        getActiveSubjectTypes in interface PolicyModel
        Parameters:
        realmName - Name of Realm.
        Returns:
        a map of active subject types for a realm to its display name.
      • getSubjectSyntax

        public Syntax getSubjectSyntax​(String realmName,
                                       String subjectType)
        Returns syntax for a subject.
        Specified by:
        getSubjectSyntax in interface PolicyModel
        Parameters:
        realmName - Name of Realm.
        subjectType - Name of Subject type.
        Returns:
        syntax for a subject.
      • getSubjectPossibleValues

        public ValidValues getSubjectPossibleValues​(String realmName,
                                                    String subjectType,
                                                    String filter)
                                             throws AMConsoleException
        Returns a set of possible values for a subject type.
        Specified by:
        getSubjectPossibleValues in interface PolicyModel
        Parameters:
        realmName - Name of Realm.
        subjectType - Name of Subject Type.
        filter - wildcards for filtering the results.
        Returns:
        a set of possible values for a subject type.
        Throws:
        AMConsoleException - if values cannot be obtained.
      • getSubjectTypeName

        public String getSubjectTypeName​(String realmName,
                                         Subject subject)
        Returns subject type name of a subject.
        Specified by:
        getSubjectTypeName in interface PolicyModel
        Parameters:
        realmName - Name of realm.
        subject - Subject instance.
        Returns:
        subject type name of a subject.
      • getSubjectViewBeanURL

        public String getSubjectViewBeanURL​(String realmName,
                                            String subjectTypeName)
        Returns properties view bean URL of a subject.
        Specified by:
        getSubjectViewBeanURL in interface PolicyModel
        Parameters:
        realmName - Name of realm.
        subjectTypeName - Name of Subject Type.
        Returns:
        properties view bean URL of a subject.
      • getSubjectViewBeanURL

        public String getSubjectViewBeanURL​(String realmName,
                                            Subject subject)
        Returns properties view bean URL of a subject.
        Specified by:
        getSubjectViewBeanURL in interface PolicyModel
        Parameters:
        realmName - Name of realm.
        subject - Subject instance.
        Returns:
        properties view bean URL of a subject.
      • getDisplayNameForSubjectValues

        public Map getDisplayNameForSubjectValues​(String realmName,
                                                  String subjectTypeName,
                                                  Set values)
        Returns a map of values to localized label.
        Specified by:
        getDisplayNameForSubjectValues in interface PolicyModel
        Parameters:
        realmName - Name of realm.
        subjectTypeName - Name of Subject Type.
        values - Valid values.
        Returns:
        a map of values to localized label.
      • getResponseProviderXML

        public String getResponseProviderXML​(String realmName,
                                             String providerType,
                                             boolean bCreate,
                                             boolean readonly)
        Returns property sheet XML for response provider.
        Specified by:
        getResponseProviderXML in interface PolicyModel
        Parameters:
        realmName - Name of Realm.
        providerType - Name of response provider name.
        bCreate - true for create view bean.
        readonly - true if administrator can only read permission.
        Returns:
        property sheet XML for response provider.
      • getResponseProviderPropertyNames

        public List getResponseProviderPropertyNames​(String realmName,
                                                     String providerType)
        Returns property names of a response provider.
        Specified by:
        getResponseProviderPropertyNames in interface PolicyModel
        Parameters:
        realmName - Name of Realm.
        providerType - Name of response provider name.
        Returns:
        property names of a response provider.
      • getActiveResponseProviderTypes

        public Map getActiveResponseProviderTypes​(String realmName)
        Returns a map of active response provider types for a realm to its display name.
        Specified by:
        getActiveResponseProviderTypes in interface PolicyModel
        Parameters:
        realmName - Name of Realm.
        Returns:
        a map of active response provider types for a realm to its display name.
      • getResponseProviderTypeName

        public String getResponseProviderTypeName​(String realmName,
                                                  ResponseProvider provider)
        Returns response provider type name of a response provider.
        Specified by:
        getResponseProviderTypeName in interface PolicyModel
        Parameters:
        realmName - Name of realm.
        provider - response provider instance.
        Returns:
        response provider type name of a response provider.
      • getResponseProviderViewBeanURL

        public String getResponseProviderViewBeanURL​(String realmName,
                                                     ResponseProvider provider)
        Returns properties view bean URL of a response provider.
        Specified by:
        getResponseProviderViewBeanURL in interface PolicyModel
        Parameters:
        realmName - Name of realm.
        provider - response provider Object.
        Returns:
        properties view bean URL of a response provider.
      • getResponseProviderViewBeanURL

        public String getResponseProviderViewBeanURL​(String realmName,
                                                     String typeName)
        Returns properties view bean URL of a response provider.
        Specified by:
        getResponseProviderViewBeanURL in interface PolicyModel
        Parameters:
        realmName - Name of realm.
        typeName - Name of response provider Type.
        Returns:
        properties view bean URL of a response provider.
      • getActiveConditionTypes

        public Map getActiveConditionTypes​(String realmName)
        Returns a map of active condition types for a realm to its display name.
        Specified by:
        getActiveConditionTypes in interface PolicyModel
        Parameters:
        realmName - Name of Realm.
        Returns:
        a map of active condition types for a realm to its display name.
      • getConditionViewBeanURL

        public String getConditionViewBeanURL​(String realmName,
                                              Condition condition)
        Returns properties view bean URL of a condition.
        Specified by:
        getConditionViewBeanURL in interface PolicyModel
        Parameters:
        realmName - Name of realm.
        condition - Condition Object.
        Returns:
        properties view bean URL of a condition.
      • getConditionViewBeanURL

        public String getConditionViewBeanURL​(String realmName,
                                              String conditionTypeName)
        Returns properties view bean URL of a condition.
        Specified by:
        getConditionViewBeanURL in interface PolicyModel
        Parameters:
        realmName - Name of realm.
        conditionTypeName - Name of Condition Type.
        Returns:
        properties view bean URL of a condition.
      • getConditionXML

        public String getConditionXML​(String realmName,
                                      String conditionType,
                                      boolean readonly)
        Returns property sheet XML for condition.
        Specified by:
        getConditionXML in interface PolicyModel
        Parameters:
        realmName - Name of Realm.
        conditionType - Name of condition name.
        readonly - true if the administrator has only read only permission.
        Returns:
        property sheet XML for condition.
      • getConditionPropertyNames

        public List getConditionPropertyNames​(String realmName,
                                              String conditionType)
        Returns property names of a condition.
        Specified by:
        getConditionPropertyNames in interface PolicyModel
        Parameters:
        realmName - Name of Realm.
        conditionType - Name of condition name.
        Returns:
        property names of a condition.
      • getConditionTypeName

        public String getConditionTypeName​(String realmName,
                                           Condition condition)
        Returns condition type name of a condition.
        Specified by:
        getConditionTypeName in interface PolicyModel
        Parameters:
        realmName - Name of realm.
        condition - Condition instance.
        Returns:
        Condition type name of a condition.
      • canCreatePolicy

        public String canCreatePolicy​(String realmName)
        Returns a descriptive message if policy cannot be created under a realm.
        Specified by:
        canCreatePolicy in interface PolicyModel
        Parameters:
        realmName - Name of Realm.
        Returns:
        a descriptive message if policy cannot be created under a realm.
      • isPolicyActive

        public boolean isPolicyActive​(String realmName,
                                      String policyName)
                               throws AMConsoleException
        Description copied from interface: PolicyModel
        Returns true if the policy is active, false otherwise.
        Specified by:
        isPolicyActive in interface PolicyModel
        Parameters:
        realmName - Realm name.
        policyName - Policy name.
        Returns:
        true if the policy is active, false otherwise.
        Throws:
        AMConsoleException
      • getAuthInstances

        public Set getAuthInstances​(String realmName)
        Returns authentication instances configured for the realm.
        Specified by:
        getAuthInstances in interface PolicyModel
        Parameters:
        realmName - Name of realm.
        Returns:
        authentication instances configured for the realm.
      • getAuthenticationLevel

        public String getAuthenticationLevel​(String realmName,
                                             String name)
        Returns authentication level of an authentication instance.
        Specified by:
        getAuthenticationLevel in interface PolicyModel
        Parameters:
        realmName - Name of realm.
        name - Authentication Instance name.
        Returns:
        authentication level of an authentication instance.