Java Doc for SSOAdapterFactory.java in  » Portal » Open-Portal » com » sun » ssoadapter » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » Open Portal » com.sun.ssoadapter 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.ssoadapter.SSOAdapterFactory

SSOAdapterFactory
public class SSOAdapterFactory implements SSOAdapterConstants(Code)
This is a simplified framework for creating Connections to different Backend It has Java APIs to store/retrieve connetion related configurations and create Connections to different backend. This class is a Java interface to create and cache instances of SSOAdapter/Connection objects. These APIs depends on AM Session and Service. This requires the AM SDK APIs to be available with in the webapp.

An SSOAdapterFactory is associated with the following:

  • An AM service: SSOAdapterConstant.SERVICE_NAME . This AM service has
  • ATTR_TEMPLATES_NAME as a Global Attribute: known as SSOAdapterTemplate
  • ATTR_CONFIGURATIONS_NAME as a dynamic Attribue: known as SSOAdapterConfiguration
  • ATTR_CONFIGURATIONS_NAME as a User Attribute


 These attributes in the above service stores the configuration information, which are stored as multiple URLs.
 An Example of sunConfigurationTemplates as a Global Attribute
 
 default|undef:///?configName=GENERIC_TEMPLATE&encoded=password&default=protocol&....
 default|imap:///?configName=SUN-ONE-MAIL&encoded=password&default=protocol&....
 default|http:///?configName=SUN-ONE-CALENDAR&encoded=password&default=protocol&.....
 .....
 An Example of SSOAdapterConfiguration as a Dynamic Attribute.
 
 default|imap:///?configName=sunOneMail&configDesc=SUN-ONE-MAIL&port=143&smtpPort=25
 default|http:///?configName=sunOneCalendar&configDesc=SUN-ONE-CALENDAR
 ......
 An Example of SSOAdapterConfiguration as the User attribue.
 sunSSOAdapterConfigurations: default|undef://b:AQIC%3D@plato.red.iplanet.com:143/?configName=sunOneMail_Mail&configDesc=SUN-ONE-MAIL....
 sunSSOAdapterConfigurations: default|undef://b:AQIC%3D@plato.red.iplanet.com:82/?configName=sunOneCalendar_Calendar&configDesc=SUN-ONE-CALENDAR....
 

The SSOAdapterFactory has the mechanisms to obtain an instance of SSOAdapter when provided with a ConfigName and SSOAdapterSession. PreRequiste:
  • Write your own Java Class which extends SSOAdapter and implements all the required methods
  • Create a SSOAdapterTemplate, Either by AdminConsole or Using amadmin/psadmin Commands and provide the above derived java className as "ssoClassName"
  • Create a SSOAdapterConfiguration, Either by AdminConsole or using amadmin/psadmin Command
  • The AM SDK's jar files are available inside webapp. (as it is placed in the webContainer classpath)
  • This ssoadapter.jar is also available inside the webapp (as it is placed in the webContainer classpath)

Usage: It can be used Inside a Portlet/Provider 
 /To Get
 HttpServletRequest  httpReq = (HttpServletRequest)request.getAttribute("javax.portlet.portletc.httpServletRequest");
 SSOAdapterSession = new SSOAdapterSession(httpReq);
 SSOAdapterFactory factory = SSOAdapterFactory.getInstance();
 PortletPreferences pref = request.getPreferences();
 String  ssoAdapterName = pref.getValue("ssoAdapter","sunOneMail");
 SSOAdapter ssoAdapter = factory.getSSOAdapter(ssoAdapterName , session );
 Properties props = ssoAdapter.getProperties();
 Object obj = newSSOAdapter.getConnection();
 if ( object != null  ) {
 //Cast it to your known type and invoke the APIs on it.
 }
 //To Edit & Save
 props.setProperty("channelName", "MyPersonalMailChannel");
 SSOAdapter newSSOAdapter = factory.setSSOAdapter(ssoAdapter, props , session );
 


version:
   1.0
See Also:   com.sun.ssoadapter.SSOAdapter
See Also:   com.sun.ssoadapter.SSOAdapterException
See Also:   com.sun.ssoadapter.SSOAdapterConstants


Field Summary
final public static  StringATTR_CONFIGURATIONS_NAME
    
final public static  StringATTR_TEMPLATES_NAME
    
