Class Application

  • All Implemented Interfaces:
    Cloneable

    public class Application
    extends Object
    implements Cloneable
    Application class contains the information on how an application behaves e.g. how to combine decision and how to compare resources; and the supported actions.
    • Constructor Detail

      • Application

        public Application()
        Public, default constructor
      • Application

        public Application​(String name,
                           ApplicationType applicationType)
        Constructs an instance.
        Parameters:
        name - Name of Application.
        applicationType - Its application type.
    • Method Detail

      • setApplicationType

        public void setApplicationType​(ApplicationType applicationType)
        Sets the application type of this Application
        Parameters:
        applicationType - The non-null application type
      • cloneAppl

        protected void cloneAppl​(Application clone)
      • getApplicationType

        public ApplicationType getApplicationType()
        Returns application type.
        Returns:
        application type.
      • getConditions

        public Set<String> getConditions()
        Returns set of supported condition class names.
        Returns:
        set of supported condition class names.
      • getSubjects

        public Set<String> getSubjects()
        Returns set of supported subject class names.
        Returns:
        set of supported subject class names.
      • getEntitlementCombinerClass

        public Class getEntitlementCombinerClass()
        Returns entitlement combiner class.
        Returns:
        entitlement combiner class.
      • getEntitlementCombiner

        public EntitlementCombiner getEntitlementCombiner()
        Returns a new instance of entitlement combiner.
        Returns:
        an instance of entitlement combiner.
      • getName

        public String getName()
        Returns application name.
        Returns:
        application name.
      • getDisplayName

        public String getDisplayName()
        Returns application display name.
        Returns:
        application display name.
      • setConditions

        public void setConditions​(Set<String> conditions)
        Sets supported condition class names.
        Parameters:
        conditions - Supported condition class names.
      • setSubjects

        public void setSubjects​(Set<String> subjects)
        Sets supported subject class names.
        Parameters:
        subjects - Supported subject class names.
      • setEntitlementCombiner

        public void setEntitlementCombiner​(Class entitlementCombiner)
        Sets entitlement combiner.
        Parameters:
        entitlementCombiner - entitlement combiner.
      • setEntitlementCombinerName

        public void setEntitlementCombinerName​(Class<? extends EntitlementCombiner> entitlementCombiner)
        Sets entitlement combiner using the EntitlementRegistry to look up the appropriate class.
        Parameters:
        entitlementCombiner - name of the entitlement combiner to look up
      • getResourceTypeUuids

        public Set<String> getResourceTypeUuids()
        Retrieves the resource type UUIDs associated with the application.
        Returns:
        The set of associated resource type UUIDs.
      • addAllResourceTypeUuids

        public void addAllResourceTypeUuids​(Set<String> resourceTypeUuids)
        Adds the passed set of resource type UUIDs to the application.
        Parameters:
        resourceTypeUuids - The set of resource type UUIDs.
      • addResourceTypeUuid

        public void addResourceTypeUuid​(String resourceTypeUuid)
        Adds the passed resource type UUID to the application.
        Parameters:
        resourceTypeUuid - The resource type UUID.
      • removeResourceTypeUuid

        public void removeResourceTypeUuid​(String resourceTypeUuid)
        Removes the passed resource type UUID from the application.
        Parameters:
        resourceTypeUuid - The resource type UUID.
      • getResourceSearchIndex

        public ResourceSearchIndexes getResourceSearchIndex​(String resource,
                                                            String realm)
                                                     throws EntitlementException
        Returns search indexes for a given resource.
        Parameters:
        resource - Resource to generate the indexes.
        realm - Current realm to be searched.
        Returns:
        Search indexes.
        Throws:
        EntitlementException - When an error occurs in the entitlements framework.
      • getResourceSaveIndex

        public ResourceSaveIndexes getResourceSaveIndex​(String resource)
        Returns save indexes for a given resource.
        Parameters:
        resource - resource to generate the indexes.
        Returns:
        save indexes.
      • getSaveIndexClass

        public Class getSaveIndexClass()
        Returns save index class.
        Returns:
        save index class.
      • getSearchIndexClass

        public Class getSearchIndexClass()
        Returns search index class.
        Returns:
        search index class.
      • getResourceComparatorClass

        public Class getResourceComparatorClass()
        Returns resource comparator class.
        Returns:
        resource comparator class.
      • getResourceComparator

        public ResourceName getResourceComparator()
        Returns resource comparator for this Application, defaulting to the ApplicationType's resource comparator if none is directly associated with this Application.
        Returns:
        resource comparator, which may be null.
      • getResourceComparator

        public ResourceName getResourceComparator​(boolean defaultToAppType)
        Returns resource comparator for this Application.
        Parameters:
        defaultToAppType - if true, will return this Application's ApplicationType resource comparator if none is set on the Application.
        Returns:
        resource comparator, which may be null.
      • setAttributeNames

        public void setAttributeNames​(Set<String> names)
        Sets attribute names.
        Parameters:
        names - Attribute names.
      • addAttributeNames

        public void addAttributeNames​(Set<String> names)
        Adds attribute names.
        Parameters:
        names - Attribute names.
      • getSaveIndex

        public ISaveIndex getSaveIndex()
        Returns save index
        Returns:
        save index
      • getSearchIndex

        public ISearchIndex getSearchIndex()
        Returns search index
        Returns:
        search index
      • getAttributeNames

        public Set<String> getAttributeNames()
        Return attribute names.
        Returns:
        attribute names.
      • getDescription

        public String getDescription()
        Returns description.
        Returns:
        description.
      • setDescription

        public void setDescription​(String description)
        Set description.
        Parameters:
        description - description.
      • getCreationDate

        public long getCreationDate()
        Returns creation date.
        Returns:
        creation date.
      • setCreationDate

        public void setCreationDate​(long creationDate)
        Sets the creation date.
        Parameters:
        creationDate - creation date.
      • getLastModifiedDate

        public long getLastModifiedDate()
        Returns last modified date.
        Returns:
        last modified date.
      • setLastModifiedDate

        public void setLastModifiedDate​(long lastModifiedDate)
        Sets the last modified date.
        Parameters:
        lastModifiedDate - last modified date.
      • getLastModifiedBy

        public String getLastModifiedBy()
        Returns the user ID who last modified the policy.
        Returns:
        user ID who last modified the policy.
      • setLastModifiedBy

        public void setLastModifiedBy​(String lastModifiedBy)
        Sets the user ID who last modified the policy.
        Parameters:
        lastModifiedBy - user ID who last modified the policy.
      • getCreatedBy

        public String getCreatedBy()
        Returns the user ID who created the policy.
        Returns:
        user ID who created the policy.
      • setCreatedBy

        public void setCreatedBy​(String createdBy)
        Sets the user ID who created the policy.
        Parameters:
        createdBy - user ID who created the policy.
      • getMetaData

        public Set<String> getMetaData()
        Returns meta information.
        Returns:
        meta information.
      • setMetaData

        public void setMetaData​(Set<String> meta)
      • setName

        public void setName​(String name)
      • setDisplayName

        public void setDisplayName​(String displayName)
        Sets the application display name.
        Parameters:
        displayName - The application display name.
      • canBeDeleted

        public boolean canBeDeleted​(String realm)
      • isEditable

        public boolean isEditable()
        An Application is editable if it can be changed by an end user. This method was put in place for subclasses that can not be edited.
        Returns:
        True if the Application can be edited.