Class SMSEntry

  • All Implemented Interfaces:
    Cloneable

    public class SMSEntry
    extends Object
    implements Cloneable
    This object represents a SMS entry in datastore, similar to UMS's equivalent class called PersistentObject.

    This class is used both to read and write information into the datastore.

    • Method Detail

      • initializeClass

        public static void initializeClass()
      • initializeProperties

        protected static void initializeProperties()
      • getAttributes

        public Map getAttributes()
        Returns the read attributes
      • getAttributeValues

        public String[] getAttributeValues​(String attrName)
        Returns the attribute values for the given attribute name. The values are returned from the cached attribute set. It is not read from the directory.
      • getAttributeValues

        public String[] getAttributeValues​(String attrName,
                                           boolean ignoreCache)
      • addAttribute

        public void addAttribute​(String attrName,
                                 String value)
                          throws SMSException
        Adds the attribute value to the given attribute name. It is stored locally and is not written to the directory.
        Throws:
        SMSException
      • setAttribute

        public void setAttribute​(String attrName,
                                 String[] attrValues)
        Set the attribute values. save() must be called to make the changes persistant
      • modifyAttributes

        public void modifyAttributes​(ModificationItem[] modItems)
        Modify the attribute values. save() must be called to make the changes persistant. This does not affect the existing attributes already read.
      • setAttributes

        public void setAttributes​(Map attributes)
        Set the attributes. save() must be called to make the changes persistant
      • removeAttribute

        public void removeAttribute​(String attrName,
                                    String value)
                             throws SMSException
        Removes the attribute value from the attribute.
        Parameters:
        attrName - Name of attribute.
        value - Value to be removed.
        Throws:
        SMSException - if value cannot be removed.
      • containsAttrValue

        public boolean containsAttrValue​(String attrName,
                                         String attrValue)
        Checks if the attribute value exists in the attribute
      • forceDelete

        public void forceDelete​(SSOToken adminToken)
                         throws SMSException,
                                SSOException
        Delete the entry in the datastore. This will delete sub-entries also! TODO: There is no way to set read-only to false, we should see what we can about this.
        Throws:
        SMSException
        SSOException
      • search

        public static Set<String> search​(SSOToken token,
                                         String dn,
                                         String filter,
                                         int numOfEntries,
                                         int timeLimit,
                                         boolean sortResults,
                                         boolean ascendingOrder)
                                  throws SMSException
        Returns the DNs that match the filter. The search is performed from the root suffix ie., DN. It searchs for SMS objects only.
        Parameters:
        token - Single-Sign On token.
        dn - Base DN
        filter - Search Filter.
        numOfEntries - number of max entries, 0 means unlimited
        timeLimit - maximum number of seconds for the search to spend, 0 means unlimited
        sortResults - true to have result sorted.
        ascendingOrder - true to have result sorted in ascending order.
        Throws:
        SMSException
      • search

        public static Iterator search​(SSOToken token,
                                      String dn,
                                      String filter,
                                      int numOfEntries,
                                      int timeLimit,
                                      boolean sortResults,
                                      boolean ascendingOrder,
                                      Set exclude)
                               throws SMSException
        Returns the DNs and its attribute values that match the filter. The search is performed from the root suffix ie., DN. It searchs for SMS objects only.
        Parameters:
        token - Single-Sign On token.
        dn - Base DN
        filter - Search Filter.
        numOfEntries - number of max entries, 0 means unlimited
        timeLimit - maximum number of seconds for the search to spend, 0 means unlimited
        sortResults - true to have result sorted.
        ascendingOrder - true to have result sorted in ascending order.
        exclude - List of DN to exclude.
        Throws:
        SMSException
      • checkIfEntryExists

        public static boolean checkIfEntryExists​(String dn,
                                                 SSOToken token)
        Checks if the provided DN exists. Used by PolicyManager.
      • isNewEntry

        public boolean isNewEntry()
        Returns true if the entry does not exist in the data store
      • getRootSuffix

        public static String getRootSuffix()
      • getAMSdkBaseDN

        public static String getAMSdkBaseDN()
      • getDataStore

        public static String getDataStore​(SSOToken token)
      • isAttributeCaseSensitive

        public static boolean isAttributeCaseSensitive​(String attrName)
        Returns:
        true if the given attribute's value is case sensitive.
      • getFilterPatternService

        public static String getFilterPatternService()
        Returns:
        the service filter pattern string
      • parseResult

        protected static Set parseResult​(Set resultSet,
                                         String dn)
      • parseResult

        protected static Set parseResult​(Set resultSet,
                                         String dn,
                                         boolean includeThisDN)