|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectibi.broker.api.cci.SecurityTokenCredential
public final class SecurityTokenCredential
This class is used to pass the security token (the RC_Cookie or MRE_Cookie) information to the CasterConnectionFactory.getConnection() method. Currently these are the only two tokens supported. The following code was taken from the samples provided with the API, and offers an example of using SecurityTokenCredential. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Copyright (c) 2004 Information Builders, Inc. All Rights Reserved. + + + + Information Builders offers sample API programs as a heuristic device. + + They are not intended, as is, for production use. Licensed users are + + welcome to alter and extend these samples and deploy them in other + + environments, or alternate configurations, as they see fit. + + Information Builders will support the documented functionality of + + its API classes and methods. However, Information Builders is not + + responsible for functionality or behavior of products built with + + its API unless the documented behavior of its discrete classes and + + methods is different than the actual results. + + + + Redistributions of IBI source code and documentation must be within + + the scope of the Information Builders Software License Agreement. + + + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ <%@ page import="ibi.broker.api.*"%> <%@ page import="ibi.broker.api.cci.*"%> <%@ page import="javax.resource.cci.*"%> <% CasterConnection casterConnection = null; try { // for cookies { Cookie[] cookieList = request.getCookies(); String securityToken = null; for(int i = 0; i < cookieList.length; i++) { if(cookieList[i].getName().equals("RC_COOKIE")) { securityToken = cookieList[i].getValue(); break; } } CasterManagedConnectionFactory managedConnectionFactory = new CasterManagedConnectionFactory(); String host = pageContext.getServletContext().getInitParameter("AGENT_NODE"); String port = pageContext.getServletContext().getInitParameter("AGENT_PORT"); managedConnectionFactory.setServerName(host); managedConnectionFactory.setPortNumber(port); CasterConnectionFactory connectionFactory = (CasterConnectionFactory)managedConnectionFactory.createConnectionFactory(); ConnectionSpec credential = new SecurityTokenCredential(securityToken); casterConnection = ((CasterConnection)connectionFactory.getConnection(credential)); } //for session { casterConnection = (CasterConnection)request.getSession().getAttribute("CASTER_CONNECTION"); } out.println("NextPage OK"); ///////Continue } catch(Exception e) { try{ out.println(e.getMessage()); }catch(Exception ex){} } %>
Constructor Summary | |
---|---|
SecurityTokenCredential()
Constructor of SecurityTokenCredential. |
|
SecurityTokenCredential(java.lang.String securityToken)
Constructor of SecurityTokenCredential. |
Method Summary | |
---|---|
java.lang.String |
getSecurityToken()
Return This security token string of the specified cookie type. |
java.lang.String |
getUserName()
Return This security token's user name. |
void |
setSecurityToken(java.lang.String securityToken)
Set a security token string in the format accepted by the token type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SecurityTokenCredential()
public SecurityTokenCredential(java.lang.String securityToken)
securityToken
- StringMethod Detail |
---|
public java.lang.String getSecurityToken()
public void setSecurityToken(java.lang.String securityToken)
securityToken
- A String in the format expected by the Security Token.public java.lang.String getUserName()
getUserName
in interface Credential
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |