|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectibi.broker.api.cci.CasterConnection
public class CasterConnection
The ReportCaster API makes use of the Java Connection Architecture (JCA) to integrate client application components with the ReportCaster Repository and Distribution Server. An integral part of the J2EE, JCA uses EIS-specific resource adapters that facilitate connectivity between the application client, the application server, and the ReportCaster Repository/Distribution Server.The system constructs a standardized connection contract, transaction contract, and security contract to connect the application servers to EIS (Enterprise Information Systems).
The connection contract uses the Connection Manager to manage the pool of connections made available within the J2EE application server environment. The transaction contract and security contract use the Transaction Manager and Security Manager, respectively, to manage their elements. Many of the classes and interfaces involved in this part of the EIS access protocol are transparent to the J2EE application server and are stored under the javax.resource.spi package.
The application contract is encapsulated by the CCI (Common Client Interface) and connects application clients to the underlying EIS. The interfaces that ReportCaster overrides and extends in this process are found in javax.resources.cci. ReportCaster implements most of these interfaces within the ibi.broker.api.cci package.
Arbitrary application clients (which could be one of the various kinds of EJB components, such as a session Bean or a message driven Bean, JSP, servlet, applet, or Java application) seeking authenticated access to data within the ReportCaster Repository can use ReportCaster's implementation of the CCI to accomplish this task.
There are two basic modes through which an application client can access or connect to the ReportCaster Distribution Server and Repository:
To access the repository in either scenario, the client component must possess the
application-level handle to the connection object, which is represented by the
CasterConnection
class. The CasterConnection
instance does not
represent the actual physical connection to the repository (that is, the
ManagedConnection
object) but is the handle to the underlying instance used
by the client application component uses to access the ReportCaster Repository and
Distribution Server.
There are two distinct differences between the connection modalities of the non-managed case
verses the managed case. In the non-managed case, the connection object is obtained directly
from the CasterConnectionFactory
, without any connection pooling taking place
on the application server level. In the managed case, you may have multiple clients interacting
with multiple EISs. Connection pooling is required to manage connection objects. The client
calls to the CasterConnectionFactory
are routed, using the resource adapter, to the Connection
Manager to obtain the CasterConnection
object.
CasterConnectionFactory
delegates the request for a connection to
the resource adapter's default ConnectionManager
instance.
CasterManagedConnectionFactory
to create a new physical connection
to the repository, which is represented by a ManagedConnection
object.
This is accomplished using the createManagedConnection
.
ManagedConnection
instance, the CasterManagedConnectionFactory
uses the security information obtained from the Subject object, any ConnectionRequestInfo,
and its configured set of properties, such as server name and port number.
ManagedConnection.getConnection()
to get the application-level connection handle (CasterConnection object). Calling the getConnection
method does not necessarily create a new physical connection to the repository. The call produces a
temporary handle that is used by the application client to access the underlying physical connection,
which itself is represented by a ManagedConnection instance.
CasterConnection.close()
.
CasterConnectionFactory
returns the connection to the
application client component that initiated the connection request.
The following sample code is taken from the samples packaged with the product. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 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. + + + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ package ibi.broker.api.samples; import ibi.broker.api.CasterManagedConnectionFactory; import ibi.broker.api.cci.CasterConnection; import ibi.broker.api.cci.CasterConnectionFactory; import ibi.broker.api.cci.PasswordCredential; import java.util.ResourceBundle; import javax.resource.cci.ConnectionSpec; public class Util { public static CasterConnection createCasterConnection() throws Exception { ResourceBundle bundle = null; String host = "localhost"; String port = "8200"; String user = "admin"; String password = ""; try { bundle = ResourceBundle.getBundle("ibi.broker.api.samples.samples"); host = bundle.getString("host"); port = bundle.getString("port"); user = bundle.getString("user"); password = bundle.getString("password"); } catch(Exception ex){} CasterManagedConnectionFactory managedConnectionFactory = new CasterManagedConnectionFactory(); managedConnectionFactory.setServerName(host); managedConnectionFactory.setPortNumber(port); CasterConnectionFactory connectionFactory = (CasterConnectionFactory)managedConnectionFactory.createConnectionFactory(); ConnectionSpec credential = new PasswordCredential(user, password.toCharArray()); return ((CasterConnection)connectionFactory.getConnection(credential)); } }
Constructor Summary | |
---|---|
CasterConnection(javax.resource.spi.ManagedConnection mc,
javax.resource.spi.ConnectionRequestInfo connInfo)
Constructor for CasterConnection. |
Method Summary | |
---|---|
void |
close()
Closes this connection to the EIS (for example, ReportCaster Repository). |
javax.resource.cci.Interaction |
createInteraction()
This method is currently not available for use within the API. |
AddressBookManager |
getAddressBookManager()
Obtains an instance of ibi.broker.api.cci.AddressBookManager
that is to be used in conjunction with this connection instance. |
ibi.broker.api.cci.AnnotationManager |
getAnnotationManager()
|
ibi.broker.api.data.preference.application.ApplicationPreference |
getApplicationPreference()
|
ConfigManager |
getConfigManager()
Obtains an instance of ibi.broker.api.cci.ConfigManager
that is to be used in conjunction with this connection instance. |
ConsoleManager |
getConsoleManager()
Obtains an instance of ibi.broker.api.cci.ConsoleManager
that is to be used in conjunction with this connection instance. |
ibi.broker.system.dserver.DserverManager |
getDserverManager()
|
LibraryAccessManager |
getLibraryAccessManager()
|
LibraryContentManager |
getLibraryContentManager()
Obtains an instance of ibi.broker.api.cci.LibraryContentManager
that is to be used in conjunction with this connection instance. |
javax.resource.cci.LocalTransaction |
getLocalTransaction()
This method is currently not available for use within the API. |
LogManager |
getLogManager()
Obtains an instance of ibi.broker.api.cci.LogManager
that is to be used in conjunction with this connection instance. |
java.io.PrintWriter |
getLogWriter()
|
javax.resource.cci.ConnectionMetaData |
getMetaData()
Obtains information about the active connection to the ReportCaster repository, which is represented by this instance of CasterConnection. |
ibi.broker.system.mre.CASTER_MREManager |
getMrManager(java.lang.String owner)
|
javax.resource.cci.ResultSetInfo |
getResultSetInfo()
This method is currently not available for use within the API. |
ScheduleManager |
getScheduleManager()
Obtains an instance of ibi.broker.api.cci.ScheduleManager
that is to be used in conjunction with this connection instance. |
protected ibi.broker.security.CasterSecurityManager |
getSecurityManager()
Obtains the Security Manager that is being used in conjunction with this connection instance. |
java.lang.String |
getSecurityToken()
|
User |
getUser()
Obtain the username of the current ReportCaster user who is accessing this CasterConnection instance. |
UserManager |
getUserManager()
Obtains an instance of ibi.broker.api.cci.UserManager
that is to be used in conjunction with this connection instance. |
void |
setApplicationPreference(ibi.broker.api.data.preference.application.ApplicationPreference applicationPreference)
|
void |
setLogWriter(java.io.PrintWriter logWriter)
|
void |
setMrRole(java.lang.String mrRole)
|
protected void |
setSecurityManager(ibi.broker.security.CasterSecurityManager securityManager)
Specifies the Security Manager for use with this CasterConnection instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CasterConnection(javax.resource.spi.ManagedConnection mc, javax.resource.spi.ConnectionRequestInfo connInfo)
Method Detail |
---|
public javax.resource.cci.Interaction createInteraction() throws javax.resource.ResourceException
createInteraction
in interface javax.resource.cci.Connection
javax.resource.ResourceException
Connection.createInteraction()
public javax.resource.cci.LocalTransaction getLocalTransaction() throws javax.resource.ResourceException
getLocalTransaction
in interface javax.resource.cci.Connection
javax.resource.ResourceException
Connection.getLocalTransaction()
public javax.resource.cci.ConnectionMetaData getMetaData() throws javax.resource.ResourceException
getMetaData
in interface javax.resource.cci.Connection
javax.resource.ResourceException
- Failed to get information about the
connected EIS instance. Error can be from the resource adapter, EIS-specific, or
communication related.Connection.getMetaData()
public javax.resource.cci.ResultSetInfo getResultSetInfo() throws javax.resource.ResourceException
getResultSetInfo
in interface javax.resource.cci.Connection
javax.resource.ResourceException
Connection.getResultSetInfo()
public void close() throws javax.resource.ResourceException
close
in interface javax.resource.cci.Connection
javax.resource.ResourceException
Connection.close()
protected void setSecurityManager(ibi.broker.security.CasterSecurityManager securityManager)
securityManager
- ReportCaster's built in Security Manager.protected ibi.broker.security.CasterSecurityManager getSecurityManager()
public AddressBookManager getAddressBookManager()
ibi.broker.api.cci.AddressBookManager
that is to be used in conjunction with this connection instance.
public LibraryAccessManager getLibraryAccessManager()
public ScheduleManager getScheduleManager()
ibi.broker.api.cci.ScheduleManager
that is to be used in conjunction with this connection instance.
public ConsoleManager getConsoleManager()
ibi.broker.api.cci.ConsoleManager
that is to be used in conjunction with this connection instance.
public ibi.broker.system.dserver.DserverManager getDserverManager()
public LogManager getLogManager()
ibi.broker.api.cci.LogManager
that is to be used in conjunction with this connection instance.
public LibraryContentManager getLibraryContentManager()
ibi.broker.api.cci.LibraryContentManager
that is to be used in conjunction with this connection instance.
ibi.broker.api.cci.LibraryContentManager
public ConfigManager getConfigManager()
ibi.broker.api.cci.ConfigManager
that is to be used in conjunction with this connection instance.
ibi.broker.api.cci.ConfigManager
public UserManager getUserManager()
ibi.broker.api.cci.UserManager
that is to be used in conjunction with this connection instance.
ibi.broker.api.cci.UserManager
public java.lang.String getSecurityToken()
public ibi.broker.system.mre.CASTER_MREManager getMrManager(java.lang.String owner) throws java.lang.Exception
java.lang.Exception
public User getUser()
ibi.broker.api.data.user.User
public void setMrRole(java.lang.String mrRole)
public ibi.broker.api.cci.AnnotationManager getAnnotationManager()
public void setLogWriter(java.io.PrintWriter logWriter)
public java.io.PrintWriter getLogWriter()
public ibi.broker.api.data.preference.application.ApplicationPreference getApplicationPreference()
public void setApplicationPreference(ibi.broker.api.data.preference.application.ApplicationPreference applicationPreference)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |