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.command; 018 019import org.apache.activemq.state.CommandVisitor; 020import org.apache.activemq.util.IntrospectionSupport; 021 022/** 023 * @openwire:marshaller code="10" 024 * 025 */ 026public class KeepAliveInfo extends BaseCommand { 027 028 public static final byte DATA_STRUCTURE_TYPE = CommandTypes.KEEP_ALIVE_INFO; 029 030 private transient Endpoint from; 031 private transient Endpoint to; 032 033 public byte getDataStructureType() { 034 return DATA_STRUCTURE_TYPE; 035 } 036 037 public boolean isResponse() { 038 return false; 039 } 040 041 public boolean isMessageDispatch() { 042 return false; 043 } 044 045 public boolean isMessage() { 046 return false; 047 } 048 049 public boolean isMessageAck() { 050 return false; 051 } 052 053 public boolean isBrokerInfo() { 054 return false; 055 } 056 057 public boolean isWireFormatInfo() { 058 return false; 059 } 060 061 /** 062 * The endpoint within the transport where this message came from. 063 */ 064 public Endpoint getFrom() { 065 return from; 066 } 067 068 public void setFrom(Endpoint from) { 069 this.from = from; 070 } 071 072 /** 073 * The endpoint within the transport where this message is going to - null 074 * means all endpoints. 075 */ 076 public Endpoint getTo() { 077 return to; 078 } 079 080 public void setTo(Endpoint to) { 081 this.to = to; 082 } 083 084 public Response visit(CommandVisitor visitor) throws Exception { 085 return visitor.processKeepAlive(this); 086 } 087 088 public boolean isMarshallAware() { 089 return false; 090 } 091 092 public boolean isMessageDispatchNotification() { 093 return false; 094 } 095 096 public boolean isShutdownInfo() { 097 return false; 098 } 099 100 public String toString() { 101 return IntrospectionSupport.toString(this, KeepAliveInfo.class); 102 } 103}