001/** 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.activemq.console.formatter; 018 019import java.io.OutputStream; 020import java.util.Collection; 021import java.util.Map; 022 023import javax.jms.Message; 024import javax.management.AttributeList; 025import javax.management.ObjectInstance; 026import javax.management.ObjectName; 027 028public interface OutputFormatter { 029 030 /** 031 * Retrieve the output stream being used by the formatter 032 */ 033 OutputStream getOutputStream(); 034 035 /** 036 * Print an ObjectInstance format of an mbean 037 * @param mbean - mbean to print 038 */ 039 void printMBean(ObjectInstance mbean); 040 041 /** 042 * Print an ObjectName format of an mbean 043 * @param mbean - mbean to print 044 */ 045 void printMBean(ObjectName mbean); 046 047 /** 048 * Print an AttributeList format of an mbean 049 * @param mbean - mbean to print 050 */ 051 void printMBean(AttributeList mbean); 052 053 /** 054 * Print a Map format of an mbean 055 * @param mbean - mbean to print 056 */ 057 @SuppressWarnings("rawtypes") 058 void printMBean(Map mbean); 059 060 /** 061 * Print a Collection format of mbeans 062 * @param mbean - collection of mbeans 063 */ 064 @SuppressWarnings("rawtypes") 065 void printMBean(Collection mbean); 066 067 /** 068 * Print a Map format of a JMS message 069 * @param msg 070 */ 071 @SuppressWarnings("rawtypes") 072 void printMessage(Map msg); 073 074 /** 075 * Print a Message format of a JMS message 076 * @param msg - JMS message to print 077 */ 078 void printMessage(Message msg); 079 080 /** 081 * Print a Collection format of JMS messages 082 * @param msg - collection of JMS messages 083 */ 084 @SuppressWarnings("rawtypes") 085 void printMessage(Collection msg); 086 087 /** 088 * Print help messages 089 * @param helpMsgs - help messages to print 090 */ 091 void printHelp(String[] helpMsgs); 092 093 /** 094 * Print an information message 095 * @param info - information message to print 096 */ 097 void printInfo(String info); 098 099 /** 100 * Print an exception message 101 * @param e - exception to print 102 */ 103 void printException(Exception e); 104 105 /** 106 * Print a version information 107 * @param version - version info to print 108 */ 109 void printVersion(String version); 110 111 /** 112 * Print a generic key value mapping 113 * @param map to print 114 */ 115 @SuppressWarnings("rawtypes") 116 void print(Map map); 117 118 /** 119 * Print a generic array of strings 120 * @param strings - string array to print 121 */ 122 void print(String[] strings); 123 124 /** 125 * Print a collection of objects 126 * @param collection - collection to print 127 */ 128 @SuppressWarnings("rawtypes") 129 void print(Collection collection); 130 131 /** 132 * Print a java string 133 * @param string - string to print 134 */ 135 void print(String string); 136}