Package com.iplanet.services.naming
Class SessionIDCorrector
- java.lang.Object
-
- com.iplanet.services.naming.SessionIDCorrector
-
public class SessionIDCorrector extends Object
In the case of reconfiguring servers in a cluster, or in the case of changing the servers in a site, a Sessions the Server ID (S1) and Site ID (SI) of the Session will potentially be out of sync. For more details about these two fields seeSessionID.parseSessionString(). SessionIDCorrector will resolve these discrepancies by adding in or removing the Site ID reference accordingly. This logic depends heavily on the assumptions about how these two fields are used. This class balances two competing requirements. The need to be accurate with the Server>Site mapping, and the need to be performant as this code will be triggered on every invocation ofSessionID.
-
-
Constructor Summary
Constructors Constructor Description SessionIDCorrector(Map<String,String> serverToSite)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SessionIDCorrectorcreate()Factory method to generate an instance of SessionIDCorrector based on the current WebtopNaming Settings.StringtoString()StringtranslatePrimaryID(String primaryID, String siteID)Performs a possible translation of the Primary ID (S1) field based on the state of OpenAM Server/Site configuration.StringtranslateSiteID(String primaryID, String siteID)Performs a possible translation of the Site ID (SI) field based on the state of OpenAM Server/Site configuration.
-
-
-
Field Detail
-
HEADER
public static final String HEADER
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public static SessionIDCorrector create()
Factory method to generate an instance of SessionIDCorrector based on the current WebtopNaming Settings. Understands the Server/SiteID interactions which WebtopNaming uses for modelling Serers and Sites. Some of this is counter-intuitive. Note: This code cannot directly listen to configuration changes because of the order in which updates to configuration are propagated throughout the system. Instead it is intended to be called by WebtopNaming (which in turn is called by NamingService).- Returns:
- Non null instance of SessionIDCorrector
-
translatePrimaryID
public String translatePrimaryID(String primaryID, String siteID)
Performs a possible translation of the Primary ID (S1) field based on the state of OpenAM Server/Site configuration.- Parameters:
primaryID- Non null, possibly empty field.siteID- Non null, possibly empty field.- Returns:
- Either the provided Primary ID if no mapping took place, or another value depending on the mapping.
-
translateSiteID
public String translateSiteID(String primaryID, String siteID)
Performs a possible translation of the Site ID (SI) field based on the state of OpenAM Server/Site configuration.- Parameters:
primaryID- Non null, possibly empty field.siteID- Non null, possibly empty field.- Returns:
- Either the provided Site ID if no mapping took place, or another value depending on the mapping.
-
-