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 * @return 033 */ 034 OutputStream getOutputStream(); 035 036 /** 037 * Print an ObjectInstance format of an mbean 038 * @param mbean - mbean to print 039 */ 040 void printMBean(ObjectInstance mbean); 041 042 /** 043 * Print an ObjectName format of an mbean 044 * @param mbean - mbean to print 045 */ 046 void printMBean(ObjectName mbean); 047 048 /** 049 * Print an AttributeList format of an mbean 050 * @param mbean - mbean to print 051 */ 052 void printMBean(AttributeList mbean); 053 054 /** 055 * Print a Map format of an mbean 056 * @param mbean - mbean to print 057 */ 058 void printMBean(Map mbean); 059 060 /** 061 * Print a Collection format of mbeans 062 * @param mbean - collection of mbeans 063 */ 064 void printMBean(Collection mbean); 065 066 /** 067 * Print a Map format of a JMS message 068 * @param msg 069 */ 070 void printMessage(Map msg); 071 072 /** 073 * Print a Message format of a JMS message 074 * @param msg - JMS message to print 075 */ 076 void printMessage(Message msg); 077 078 /** 079 * Print a Collection format of JMS messages 080 * @param msg - collection of JMS messages 081 */ 082 void printMessage(Collection msg); 083 084 /** 085 * Print help messages 086 * @param helpMsgs - help messages to print 087 */ 088 void printHelp(String[] helpMsgs); 089 090 /** 091 * Print an information message 092 * @param info - information message to print 093 */ 094 void printInfo(String info); 095 096 /** 097 * Print an exception message 098 * @param e - exception to print 099 */ 100 void printException(Exception e); 101 102 /** 103 * Print a version information 104 * @param version - version info to print 105 */ 106 void printVersion(String version); 107 108 /** 109 * Print a generic key value mapping 110 * @param map to print 111 */ 112 void print(Map map); 113 114 /** 115 * Print a generic array of strings 116 * @param strings - string array to print 117 */ 118 void print(String[] strings); 119 120 /** 121 * Print a collection of objects 122 * @param collection - collection to print 123 */ 124 void print(Collection collection); 125 126 /** 127 * Print a java string 128 * @param string - string to print 129 */ 130 void print(String string); 131}