Class DefaultClientTypesManager

    • Constructor Detail

      • DefaultClientTypesManager

        public DefaultClientTypesManager()
    • Method Detail

      • initManager

        public void initManager()
        Do stuff that needs to get the Manager working.
        Specified by:
        initManager in interface ClientTypesManager
      • loadMaps

        protected void loadMaps()
        Refactor method Load the userAgentMap. The userAgentMap is used by the client detector to query clientType.
      • addToClientMap

        protected Client addToClientMap​(String ct,
                                        Map cMap)
        Add to the userAgentMap, clientTypeMap & ProfilesMap.
        Returns:
        the created Client Object
      • addToClientMap

        protected Client addToClientMap​(String ct,
                                        Map cMap,
                                        boolean addToStyles)
        Parameters:
        addToStyles - Indicates if the Client should be added to the Styles Map. Will be false when a Client is added from CC/PP module, whose added clients shouldn't be visible in the admin console.
      • removeFromClientMap

        protected void removeFromClientMap​(String ct,
                                           Client c)
        complements addToClientMap()
      • storeInProfilesMap

        protected void storeInProfilesMap​(Client client)
        Adds the client to its appropriate baseProfileMap & styleMap. Ex: Nokia7110, with Nokia style & WML for its baseProfile, will go into wmlProfilesMap under Nokia styles. (Used only for displaying Styles & Clients under Base in the console plug-in). Currently Aligo only supports 1 level of Style. Only the baseProfiles immediate children are eligible to be Styles.
      • removeFromProfilesMap

        protected void removeFromProfilesMap​(String ct,
                                             Client c)
        complements storeInProfilesMap
      • getStylesProfileMap

        protected Map getStylesProfileMap​(String ct,
                                          Set p)
        Get the Style Map corresponding to the parentSet p.
      • addToIndexes

        protected Client addToIndexes​(String ct,
                                      Map cMap)
        Create Client Object & add to all our indexes. Called only by addClient & on clientChanged notification.
      • addToIndexes

        protected Client addToIndexes​(String ct,
                                      Map cMap,
                                      boolean addtoStyles)
        Parameters:
        addtoStyles - true only if the data is stored in ldap false for uaprof clients which only stay in memory.
      • getFromUserAgentMap

        public Client getFromUserAgentMap​(String ua)
      • userAgentSet

        public Set userAgentSet()
      • getPartiallyMatchedClient

        public String getPartiallyMatchedClient​(String ua)
        Get a previously "partially" matched userAgent String
        Returns:
        the clientType string matched previously for this ua.
      • addToPartialMatchMap

        public void addToPartialMatchMap​(String ua,
                                         String clientType)
        Add client to our partialMatchMap.
      • canCreateClients

        public boolean canCreateClients()
        Check if we can create clients and add them to internal DB.
      • getClientInstance

        public Client getClientInstance​(String clientType)
        Get the clientType from clientTypeMap.
        Specified by:
        getClientInstance in interface ClientTypesManager
        Parameters:
        clientType - requested client type.
        Returns:
        The requested Client object
      • getClientInstance

        public Client getClientInstance​(String clientType,
                                        SSOToken token)
        Description copied from interface: ClientTypesManager
        Gets client object for specified client type with specified token
        Specified by:
        getClientInstance in interface ClientTypesManager
        Parameters:
        clientType - requested client type
        token - SSO Token
        Returns:
        The requested Client object
      • getClientTypeData

        public Map getClientTypeData​(String clientType)
        Description copied from interface: ClientTypesManager
        Returns properties of the requested client type
        Specified by:
        getClientTypeData in interface ClientTypesManager
        Parameters:
        clientType - requested client type
        Returns:
        All properties of the request client type as Map
      • loadClient

        protected Client loadClient​(String clientType)
        1. Load internal client data and set parent data 2. Load External client data and merge with internal client data 3. Load merged client data to mergedClientData set 4. Construct Client object and add to loadedClientsMap
      • loadInternalClient

        protected Map loadInternalClient​(String clientType)
        Load client properties recursively from internal DB
        Returns:
        Map iMap
      • loadExternalClient

        protected Map loadExternalClient​(String clientType)
        Load client properties recursively from external DB
        Returns:
        Map eMap
      • setDirty

        public void setDirty​(String ct,
                             Map data)
        Description copied from interface: ClientTypesManager
        Updates client data. Need to call store() after this method.
        Specified by:
        setDirty in interface ClientTypesManager
        Parameters:
        ct - client type
        data - client data. Key is the property name and value is the property value as String.
      • clientChanged

        public void clientChanged​(String clientType,
                                  int dbType,
                                  int opType)
        AMClientDataListener method for client change notification
        Specified by:
        clientChanged in interface AMClientDataListener
        Parameters:
        clientType -
        dbType -
        opType -
      • getBaseProfileNames

        public Set getBaseProfileNames()
        Returns:
        a Set of baseProfileNames. sorted in ascending order.
      • getStyles

        public Set getStyles​(String baseProfileName)
        Parameters:
        baseProfileName - A valid base profile name
        Returns:
        A Set of all styles belonging to baseProfile
      • getClients

        public Map getClients​(String baseProfileName,
                              String style)
        Parameters:
        baseProfileName - A valid base profile name
        style - A valid style name
        Returns:
        A Map of all clientTypes belonging to baseProfile & style
      • addClientExternal

        public int addClientExternal​(SSOToken token,
                                     Map props)
                              throws AMClientCapException
        Wrapper methods for add/modify/remove APIs in AMClientCapData. We have it here, so we dont have to wait for an event notification to arrive when this is called by the plugin.
        Throws:
        AMClientCapException
      • removeFromMaps

        protected void removeFromMaps​(String clientType)
        Remove all references to this client
        Parameters:
        clientType - The removable clientType
      • setParentStyles

        protected void setParentStyles​(Map clientData)
        Sets the styles and parent ids tree set for a client
        Parameters:
        clientData -