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()
           
static ServiceInfo getServiceInfo(Ref ref)
           
static TransportManager getTransportManager()
           
static UsernamePassword getUsernamePassword(TransportProvider provider, Ref serviceAccount)
           
static weblogic.security.UsernameAndPassword getUsernamePasswordCredential(TransportProvider provider, Ref serviceAccount)
          Deprecated. Use getUsernamePassword(com.bea.wli.sb.transports.TransportProvider, com.bea.wli.config.Ref) instead
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:
Returns whether or not the code is being executed on the admin server

clusterExists

public static boolean clusterExists()
Returns:
true if ALSB is deployed in a WLS clustered domain

getUsernamePasswordCredential

public static weblogic.security.UsernameAndPassword getUsernamePasswordCredential(TransportProvider provider,
                                                                                  Ref serviceAccount)
                                                                           throws CredentialNotFoundException
Deprecated. Use getUsernamePassword(com.bea.wli.sb.transports.TransportProvider, com.bea.wli.config.Ref) instead

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

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

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:
list of all available dispatch policies in ALSB domain
Throws:
TransportException