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 */ 017 package org.apache.activemq.command; 018 019 import org.apache.activemq.state.CommandVisitor; 020 021 /** 022 * Used to start and stop transports as well as terminating clients. 023 * 024 * @openwire:marshaller code="18" 025 * @version $Revision: 1.1 $ 026 */ 027 public class ConnectionControl extends BaseCommand { 028 public static final byte DATA_STRUCTURE_TYPE = CommandTypes.CONNECTION_CONTROL; 029 protected boolean suspend; 030 protected boolean resume; 031 protected boolean close; 032 protected boolean exit; 033 protected boolean faultTolerant; 034 035 public byte getDataStructureType() { 036 return DATA_STRUCTURE_TYPE; 037 } 038 039 public Response visit(CommandVisitor visitor) throws Exception { 040 return visitor.processConnectionControl(this); 041 } 042 043 /** 044 * @openwire:property version=1 045 * @return Returns the close. 046 */ 047 public boolean isClose() { 048 return close; 049 } 050 051 /** 052 * @param close The close to set. 053 */ 054 public void setClose(boolean close) { 055 this.close = close; 056 } 057 058 /** 059 * @openwire:property version=1 060 * @return Returns the exit. 061 */ 062 public boolean isExit() { 063 return exit; 064 } 065 066 /** 067 * @param exit The exit to set. 068 */ 069 public void setExit(boolean exit) { 070 this.exit = exit; 071 } 072 073 /** 074 * @openwire:property version=1 075 * @return Returns the faultTolerant. 076 */ 077 public boolean isFaultTolerant() { 078 return faultTolerant; 079 } 080 081 /** 082 * @param faultTolerant The faultTolerant to set. 083 */ 084 public void setFaultTolerant(boolean faultTolerant) { 085 this.faultTolerant = faultTolerant; 086 } 087 088 /** 089 * @openwire:property version=1 090 * @return Returns the resume. 091 */ 092 public boolean isResume() { 093 return resume; 094 } 095 096 /** 097 * @param resume The resume to set. 098 */ 099 public void setResume(boolean resume) { 100 this.resume = resume; 101 } 102 103 /** 104 * @openwire:property version=1 105 * @return Returns the suspend. 106 */ 107 public boolean isSuspend() { 108 return suspend; 109 } 110 111 /** 112 * @param suspend The suspend to set. 113 */ 114 public void setSuspend(boolean suspend) { 115 this.suspend = suspend; 116 } 117 }