final public static  StringGENERIC_SSOADAPTER_CLASS
    
final public static  StringSERVICE_NAME
    
protected static  SSOAdapterFactoryssoAdapterInstance
    


Method Summary
public  EnumerationgetConfigurationNames(SSOAdapterSession session)
    
public static  SSOAdapterFactorygetInstance()
     Returns an instance of SSOAdapterFactory.
public  SSOAdaptergetSSOAdapter(String configName, SSOAdapterSession session)
     Returns an SSOAdapter object of the appropriate configuration and of the specified instanceName.

If "configName" is not specified, then the first configuration found will be used.

The "instanceName" parameter provides a means of selectively sharing (or not), a particular instance of an SSOAdapter amongst cooperating sections of code.

public  voidremoveConfiguration(String userConfigName, SSOAdapterSession session)
    
public  SSOAdaptersetSSOAdapter(SSOAdapter immutableAdapter, Properties newProperties, SSOAdapterSession session)
     This method either generates a new SSOAdapter if one does not exist or updates the existing SSOAdapter.

Field Detail
ATTR_CONFIGURATIONS_NAME
final public static String ATTR_CONFIGURATIONS_NAME(Code)
SSO Adapter Attribute for Configurations



ATTR_TEMPLATES_NAME
final public static String ATTR_TEMPLATES_NAME(Code)
SSO Adapter Attribute for Templates



GENERIC_SSOADAPTER_CLASS
final public static String GENERIC_SSOADAPTER_CLASS(Code)
Generic SSOAdapter implementation class



SERVICE_NAME
final public static String SERVICE_NAME(Code)
SSO Adapter Service Name



ssoAdapterInstance
protected static SSOAdapterFactory ssoAdapterInstance(Code)
Reference to SSOAdapterFactory instance





Method Detail
getConfigurationNames
public Enumeration getConfigurationNames(SSOAdapterSession session)(Code)
Gets all the Configurations defined for the session
Parameters:
  session - a SSOAdapterSession an enumeration of all the configs



getInstance
public static SSOAdapterFactory getInstance()(Code)
Returns an instance of SSOAdapterFactory. SSOAdapterFactory instance



getSSOAdapter
public SSOAdapter getSSOAdapter(String configName, SSOAdapterSession session) throws SSOAdapterException(Code)
Returns an SSOAdapter object of the appropriate configuration and of the specified instanceName.

If "configName" is not specified, then the first configuration found will be used.

The "instanceName" parameter provides a means of selectively sharing (or not), a particular instance of an SSOAdapter amongst cooperating sections of code. If two sections of code specify the same instanceName, then they will receive the same SSOAdapter instance. If they each specify different names, each will receive an instance of an SSOAdapter unique to that instanceName.

Once an SSOAdapter is instantiated, it is stored in a cache within this SSOAdapterFactory. All future invocations of this method requesting an SSOAdapter of this particular configuration will be retrieved from the cache. The SSOAdapter will be "uninitialized" and removed from the cache when the user's session is terminated. ssoAdapter: an instance of SSOAdapter
Parameters:
  session - a SSOAdapterSession
Parameters:
  configName - The name of the configuration to which an SSOAdaptershould be bound.
throws:
  com.sun.ssoadapter.SSOAdapterException - incase of failure




removeConfiguration
public void removeConfiguration(String userConfigName, SSOAdapterSession session) throws SSOAdapterException(Code)
remove the configuration for the user
Parameters:
  userConfigName - an userConfiguration
Parameters:
  session - a SSOAdapterSession
throws:
  com.sun.ssoadapter.SSOAdapterException - an Exception incaseof failure



setSSOAdapter
public SSOAdapter setSSOAdapter(SSOAdapter immutableAdapter, Properties newProperties, SSOAdapterSession session) throws SSOAdapterException(Code)
This method either generates a new SSOAdapter if one does not exist or updates the existing SSOAdapter. The SSOAdapter is referenced by the Channel/Provider's 'ssoAdapter' display profile property which is used to match the Service Configurations 'configName' an instance of SSOAdapter
Parameters:
  session - a SSOAdapterSession
Parameters:
  immutableAdapter - The immutable SSOAdapter object to update
Parameters:
  newProperties - SSOAdapter Properties to update
throws:
  com.sun.ssoadapter.SSOAdapterException - incase of failure



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.