com.bea.wli.sb.transports
Class TransportManagerHelper

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

public class TransportManagerHelper
extends Object

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


Method Summary
static boolean clusterExists()
           
static Set<String> getDispatchPolicies()
          Returns the set of dispatch policies available on the server.
static Set<String> getDispatchPolicies(JMXConnector connector)
           
static weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean getDomainRuntimeService(JMXConnector connector)
           
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 boolean hasSSLClientKeyPair(TransportProvider provider, Ref skp)
           
static boolean isAdmin()
           
static boolean isStaticServiceAccount(Ref serviceAccount)
           
static void schedule(Runnable runnable, String dispatchPolicy)
          Schedule a work instance for execution in another thread associated with specified dispatch policy.
static List<Ref> searchInstanceIds(String typeId, String keyName, 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

isAdmin

public static boolean isAdmin()
Returns:
whether or not the code is being executed on the admin server
Throws:
IllegalStateException - if the caller is offline.

clusterExists

public static boolean clusterExists()
Returns:
true if ALSB is deployed in a WLS clustered domain. It always returns false 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

searchInstanceIds

public static List<Ref> searchInstanceIds(String typeId,
                                          String keyName,
                                          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:
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

schedule

public static void schedule(Runnable runnable,
                            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 ALSB 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.

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

getDispatchPolicies

public static Set<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 ALSB domain
Throws:
TransportException - if the caller of this method is offline.

getDispatchPolicies

public static Set<String> getDispatchPolicies(JMXConnector connector)
                                       throws TransportException
Returns:
list of all available dispatch policies in ALSB domain
Throws:
TransportException

getDomainRuntimeService

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

getWsdlDescription

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