MQ Admin Program
MQ Admin Program
V7.5
Progress SonicMQ Administrative Programming Guide V7.5
Copyright © 2007 Sonic Software Corporation. All rights reserved. Sonic Software Corporation is
a wholly-owned subsidiary of Progress Software Corporation.
The Sonic Software products referred to in this document are also copyrighted, and all rights are
reserved by Sonic Software Corporation and/or its licensors, if any. This manual may not, in whole
or in part, be copied, translated, or reduced to any electronic medium or machine-readable form
without prior consent, in writing, from Sonic Software Corporation.
The information in this manual is subject to change without notice, and Sonic Software Corporation
assumes no responsibility for any errors that may appear in this document. The references in this
manual to specific platforms supported are subject to change.
Dynamic Routing Architecture, Sonic ESB, SonicMQ, Sonic Software (and design), Sonic
Orchestration Server, and SonicSynergy are registered trademarks of Sonic Software Corporation in
the U.S. and other countries. Connect Everything. Achieve Anything., Sonic SOA Suite, Sonic
Business Integration Suite, Sonic Collaboration Server, Sonic Continuous Availability Architecture,
Sonic Database Service, Sonic eXtensible Information Server, Sonic Workbench, and Sonic XML
Server are trademarks of Sonic Software Corporation in the U.S. and other countries. Progress is a
registered trademark of Progress Software Corporation in the U.S. and other countries. IBM is a
registered trademark of IBM Corporation. Java and all Java-based marks are trademarks or
registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. Any other
trademarks or service marks contained herein are the property of their respective owners.
SonicMQ Product Family includes code licensed from RSA Security, Inc. Some portions licensed
from IBM are available at http://oss.software.ibm.com/icu4j/.
SonicMQ Product Family includes code licensed from Mort Bay Consulting Pty. Ltd. The Jetty
Package is Copyright © 1998 Mort Bay Consulting Pty. Ltd. (Australia) and others.
SonicMQ Product Family includes the JMX Technology from Sun Microsystems, Inc. Use and
Distribution is subject to the Sun Community Source License available at
http://sun.com/software/communitysource.
SonicMQ Product Family includes files that are subject to the Netscape Public License Version 1.1
(the "License"); you may not use this file except in compliance with the License. You may obtain a
copy of the License at http://www.mozilla.org/NPL/. Software distributed under the License is
distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing rights and limitations under the
License. The Original Code is Mozilla Communicator client code, released March 31, 1998. The
Initial Developer of the Original Code is Netscape Communications Corporation. Portions created
by Netscape are Copyright 1998-1999 Netscape Communications Corporation. All Rights
Reserved.
SonicMQ Product Family includes a version of the Saxon XSLT and XQuery Processor from
Saxonica Limited that has been modified by Progress Software Corporation. The contents of the
Saxon source code and the modified source code file (Configuration.java) are subject to the Mozilla
Public License Version 1.0 (the "License"); you may not use these files except in compliance with
the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ and a copy of
the license (MPL-1.0.html) can also be found in the installation directory, in the
Docs7.5/third_party_licenses folder, along with a copy of the modified code (Configuration.java);
and a description of the modifications can be found in the Progress SonicMQ v7.5 README file.
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY
OF ANY KIND, either express or implied. See the License for the specific language governing
rights and limitations under the License. The Original Code is The SAXON XSLT and XQuery
Processor from Saxonica Limited. The Initial Developer of the Original Code is Michael Kay
http://www.saxonica.com/products.html). Portions created by Michael Kay are Copyright © 2001-
2005. All rights reserved. Portions created by Progress Software Corporation are Copyright © 2007.
All rights reserved.
April 2007
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9
About This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
SonicMQ Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Worldwide Technical Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
SonicMQ is a fast, flexible, and scalable messaging broker that simplifies the
development and integration of highly distributed enterprise applications. SonicMQ is a
complete implementation of the Java Message Service specification Version 1.1, an API
for accessing enterprise messaging systems from Java programs.
This book provides information about using the SonicMQ Management Application
Program Interfaces (APIs).
Typographical Conventions
This section describes the text-formatting conventions used in this guide and a description
of notes, warnings, and important messages. This guide uses the following typographical
conventions:
● Bold typeface in this font indicates keyboard key names (such as Tab or Enter) and
the names of windows, menu commands, buttons, and other Sonic user-interface
elements. For example, “From the File menu, choose Open.”
● Bold typeface in this font emphasizes new terms when they are introduced.
● Monospace typeface indicates text that might appear on a computer screen other than
the names of Sonic user-interface elements, including:
■ Code examples and code text that the user must enter
■ System output such as responses and error messages
■ Filenames, pathnames, and software component names, such as method names
● Bold monospace typeface emphasizes text that would otherwise appear in monospace
typeface to emphasize some computer input or output in context.
● Monospace typeface in italics or Bold monospace typeface in italics (depending
on context) indicates variables or placeholders for values you supply or that might
vary from one case to another.
This manual uses the following syntax notation conventions:
● Brackets ([ ]) in syntax statements indicate parameters that are optional.
● Braces ({ }) indicate that one (and only one) of the enclosed items is required. A
vertical bar (|) separates the alternative selections.
● Ellipses (...) indicate that you can choose one or more of the preceding items.
This guide highlights special kinds of information by shading the information area, and
indicating the type of alert in the left margin.
Note A Note flag indicates information that complements the main text flow. Such information
is especially helpful for understanding the concept or procedure being discussed.
Important An Important flag indicates information that must be acted upon within the given context
to successfully complete the procedure or task.
Warning A Warning flag indicates information that can cause loss of data or other damage if
ignored.
SonicMQ Documentation
SonicMQ provides the following documentation:
Getting Started with Progress SonicMQ An overview of the SonicMQ architecture and messaging
(PDF) concepts. Guides the user through some of the SonicMQ
sample applications to demonstrate basic messaging features.
Progress SonicMQ Application Takes you through the Java sample applications to illustrate
Programming Guide the design patterns they offer to your applications. Details
(PDF) each facet of the client functionality: connections, sessions,
transactions, producers and consumers, destinations,
messaging models, message types and message elements.
Complete information is included on hierarchical
namespaces, recoverable file channels, and distributed
transactions.
SonicMQ API Reference Online JavaDoc compilation of the exposed SonicMQ Java
(HTML) messaging client APIs.
Progress SonicMQ Configuration and Describes the container and broker configuration toolset in
Management Guide detail plus how to use the JNDI store for administered objects,
(PDF) and the certificate manager. Shows how to manage and
monitor deployed components including their metrics and
notifications.
Progress SonicMQ Administrative Provides information about moving development projects into
Programming Guide test and production environments. Describes recommended
(PDF) build procedures, domain mappings, and reporting features.
Management Application API Reference Online JavaDoc compilation of the exposed SonicMQ
(HTML) management configuration and runtime APIs.
Metrics and Notifications API Reference Online JavaDoc of the exposed SonicMQ management
(HTML) monitoring APIs.
Progress SonicMQ Performance Tuning Illustrates the buffers and caches that control message flow
Guide and capacities to help you understand how combinations of
(PDF) parameters can improve both throughput and service levels.
Sonic Event Monitor User’s Guide Provides a logging framework to track, record, or redirect
(PDF) metrics and notifications that monitor and manage
applications.
This book contains information about using the SonicMQ Management Application
Programming Interface (API). This API provides configuration and runtime access to the
Sonic Management Environment, and includes Service Provider Interfaces (SPIs) for
implementing the Pluggable Authentication and Security Service (PASS). The interfaces,
operations, and attributes in this API are documented in the JavaDoc included with your
SonicMQ installation (see sonic_install_root/Docs7.5/api/mgmt_api/index.html).
This book provides an overview of the interfaces located in each of the following
packages:
● Configuration Packages — Use the Configuration API to configure all aspects of
SonicMQ and the Management Framework, including collections, containers,
brokers, clusters, queues, and routings. Get and set individual attributes on a
configuration, create and delete configurations, and manipulate tables and lists.
See Chapter 2, “Using the Configuration API for the Sonic Management
Environment.”
● Runtime Packages — Use the Runtime API to monitor and manage running
containers and components in your management applications. Gather runtime
information and perform operations on manageable entities (containers, components)
in the Sonic environment.
See Chapter 3, “Using the Runtime API for the Sonic Management Environment.”
● Managemement Security — Use the Directory Service API—together with the
Configuration API and the Runtime API—to enable and configure runtime checking
of management permissions, and auditing of configuration and runtime events.
See Chapter 4, “Using the Directory Service API for Sonic Management Security.”
See the Progress SonicMQ Configuration and Management Guide for information about
using the Sonic Management Console (SMC) to access these components.
See the Progress SonicMQ Deployment Guide for detailed information about configuring
and running these components for your own application deployments.
See the Configuration API online documentation for detailed information about the
interfaces, classes, and methods contained in these interfaces. The API documentation is
available online at: sonic_install_root/Docs7.5/api/mgmt_api/index.html.
Setting Classpaths
Several interfaces provide a setClasspath(String) method:
● ActivationDaemonBean
● AgentManagerBean
● BackupBrokerBean
● BrokerBean
● CollectionsMonitorBean
● ContainerBean
● DirectoryServiceBean
While you can provide a delimited list for compound classpath entries, the delimiter in the
method is always semicolon (;) regardless of the target platform. For example:
setClasspath(“/usr/sonic;/opt/bin;foo/bar”)
When the defined configuration is deployed, the platform specific delimiter—colon under
UNIX and Linux, semicolon under Windows—will be appropriately generated in the
classpath.
Factory Operations
To connect the Configuration API to a running domain and Directory Service use one of
the following two factories:
● MFMgmtBeanFactory — Use this factory if you intend to configure only framework
components
● MQMgmtBeanFactory — Use this factory if you want to configure brokers and
clusters in addition to framework components
The MQMgmtBeanFactory factory extends MFMgmtBeanFactory and contains all the beans
related to the Sonic broker and framework.
Use factory operations to:
● Connect to and disconnect from a domain
● Get the names of all available configurations of a particular type
● Get an individual configuration
● Create, save, commit, and delete a configuration
● Rollback changes to a configuration (before committing the changes)
● Flush configurations cached in memory
Important Any configuration created or edited using the Configuration API is not stored to the
Directory Service until you explicitly save it and then commit to save to the Directory
Service.
When committing transactions, it is more efficient to use smaller transactional units. For
example, instead of committing a single transaction containing 1000 containers or 200
brokers, commit several smaller transactions containing fewer containers or brokers. In
general, your transactions should not include more than:
● 1000 users
● 500 containers
● 100 brokers
A newly created configuration has default attribute values where specified in the schema,
and might be missing some required attribute values. If some required values are missing,
you will receive an error message when you try to save the configuration, indicating that
the required values are missing. You can then provide these values and save the
configuration. The Configuration API online documentation details which attribute
values are required, and which are optional. Some attribute values are overwritable, and
can be customized for your configuration. See the Configuration API online
documentation at: sonic_install_root/Docs7.5/api/mgmt_api/index.html.
◆ To connect to a domain:
1. Create a factory.
For example:
For example:
util.setRequestTimeout(45);
factory.connect("Domain1", // DS Domain
"tcp://localhost:2506", // DS Location
"Administrator", // Username
"Administrator"); // Password
◆ To create a configuration:
❖ Use one of the create operations.
For example, to create a broker configuration:
IBrokerBean createBrokerBean(“/MyBrokers/Broker1”);
You can use customized code to handle broker-specific operations such as:
■ Setting the broker name
■ Creating a default acceptor and sample queues
This operation reverts the configuration to match what is in the Directory Service.
This operation dumps configurations cached in memory, along with all references to
any beans previously used.
The following example shows how to create a factory to connect to the Directory Service,
load a broker configuration, save and commit changes to the configuration, and flush the
configuration cached memory.
//Create a factory
domain.connect("Domain1", // DS Domain
"tcp://localhost:2506", // DS Location
"Administrator", // Username
"Administrator"); // Password
Creating a Container
The following code, excerpted from the sample CreateContainer.java, shows how to
create a container and set attribute values for the new container:
domain.connect("Domain1", // DS Domain
"tcp://localhost:2506", // DS Location
"Administrator", // Username
"Administrator"); // Password
...
{
IContainerBean container = domain.createContainerBean("/Containers/"
+ CONTAINER_NAME);
container.setContainerName(CONTAINER_NAME);
See “Create Container Java Sample” on page 47 and “Create Container JavaScript
Sample” on page 51 for information about samples that demonstrate creating a container
using the Configuration API.
...
String brokerComponentName = “myBroker1”;
IBrokerBean bbean = factory.getBrokerBean(“/Brokers/Broker1”);
IContainerBean.IComponentsType containerComponents = container.getComponents();
IContainerBean.IStartupParams startupParams = containerComponents.createEntry();
startupParams.setConfigRef( bBean );
startupParams.setAutoStart( true );
containerComponents.addEntry( brokerComponentName, startupParms );
...
Creating Queues
The following code, excerpted from the sample CreateQueues.java, shows how to create
a queue, add the queue to the list of queues for the broker, and modify some of the queue’s
parameters:
domain.connect("Domain1", // DS Domain
"tcp://localhost:2506", // DS Location
"Administrator", // Username
"Administrator"); // Password
// Load the Broker Bean for /Brokers/Broker1
IBrokerBean broker = domain.getBrokerBean(BROKER_VIEW_NAME);
IQueuesBean.IQueueAttributes queue;
queue = queues.createQueue();
queue.setQueueName(QUEUE_NAME);
// Add the new queue into the list of queues
queues.addQueue(QUEUE_NAME, queue);
domain.commit();
...
//Get the queue
queue = domain.getBrokerBean("/Brokers/Broker1").getQueuesBean()
.getQueues().getQueue(QUEUE_NAME);
// Change some of the queue values
queue.setQueueMaxSize(12345);
queue.setReadExclusive(true);
domain.commit();
...
See “Create Queues Java Sample” on page 46 and “Create Queue JavaScript Sample” on
page 50 for information about samples that demonstrate creating queues using the
Configuration API. The samples also demonstrate how to check to see if a queue by the
same name already exists for the broker.
Creating Routes
The following code, excerpted from the sample CreateRoutes.java, shows how to get a
list of defined routes for a broker, check to see whether a route already exists, add a route
to the broker, and modify some of the route’s parameters:
domain.connect("Domain1", // DS Domain
"tcp://localhost:2506", // DS Location
"Administrator", // Username
"Administrator"); // Password
// Load the Broker Bean for /Brokers/Broker1
IBrokerBean broker = domain.getBrokerBean(BROKER_VIEW_NAME);
// Get the bean containing all route information from this broker
IRoutesBean routes = broker.getRoutesBean();
IRouteDirectSoapBean.IRoutingDirectContentMapType contentMap =
newRoute.getDirectContentMap();
IRouteDirectSoapBean.IRoutingDirectContentMapItemType mapItem =
contentMap.createItem();
mapItem.setJmsType("XML");
mapItem.setHttpType("text/specialXML");
contentMap.addItem("item1", mapItem);
See “Create Routes Java Sample” on page 47 and “Create Routes JavaScript Sample” on
page 50 for information about samples that demonstrate creating routes using the
Configuration API. The samples also demonstrate how to check to see if a route by the
same name already exists for the broker.
package com.sonicsw.mq.mgmtapi.config.test;
import java.util.Iterator;
import java.util.List;
import com.sonicsw.ma.mgmtapi.config.IMgmtBeanBase;
import com.sonicsw.mq.mgmtapi.config.IAcceptorDirectBean;
import com.sonicsw.mq.mgmtapi.config.IAcceptorProtocolBean;
import com.sonicsw.mq.mgmtapi.config.IAcceptorTcpsBean;
import com.sonicsw.mq.mgmtapi.config.IAcceptorUrlReceiveBean;
import com.sonicsw.mq.mgmtapi.config.IAcceptorsBean;
import com.sonicsw.mq.mgmtapi.config.IBrokerBean;
import com.sonicsw.mq.mgmtapi.config.MQMgmtBeanFactory;
public class CreateAcceptors
{
public CreateAcceptors()
{
}
public static void main(String[] args)
{
try
{
MQMgmtBeanFactory domain = new MQMgmtBeanFactory();
domain.connect("Domain1",
"localhost:2506",
"Administrator",
"Administrator");
//Get the bean containing all acceptors info for this broker
IAcceptorsBean acceptorsBean = bbean.getAcceptorsBean();
//Get set of currently defined acceptors
IAcceptorsBean.IAcceptorMapType acceptors = acceptorsBean.getAcceptors();
//Create acceptor direct bean (MQ_ACCEPTOR_DIRECT)
IAcceptorDirectBean directBean = acceptorsBean.createAcceptorDirectBean();
directBean.setAcceptorName("DIRECT_ACCEPTOR");
directBean.setAcceptorUrl("http://localhost:8082");
IAcceptorDirectBean.ISslParametersType directParams =
directBean.getSslParameters();
//change enum attribute value
directParams.setSslCertificateChainForm("PKCS12");
//Get set of currently defined protocol acceptors for HTTP direct acceptors
IAcceptorDirectBean.IAcceptorProtocolMapType directType =
directBean.getProtocols();
//create Direct Protocol bean and add it to a set
IAcceptorProtocolBean directProtocolSubbean = directBean.createProtocolBean();
directProtocolSubbean.setDirectName("DIRECT_PROTOCOL");
//--- create content map entry
IAcceptorProtocolBean.IAcceptorDirectContentMapType directContentMap =
directProtocolSubbean.getDirectContentMap();
IAcceptorProtocolBean.IAcceptorDirectContentMapItemType item =
directContentMap.createItem();
item.setHttpType("text");
item.setJmsType("XML"); //possible values: XML, MULTIPART, TEXT, BYTES
directContentMap.addItem("first", item);
directType.addItem("DIRECT_PROTOCOL", directProtocolSubbean);
//--- create URLs
IAcceptorProtocolBean.IHttpDirectURLMapType urls =
directProtocolSubbean.getDirectUrlMap();
IAcceptorUrlReceiveBean urlReceiveBean =
directProtocolSubbean.createAcceptorUrlReceiveBean();
urlReceiveBean.setUser("myUser");
urlReceiveBean.setDestinationName("DESTINATION_NAME");
urlReceiveBean.setUrl("http://localhost:8082");
urls.addItem("DESTINATION_NAME", urlReceiveBean);
//commit changes to DS
domain.commit();
The following code example continues from the previous example, and shows how to
modify an acceptor:
if (acceptors.getItem(name)instanceof IAcceptorDirectBean)
{
directBean = (IAcceptorDirectBean) acceptors.getItem(name);
//modify acceptor's url
directBean.setAcceptorUrl("http:localhost:8089");
}
}
domain.commit();
domain.disconnect();
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
System.exit(0);
}
}
See the chapter “Configuring Acceptors” in the Progress SonicMQ Configuration and
Management Guide for information about other types of acceptors that can be configured
for a broker.
package com.sonicsw.mq.mgmtapi.config.test;
import com.sonicsw.ma.mgmtapi.config.MgmtException;
import com.sonicsw.mq.mgmtapi.config.IBrokerBean;
import com.sonicsw.mq.mgmtapi.config.IClusterBean;
import com.sonicsw.mq.mgmtapi.config.MQMgmtBeanFactory;
import java.util.*;
public class AddBrokerToCluster
{
private static String CLUSTER_VIEW_NAME = "/Cluster1";
public AddBrokerToCluster()
{
}
public static void main(String[] args)
{
try
{
MQMgmtBeanFactory domain = new MQMgmtBeanFactory();
domain.connect("Domain1",
"localhost",
"Administrator",
"Administrator");
//Create cluster bean
IClusterBean cbean = domain.createClusterBean(CLUSTER_VIEW_NAME);
//get members of a cluster
IClusterBean.IClusterMembers members =
domain.getClusterBean("/Cluster1").getClusterMembers();
//Add broker to the cluster
//Assumes that non-secure broker "Broker2" exists in DS
IBrokerBean bbean = domain.getBrokerBean("/Brokers/Broker2");
members.addItem("Broker2", bbean);
//Note: Throw exception if we try to add security-enabled broker to non_secure
//cluster (Cluster1 in our case)
domain.saveClusterBean(cbean);
domain.commit();
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
System.exit(0);
}
}
Configuring Security
The following code, excerpted from the sample CreateRoutes.java, shows how to create
a user in the default authentication domain, create a group in the default authentication
domain, create an access control list (ACL) in the default authorization policy, and create
a quality of protection (QoP) setting in the default authorization policy.
First, connect to the domain and create a user, group, ACL, and QoP in the Authentication
Domain, then commit the changes to the Directory Service, as shown:
domain.connect("Domain1", // DS Domain
"tcp://localhost:2506", // DS Location
"Administrator", // Username
"Administrator"); // Password
//create a new user in Authentication Domain
createUser(domain);
//create a new group in Authentication Domain
createGroup(domain);
//create a new ACL in Authorization Policies
createACL(domain);
//create a new Qop in Authorization Policies
createQop(domain);
//propagate all changes to the DS
domain.commit();
Create a new user in the authentication domain, having a user name and password:
Create a group in the authentication domain. Check whether the group already exists.
Set a group name, create a group member, and add the member to the group, as shown:
Create a QoP for the authentication policy, setting QoP parameters including resource
name and type:
See “Security Java Sample” on page 48 and “Security JavaScript Sample” on page 51 for
information about samples that demonstrate implementing security using the
Configuration API.
CRL Checking
setDoCrlChecking
public void setDoCrlChecking(boolean value)
Sets the attribute for DO_CRL_CHECKING to the specified boolean value.
getDoCrlChecking
public boolean getDoCrlChecking()
Gets the attribute for DO_CRL_CHECKING as a boolean value. See also
getDoCrlCheckingMetaData() to return the IMgmtAttributeMetaData value.
createCaList
public IBrokerBean.ICaListType createCaList()
Creates an instance of an ICaListType attribute. This new instance is not currently part of
the configuration. Once it has been configured, set into the configuration using the
setCaList method.
setCaList
public void setCaList(IBrokerBean.ICaListType value)
Sets the attribute for CA_LIST to the specified ICaListType value.
getCaList
public IBrokerBean.ICaListType getCaList()
Gets the attribute for CA_LIST.
See also getCaListMetaData() to get attribute metadata for CA_LIST.
createPrimaryLdapServerConnectionProperties
public IBrokerBean.ILdapConnectionType
createPrimaryLdapServerConnectionProperties()
Creates an instance of an ILdapConnectionType attribute. This new instance is not
currently part of the configuration. After it is configured, set it into the configuration using
the setPrimaryLdapServerConnectionProperties method to return the new
ILdapConnectionType bean.
setPrimaryLdapServerConnectionProperties
public void setPrimaryLdapServerConnectionProperties
(IBrokerBean.ILdapConnectionType value)
Sets the attribute for PRIMARY_LDAP_SERVER_CONNECTION_PROPERTIES to the specified
ILdapConnectionType value.
getPrimaryLdapServerConnectionProperties
public void setPrimaryLdapServerConnectionProperties
(IBrokerBean.ILdapConnectionType value)
Gets the value of setPrimaryLdapServerConnectionProperties. See also
getPrimaryLdapServerConnectionPropertiesMetadata() to return the
IMgmtAttributeMetaData value.
createBackupLdapServerConnectionProperties
public IBrokerBean.ILdapConnectionType
createBackupLdapServerConnectionProperties()
Creates an instance of an ILdapConnectionType attribute. This new instance is not
currently part of the configuration. After it is configured, set it into the configuration using
the setBackupLdapServerConnectionProperties method to return the new
ILdapConnectionType bean.
setPrimaryLdapServerConnectionProperties
public void setPrimaryLdapServerConnectionProperties
(IBrokerBean.ILdapConnectionType value)
Gets the value of setPrimaryLdapServerConnectionProperties. See also
getPrimaryLdapServerConnectionPropertiesMetadata() to return the
IMgmtAttributeMetaData value.
getBackupLdapServerConnectionProperties
public void setBackupLdapServerConnectionProperties
(IBrokerBean.ILdapConnectionType value)
Gets the value of setBackupLdapServerConnectionProperties. See also
getBackupLdapServerConnectionPropertiesMetadata() to return the
IMgmtAttributeMetaData value.
import com.sonicsw.mq.mgmtapi.config.*;
import com.sonicsw.mq.mgmtapi.config.*;
import com.sonicsw.mq.mgmtapi.config.constants.*;
Note If you type the name of an advanced property incorrectly, you get a runtime exception
when you try to set the attribute.
Configuration Names
All operations on collections, containers, brokers, clusters, queues, and routings use
logical names. These names allow you to name and organize your components into a
hierarchical structure of your choosing. The configuration name consists of the path name
and the component name. For example, the name: /Brokers/Broker1 describes a broker
configuration, Broker1, that is stored in the folder Brokers.
You must use logical names in your applications to refer to all configurations, including
containers, collections, and brokers. For example, you can define a variable for a broker
as:
private static final String BROKER_NAME = "/Brokers/Broker1"
For more information about names, see the chapter “Introduction to Configuration” in the
Progress SonicMQ Configuration and Management Guide.
You can access maps in inner classes. The Configuration API includes methods to add and
delete from a map keyed off a name. Code Sample 2 shows the IMgmtMapBase interface.
Code Sample 2. IMgmtMapBase Interface
public interface IMgmtMapBase extends IMgmtSubBeanBase
{
public List getKeyNames() throws MgmtException;
Code Sample 3, from the CreateQueues sample application, shows how to:
● Get a queue from a map
● Create a queue
● Add a queue to the queues map
● Save the bean including the new queue
● Commit the save operation
IQueuesBean.IQueueAttributes queue;
try
{
// check if the specified queue already exists
queue = queues.getQueue(QUEUE_NAME);
queue = queues.createQueue();
queue.setQueueName(QUEUE_NAME);
// save bean
domain.saveBrokerBean(broker);
domain.commit();
You can also access indexed lists in inner classes. The Configuration API includes
methods to add, insert, and delete from an indexed list. Code Sample 4 shows the
IMgmtListBase interface.
The following subdirectories provide java and JavaScript Configuration API samples:
● javaConfigBean — A Java example showing how to configure the Sonic Management
Environment using the Configuration APIs
● jsConfigBean — A JavaScript example showing how to configure the Sonic
Management Environment using the Configuration APIs
These directories contain scripts that run the samples or configure the environment in
which to run the samples.
All samples directories have a readme.txt that describes the contents more completely.
Where appropriate, the readme.txt file contains instructions for running more complex
samples.
Each sample is described in more detail in the following sections. These samples are
based on a typical installation of SonicMQ where the default settings were accepted, such
as domain name, container name, and broker port. If you have different settings, you must
change the sample code accordingly and recompile.
Important To execute the javaConfigBean sample you must install the SonicMQ container.
Important The command files for administrative applications specifically set the command line to
launch the JRE with the directive -Xbootclasspath/p: explicitly identifying
xercesImpl.jar, and xmlParserAPIs.jar
When you create launch scripts for your applications, be sure to include these
bootclasspath settings as well as the environment and classpath settings.
Important To execute the jsConfigBean sample you must have installed the SonicMQ container.
Each sample script is described in more detail in the following sections. These samples
are based on a typical installation of SonicMQ where the default settings were accepted,
such as domain name, container name, and broker port. If you have different settings, you
must change the sample code accordingly and recompile.
Chapter 3 describes using the SonicMQ Runtime API, which provides programmatic
access to the Sonic Management Environment. This chapter contains the following
sections:
● “Overview of the Runtime API” — Explains the option of using the JMX APIs or the
Proxy APIs in your runtime programming
● “Manageable Components in the Runtime API” — Explains various Sonic
components using the Runtime API
● “Management Attributes” — Describes component management attributes associated
with runtime configuration and behavior
● “Management Operations” — Describes management operations for runtime actions
that a component can perform
● “Metrics” — Describes metrics and alerts exposed by the broker and agent in the
Sonic Management environment
● “Management Notifications” — Describes metric alert notifications available for
manageable components in the Runtime API
● “Filtering Notifications” — Explains how to access sample applications to help you
get started with the Runtime API
Programming Options
You can program using either:
● JMX APIs— Reflective/dynamic style interface based on JMX interfaces presented
through a JMS/JMX Connector Client
● Proxy APIs — Simplified programming through a typed/static style interface
As shown in Figure 1, the proxy APIs provide an interface that masks the complexity of
the JMS/JMX connector client.
Proxies
JMX APIs
The JMS/JMX Connector Client provides a remote interface to the JMX MBean Servers
located in each container. The connector follows a similar pattern to other JMX
connectors in the public domain, however it has the following advantages:
● A single connector can be used to address any container and its components
(MBeans) within a domain; this is achieved through the JMX domain and MBean
naming patterns used by the Sonic Management Environment.
● The connector is built on the SonicMQ messaging transport and thus provides a high
level of reliability for management communications and many options for securing
such communications (even across the Internet and through firewalls).
● The connector transparently handles short term transient connection failures and
provides a configurable request timeout mechanism.
Code Sample 5 shows the JMX pattern for creating a connector through the use of a
connector address object.
Code Sample 5. Creating a JMS Connector Client
Hashtable env = new Hashtable( );
env.put(“ConnectionURLs", "tcp://localhost:2506");
env.put("DefaultUser", "Administrator");
env.put("DefaultPassword", "Administrator");
JMSConnectorAddress address = new JMSConnectorAddress(env);
JMSConnectorClient connector = new JMSConnectorClient( );
connector.connect(address)
..
connector.disconnect( );
Note The Proxy APIs require creation of a connector, although all subsequent programming is
done through the proxy interface (see “Sonic Proxy APIs” on page 57).
The connector has two modes, one that allows the connector to communicate to all JMX
MBean Servers and another that dedicates a connector to a single JMX MBean Server
(equivalent to a Sonic Management Environment container). To support the former
(default) mode, certain MBeanServer methods are not supported on the connector when
in this mode. The unsupported methods are those that do not take a JMX ObjectName in
their parameter list and thus cannot take advantage of the JMX domain and MBean
naming patterns used by the Sonic Management Environment.
See the Runtime API online documentation for information about the connector address.
This documentation is located at sonic_install_root/Docs7.5/api/mgmt_api/index.html in
the package com.sonicsw.mf.jmx.client.
The following naming pattern is used by the Sonic Management Environment to uniquely
address a component:
sonicdomain.container:ID=component
The JMX API provides runtime programming access in the following ways:
● Attributes — Use get and set methods by attribute name.
● Operations — Invoke methods by name and signature.
● Notifications — Add and remove subscriptions to notifications.
For a sample application that uses the JMX API, see “JMX DynamicMBean Sample” on
page 78. For information about the JMX interface and JMX connectors, see the JMX 1.2
documentation available from the Sun Web site at:
http://java.sun.com/products/JavaManagement/
The proxy APIs provide runtime programming access in the following ways:
● Attributes — Get and set attributes by name:
❍ attributeType getattributeName
❍ attributeType setattributeName
● Operations — Invoke methods by name and signature. For example, void shutdown()
● Notifications — Add and remove subscriptions to notifications
The proxy APIs can be used in custom Java applications or called from scripting
languages that support Java objects such as JavaScript.
The Runtime API provides factories to create the proxy implementations of the agent,
agent manager, activation daemon, collections monitor, Directory Service, and broker
interfaces. See the Runtime API online documentation for detailed information about
factories, interfaces, classes, and methods. This documentation is located at:
sonic_install_root/Docs7.5/api/mgmt_api/index.html.
IBrokerProxy brokerProxy =
MQProxyFactory.createBrokerProxy(connector, brokerName);
..
// Typed interface allows method to return an array list without casting
For sample applications that use the proxy APIs, see “Java Proxy API Samples” on
page 85 and “JavaScript Proxy API Samples” on page 89. These samples provide both
Java and JavaScript programming examples.
Agent
The agent component provides an API to manage a container and is synonymous with the
container in this discussion. Each container hosts exactly one agent component. The
IAgentProxy is a remote interface to a runtime instance of an agent. Management
attributes and operations are documented in this interface. See the Runtime API online
documentation at: sonic_install_root/Docs7.5/api/mgmt_api/index.html for more
information about the IAgentProxy interface, located in the package
com.sonicsw.mf.mgmtapi.runtime.
An implementation of this interface can be created using the MFProxyFactory class. Each
implementation instance is valid for the life of the provided JMS/JMX connector and
MBean ObjectName. The implementation is built using remote JMX MBeanServer calls.
For more information about JMX, see the following:
● Sun’s JMX specification available from the Sun Web site at:
http://java.sun.com/products/JavaManagement/
● Sonic Runtime API online documentation available at:
sonic_install_root/Docs7.5/api/mgmt_api/index.html
Agent Manager
The agent manager provides a central point of access to manage the operational aspects
of the whole domain. The agent manager maintains the current runtime status of the whole
domain in two ways:
● After determining an initial state for each container in the domain, the agent manager
applies updates to the aggregated state as it receives state change notifications from
individual containers.
● The agent manager periodically polls each container for its status.
When the agent manager cannot contact a container, the container's status is assumed to
be offline. The agent manager may fail to contact the container due to container failure,
the fact that the container was never started, or due to a long-term communications failure.
The polling interval can be configured for each container so that no polling occurs or so
that each container is polled at a configured interval. If polling is not enabled, it is possible
the agent manager will not detect some container failures (those that prevent state change
notifications from being sent, such as a crash of the host machine on which the container
is running).
A single agent manager component (or fault tolerant pair) is allowed for a given domain.
The Sonic Management Console allows configuration of a single container in the domain
to host the agent manager component (or a container for each of the recovery and backup
agent managers for the deployment of a fault tolerant pair).
The public interface IAgentManagerProxy is a remote interface to the agent manager
runtime instance. Management attributes and operations are documented in this interface.
See the Runtime API online documentation at
sonic_install_root/Docs7.5/api/mgmt_api/index.html for more information about the
IAgentManagerProxy interface, located in the package com.sonicsw.mf.mgmtapi.runtime.
Activation Daemon
An Activation Daemon provides a way to launch new child containers as spawned
processes of the container hosting the Activation Daemon. This allows new containers to
be launched by remote administrative clients without the administrator having to log on
to that host. A typical use would be to have the container hosting the Activation Daemon
launched as a Windows service on Windows platforms or a startup process under
UNIX/Linux.
An Activation Daemon monitors the health of its child containers and, depending on
configured rules, restarts those containers upon failure. Normally one Activation Daemon
is deployed per host. Multiple Activation Daemons can be created per domain. Containers
can be launched by the Activation Daemon:
● At Activation Daemon startup time
● At a configured time
● After a container failure (up to a configurable number of retries)
● On demand from the Sonic Management Console (see the Progress SonicMQ
Configuration and Management Guide), or through the Management API
The public interface IActivationDaemonProxy is a remote interface to a runtime instance
of an ActivationDaemon. Management attributes and operations are documented in this
interface. See the Runtime API online documentation at Docs7.5/api/mgmt_api for more
information about the IActivationDaemonProxy interface, located in the package
com.sonicsw.mf.mgmtapi.runtime.
Collections Monitor
A collections monitor provides a mechanism to monitor and record runtime information
across collections of components. In particular, a collections monitor can be configured to:
● Forward notification generated by the components in a collection
● Store and aggregate notifications generated by the components in a collection
● Store and aggregate metrics supplied by the components in a collection
The management API exposed by the collections monitor allows access to both
aggregated monitoring information and the underlying history used to generate the
aggregated data.
The public interface ICollectionsMonitorProxy is a remote interface to the collections
monitor instance. Management attributes and operations are documented in this interface.
See the Runtime API online documentation at
sonic_install_root/Docs7.5/api/mgmt_api/index.html for more information about the
ICollectionsMonitorProxy interface, located in the package
com.sonicsw.mf.mgmtapi.runtime.
An implementation of this interface can be created using the MFProxyFactory class. Each
implementation instance is valid for the life of the provided JMS/JMX connector and
MBean ObjectName. The implementation is built using remote JMX MBeanServer calls.
Directory Service
The Directory Service provides a service through which you can configure a Sonic
deployment and manage the storage of the configuration information. Although these two
aspects are exposed through the management API of the Directory Service, an additional
API, the Configuration API (see Chapter 2, “Using the Configuration API for the Sonic
Management Environment”), is used to hide the complexities of configuration and the
schema of the underlying configuration store. However, the operational aspects of the
Directory Service (for example, taking storage backups and controlling fault tolerant
behavior) are provided in the IDirectoryServiceProxy interface.
The public interface IDirectoryServiceProxy is a remote interface to a runtime instance
of a DirectoryService. Management attributes and operations are documented in this
interface. See the Runtime API online documentation at
sonic_install_root/Docs7.5/api/mgmt_api/index.html for more information about the
IDirectoryServiceProxy interface, located in the package
com.sonicsw.mf.mgmtapi.runtime.
Broker
The public interface IBrokerProxy is a remote interface to a runtime instance of a
SonicMQ broker. Management attributes and operations are documented in this interface.
See the Runtime API online documentation at
sonic_install_root/Docs7.5/api/mgmt_api/index.html for more information about the
IBrokerProxy interface, located in the package com.sonicsw.mq.mgmtapi.runtime.
Management Attributes
All components have management attributes with settings associated with the component
and its runtime configuration and behavior.
Management attributes can have some or all of the following features:
● Provide an initial value based on a component's configuration that is stored in the
Directory Service
● Be readable via the component's Runtime API
● Be settable via the component's Runtime API, so that when the value is reset, the
component's behavior will change appropriately at that time
● Be settable via dynamic changes to the component's configuration stored in the
Directory Service that are then propagated by the Directory Service to the component
If an attribute value is settable via the Runtime API, that change is transient. The next time
the component is loaded, the value is set to either its default initial value or, if appropriate,
its configuration value.
Dynamic configuration changes that store an attribute value in the Directory Service, and
that are subsequently propagated to and handled by the component, will overwrite an
transient attribute value set through the Runtime API.
The following table summarizes management attributes available for the agent, agent
manager, activation daemon, collections monitor, Directory Service, and broker, as well
as additional attributes available for the agent and broker. See the Runtime API online
documentation for complete summaries and descriptions of operations available in each
interface, located at: sonic_install_root/Docs7.5/api/mgmt_api/index.html.
Interface:
ICollectionsMonitorProxy
Management Operations
All components have management operations that describe runtime actions that a
component can perform.
The following table summarizes management operations available for the agent, agent
manager, activation daemon, collections monitor, Directory Service, and broker. See the
Runtime API online documentation for complete summaries and descriptions of
operations available in each interface. This documentation is located at:
sonic_install_root/Docs7.5/api/mgmt_api/index.html.
Metrics
A metric is an interpretation of a statistic. There can be multiple interpretations of a single
set of statistical data such as, total, average, maximum, and minimum. A metric is a single
value at an instance in time calculated from raw statistical data, for example, a counter, or
a rate per second calculated over a collection interval.
Metrics are exposed by components managed within the Sonic Management environment.
The following components expose metrics:
● Agent
● SonicMQ Broker
Metrics can be selectively and dynamically enabled and disabled at runtime (enabling is
maintained across container restarts). A certain amount of overhead (depending on the
particular metric) is associated with statistical data collection and metric interpretation.
To minimize overhead, all metrics are disabled by default.
Metrics can be enabled, disabled, and gathered using either the Sonic Management
Console or the Runtime API.
Metrics are classified into trees of related metric types. Each metric's path in the tree is
represented using a list of strings, where each token describes a branch or leaf. The
canonical form of the path is displayed as a period (.) delimited list, for example:
"system.memory.CurrentUsage".
Instance Metrics
Instance metrics are used to apply the same data collection and interpretation to multiple
instances of similar entities maintained by a component. For example, the SonicMQ
broker provides instance metrics for queues and connections.
Instance metrics can be dynamically enabled and disabled at runtime for specific
instances or instances that match a common pattern (for example,
"queue.messages.Count.SampleQ*"). This allows for gathering metrics pertaining to
specific entities of interest.
Enabling instance metrics does not require that a particular entity be present at the time
of metric enabling. For example, the SonicMQ broker exposes instance metrics for
connections, and metrics for a particular connection identity can be enabled prior to the
establishment of that particular connection identity (no data collection overhead will be
incurred until the connection is established).
Alerts
Certain metrics allow alerts to be defined for the purpose of asynchronous notification
when their associated thresholds are exceeded. Which metrics allow alerts to be specified
is documented in a particular component type's documentation. For example, the
SonicMQ broker allows alerts to be specified for the rate of messages delivered to a
particular connection identity.
The term used for the notification generated as a result of a threshold having been
exceeded is an alert notification. Alert notifications are named based on their source
metric, for example, application.alert.connection.messages.ReceivedPerSecond. These
notifications encapsulate the actual value of the metric and the time the threshold was
exceeded.
Where alerts are allowed, multiple alerts may be specified. Additionally some metrics
allow definition of both high and low threshold alerts with different threshold values.
Metrics Summary
The following table summarizes the metrics available in the agent and broker interfaces:
Component Metrics
Agent ● Memory usage
Package: ● Management thread pool
com.sonicsw.mf.mgmtapi.runtime
Interface:
IAgentProxy
Note The collections monitor interface provides aggregate metrics for a selected collection of
brokers. See the interfaceICollectionsMonitorProxy in the package
com.sonicsw.mf.mgmtapi.runtime.
Note Broker queue metrics are provided for the system queue SonicMQ.routingQueue but not for
the system queue SonicMQ.deadMessage. You can workaround that constraint by having
applications specify user-defined dead message queues. See the chapter
“Guaranteeing Messages” in the Progress SonicMQ Application Programming Guide for
more information.
See the Runtime API online documentation for complete summaries and descriptions of
metrics available in each interface. This documentation is located at:
sonic_install_root/Docs7.5/api/mgmt_api/index.html.
Management Notifications
Management notifications are published when significant events occur. To receive alert
notifications, your application must have metrics enabled and thresholds defined for the
notification you want to receive (see “Metrics” on page 68).
Management notifications are published by the following components:
● Agent
● Agent Manager
● Activation Daemon
● Collections Monitor
● Directory Service
● SonicMQ Broker
A notification encapsulates information about a significant event that has occurred during
the execution of a container or a component. The notification includes:
● Type of notification
● Source of the notification
● Time the notification was generated
● Attributes describing details about the event that generated the notification
Notifications are received by management clients once they have subscribed to them on a
particular component. You can subscribe to and view notifications using either the Sonic
Management Console or the Runtime API.
Notifications are classified into trees of related types. Each notification's path in the tree
is represented using a list of strings, where each token describes a branch or leaf. The
canonical form of the path is displayed as a period (.) delimited list. For example:
system.state.Online.
Notifications Summary
The following table summarizes notifications available for the agent, agent manager,
activation daemon, collections monitor, Directory Service, and broker. See the Runtime
API online documentation for complete summaries and descriptions of notifications
available in each interface. This documentation is located at:
sonic_install_root/Docs7.5/api/mgmt_api/index.html.
Important Metrics must be enabled and alert thresholds defined in order to receive alert
notifications. See “Metrics” on page 68.
Component Notifications
Agent ● Container state
Package: ● Component loading (other than startup)
com.sonicsw.mf.mgmtapi.runtime ● Trace log status
Interface: ● Metric alerts
IAgentProxy
Component Notifications
Collections Monitor ● Collections Monitor state
Package: ● Monitored threshold exceeded
com.sonicsw.mf.mgmtapi.runtime
Interface:
ICollectionsMonitorProxy
getAttributes
public AttributeList getAttributes(java.lang.String[] attributeNames)
Gets the values of several attributes of an AgentManager component. Getting multiple
attribute values at once is typically more efficient than getting individual attribute values.
Readable attributes (and their datatypes) exposed by an AgentManager that tune the
polling intervals and threads (useful features in large scale deployments) are:
● RefreshInterval (java.lang.Integer)
● CollectionInterval (java.lang.Integer)
● MinPollingThreads (java.lang.Integer)
● MaxPollingThreads (java.lang.Integer)
setRefreshInterval
public void setRefreshInterval(java.lang.Integer value)
Sets the value (in seconds) of the RefreshInterval attribute.
setCollectionInterval
public void setCollectionInterval(java.lang.Integer value)
Sets the value (in minutes) of the CollectionInterval attribute.
74 Progress SonicMQ Administrative Programming Guide V7.5
Management Notifications
Filtering Notifications
Methods in the Management API let you create notification listeners and define the
filtration by notification types and attributes.
About Filters
Java Management Extensions (JMX) supports filtering of notifications such that a
management client can be configured to receive only a subset of the notifications
generated by a given source. JMX provides a simple notification type prefix filter.
SonicMQ additionally provides a more sophisticated filtering mechanism that allows
filtering by specifying regular expressions for the notification type and any number of the
attributes of the notification. Only notifications that match the specified regular
expressions are sent to the listening management application.
Within the selected notification types, the attributes of selected notifications can be
filtered based on an attribute value pattern also using regular expression syntax. When
only attribute expressions are specified in the filter and no notification types, all
notifications are evaluated against the attribute value patterns.
setTypeExpression
public void setTypeExpression(String expression)
Enable notifications of the type and the specified expression to be sent to the listener.
Setting the pattern to null clears a previously set expression.
getTypeExpression
public String getTypeExpression()
Gets the currently defined regular expression to be used for filtering by notification
type.
setAttributeExpression
public void setAttributeExpression(String attributeName, String expression);
Enables notifications with an attribute that matches the specified expression (and any
defined type expression or other attribute expressions) to be sent to the listener.
Setting the expression to null clears a previously set expression for the given attribute
name.
getAttributeExpressions
public Map getAttributeExpressions();
Gets previously set attribute expressions keyed by attribute.
clearAllAttributeExpressions
public void clearAllAttributeExpressions();
Clear all previously defined attribute name expressions.
Rules in Filters
The following rules apply to filters:
● Filters use regular expression syntax.
● Text is case sensitive.
● When no filter expression is defined, all notifications are filtered out.
● The structure of an expression string is Type Attribute Attribute ... which means that
if you intend to use a type filter, state it first, the add zero or more attribute filters to
further qualify the results of the previous part of the test.
For more information about the features of this sample, see the comments in the file:
MQ7.5_install_root\samples\Management\runtimeAPI\javaJMX\MgmtCLI.java.
Important To execute the CLI sample you must already have installed the SonicMQ container.
4. In the CLI shell you can get command help by typing a command followed by a
question mark (?) character. For example:
> subscribe ?
Most shell commands expect an argument specifying the JMX object name (or context)
to which the command should be applied. A default object name (or context) can be set
using the command cc, in which case the object name (or context) can be omitted from
the arguments.
The CLI commands that follow are supported by this sample.
capture
capture [<domain>.<container>:ID=<id>] <metric name>{,<metric name>...}
Captures and displays the values of given metric(s) in the given component context. If no
component context is provided, the current context is used. Multiple metric names must
be supplied as a comma separated list.
cc
cc <domain>.<container>:<id>
disable
disable [<domain>.<container>:ID=<id>] <metricName>{,<metricName>...}
Disables the given metric(s) in the given component context. If no component context is
provided, the current context is used. Multiple metric names must be supplied as a comma
separated list. Assumes the given metrics are dynamic, and therefore can be disabled.
For example, disable the thread count metric on the agent as follows:
enable
enable [<domain>.<container>:ID=<id>] <metricName>{,<metricName>...}
Enables the given metric(s) in the given component context. If no component context is
provided, the current context is used. Multiple metric names must be supplied as a comma
separated list. Assumes the given metrics are dynamic, and therefore can be enabled.
For example, you can enable the thread count metric on the agent, then capture that
metric, as shown:
exit
exit
get
get [<domain>.<container>:ID=<id>] <attributeName>{,<attributeName>,...}
Gets the current values of the requested attributes for the given component context. If no
component context is provided, the current context is used. Multiple attribute names must
be supplied as a comma separated list enclosed in quotes.
For example, to get the ConfigID attribute for the component
Domain1.Container1:ID=Broker1, enter the get command, as shown:
invoke
invoke [<domain>.<container>:ID=<id>] <operationName> {param1,{param2...}}
Open the log file to confirm it was created with the name and location you specified.
set
set [<domain>.<container>:ID=<id>] <attributeName> <attributeValue>
Resets the value of the given attribute of the given component context. If no component
context is provided, the current context is used.
For example, use get and set commands to retrieve and reset a component attribute value.
In this case, retrieve the metrics refresh interval for Broker1 and reset it to 30:
show
show {attributes|operations|notifications|metrics} [<domain>.<container>:<id>]
Shows the metrics currently enabled in the given component context. If no context is
provided, the current context is used.
show keywords
Shows the runtime state of the domain, container or component specified by the given
context. If no context is provided, the current context is used.
ConfigID
- Configuration identity.
Classname
- Component classname.
ReleaseVersion
- Component release version.
State
- Execution state.
StateString
- Execution state description.
LastError
- Last (uncleared) error condition.
LastErrorLevel
- Last (uncleared) error severity.
LastErrorLevelString
- Last (uncleared) error severity description.
Uptime
- Execution time (milliseconds).
SharedNamespace
- Common component namespace.
Classpath
- Component classpath.
TraceMask
- Debug bit mask.
TraceMaskValues
- Possible TraceMask values.
MetricsRefreshInterval
- The number of seconds between refreshing of the statistical information on which metrics
are based.
MetricsCollectionInterval
- The number of minutes over which historical statistical information on which metrics are
based is collected.
BrokerName
- The configured broker name.
RoutingNodeName
- The configured routing node name.
ClusterName
- The name of the cluster to which the broker belongs (empty if the broker is not a member
of a cluster).
SecurityEnabled
- A flag indicating if the broker has security enabled.
ReplicationState
- 0=STARTUP,1=WAITING,2=STANDALONE,3=ACTIVE,4=STANDBY,5=ACTIVE_SYNC,6=STANDBY_SYNC
ReplicationStateString
- The current Replication State
ReplicationType
- PRIMARY or BACKUP
You can use the get command to get the value of any of these attributes (see “get” on
page 80).
subscribe
subscribe
[<domain>.<container>:ID=<id>]<notificationType>{,<notificationType>...}
unsubscribe
unsubscribe
[<domain>.<container>:ID=<id>]<notificationType>{,<notificationType>...}
The samples make use of proxies that mask the underlying JMX (reflective) calls. A
sample that directly uses the JMX API can be found in the directory:
samples\Management\runtimeAPI\javaJMX
Each sample is described in more detail in the following sections. When you run the
samples, each application interactively prompts for the specific information it requires.
Important To execute the javaProxy samples you must already have installed the SonicMQ
container.
Shutdown.java
The Shutdown class and the static class it calls demonstrate using Java to:
● Create a JMS JMX Connector Client
● Create a runtime proxy for a component (in this case, the agent component that
manages the container process)
● Execute an operation exposed through the Runtime API of the agent component (in
this case, an operation to shutdown the container)
After executing the program you should see the container shutdown. The shutdown can
be observed by looking at the stdout for the container process or viewing the runtime
status of the container in the Sonic Management Console.
ShowQueues.java
The ShowQueues class and the static class it calls demonstrate using Java to:
● Create a JMS JMX Connector Client
● Create a runtime proxy for a component (in this case, the broker component)
● Execute an operation exposed through the Runtime API of the broker component (in
this case, an operation to get the queues managed by the broker)
After executing the program you should see the a list of queues and the number of
messages held on each queue managed by the broker. The results can be compared with
those shown in the Manage tab of the Sonic Management Console after selecting the
broker's Queues node.
ClearQueues.java
The ClearQueues class and the static class it calls demonstrate using Java to:
● Create a JMS JMX Connector Client
● Create a runtime proxy for a component (in this case, the broker component)
● Execute an operation exposed through the Runtime API of the broker component (in
this case, an operation to clear messages from a particular set of queues managed by
the broker)
After executing the program you may want to execute the ShowQueues class in order to see
the effects of the ClearQueues class.
NotificationReporter.java
The NotificationReporter class and the static class it calls demonstrate using java to:
● Create a JMS JMX Connector Client
● Create a runtime proxy for a component (in this case, the broker component)
● Create a notification listener that will display management notifications emitted by
the broker
This program will continue to listen and display received notifications until it is
terminated. Use Ctrl-C to terminate the program. For each notification received, the
notification name (or type) and the source of the notification will be displayed.
Notifications, such as those generated when clients connect and disconnect, can be
created using the JMS Test Client application or running one of the programs described
in this section (for example, ShowQueues) from another shell.
FilteringNotificationReporter.java
The FilteringNotificationReporter class and the static class it calls demonstrate using
Java to:
● Create a JMS JMX Connector Client
● Create a runtime proxy for a component (in this case, the broker component)
● Create a notification listener and regular expression based notification filter that will
display a filtered set of management notifications (based on both the notification type
and attribute values) emitted by the broker
This program will continue to listen and display received notifications until it is
terminated. Use Ctrl-C to terminate the program. For each notification received, the
notification name (or type) and the source of the notification is displayed.
The code segment that does the filtering in this example is:
// create a Sonic expression based filter and setup some filtering rules
ExpressionBasedNotificationFilter filter = new ExpressionBasedNotificationFilter();
Notifications generated when clients subscribe and unsubscribe can be created by using
the JMS Test Client application and TopicPubSub samples such as Chat.
BackupDS.java
The BackupDS class and the static class it calls demonstrate one way to perform a backup
of the Directory Service storage, using Java to:
● Create a JMS JMX Connector Client.
● Create a runtime proxy for a component (in this case the Directory Service
component that manages the domain's configuration store).
● Set an attribute exposed through the Runtime API of the Directory Service
component in order to place the Directory Service in a state under which it is valid to
take an online backup of the domain's configuration store.
● Prompt the user to perform the backup (tar, copy, etc.) and indicate when the backup
is complete.
● Reset the online backup attribute in order to place the Directory Service back to a state
where it can handle further configuration updates.
As the Directory Service is placed in and out of the online backup mode, you can observe
related messages on the Directory Service’s container standard output.
As an additional exercise, you can try executing your backup process directly from the
program, replacing the standard input prompting.
DBCompaction.java
The DBCompaction class shows how to invoke a database compaction reques remotely, and
check on its status, using Java to:
● Set the administrative connection information, broker identity, and working directory.
● Enable a forceStop that forces the db compaction operation to stop after the specified
time interval.
The broker whose data storage you want to compact must be in a stopped state yet the
management container that hosts that broker must be running. To do this, you must do one
of the following:
● Start the management container that hosts the broker. Then, on the Manage tab in the
SMC, right-click on the broker, and choose Operations > Stop.
● On the SMC Configure tab, right-click on the hosted broker component in the
management container, choose Properties, and then clear the Auto Start option. Then
start the management container. (Select the option again after you complete the
compaction task.)
The application initiates the operation and does not report on its results.
Each sample script is described in more detail in the following sections. Each script
assumes the installation default values were selected for domain name, container name,
broker port, etc. If you made non-default selections during installation, you must modify
the scripts appropriately.
Important To execute the jsProxy samples you must already have installed the SonicMQ container.
Shutdown.js
The Shutdown.js script and the script functions it calls demonstrate using JavaScript to:
● Create a JMS JMX Connector Client
● Create a runtime proxy for a component (in this case the agent component that
manages the container process)
● Execute an operation exposed through the Runtime API of the agent component (in
this case an operation to shutdown the container)
After executing this script you should see the container shutdown. The shutdown can be
observed by looking at the stdout for the container process or viewing the runtime status
of the container in the Sonic Management Console.
ShowQueues.js
The ShowQueues.js script and the script functions it calls demonstrate using JavaScript to:
● Create a JMS JMX Connector Client
● Create a runtime proxy for a component (in this case, the broker component)
● Execute an operation exposed through the Runtime API of the broker component (in
this case, an operation to get the queues managed by the broker)
After executing this script you should see the a list of queues and the number of messages
held on each queue managed by the broker. The results can be compared with those shown
in the Manage tab of the Sonic Management Console after selecting the broker's Queues
node.
ClearQueues.js
The ClearQueues.js script and the script functions it calls demonstrate using JavaScript
to:
● Create a JMS JMX Connector Client
● Create a runtime proxy for a component (in this case, the broker component)
● Execute an operation exposed through the Runtime API of the broker component (in
this case, an operation to clear messages from a particular set of queues managed by
the broker)
After executing this script you can execute the ShowQueues.js script to see the effects of
the ClearQueues.js script.
NotificationReporter.js
The NotificationReporter.js script and the script functions it calls demonstrate using
JavaScript to:
● Create a JMS JMX Connector Client.
● Create a runtime proxy for a component (in this case, the broker component).
● Create a notification listener that will display management notifications emitted by
the broker.
This script will continue to listen and display received notifications until it is terminated.
Use Ctrl-c to terminate the program.
For each notification received, the notification name (or type) and the source of the
notification will be displayed.
Notifications, such as those generated when clients connect and disconnect, can be
created using the JMS Test Client application or running one of the scripts described in
this section (for example, ShowQueues.js) from another shell.
FilteringNotificationReporter.js
The FilteringNotificationReporter.js script and the script functions it calls
demonstrate using JavaScript to:
● Create a JMS JMX Connector Client.
● Create a runtime proxy for a component (in this case, the broker component).
● Create a notification listener and Sonic regular expression based notification filter that
will display a filtered set of management notifications (based on both the notification
type and attribute values) emitted by the broker.
This script will continue to listen and display received notifications until it is terminated.
Use Ctrl-C to terminate the program.
For each notification received, the notification name (or type) and the source of the
notification is displayed.
The code segment that does the filtering in this example is:
// create a Sonic expression based filter and setup some filtering rules
ExpressionBasedNotificationFilter filter = new ExpressionBasedNotificationFilter();
Notifications generated when clients subscribe and unsubscribe can be created by using
the JMS Test Client application and TopicPubSub samples such as Chat.
BackupDS.js
The BackupDS script and the script functions it calls demonstrate one way to perform a
backup of the Directory Service storage, using JavaScript to:
● Create a JMS JMX Connector Client.
● Create a runtime proxy for a component (in this case the Directory Service
component that manages the domain's configuration store).
● Set an attribute exposed through the Runtime API of the Directory Service
component in order to place the Directory Service in a state under which it is valid to
take an online backup of the domain's configuration store.
● Prompt the user to perform the backup (tar, copy, etc.) and indicate when the backup
is complete.
● Reset the online backup attribute in order to place the Directory Service back to a state
where it can handle further configuration updates.
As the Directory Service is placed in and out of the online backup mode, you can observe
related messages on the Directory Service’s container standard output.
As an additional exercise, you can try executing your backup process directly from the
program, replacing the standard input prompting.
Chapter 4 describes using the SonicMQ Directory Service API, which provides
programmatic access to the Directory Service to maintain permissions enforcement and
auditing:
● “Overview of the Directory Service (DS) API”
● “Interfaces”
● “Factory Operations”
● “Sonic DS API Sample”
Interfaces
The IManagementSecurityConfigurator interface provides the methods used by
administration clients to enable and configure the management security features:
● Configuration and runtime checking of management permissions
● Auditing of configuration and/or runtime events.
Creation and use of an instance of this interface is demonstrated in the installed sample
sonic_install_root/MQ7.5/samples/Management/mgmtSecurityAPI/java.
The paths parameter is the organizational hierarchy shown in the Configured Objects
section of the Configure tab in the Sonic Management Console.
Factory Operations
The ManagementPermissionsFactory lets you create instances of IManagementPermission.
Principal
A principal is a group or user name in the Authentication Domain assigned for
permissions enforcement.
● setPrincipal(String principal)
● String getPrincipal()
Scope
Scope setting methods in the DS API are:
● setScope(int scope)
● int getScope()
A scope is defined as a bit mask whose values are formed by adding constants. The scope
constants, located in sonic_install_dir/Docs7.5/api/mgmt_api/constant-values.html,
are:
com.sonicsw.mf.common.security.IConfigureScopeBits
public static final int THIS_FOLDER_SCOPE1
public static final int ALL_FOLDERS_SCOPE 2
public static final int THIS_CONFIGURATION_OR_FILE_SCOPE 4
public static final int ALL_CONFIGURATIONS_AND_FILES_SCOPE 8
com.sonicsw.mf.common.security.IManageScopeBits
public static final int ALL_FOLDERS_SCOPE 1
public static final int THIS_CONTAINER_SCOPE 2
public static final int ALL_CONTAINERS_SCOPE 4
public static final int THIS_COMPONENT_SCOPE 8
public static final int ALL_COMPONENTS_SCOPE 16
Permissions
Permission setting methods in the DS API are:
● setPermissions(int permissions)
● int getPermissions()
A permission setting is a bit mask whose values are formed by adding constants.
Both allow and deny constants are available for each permission. Avoid invalid
combinations, such as ALLOW_READ + DENY_READ, in which case the allow permission is
recorded (hence, ALLOW_READ + DENY_READ = ALLOW_READ.) Other invalid combinations are
functional mismatches such as ALLOW_DELETE+DENY_WRITE.
Permission constants, located in sonic_install_dir/Docs7.5/api/mgmt_api/constant-
values.html, are:
com.sonicsw.mf.common.security.IConfigurePermissionBits
public static final int ALLOW_READ 1
public static final int DENY_READ2
public static final int ALLOW_WRITE 4
public static final int DENY_WRITE 8
public static final int ALLOW_DELETE 16
public static final int DENY_DELETE32
public static final int ALLOW_SET_PERMISSIONS 64
public static final int DENY_SET_PERMISSIONS 128
com.sonicsw.mf.common.security.IManagePermissionBits
public static final int ALLOW_LIFE_CYCLE_CONTROL 1
public static final int DENY_LIFE_CYCLE_CONTROL 2
public static final int ALLOW_ENABLE_DISABLE_METRICS 4
public static final int DENY_ENABLE_DISABLE_METRICS 8
public static final int ALLOW_NOTIFICATION_SUBSCRIPTION16
public static final int DENY_NOTIFICATION_SUBSCRIPTION 32
public static final int ALLOW_SET_ATTRIBUTES64
public static final int DENY_SET_ATTRIBUTES 128
public static final int ALLOW_PERFORM_ACTIONS 256
public static final int DENY_PERFORM_ACTIONS 512
public static final int ALLOW_GET_INFORMATION 1024
public static final int DENY_GET_INFORMATION 2048
When a value is neither set to allow or to deny an action, the permission is not considered
to be defined in the setting. For example, if you set a principal’s permissions to
ALLOW_READ+ALLOW_WRITE and the action is delete, then the permission resolution will
search for another setting.
The sample is a Java-based Command Line Interface (CLI) for the enablement of
permissions enforcement and auditing using the DS API. You can display and maintain
the domain-wide management security settings, as well as add, list, update, and delete
configure permissions and manage permissions.
After you explore the behavior of the commands in this shell, deconstruct its source file,
MgmtSecurityCLI.java, to review the coding details.
and press Enter, the response lists the keywords tat can follow show:
Commands are: audit configure enforcement help keywords manage
Management Security
> enable enforcement authentication_domain_path
> enable default permissions
> show enforcement
> disable all permissions
> disable enforcement
Auditing
> enable configure audit
> enable manage audit
> enable central audit
> set audit config URL
> show audit
> disable configure audit
> disable manage audit
> disable central audit
Chapter 5 describes using the SonicMQ Server Provider Interfaces (SPIs) for
implementing the Pluggable Authentication and Security Service (PASS). This chapter
contains the following sections:
● “Overview of the PASS SPIs” — Introduces the PASS SPIs, which include the Login,
Authentication, and Management SPIs
● “Login SPI” — Describes the Login SPI interfaces, with which you can implement
your own custom login modules or plug in JAAS-based authentication functionality
● “Authentication SPI” — Describes the Authentication SPI, which you configure for
a broker having an external Authentication Domain
● “Management SPI” — Describes the Management SPI, which you can implement to
retrieve users and groups from any third-party security store
See the chapter “Configuring Security” in the Progress SonicMQ Configuration and
Management Guide for information about using the SMC to configure these security
features in SonicMQ.
Login SPI
The Login SPI provides access to the ILogin and IPasswordUser interfaces. You can
implement these interfaces in order to use your own custom login modules. You can also
use the login module to plug in JAAS-based authentication functionality. When you
implement the Login SPI, users can be authenticated with external authentication service
before a JMS connection is created, either by a proprietary or JAAS login module
implementation. The Login SPI includes the following interfaces:
● ILogin — Provides methods to authenticate JMS client applications with one or many
external security domains
● IPasswordUser — Provides methods to get a user’s credentials for authentication
4. The SonicMQ runtime calls the method login( ) on the underlying SPI
implementation.
5. If the login( ) method returns without an exception, the login to external security
store or schema is assumed validated and user is considered authenticated.
6. Upon successful return from the login( ) method, the SonicMQ runtime calls the
getCredential( ) method to retrieve the user name and the transformed password via
an implementation of IPasswordUser.
7. The retrieved user name, password, and transformed password are used to establish a
JMS connection.
The transformed password is used when the SonicMQ broker is configured with an
external Authentication Domain. This is a delegation mode of the authentication process
in which the transformed password is transmitted across the wire to the SonicMQ broker.
The broker authenticates the connecting client using the transformed password via a
configured Authentication SPI.
For example, assume a user testUser has a password testPassword. The application
implements the Login SPI, and the getCredential( ) method returns an instance of
IPasswordUser with user name testUser and a byte[ ]password.
The client is unaware that the broker is configured with an external Authentication
Domain. While a connection is being established, one of the following two things can
happen, depending on whether the user is found in the security cache:
● The broker finds that there is an internal user testUser — The broker then uses the
password testPassword to authenticate the user (this is the regular challenge and
response).
● The user testUser is not present in the broker’s security cache — The user is then
considered an external user and the broker requests the byte[ ] password from the
client application. When the broker gets the byte[ ] password from the client, the
broker calls Authentication SPI's authenticate method.
The following code example shows how to create a topic connection to the SonicMQ
broker, invoking the Login SPI implementation. This code example assumes a user
testUser with the password testPassword exists as a valid Sonic user. This code example
is excerpted from the file JMSClient.java, located at:
MQ7.5_install_root\samples\AdvancedSecurity\com\sonicsw\samples\pass\
extAuthDomain\loginspi\
The full code sample includes an example of how to create a queue connection and
message listeners, and how to handle messages received:
...
// Create a connection.
try
{
System.out.println("\r\nTesting creation of a TopicConnection");
javax.jms.TopicConnectionFactory factory;
The following code example shows how to implement the IPasswordUser interface:
package com.sonicsw.samples.pass.extAuthDomain.loginspi;
import com.sonicsw.security.pass.client.IPasswordUser;
//user password
String m_password;
//Default Constructor
private PasswordUser()
{
}
/**
* Constructor
* <p>
* @param uid user name
* @param pwd user's password
*/
public PasswordUser(String uid, String pwd)
{
m_userName = uid;
m_password = pwd;
}
//see com.sonicsw.security.pass.client.IPasswordUser#getPassword()
//see com.sonicsw.security.pass.broker.IAuthentication#authenticate(java.lang.String,
//byte[])
//see com.sonicsw.security.pass.client.IPasswordUser#setGroups(java.lang.String[])
//see java.security.Principal#getName()
That example was excerpted from the file PasswordUser.java, located at:
MQ7.5_install_root\samples\AdvancedSecurity\com\sonicsw\samples\pass\
extAuthDomain\loginspi.
The following code example shows how to test a Login SPI implementation when
connecting to the SonicMQ broker by testing the authentication of a flat file user.
package com.sonicsw.samples.pass.extAuthDomain.loginspi;
import com.sonicsw.security.pass.client.ILogin;
import com.sonicsw.security.pass.client.IPasswordUser;
//Default Constructor
public LoginSpiImpl()
{
m_login = this;
}
//see com.sonicsw.security.pass.client.ILogin#getCredential()
public IPasswordUser getCredential()
{
return new PasswordUser(m_username, m_password);
}
//see com.sonicsw.security.pass.client.ILogin#getLoginSPI()
public ILogin getLoginSPI()
{
return m_login;
}
//see com.sonicsw.security.pass.client.ILogin#setPassword(java.lang.String)
public void setPassword(String password)
{
m_password = password;
}
//see com.sonicsw.security.pass.client.ILogin#setUserName(java.lang.String)
public void setUserName(String username)
{
m_username = username;
}
//see com.sonicsw.security.pass.client.ILogin#login()
public boolean login()
{
// TODO
// Here, you can write your own login function/call.
// If error, return false. Else return true.
return true;
}
//see com.sonicsw.security.pass.client.ILogin#logout()
public void logout()
{
// Do nothing
}
}
Alternatively, you can configure the Login SPI implementation using the following JVM
argument:
-DSonicMQ.LOGIN_SPI=sonic.pass.loginspi.impl.BasicLogin
Note A Login SPI configured using the ConnectionFactory takes precedence over a Login API
configured using a JVM argument.
Authentication SPI
The Authentication SPI provides access to the following interfaces:
● IAuthentication — Provides the methods required for delegation mode authentication
of JMS clients connecting to the broker.
● IBrokerSecurityCache — Provides callback operations required to find external users
cached on the broker.
Both these interfaces are located in the package: com.sonicsw.security.pass.broker.
...
// create an instance of this class
Authentication sample = new Authentication();
if (s_verbose)
System.out.println("\r\n----- Authentication.main() -------");
4. The broker updates the credential of the external user cached on the broker, if any. For
example:
if (users == null)
return null;
try
{
ArrayList list = new ArrayList();
Now the Authentication SPI in the external Authentication Domain is ready for use.
As a user tries to establish a JMS connection with a secured broker, the broker checks for
the user's credential in the broker cache. One of the following two things can happen,
depending on whether the user is found in the internal cache:
● The user is an internal user — Regular Challenge and Response based authentication
is used.
● The user is not found in the internal user cache (and an Authentication SPI has been
configured on the broker) — The broker sends a request to the client JMS application
to send the credentials. The SonicMQ client runtime uses the Login SPI to provide
the byte[ ] of the credential. This byte[ ] is transmitted to the broker.
The broker then passes the user name with the byte[ ] to the Authentication SPI
implementation. If the SPI throws an exception, the user is considered
unauthenticated.
Upon successful authentication, the Authentication SPI returns a group array of groups to
which the user belongs. These groups are defined in the external store—they are not
SonicMQ groups. These external groups are mapped to internal groups in the Group Map
for the external Authentication Domain. (See the chapter “Configuring Security” in the
Progress SonicMQ Configuration and Management Guide for information about using
the Sonic Management Console (SMC) to configure a Group Map for an external
Authentication Domain.)
For example, a user Bob might belong to three groups: Employee, HR Manager, and
Directory Administrator. In this case, the String[ ] returned contains Employee, HR
Manager, and Directory Administrator as three items in the array.
These returned groups are used to add the user to the appropriate ACL entry. By default,
the user is also added to the internal PUBLIC group, as user must belong to this internal
group to perform JMS messaging.
Note Changes to the Authentication SPI require recompilation of code in prior release —
Enhancements to the authenticate method require that previously deployed
Authentication SPIs be modified so that they reflect the changes.
Authenticate Method
The signature of the authenticate method is:
public IPasswordUser authenticate(String username,
byte[] credentials,
X509Certificate[] clientCert)
where
■ String username is
the user name that initiated the JMS connection. The user
name can be changed by Login SPI implementation on the client side.
Management SPI
You can use the Management SPI to retrieve a user and group from any third-party
security store. Implementing this SPI results in viewing the read-only users and groups
present on the external security store. The Management SPI provides access to the
following interfaces:
● IManagement — Provides methods to retrieve the user and group from any third party
security store. Located in the package:
com.sonicsw.security.pass.mf.IManagement.
● IGroup — Provides methods to retrieve the name of an external group and a list of
users of that group. Located in the package:
com.sonicsw.security.pass.mf.IGroup.
● INotificationListener — Used by the SonicMQ Directory Service to receive change
notifications regarding any changes in user or group information in the external
security store or domain. Located in the package:
com.sonicsw.security.pass.mf.INotificationListener.
● IEvent — The base interface of all the events that can be used to notify the listener for
any change in users and group information. Located in the package:
com.sonicsw.security.pass.mf.IEvent. Event interfaces can be implemented to
notify the listener of changes in:
■ Groups added, deleted, or modified
■ Users added, deleted, or modified
■ Events discontinued
The following code examples show how to implement the Management SPI for an XML-
based flat file security store. This example uses the Management SPI to retrieve the user
and group information from a third party security store. This code is excerpted from the
sample file:
MQ7.5_install_root\samples\AdvancedSecurity\com\sonicsw\samples\pass
\extAuthDomain\mgmtspi\Management.java
Refer to this file for the complete code sample for implementing the Management SPI.
tempStr = (String)configuration.get(MANAGEMENT_SPI_TRACE);
s_verbose = tempStr != null ? (tempStr.equalsIgnoreCase("true") ? true : false) : false;
m_configuration.put(MANAGEMENT_SPI_TRACE, (s_verbose ? "true" : "false"));
...
try
{
// read all the users from XML file
String filenameAndLocation = (String) m_configuration.get(USERS_XML);
HashMap users = XMLFileReader.getXMLFileReader().getUsers(filenameAndLocation);
//Get the groups from the XML file and convert them into IGroups
Object o = groups.get(key);
if (o instanceof ArrayList)
{
ArrayList groupMembers = (ArrayList) o;
for (Iterator iterator = groupMembers.iterator(); iterator.hasNext(); )
{
String userName = (String) iterator.next();
if (userName != null)
list.add(new PasswordUser(userName, ""));
}
}
IPasswordUser[] userArray = new PasswordUser[list.size()];
list.toArray(userArray);
6. Return a user matching an ID, and return the user’s credentials, as shown:
//Get the users from the XML file and convert them into IPasswordUser
//Return a list of users
return userArray;
}
return null;
}
8. Register event notifications listeners and delete them (if using Management SPI
listeners), as shown:
Also see the chapter “Security Considerations in System Design” in the Progress
SonicMQ Deployment Guide for information about running the advanced security sample
provided with SonicMQ.
A code examples
add a broker to a cluster 35
Activation Daemons 61 add a broker to a container 28
Advanced Security SPIs 101 Configuration API 22
agent 59 configure security 36
agent manager 60 create a container 27
alert notifications 69, 71 create a queue 28
APIs create a route 29
Advanced Security SPIs 101 create HTTP Direct acceptors for a broker 32
Configuration 17 disable Nagle algorithm 41
Directory Service 94 set advanced properties 42
JMX 55 collections monitor 61
proxy 57 command line interface (CLI) sample 78
Runtime 53 commit 21, 25
attributes of notifications compact database
filtering 76 Java sample 88
Authentication SPI 104, 109 Configuration API 17
accessing maps 43
backup broker 20
B broker components 19
certificate revocation list caches 39
broker 19, 63 code examples 22
backup 20 factory connections 20
create configuration 25 fault tolerant connections 20
proxy 113 fault tolerant management components 24
security cache SPI 109 framework components 19
inner classes 43
samples 45
C configuration name 42
certificate revocation list caches connect
configuring 39 to a domain 23
refreshing 63 to fault tolerant management components 24
F M
factory operations 20 manageable components
fault tolerance 20 Configuration API 19
filtering notifications Runtime API 59
Java sample 87 summary 16
JavaScript sample 91 management
flush attributes 63
configurations 21, 26 framework components 19
CRL caches 63 notifications 71
operations 66
management APIs
Configuration 17
Runtime 53