Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Service Bus
11g Release 1 (11.1.1.6.3)

E15033-08


com.bea.wli.sb.transports
Class TransportManagerHelper

java.lang.Object
  extended by com.bea.wli.sb.transports.TransportManagerHelper


public class TransportManagerHelper
extends java.lang.Object

Helper class that allows the client to execute some common tasks with respect to Transport subsystem


Method Summary
static boolean clusterExists()
           
static java.lang.String getCluster()
           
static java.util.Set<java.lang.String> getDispatchPolicies()
          Returns the set of dispatch policies available on the server.
static java.util.Set<java.lang.String> getDispatchPolicies(javax.management.remote.JMXConnector connector)
           
static weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean getDomainRuntimeService(javax.management.remote.JMXConnector connector)
           
static java.util.Set<java.lang.String> getRuntimeServerNames()
           
static ServiceInfo getServiceInfo(Ref ref)
           
static weblogic.security.KeyPairCredential getSSLClientKeyPair(TransportProvider provider, Ref skp)
          Returns a key-pair (private key and certificate chain) for SSL client authentication stored on the given service key provider
static TransportManager getTransportManager()
           
static UsernamePassword getUsernamePassword(TransportProvider provider, Ref serviceAccount)
           
static WsdlDescription getWsdlDescription(Ref ref)
           
static XmlDescription getXmlDescription(Ref ref)
           
static boolean hasSSLClientKeyPair(TransportProvider provider, Ref skp)
           
static boolean isAdmin()
           
static boolean isOffline()
           
static boolean isRuntimeEnabled()
           
static boolean isStaticServiceAccount(Ref serviceAccount)
           
static void schedule(java.lang.Runnable runnable, java.lang.String dispatchPolicy)
          Schedule a work instance for execution in another thread associated with specified dispatch policy.
static void schedule(java.lang.Runnable runnable, java.lang.String dispatchPolicy, java.lang.String appName, java.lang.String moduleName)
          Schedule a work instance for execution in another thread associated with specified dispatch policy.
static java.util.List<Ref> searchInstanceIds(java.lang.String typeId, java.lang.String keyName, java.lang.Object keyValue)
          Returns a list of references for instances that has the given keyValue for the given key.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

getTransportManager

public static TransportManager getTransportManager()
                                            throws TransportException
Returns:
Returns an instance of Transport Manager.
Throws:
TransportException - a exception occurred

isAdmin

public static boolean isAdmin()
Returns:
whether or not the code is being executed on OSB configuration server. On WebLogic, this is typically the admin server.
Throws:
java.lang.IllegalStateException - if the caller is offline.

clusterExists

public static boolean clusterExists()
Returns:
true if OSB is deployed in a clustered domain. It always returns false when the caller is offline, or when there is a non-clustered OSB managed server

isRuntimeEnabled

public static boolean isRuntimeEnabled()
Returns:
true if the OSB runtime is enabled on this node. Typically, runtime is enabled on the admin server only in single node configuration. In a multi-server configuration, it is only enabled on the OSB managed servers (whether in a cluster or not), and not on the admin.

isOffline

public static boolean isOffline()
Returns:
true if running in offline mode ( e.g. within an IDE), false if running on a server ( e.g. WebLogic)

getRuntimeServerNames

public static java.util.Set<java.lang.String> getRuntimeServerNames()
Returns:
set of string names of the mananged servers running in the OSB cluster.
Throws:
java.lang.UnsupportedOperationException - if this is called in offline mode.

getCluster

public static java.lang.String getCluster()
Returns:
the OSB cluster name. null if OSB is not deployed on any cluster, or if the caller is offline.

getUsernamePassword

public static UsernamePassword getUsernamePassword(TransportProvider provider,
                                                   Ref serviceAccount)
                                            throws CredentialNotFoundException
Parameters:
provider - transport provider
serviceAccount - a reference to a service account
Returns:
the username and password assigned to the service account. Transport providers that need access to credentials during activation can use this interface to lookup a username/password assigned to a service account. This interface should not be used to lookup credentials during outbound messaging
Throws:
CredentialNotFoundException - if the service account does not exist or if a username/password has not been assigned to the service account

isStaticServiceAccount

public static boolean isStaticServiceAccount(Ref serviceAccount)
                                      throws TransportException
Parameters:
serviceAccount - a service account reference
Returns:
true if the service account is a static service account
Throws:
TransportException - if there is no service account for the given reference

getSSLClientKeyPair

public static weblogic.security.KeyPairCredential getSSLClientKeyPair(TransportProvider provider,
                                                                      Ref skp)
                                                               throws CredentialNotFoundException
Returns a key-pair (private key and certificate chain) for SSL client authentication stored on the given service key provider
Parameters:
provider - the transport provider requesting the key-pair
skp - a reference to a service key provider
Returns:
the key-pair
Throws:
CredentialNotFoundException - if the service key provider does not exist or does not have a key-pair for SSL client authentication

hasSSLClientKeyPair

