| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.LinkedHashSet; |
| | | import java.util.TreeMap; |
| | | |
| | | import org.opends.server.admin.std.server.ConnectionHandlerCfg; |
| | |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeBuilder; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.InitializationException; |
| | |
| | | // Get information about all the available connections. |
| | | ArrayList<Collection<ClientConnection>> connCollections = |
| | | new ArrayList<Collection<ClientConnection>>(); |
| | | for (ConnectionHandler handler : DirectoryServer.getConnectionHandlers()) |
| | | for (ConnectionHandler<?> handler : DirectoryServer.getConnectionHandlers()) |
| | | { |
| | | ConnectionHandler<? extends ConnectionHandlerCfg> connHandler = |
| | | (ConnectionHandler<? extends ConnectionHandlerCfg>) handler; |
| | |
| | | |
| | | // Iterate through all the client connections and create a one-line summary |
| | | // of each. |
| | | AttributeType attrType = |
| | | DirectoryServer.getDefaultAttributeType("connection"); |
| | | LinkedHashSet<AttributeValue> values = |
| | | new LinkedHashSet<AttributeValue>(connMap.size()); |
| | | AttributeType attrType = DirectoryServer |
| | | .getDefaultAttributeType("connection"); |
| | | AttributeBuilder builder = new AttributeBuilder(attrType); |
| | | for (ClientConnection conn : connMap.values()) |
| | | { |
| | | values.add(new AttributeValue(attrType, conn.getMonitorSummary())); |
| | | builder.add(new AttributeValue(attrType, conn.getMonitorSummary())); |
| | | } |
| | | |
| | | |
| | | ArrayList<Attribute> attrs = new ArrayList<Attribute>(1); |
| | | attrs.add(new Attribute(attrType, "connection", values)); |
| | | attrs.add(builder.toAttribute()); |
| | | return attrs; |
| | | } |
| | | } |