Date Created: Mon 08-Nov-2010

Related Document Categories:

Get my WebSphere Application Server course here >> http://www.themiddlewareshop.com/products/


    WebSphere Jython JMS Scripts

    ###############################################################################
    # JMS Resource Management
    ###############################################################################

    def enableService(serviceName, scope):
    """ This method encapsulates the base action of enabling a service for use in WAS.

    Parameters:
    serviceName - Name of the service to be enabled in String format
    scope - Identification of object (such as server or node) in String format.
    Returns:
    No return value
    """
    m = "enableService: "
    #--------------------------------------------------------------------
    # Get a list of service objects. There should only be one.
    # If there's more than one, use the first one found.
    #--------------------------------------------------------------------
    services = _splitlines(AdminConfig.list(serviceName, scope))
    if (len(services) == 0):
    sop(m, "The %s service could not be found." % serviceName)
    return
    #endIf
    serviceID = services[0]

    #--------------------------------------------------------------------
    # Set the service enablement
    #--------------------------------------------------------------------
    if (AdminConfig.showAttribute(serviceID, "enable") == "true"):
    sop(m, "The %s service is already enabled." % serviceName)
    else:
    AdminConfig.modify(serviceID, [["enable", "true"]] )
    #endElse
    #endDef

    def deleteAllSIBuses():
    """Deletes all SIB bus objects in the configuration."""
    m = "deleteAllSIBuses: "
    #sop(m,"Entry.")

    try:
    bus_list = _splitlines(AdminTask.listSIBuses())
    #sopY(m,"bus_list=%s" % ( bus_list ))

    for bus in bus_list:
    #sop(m,"bus=%s" % ( bus ))
    bus_name = getNameFromId(bus)
    sop(m,"Deleting bus_name=%s" % ( bus_name ))
    AdminTask.deleteSIBus('[-bus %s ]' % (bus_name))
    except AttributeError:
    return
    #sop(m,"Exit.")

    def addSIBusMember(clusterName, nodeName, serverName, SIBusName):
    """ This method encapsulates the actions needed to add a server-node or a cluster to a bus.
    It will scan the member list to determine if cluster or server-node is already on the specified
    bus. If not, it will add the member.

    Parameters:
    clusterName - Name of the cluster to add onto bus in String format. If value is "none", server-node will be added instead of cluster
    nodeName - Name of node containing server to add onto bus in String format.
    serverName - Name of server to add onto bus in String format.
    SIBusName - Name of bus to add member onto in String format.
    Returns:
    No return value
    """
    m = "addSIBusMember: "

    if(clusterName == "none"):
    for member in _splitlines(AdminTask.listSIBusMembers(["-bus", SIBusName])):
    memberNode = AdminConfig.showAttribute(member, "node")
    memberServer = AdminConfig.showAttribute(member, "server")
    if((memberNode == nodeName) and (memberServer == serverName)):
    sop(m, "The bus member already exists.")
    return
    #endIf
    #endFor
    AdminTask.addSIBusMember(["-bus", SIBusName, "-node", nodeName, "-server", serverName])
    else:
    for member in _splitlines(AdminTask.listSIBusMembers(["-bus", SIBusName])):
    memberCluster = AdminConfig.showAttribute(member, "cluster")
    if(memberCluster == clusterName):
    sop(m, "The bus member already exists.")
    return
    #endIf
    #endFor

    AdminTask.addSIBusMember(["-bus", SIBusName, "-cluster", clusterName])
    #endElse
    #endDef

    def createSIBus(clusterName, nodeName, serverName, SIBusName, scope, busSecurity=""):
    """ This method encapsulates the actions needed to create a bus on the current cell.
    It will check to see if the bus already exists. If not, it will add the member.

    Parameters:
    clusterName - Name of the cluster to add onto bus in String format. If value is "none", server-node will be added instead of cluster
    nodeName - Name of node containing server to add onto bus in String format.
    serverName - Name of server to add onto bus in String format.
    SIBusName - Name of bus to create in String format.
    scope - Identification of object (such as server or node) in String format.
    busSecurity - Set this option to TRUE to enforce the authorization policy for the bus
    Returns:
    No return value
    """
    m = "createSIBus: "
    #--------------------------------------------------------------------
    # Create a bus in the current cell. As well as creating a bus, the
    # createSIBus command will create a default topic space on the bus.
    #--------------------------------------------------------------------
    bus = AdminConfig.getid('/SIBus:%s' % SIBusName)

    if((len(bus) == 1) or (len(bus) == 0)):
    params = ["-bus", SIBusName, "-description", "Messaging bus for testing"]
    if(not(busSecurity == "")):
    params.append("-busSecurity")
    params.append(busSecurity)
    else:
    # Use deprecated -secure option for compatibility with prior versions of this script.
    params.append("-secure")
    params.append("FALSE")
    #endElse
    AdminTask.createSIBus(params)
    else:
    sop(m, "The %s already exists." % SIBusName)
    #endElse

    #--------------------------------------------------------------------
    # Add SI bus member
    #--------------------------------------------------------------------
    addSIBusMember(clusterName, nodeName, serverName, SIBusName)

    #--------------------------------------------------------------------
    # Enable SIB service
    #--------------------------------------------------------------------
    enableService("SIBService", scope)
    #endDef

    def createSIBus_ext(SIBusName, desc, busSecurity, interAuth, medAuth, protocol, discard, confReload, msgThreshold ):
    """ This method encapsulates the actions needed to create a bus on the current cell.
    It will check to see if the bus already exists. If not, it will create the bus.

    Parameters:
    SIBusName - Name of bus to create in String format.
    desc - Descriptive information about the bus.
    busSecurity - Enables or disables bus security.
    interAuth - Name of the authentication alias used to authorize communication between messaging engines on the bus.
    medAuth - Name of the authentication alias used to authorize mediations to access the bus.
    protocol - The protocol used to send and receive messages between messaging engines, and between API clients and messaging engines.
    discard - Indicate whether or not any messages left in a queue's data store should be discarded when the queue is deleted.
    confReload - Indicate whether configuration files should be dynamically reloaded for this bus.
    msgThreshold - The maximum number of messages that any queue on the bus can hold.
    Returns:
    No return value
    """
    m = "createSIBus_ext: "
    sop (m, "Entering createSIBus_ext function...")
    #--------------------------------------------------------------------
    # Create a bus in the current cell.
    #--------------------------------------------------------------------
    bus = AdminConfig.getid('/SIBus:%s' % SIBusName)
    if((len(bus) == 1) or (len(bus) == 0)):
    params = ["-bus", SIBusName, "-description", desc, "-interEngineAuthAlias", interAuth, "-mediationsAuthAlias", medAuth, "-protocol", protocol, "-discardOnDelete", discard, "-configurationReloadEnabled", confReload, "-highMessageThreshold", msgThreshold ]
    if(not(busSecurity == "")):
    params.append("-busSecurity")
    params.append(busSecurity)
    else:
    # Use deprecated -secure option for compatibility with prior versions of this script.
    params.append("-secure")
    params.append("FALSE")
    #endElse
    AdminTask.createSIBus(params)
    else:
    sop(m, "The %s already exists." % SIBusName)
    #endElse
    #endDef


    def addSIBusMember_ext (clusterName, nodeName, serverName, SIBusName, messageStoreType, logSize, logDir, minPermStoreSize, minTempStoreSize, maxPermStoreSize, maxTempStoreSize, unlimPermStoreSize, unlimTempStoreSize, permStoreDirName, tempStoreDirName, createDataSrc, createTables, authAlias, schemaName, dataSrcJNDIName ):

    """ This method encapsulates the actions needed to add a server-node or a cluster to a bus.
    It will scan the member list to determine if cluster or server-node is already on the specified
    bus. If not, it will add the member.

    Parameters:
    clusterName - Name of the cluster to add onto bus in String format. If value is "none", server-node will be added instead of cluster
    nodeName - Name of node containing server to add onto bus in String format.
    serverName - Name of server to add onto bus in String format.
    SIBusName - Name of bus to add member onto in String format.
    messageStoreType - Indicates whether a filestore or datastore should be used. Valid values are 'filestore' and 'datastore'.
    logSize - The size, in megabytes, of the log file.
    logDir - The name of the log files directory.
    minPermStoreSize - The minimum size, in megabytes, of the permanent store file.
    minTempStoreSize - The minimum size, in megabytes, of the temporary store file.
    maxPermStoreSize - The maximum size, in megabytes, of the permanent store file.
    maxTempStoreSize - The maximum size, in megabytes, of the temporary store file.
    unlimPermStoreSize -'true' if the permanent file store size has no limit; 'false' otherwise.
    unlimTempStoreSize - 'true' if the temporary file store size has no limit; 'false' otherwise.
    permStoreDirName - The name of the store files directory for permanent data.
    tempStoreDirName - The name of the store files directory for temporary data.
    createDataSrc - When adding a server to a bus, set this to true if a default datasource is required. When adding a cluster to a bus, this parameter must not be supplied.
    createTables - Select this option if the messaging engine creates the database tables for the data store. Otherwise, the database administrator must create the database tables.
    authAlias - The name of the authentication alias used to authenticate the messaging engine to the data source.
    schemaName - The name of the database schema used to contain the tables for the data store.
    dataSrcJNDIName - The JNDI name of the datasource to be referenced from the datastore created when the member is added to the bus.
    Returns:
    No return value
    """
    m = "addSIBusMember: "
    sop (m, "Entering addSIBusMember function...")

    params = "-bus", SIBusName

    if(clusterName == "none"):
    for member in _splitlines(AdminTask.listSIBusMembers(["-bus", SIBusName])):
    memberNode = AdminConfig.showAttribute(member, "node")
    memberServer = AdminConfig.showAttribute(member, "server")
    if((memberNode == nodeName) and (memberServer == serverName)):
    sop(m, "The bus member already exists.")
    return
    #endIf
    #endFor
    params += "-node", nodeName, "-server", serverName
    else:
    for member in _splitlines(AdminTask.listSIBusMembers(["-bus", SIBusName])):
    memberCluster = AdminConfig.showAttribute(member, "cluster")
    if(memberCluster == clusterName):
    sop(m, "The bus member already exists.")
    return
    #endIf
    #endFor
    params += "-cluster", clusterName
    #endElse

    if (messageStoreType.lower() == 'filestore'):
    params += "-fileStore",
    params += "-logSize", logSize, "-logDirectory", logDir,
    params += "-minPermanentStoreSize", minPermStoreSize, "-minTemporaryStoreSize", minTempStoreSize,
    params += "-unlimitedPermanentStoreSize", unlimPermStoreSize, "-unlimitedTemporaryStoreSize", unlimTempStoreSize,

    if (unlimPermStoreSize == 'false'):
    params += "-maxPermanentStoreSize", maxPermStoreSize,
    #endIf

    if (unlimTempStoreSize == 'false'):
    params += "-maxTemporaryStoreSize", maxTempStoreSize,
    #endif
    params += "-permanentStoreDirectory", permStoreDirName, "-temporaryStoreDirectory", tempStoreDirName
    else:
    if (messageStoreType.lower() == 'datastore'):
    params += "-dataStore",
    params += "-createDefaultDatasource", createDataSrc,
    params += "-datasourceJndiName", dataSrcJNDIName,
    params += "-createTables", createTables,
    params += "-authAlias", authAlias, "-schemaName", schemaName
    #endIf
    #endIf

    AdminTask.addSIBusMember(params)

    #endDef

    def createSIBJMSConnectionFactory(clusterName, serverName, jmsCFName, jmsCFJNDI, jmsCFDesc, jmsCFType, SIBusName, provEndPoints, scope, authAlias=""):
    """ This method encapsulates the actions needed to create a JMS Connection Factory for handling connections between communicators and queues.

    Parameters:
    clusterName - Name of the cluster to associate connection factory with in String format. If value is "none", server will be used instead of cluster
    serverName - Name of server to associate connection factory with in String format.
    jmsCFName - Name to use for connection factory in String format.
    jmsCFJNDI - JNDI Identifier to use for connection factory in String format.
    jmsCFDesc - Description of the connection factory in String format.
    jmsCFType - Type of the connection factory in String format
    SIBusName - Name of bus to associate connection factory with in String format.
    provEndPoints - Provider of connection factory in String format
    scope - Identification of object (such as server or node) in String format.
    authAlias - Authentication alias for connection factory in String format
    Returns:
    No return value
    """
    m = "createSIBJMSConnectionFactory: "
    #--------------------------------------------------------------------
    # Create SIB JMS connection factory
    #--------------------------------------------------------------------
    if(clusterName == "none"):
    jmsCF = AdminConfig.getid('/Server:%s/J2CResourceAdapter:SIB JMS Resource Adapter/J2CConnectionFactory:%s' % (serverName,jmsCFName))
    else:
    jmsCF = AdminConfig.getid('/ServerCluster:%s/J2CResourceAdapter:SIB JMS Resource Adapter/J2CConnectionFactory:%s' % (clusterName,jmsCFName))
    #endElse
    if (len(jmsCF) != 0):
    sop(m, "The %s JMS connection factory already exists." % jmsCFName)
    return
    #endIf

    #--------------------------------------------------------------------
    # Create the SIB JMS connection factory
    #--------------------------------------------------------------------
    params = ["-name", jmsCFName, "-jndiName", jmsCFJNDI, "-busName", SIBusName, "-description", jmsCFDesc]
    if(not(jmsCFType == "")):
    params.append("-type")
    params.append(jmsCFType)
    #endIf
    if(not(provEndPoints == "")):
    params.append("-providerEndPoints")
    params.append(provEndPoints)
    #endIf
    if(not(authAlias == "")):
    params.append("-containerAuthAlias")
    params.append(authAlias)
    #endIf

    AdminTask.createSIBJMSConnectionFactory(scope, params)
    #endDef

    def createSIBJMSQueue(jmsQName, jmsQJNDI, jmsQDesc, SIBQName, scope):
    """ This method encapsulates the actions needed to create a JMS Queue for messages.

    Parameters:
    jmsQName - Name to use for queue in String format.
    jmsQJNDI - JNDI Identifier to use for queue in String format.
    jmsQDesc - Description of the queue in String format.
    SIBQName - Queue Name value used in protocol in String format
    scope - Identification of object (such as server or node) in String format.
    Returns:
    No return value
    """
    m = "createSIBJMSQueue: "
    #--------------------------------------------------------------------
    # Create SIB JMS queue
    #--------------------------------------------------------------------
    for queue in _splitlines(AdminTask.listSIBJMSQueues(scope)):
    name = AdminConfig.showAttribute(queue, "name")
    if (name == jmsQName):
    sop(m, "The %s SIB JMS queue already exists." % jmsQName)
    return
    #endIf
    #endFor

    params = ["-name", jmsQName, "-jndiName", jmsQJNDI, "-description", jmsQDesc, "-queueName", SIBQName]
    AdminTask.createSIBJMSQueue(scope, params)
    #endDef

    def createSIBQueue(clusterName, nodeName, serverName, SIBQName, SIBusName):
    """ This method encapsulates the actions needed to create a queue for the Service Integration Bus.

    Parameters:
    clusterName - Name of the cluster to associate queue with in String format. If value is "none", server-node will be used instead of cluster
    nodeName - Name of node containing server to associate queue with in String format.
    serverName - Name of server to associate queue with in String format.
    SIBQName - Name of queue to create in String format
    SIBusName - Name of bus to associate queue with in String format.
    Returns:
    No return value
    """
    m = "createSIBQueue: "
    #--------------------------------------------------------------------
    # Create SIB queue
    #--------------------------------------------------------------------
    for queue in _splitlines(AdminConfig.list("SIBQueue")):
    identifier = AdminConfig.showAttribute(queue, "identifier")
    if (identifier == SIBQName):
    sop(m, "The %s SIB queue already exists." % SIBQName)
    return
    #endIf
    #endFor

    #--------------------------------------------------------------------
    # Create SIB queue
    #--------------------------------------------------------------------
    if(clusterName == "none"):
    params = ["-bus", SIBusName, "-name", SIBQName, "-type", "Queue", "-node", nodeName, "-server", serverName]
    else:
    params = ["-bus", SIBusName, "-name", SIBQName, "-type", "Queue", "-cluster", clusterName]
    #endElse
    AdminTask.createSIBDestination(params)
    #endDef

    def createSIBJMSTopic(jmsTName, jmsTJNDI, jmsTDesc, SIBTName, SIBTopicSpace, scope):
    """ This method encapsulates the actions needed to create a JMS Topic.

    Parameters:
    jmsTName - Name of topic in String format
    jmsTJNDI - JNDI Identifier of topic in String format
    jmsTDesc - Description of topic in String format
    SIBTName - Topic name value used in SIB in String format
    SIBTopicSpace - Topic space value used in SIB in String format
    scope - Identification of object (such as server or node) in String format.
    Returns:
    No return value
    """
    m = "createSIBJMSTopic: "
    #--------------------------------------------------------------------
    # Create SIB JMS topic
    #--------------------------------------------------------------------
    for topic in _splitlines(AdminTask.listSIBJMSTopics(scope)):
    name = AdminConfig.showAttribute(topic, "name")
    if (name == jmsTName):
    sop(m, "The %s SIB JMS topic already exists." % jmsTName)
    return
    #endIf
    #endFor

    params = ["-name", jmsTName, "-jndiName", jmsTJNDI, "-description", jmsTDesc, "-topicName", SIBTName, "-topicSpace", SIBTopicSpace]
    AdminTask.createSIBJMSTopic(scope, params)
    #endDef

    def createSIBTopic(clusterName, nodeName, serverName, SIBTName, SIBusName):
    """ This method encapsulates the actions needed to create a topic for the Service Integration Bus.

    Parameters:
    clusterName - Name of the cluster to associate topic with in String format. If value is "none", server-node will be used instead of cluster
    nodeName - Name of node containing server to associate topic with in String format.
    serverName - Name of server to associate topic with in String format.
    SIBQName - Name of topic to create in String format
    SIBusName - Name of bus to associate topic with in String format.
    Returns:
    No return value
    """
    m = "createSIBTopic: "
    #--------------------------------------------------------------------
    # Create SIB topic
    #--------------------------------------------------------------------
    for topic in _splitlines(AdminConfig.list("SIBTopicSpace")):
    identifier = AdminConfig.showAttribute(topic, "identifier")
    if (identifier == SIBTName):
    sop(m, "The %s SIB topic already exists." % SIBTName)
    return
    #endIf
    #endFor

    #--------------------------------------------------------------------
    # Create SIB topic
    #--------------------------------------------------------------------
    if(clusterName == "none"):
    params = ["-bus", SIBusName, "-name", SIBTName, "-type", "TopicSpace", "-node", nodeName, "-server", serverName]
    else:
    params = ["-bus", SIBusName, "-name", SIBTName, "-type", "TopicSpace", "-cluster", clusterName]
    #endElse
    AdminTask.createSIBDestination(params)
    #endDef

    def createSIBJMSActivationSpec(activationSpecName, activationSpecJNDI, jmsQJNDI, destinationType, messageSelector, authAlias, SIBusName, scope):
    """ This method encapsulates the actions needed to create a JMS Activation Specification.

    Parameters:
    activationSpecName - Name of activation spec in String format
    actiovationSpecJNDI - JNDI Identifier of activation spec in String format
    jmsQJNDI - JNDI Identifier of the JMS queue to associate spec with in String format
    destinationType - Type of destination end point in String format
    messageSelector - Identifier of the message selector in String format
    authAlias - Authentication alias for activation spec in String format
    SIBusName - Name of bus to connect activation spec to in String format
    scope - Identification of object (such as server or node) in String format.
    Returns:
    No return value
    """
    m = "createSIBJMSActivationSpec: "

    for spec in _splitlines(AdminTask.listSIBJMSActivationSpecs(scope)):
    name = AdminConfig.showAttribute(spec, "name")
    if (name == activationSpecName):
    sop(m, "The %s SIB JMS activation spec already exists." % activationSpecName)
    return
    #endIf
    #endFor

    #--------------------------------------------------------------------
    # Create SIB JMS activation spec
    #--------------------------------------------------------------------
    params = ["-name", activationSpecName, "-jndiName", activationSpecJNDI, "-busName", SIBusName, "-destinationJndiName", jmsQJNDI, "-destinationType", destinationType]
    if(not(authAlias == "")):
    params.append("-authenticationAlias")
    params.append(authAlias)
    #endIf
    if(not(messageSelector == "")):
    params.append("-messageSelector")
    params.append(messageSelector)
    #endIf
    AdminTask.createSIBJMSActivationSpec(scope, params)
    #endDef

    def deleteSIBJMSConnectionFactory(jmsCFName, clusterName, serverName):
    """ This method encapsulates the actions needed to delete a SIB JMS Connection Factory.

    Parameters:
    jmsCFName - Name of connection factory in String format.
    clusterName - Name of the cluster to associate queue with in String format. If value is "none", server will be used instead of cluster.
    serverName - Name of server to associate queue with in String format.
    Returns:
    No return value
    """
    m = "deleteSIBJMSConnectionFactory: "
    #--------------------------------------------------------------------
    # Retrieve specific Object ID and remove Connection Factory using ID
    #--------------------------------------------------------------------
    if(clusterName == "none"):
    jmsCF = AdminConfig.getid('/Server:%s/J2CResourceAdapter:SIB JMS Resource Adapter/J2CConnectionFactory:%s' % (serverName,jmsCFName))
    else:
    jmsCF = AdminConfig.getid('/Cluster:%s/J2CResourceAdapter:SIB JMS Resource Adapter/J2CConnectionFactory:%s' % (clusterName,jmsCFName))
    #endElse
    if(not(jmsCF == "")):
    AdminConfig.remove(jmsCF)
    sop(m, "Deleted connection factory %s" % jmsCFName)
    else:
    sop(m, "ConnectionFactory %s not found" % jmsCFName)
    #endElse
    #endDef

    def deleteSIBJMSActivationSpec(jmsASName, clusterName, serverName):
    """ This method encapsulates the actions needed to delete a SIB JMS Activation Specification.

    Parameters:
    jmsASName - Name of activation spec in String format.
    clusterName - Name of the cluster to associate queue with in String format. If value is "none", server will be used instead of cluster.
    serverName - Name of server to associate queue with in String format.
    Returns:
    No return value
    """
    m = "deleteSIBJMSActivationSpec: "
    #--------------------------------------------------------------------
    # Retrieve specific Resource Adapter Type ID for SIB JMS Resource Adapter
    #--------------------------------------------------------------------
    if(clusterName == "none"):
    ra = AdminConfig.getid('/Server:%s/J2CResourceAdapter:SIB JMS Resource Adapter' % serverName)
    else:
    ra = AdminConfig.getid('/Cluster:%s/J2CResourceAdapter:SIB JMS Resource Adapter' % clusterName)
    #endElse

    #--------------------------------------------------------------------
    # Remove the Activation Spec found in the SIB JMS Resource Adapter
    #--------------------------------------------------------------------
    for spec in _splitlines(AdminTask.listJ2CActivationSpecs(ra, ["-messageListenerType", "javax.jms.MessageListener"])):
    name = AdminConfig.showAttribute(spec, "name")
    if (name == jmsASName):
    AdminConfig.remove(spec)
    sop(m, "Deleted ActivationSpec %s" % jmsASName)
    return
    #endIf
    #endFor

    sop(m, "ActivationSpec %s not found" % jmsASName)
    #endDef

    def deleteSIBJMSQueue(qName, scope):
    """ This method encapsulates the actions needed to delete a SIB JMS Queue.

    Parameters:
    qName - Name of JMS queue in String format.
    scope - Identification of object (such as server or node) in String format.
    Returns:
    No return value
    """
    m = "deleteSIBJMSQueue: "
    #--------------------------------------------------------------------
    # Search for queue based on scope and delete
    #--------------------------------------------------------------------
    for queue in _splitlines(AdminTask.listSIBJMSQueues(scope)):
    name = AdminConfig.showAttribute(queue, "name")
    if (name == qName):
    AdminTask.deleteSIBJMSQueue(queue)
    sop(m, "Deleted jms queue %s" % qName)
    return
    #endIf
    #endFor
    #endDef

    def deleteSIBJMSTopic(tName, scope):
    """ This method encapsulates the actions needed to delete a SIB JMS Topic.

    Parameters:
    tName - Name of JMS queue in String format.
    scope - Identification of object (such as server or node) in String format.
    Returns:
    No return value
    """
    m = "deleteSIBJMSTopic: "
    #--------------------------------------------------------------------
    # Search for topic based on scope and delete
    #--------------------------------------------------------------------
    for topic in _splitlines(AdminTask.listSIBJMSTopics(scope)):
    name = AdminConfig.showAttribute(topic, "name")
    if (name == tName):
    AdminTask.deleteSIBJMSTopic(topic)
    sop(m, "Deleted jms topic %s" % tName)
    return
    #endIf
    #endFor
    #endDef

    def deleteSIBQueue(qName, SIBusName):
    """ This method encapsulates the actions needed to delete a SIB Queue.

    Parameters:
    qName - Name of SIB queue in String format.
    SIBusName - Name of the bus the queue is associated with in String format.
    Returns:
    No return value
    """
    m = "deleteSIBQueue: "
    #--------------------------------------------------------------------
    # Search for queue based on scope and delete
    #--------------------------------------------------------------------
    params = ["-bus", SIBusName, "-name", qName]
    scope = ["-bus", SIBusName, "-type", "Queue"]

    if(not(re.compile(SIBusName, 0).search(AdminTask.listSIBuses())==None)):
    for q in _splitlines(AdminTask.listSIBDestinations(scope)):
    name = AdminConfig.showAttribute(q, "identifier")
    if (name == qName):
    AdminTask.deleteSIBDestination(params)
    sop(m, "Deleted destination %s" % qName)
    return
    #endIf
    #endFor
    #endIf
    #endDef

    def deleteBus(SIBusName):
    """ This method encapsulates the actions needed to delete a Service Integration Bus.

    Parameters:
    SIBusName - Name of the bus to delete in String format
    Returns:
    No return value
    """
    m = "deleteBus: "
    #--------------------------------------------------------------------
    # Search for bus using the provided bus name
    #--------------------------------------------------------------------
    for bus in _splitlines(AdminTask.listSIBuses()):
    name = AdminConfig.showAttribute(bus, "name")
    if (name == SIBusName):
    params = ["-bus", SIBusName]
    AdminTask.deleteSIBus(params)
    sop(m, "deleted SIBus %s" % SIBusName)
    return
    #endIf
    #endFor
    #endDef

    Get my WebSphere Application Server course here >> http://www.themiddlewareshop.com/products/


Steve Robinson - IBM Champion 2013

About Me

Steve Robinson has been working in IT for over 20 years and has provided solutions for many large-enterprise corporate companies across the world. Steve specialises in Java and Middleware.

In January 2013, I was awarded the prestigous 'IBM Champion' accolade.


Read my books?

IBM WebSphere Application Server 8.0 Administration Guide

IBM WebSphere Application Server 8.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

WebSphere Categories

Other Categories