public static boolean hasSSLClientKeyPair(TransportProvider provider,
                                          Ref skp)
                                   throws TransportException
Parameters:
provider - the transport provider requesting the key-pair
skp - a reference to a service key provider
Returns:
true if the given service key provider has a key-pair (private key and certificate chain) for SSL client authentication
Throws:
TransportException - if the service key provider does not exist

getServiceInfo

public static ServiceInfo getServiceInfo(Ref ref)
                                  throws TransportException
Parameters:
ref - service reference
Returns:
service information, i.e. binding, transport configuration, etc. for corresponding service
Throws:
TransportException - if an exception occurs

searchInstanceIds

public static java.util.List<Ref> searchInstanceIds(java.lang.String typeId,
                                                    java.lang.String keyName,
                                                    java.lang.Object keyValue)
                                             throws TransportException
Returns a list of references for instances that has the given keyValue for the given key. Can be used by transport providers to search for all services that match a certain search criteria.
Parameters:
typeId - the resource type
keyName - can be one of the defined type ids, e.g. Refs.PROXY_REF. Also see Refs
keyValue - can be one of the defined queries, e.g. ProxyServiceQuery.KEY_PROXYURI. Also see ProxyServiceQuery and BusinessServiceQuery
Returns:
a list of references for instances that has the given keyValue for the given key. Returns empty list if none found.
Throws:
TransportException - if an exception occurs

schedule

public static void schedule(java.lang.Runnable runnable,
                            java.lang.String dispatchPolicy)
                     throws TransportException
Schedule a work instance for execution in another thread associated with specified dispatch policy. This method can be used by transport providers to post the results of outbound blocking message call back to OSB response pipeline on a different thread than that on which the incoming request method was received. Dispatch policies can be configured with WLS console by the way of registering new Work Managers in the domain. If dispatchPolicy argument is null, the default dispatch policy will be used. Other semantics: o Runnable.run() will be called in the context of the security subject, if any, that was present at the time schedule() was invoked. Note: on WLS, if there is no application context on the thread at the moment this method is called, then the default work manager will be used. use #schedule(Runnable, String, String) instead to specify the application name to associate the work manager with.
Parameters:
runnable - action to execute asynchronously
dispatchPolicy - name of the WLS WorkManager which will be used to execute the Runnable.run action. Maybe null, in which case the default work manager will be used.
Throws:
TransportException - if an exception occurs

schedule

public static void schedule(java.lang.Runnable runnable,
                            java.lang.String dispatchPolicy,
                            java.lang.String appName,
                            java.lang.String moduleName)
                     throws TransportException
Schedule a work instance for execution in another thread associated with specified dispatch policy. This method can be used by transport providers to post the results of outbound blocking message call back to OSB response pipeline on a different thread than that on which the incoming request method was received. Dispatch policies can be configured by the WLS console by the way of registering new Work Managers in the domain. If dispatchPolicy argument is null, the default dispatch policy will be used. An application and module namecan be specified to find the application and module the user want to associate the work manager with. Other semantics: o Runnable.run() will be called in the context of the security subject, if any, that was present at the time schedule() was invoked.
Parameters:
runnable - scheduled work
dispatchPolicy - work manager name
appName - application name to associated work manager with. If null, then it is infered from the current application context.
moduleName - module name to associated work manager with. If null, then it is infered from the current application context.
Throws:
TransportException - if an exception occurs.

getDispatchPolicies

public static java.util.Set<java.lang.String> getDispatchPolicies()
                                                           throws TransportException
Returns the set of dispatch policies available on the server. This method can only be invoked in online mode. Otherwise, it will throw TransportException. Use getDispatchPolicies(JMXConnector connector) if you for transports implementation that supports offline mode.
Returns:
list of all available dispatch policies in OSB domain
Throws:
TransportException - if the caller of this method is offline.

getDispatchPolicies

public static java.util.Set<java.lang.String> getDispatchPolicies(javax.management.remote.JMXConnector connector)
                                                           throws TransportException
Parameters:
connector - the JMXConnector instance used to access the domain.
Returns:
list of all available dispatch policies in OSB domain
Throws:
TransportException - if an exception occurs

getDomainRuntimeService

public static weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean getDomainRuntimeService(javax.management.remote.JMXConnector connector)
                                                                                                        throws TransportException
Throws:
TransportException

getWsdlDescription

public static WsdlDescription getWsdlDescription(Ref ref)
                                          throws TransportException
Parameters:
ref - the wsdl ref
Returns:
Wsdl associated with this service, if any. Returns null for non WSDL-based services.
Throws:
TransportException - if an exception occurs

getXmlDescription

public static XmlDescription getXmlDescription(Ref ref)
                                        throws TransportException
Parameters:
ref - the schema ref
Returns:
Schema associated with this service request or response, if any, otherwise returns null
Throws:
TransportException - if an exception occurs

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Service Bus
11g Release 1 (11.1.1.6.3)

E15033-08


Copyright © 2008, 2012, Oracle. All rights reserved.