http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionControlMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionControlMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionControlMarshaller.java new file mode 100644 index 0000000..da4aa81 --- /dev/null +++ b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionControlMarshaller.java @@ -0,0 +1,216 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.openwire.codec.universal; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.activemq.openwire.codec.*; +import org.apache.activemq.openwire.commands.*; + +/** + * Marshalling code for Open Wire for ConnectionControl + * + * NOTE!: This file is auto generated - do not modify! + * + */ +public class ConnectionControlMarshaller extends BaseCommandMarshaller { + + /** + * Return the type of Data Structure handled by this Marshaler + * + * @return short representation of the type data structure + */ + public byte getDataStructureType() { + return ConnectionControl.DATA_STRUCTURE_TYPE; + } + + /** + * @return a new instance of the managed type. + */ + public DataStructure createObject() { + return new ConnectionControl(); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * @param bs the boolean stream where the type's booleans were marshaled + * + * @throws IOException if an error occurs while reading the data + */ + public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, target, dataIn, bs); + + ConnectionControl info = (ConnectionControl) target; + int version = wireFormat.getVersion(); + + info.setClose(bs.readBoolean()); + info.setExit(bs.readBoolean()); + info.setFaultTolerant(bs.readBoolean()); + info.setResume(bs.readBoolean()); + info.setSuspend(bs.readBoolean()); + if (version >= 6) { + info.setConnectedBrokers(tightUnmarshalString(dataIn, bs)); + } + if (version >= 6) { + info.setReconnectTo(tightUnmarshalString(dataIn, bs)); + } + if (version >= 6) { + info.setRebalanceConnection(bs.readBoolean()); + } + if (version >= 6) { + info.setToken(tightUnmarshalConstByteArray(dataIn, bs, 0)); + } + } + + /** + * Write the booleans that this object uses to a BooleanStream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException { + ConnectionControl info = (ConnectionControl) source; + int version = wireFormat.getVersion(); + + int rc = super.tightMarshal1(wireFormat, source, bs); + bs.writeBoolean(info.isClose()); + bs.writeBoolean(info.isExit()); + bs.writeBoolean(info.isFaultTolerant()); + bs.writeBoolean(info.isResume()); + bs.writeBoolean(info.isSuspend()); + if (version >= 6) { + rc += tightMarshalString1(info.getConnectedBrokers(), bs); + } + if (version >= 6) { + rc += tightMarshalString1(info.getReconnectTo(), bs); + } + if (version >= 6) { + bs.writeBoolean(info.isRebalanceConnection()); + } + if (version >= 6) { + rc += tightMarshalByteArray1(info.getToken(), bs); + } + + return rc + 0; + } + + /** + * Write a object instance to data output stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param dataOut the DataOut where the properties are written + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, source, dataOut, bs); + + ConnectionControl info = (ConnectionControl) source; + int version = wireFormat.getVersion(); + + bs.readBoolean(); + bs.readBoolean(); + bs.readBoolean(); + bs.readBoolean(); + bs.readBoolean(); + if (version >= 6) { + tightMarshalString2(info.getConnectedBrokers(), dataOut, bs); + } + if (version >= 6) { + tightMarshalString2(info.getReconnectTo(), dataOut, bs); + } + if (version >= 6) { + bs.readBoolean(); + } + if (version >= 6) { + tightMarshalByteArray2(info.getToken(), dataOut, bs); + } + } + + /** + * Write the object to the output using loose marshaling. + * + * @throws IOException if an error occurs while writing the data + */ + public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException { + ConnectionControl info = (ConnectionControl) source; + int version = wireFormat.getVersion(); + + super.looseMarshal(wireFormat, source, dataOut); + dataOut.writeBoolean(info.isClose()); + dataOut.writeBoolean(info.isExit()); + dataOut.writeBoolean(info.isFaultTolerant()); + dataOut.writeBoolean(info.isResume()); + dataOut.writeBoolean(info.isSuspend()); + if (version >= 6) { + looseMarshalString(info.getConnectedBrokers(), dataOut); + } + if (version >= 6) { + looseMarshalString(info.getReconnectTo(), dataOut); + } + if (version >= 6) { + dataOut.writeBoolean(info.isRebalanceConnection()); + } + if (version >= 6) { + looseMarshalByteArray(wireFormat, info.getToken(), dataOut); + } + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * + * @throws IOException if an error occurs while writing the data + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException { + super.looseUnmarshal(wireFormat, target, dataIn); + + ConnectionControl info = (ConnectionControl) target; + int version = wireFormat.getVersion(); + + info.setClose(dataIn.readBoolean()); + info.setExit(dataIn.readBoolean()); + info.setFaultTolerant(dataIn.readBoolean()); + info.setResume(dataIn.readBoolean()); + info.setSuspend(dataIn.readBoolean()); + if (version >= 6) { + info.setConnectedBrokers(looseUnmarshalString(dataIn)); + } + if (version >= 6) { + info.setReconnectTo(looseUnmarshalString(dataIn)); + } + if (version >= 6) { + info.setRebalanceConnection(dataIn.readBoolean()); + } + if (version >= 6) { + info.setToken(looseUnmarshalByteArray(dataIn)); + } + } +}
http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionErrorMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionErrorMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionErrorMarshaller.java new file mode 100644 index 0000000..c694202 --- /dev/null +++ b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionErrorMarshaller.java @@ -0,0 +1,136 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.openwire.codec.universal; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.activemq.openwire.codec.*; +import org.apache.activemq.openwire.commands.*; + +/** + * Marshalling code for Open Wire for ConnectionError + * + * NOTE!: This file is auto generated - do not modify! + * + */ +public class ConnectionErrorMarshaller extends BaseCommandMarshaller { + + /** + * Return the type of Data Structure handled by this Marshaler + * + * @return short representation of the type data structure + */ + public byte getDataStructureType() { + return ConnectionError.DATA_STRUCTURE_TYPE; + } + + /** + * @return a new instance of the managed type. + */ + public DataStructure createObject() { + return new ConnectionError(); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * @param bs the boolean stream where the type's booleans were marshaled + * + * @throws IOException if an error occurs while reading the data + */ + public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, target, dataIn, bs); + + ConnectionError info = (ConnectionError) target; + + info.setException((Throwable) tightUnmarsalThrowable(wireFormat, dataIn, bs)); + info.setConnectionId((ConnectionId) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); + } + + /** + * Write the booleans that this object uses to a BooleanStream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException { + ConnectionError info = (ConnectionError) source; + + int rc = super.tightMarshal1(wireFormat, source, bs); + rc += tightMarshalThrowable1(wireFormat, info.getException(), bs); + rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs); + + return rc + 0; + } + + /** + * Write a object instance to data output stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param dataOut the DataOut where the properties are written + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, source, dataOut, bs); + + ConnectionError info = (ConnectionError) source; + + tightMarshalThrowable2(wireFormat, info.getException(), dataOut, bs); + tightMarshalNestedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs); + } + + /** + * Write the object to the output using loose marshaling. + * + * @throws IOException if an error occurs while writing the data + */ + public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException { + ConnectionError info = (ConnectionError) source; + + super.looseMarshal(wireFormat, source, dataOut); + looseMarshalThrowable(wireFormat, info.getException(), dataOut); + looseMarshalNestedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * + * @throws IOException if an error occurs while writing the data + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException { + super.looseUnmarshal(wireFormat, target, dataIn); + + ConnectionError info = (ConnectionError) target; + + info.setException((Throwable) looseUnmarsalThrowable(wireFormat, dataIn)); + info.setConnectionId((ConnectionId) looseUnmarsalNestedObject(wireFormat, dataIn)); + } +} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionIdMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionIdMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionIdMarshaller.java new file mode 100644 index 0000000..91a5bb6 --- /dev/null +++ b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionIdMarshaller.java @@ -0,0 +1,131 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.openwire.codec.universal; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.activemq.openwire.codec.*; +import org.apache.activemq.openwire.commands.*; + +/** + * Marshalling code for Open Wire for ConnectionId + * + * NOTE!: This file is auto generated - do not modify! + * + */ +public class ConnectionIdMarshaller extends BaseDataStreamMarshaller { + + /** + * Return the type of Data Structure handled by this Marshaler + * + * @return short representation of the type data structure + */ + public byte getDataStructureType() { + return ConnectionId.DATA_STRUCTURE_TYPE; + } + + /** + * @return a new instance of the managed type. + */ + public DataStructure createObject() { + return new ConnectionId(); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * @param bs the boolean stream where the type's booleans were marshaled + * + * @throws IOException if an error occurs while reading the data + */ + public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, target, dataIn, bs); + + ConnectionId info = (ConnectionId) target; + + info.setValue(tightUnmarshalString(dataIn, bs)); + } + + /** + * Write the booleans that this object uses to a BooleanStream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException { + ConnectionId info = (ConnectionId) source; + + int rc = super.tightMarshal1(wireFormat, source, bs); + rc += tightMarshalString1(info.getValue(), bs); + + return rc + 0; + } + + /** + * Write a object instance to data output stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param dataOut the DataOut where the properties are written + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, source, dataOut, bs); + + ConnectionId info = (ConnectionId) source; + + tightMarshalString2(info.getValue(), dataOut, bs); + } + + /** + * Write the object to the output using loose marshaling. + * + * @throws IOException if an error occurs while writing the data + */ + public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException { + ConnectionId info = (ConnectionId) source; + + super.looseMarshal(wireFormat, source, dataOut); + looseMarshalString(info.getValue(), dataOut); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * + * @throws IOException if an error occurs while writing the data + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException { + super.looseUnmarshal(wireFormat, target, dataIn); + + ConnectionId info = (ConnectionId) target; + + info.setValue(looseUnmarshalString(dataIn)); + } +} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionInfoMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionInfoMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionInfoMarshaller.java new file mode 100644 index 0000000..184f272 --- /dev/null +++ b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConnectionInfoMarshaller.java @@ -0,0 +1,244 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.openwire.codec.universal; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.activemq.openwire.codec.*; +import org.apache.activemq.openwire.commands.*; + +/** + * Marshalling code for Open Wire for ConnectionInfo + * + * NOTE!: This file is auto generated - do not modify! + * + */ +public class ConnectionInfoMarshaller extends BaseCommandMarshaller { + + /** + * Return the type of Data Structure handled by this Marshaler + * + * @return short representation of the type data structure + */ + public byte getDataStructureType() { + return ConnectionInfo.DATA_STRUCTURE_TYPE; + } + + /** + * @return a new instance of the managed type. + */ + public DataStructure createObject() { + return new ConnectionInfo(); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * @param bs the boolean stream where the type's booleans were marshaled + * + * @throws IOException if an error occurs while reading the data + */ + public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, target, dataIn, bs); + + ConnectionInfo info = (ConnectionInfo) target; + int version = wireFormat.getVersion(); + + info.setConnectionId((ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); + info.setClientId(tightUnmarshalString(dataIn, bs)); + info.setPassword(tightUnmarshalString(dataIn, bs)); + info.setUserName(tightUnmarshalString(dataIn, bs)); + if (bs.readBoolean()) { + short size = dataIn.readShort(); + BrokerId value[] = new BrokerId[size]; + for (int i = 0; i < size; i++) { + value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs); + } + info.setBrokerPath(value); + } else { + info.setBrokerPath(null); + } + info.setBrokerMasterConnector(bs.readBoolean()); + info.setManageable(bs.readBoolean()); + if (version >= 2) { + info.setClientMaster(bs.readBoolean()); + } + if (version >= 6) { + info.setFaultTolerant(bs.readBoolean()); + } + if (version >= 6) { + info.setFailoverReconnect(bs.readBoolean()); + } + if (version >= 8) { + info.setClientIp(tightUnmarshalString(dataIn, bs)); + } + } + + /** + * Write the booleans that this object uses to a BooleanStream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException { + ConnectionInfo info = (ConnectionInfo) source; + int version = wireFormat.getVersion(); + + int rc = super.tightMarshal1(wireFormat, source, bs); + rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs); + rc += tightMarshalString1(info.getClientId(), bs); + rc += tightMarshalString1(info.getPassword(), bs); + rc += tightMarshalString1(info.getUserName(), bs); + rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs); + bs.writeBoolean(info.isBrokerMasterConnector()); + bs.writeBoolean(info.isManageable()); + if (version >= 2) { + bs.writeBoolean(info.isClientMaster()); + } + if (version >= 6) { + bs.writeBoolean(info.isFaultTolerant()); + } + if (version >= 6) { + bs.writeBoolean(info.isFailoverReconnect()); + } + if (version >= 8) { + rc += tightMarshalString1(info.getClientIp(), bs); + } + + return rc + 0; + } + + /** + * Write a object instance to data output stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param dataOut the DataOut where the properties are written + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, source, dataOut, bs); + + ConnectionInfo info = (ConnectionInfo) source; + int version = wireFormat.getVersion(); + + tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs); + tightMarshalString2(info.getClientId(), dataOut, bs); + tightMarshalString2(info.getPassword(), dataOut, bs); + tightMarshalString2(info.getUserName(), dataOut, bs); + tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs); + bs.readBoolean(); + bs.readBoolean(); + if (version >= 2) { + bs.readBoolean(); + } + if (version >= 6) { + bs.readBoolean(); + } + if (version >= 6) { + bs.readBoolean(); + } + if (version >= 8) { + tightMarshalString2(info.getClientIp(), dataOut, bs); + } + } + + /** + * Write the object to the output using loose marshaling. + * + * @throws IOException if an error occurs while writing the data + */ + public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException { + ConnectionInfo info = (ConnectionInfo) source; + int version = wireFormat.getVersion(); + + super.looseMarshal(wireFormat, source, dataOut); + looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut); + looseMarshalString(info.getClientId(), dataOut); + looseMarshalString(info.getPassword(), dataOut); + looseMarshalString(info.getUserName(), dataOut); + looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut); + dataOut.writeBoolean(info.isBrokerMasterConnector()); + dataOut.writeBoolean(info.isManageable()); + if (version >= 2) { + dataOut.writeBoolean(info.isClientMaster()); + } + if (version >= 6) { + dataOut.writeBoolean(info.isFaultTolerant()); + } + if (version >= 6) { + dataOut.writeBoolean(info.isFailoverReconnect()); + } + if (version >= 8) { + looseMarshalString(info.getClientIp(), dataOut); + } + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * + * @throws IOException if an error occurs while writing the data + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException { + super.looseUnmarshal(wireFormat, target, dataIn); + + ConnectionInfo info = (ConnectionInfo) target; + int version = wireFormat.getVersion(); + + info.setConnectionId((ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn)); + info.setClientId(looseUnmarshalString(dataIn)); + info.setPassword(looseUnmarshalString(dataIn)); + info.setUserName(looseUnmarshalString(dataIn)); + if (dataIn.readBoolean()) { + short size = dataIn.readShort(); + BrokerId value[] = new BrokerId[size]; + for (int i = 0; i < size; i++) { + value[i] = (BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn); + } + info.setBrokerPath(value); + } else { + info.setBrokerPath(null); + } + info.setBrokerMasterConnector(dataIn.readBoolean()); + info.setManageable(dataIn.readBoolean()); + if (version >= 2) { + info.setClientMaster(dataIn.readBoolean()); + } + if (version >= 6) { + info.setFaultTolerant(dataIn.readBoolean()); + } + if (version >= 6) { + info.setFailoverReconnect(dataIn.readBoolean()); + } + if (version >= 8) { + info.setClientIp(looseUnmarshalString(dataIn)); + } + } +} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConsumerControlMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConsumerControlMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConsumerControlMarshaller.java new file mode 100644 index 0000000..21958cb --- /dev/null +++ b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConsumerControlMarshaller.java @@ -0,0 +1,205 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.openwire.codec.universal; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.activemq.openwire.codec.*; +import org.apache.activemq.openwire.commands.*; + +/** + * Marshalling code for Open Wire for ConsumerControl + * + * NOTE!: This file is auto generated - do not modify! + * + */ +public class ConsumerControlMarshaller extends BaseCommandMarshaller { + + /** + * Return the type of Data Structure handled by this Marshaler + * + * @return short representation of the type data structure + */ + public byte getDataStructureType() { + return ConsumerControl.DATA_STRUCTURE_TYPE; + } + + /** + * @return a new instance of the managed type. + */ + public DataStructure createObject() { + return new ConsumerControl(); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * @param bs the boolean stream where the type's booleans were marshaled + * + * @throws IOException if an error occurs while reading the data + */ + public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, target, dataIn, bs); + + ConsumerControl info = (ConsumerControl) target; + int version = wireFormat.getVersion(); + + if (version >= 6) { + info.setDestination((OpenWireDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); + } + info.setClose(bs.readBoolean()); + info.setConsumerId((ConsumerId) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); + info.setPrefetch(dataIn.readInt()); + if (version >= 2) { + info.setFlush(bs.readBoolean()); + } + if (version >= 2) { + info.setStart(bs.readBoolean()); + } + if (version >= 2) { + info.setStop(bs.readBoolean()); + } + } + + /** + * Write the booleans that this object uses to a BooleanStream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException { + ConsumerControl info = (ConsumerControl) source; + int version = wireFormat.getVersion(); + + int rc = super.tightMarshal1(wireFormat, source, bs); + if (version >= 6) { + rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getDestination(), bs); + } + bs.writeBoolean(info.isClose()); + rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs); + if (version >= 2) { + bs.writeBoolean(info.isFlush()); + } + if (version >= 2) { + bs.writeBoolean(info.isStart()); + } + if (version >= 2) { + bs.writeBoolean(info.isStop()); + } + + return rc + 4; + } + + /** + * Write a object instance to data output stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param dataOut the DataOut where the properties are written + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, source, dataOut, bs); + + ConsumerControl info = (ConsumerControl) source; + int version = wireFormat.getVersion(); + + if (version >= 6) { + tightMarshalNestedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs); + } + bs.readBoolean(); + tightMarshalNestedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs); + dataOut.writeInt(info.getPrefetch()); + if (version >= 2) { + bs.readBoolean(); + } + if (version >= 2) { + bs.readBoolean(); + } + if (version >= 2) { + bs.readBoolean(); + } + } + + /** + * Write the object to the output using loose marshaling. + * + * @throws IOException if an error occurs while writing the data + */ + public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException { + ConsumerControl info = (ConsumerControl) source; + int version = wireFormat.getVersion(); + + super.looseMarshal(wireFormat, source, dataOut); + if (version >= 6) { + looseMarshalNestedObject(wireFormat, (DataStructure)info.getDestination(), dataOut); + } + dataOut.writeBoolean(info.isClose()); + looseMarshalNestedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut); + dataOut.writeInt(info.getPrefetch()); + if (version >= 2) { + dataOut.writeBoolean(info.isFlush()); + } + if (version >= 2) { + dataOut.writeBoolean(info.isStart()); + } + if (version >= 2) { + dataOut.writeBoolean(info.isStop()); + } + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * + * @throws IOException if an error occurs while writing the data + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException { + super.looseUnmarshal(wireFormat, target, dataIn); + + ConsumerControl info = (ConsumerControl) target; + int version = wireFormat.getVersion(); + + if (version >= 6) { + info.setDestination((OpenWireDestination) looseUnmarsalNestedObject(wireFormat, dataIn)); + } + info.setClose(dataIn.readBoolean()); + info.setConsumerId((ConsumerId) looseUnmarsalNestedObject(wireFormat, dataIn)); + info.setPrefetch(dataIn.readInt()); + if (version >= 2) { + info.setFlush(dataIn.readBoolean()); + } + if (version >= 2) { + info.setStart(dataIn.readBoolean()); + } + if (version >= 2) { + info.setStop(dataIn.readBoolean()); + } + } +} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConsumerIdMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConsumerIdMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConsumerIdMarshaller.java new file mode 100644 index 0000000..974997d --- /dev/null +++ b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConsumerIdMarshaller.java @@ -0,0 +1,141 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.openwire.codec.universal; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.activemq.openwire.codec.*; +import org.apache.activemq.openwire.commands.*; + +/** + * Marshalling code for Open Wire for ConsumerId + * + * NOTE!: This file is auto generated - do not modify! + * + */ +public class ConsumerIdMarshaller extends BaseDataStreamMarshaller { + + /** + * Return the type of Data Structure handled by this Marshaler + * + * @return short representation of the type data structure + */ + public byte getDataStructureType() { + return ConsumerId.DATA_STRUCTURE_TYPE; + } + + /** + * @return a new instance of the managed type. + */ + public DataStructure createObject() { + return new ConsumerId(); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * @param bs the boolean stream where the type's booleans were marshaled + * + * @throws IOException if an error occurs while reading the data + */ + public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, target, dataIn, bs); + + ConsumerId info = (ConsumerId) target; + + info.setConnectionId(tightUnmarshalString(dataIn, bs)); + info.setSessionId(tightUnmarshalLong(wireFormat, dataIn, bs)); + info.setValue(tightUnmarshalLong(wireFormat, dataIn, bs)); + } + + /** + * Write the booleans that this object uses to a BooleanStream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException { + ConsumerId info = (ConsumerId) source; + + int rc = super.tightMarshal1(wireFormat, source, bs); + rc += tightMarshalString1(info.getConnectionId(), bs); + rc += tightMarshalLong1(wireFormat, info.getSessionId(), bs); + rc += tightMarshalLong1(wireFormat, info.getValue(), bs); + + return rc + 0; + } + + /** + * Write a object instance to data output stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param dataOut the DataOut where the properties are written + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, source, dataOut, bs); + + ConsumerId info = (ConsumerId) source; + + tightMarshalString2(info.getConnectionId(), dataOut, bs); + tightMarshalLong2(wireFormat, info.getSessionId(), dataOut, bs); + tightMarshalLong2(wireFormat, info.getValue(), dataOut, bs); + } + + /** + * Write the object to the output using loose marshaling. + * + * @throws IOException if an error occurs while writing the data + */ + public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException { + ConsumerId info = (ConsumerId) source; + + super.looseMarshal(wireFormat, source, dataOut); + looseMarshalString(info.getConnectionId(), dataOut); + looseMarshalLong(wireFormat, info.getSessionId(), dataOut); + looseMarshalLong(wireFormat, info.getValue(), dataOut); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * + * @throws IOException if an error occurs while writing the data + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException { + super.looseUnmarshal(wireFormat, target, dataIn); + + ConsumerId info = (ConsumerId) target; + + info.setConnectionId(looseUnmarshalString(dataIn)); + info.setSessionId(looseUnmarshalLong(wireFormat, dataIn)); + info.setValue(looseUnmarshalLong(wireFormat, dataIn)); + } +} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConsumerInfoMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConsumerInfoMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConsumerInfoMarshaller.java new file mode 100644 index 0000000..216735f --- /dev/null +++ b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ConsumerInfoMarshaller.java @@ -0,0 +1,279 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.openwire.codec.universal; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.activemq.openwire.codec.*; +import org.apache.activemq.openwire.commands.*; + +/** + * Marshalling code for Open Wire for ConsumerInfo + * + * NOTE!: This file is auto generated - do not modify! + * + */ +public class ConsumerInfoMarshaller extends BaseCommandMarshaller { + + /** + * Return the type of Data Structure handled by this Marshaler + * + * @return short representation of the type data structure + */ + public byte getDataStructureType() { + return ConsumerInfo.DATA_STRUCTURE_TYPE; + } + + /** + * @return a new instance of the managed type. + */ + public DataStructure createObject() { + return new ConsumerInfo(); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * @param bs the boolean stream where the type's booleans were marshaled + * + * @throws IOException if an error occurs while reading the data + */ + public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, target, dataIn, bs); + + ConsumerInfo info = (ConsumerInfo) target; + int version = wireFormat.getVersion(); + + info.setConsumerId((ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); + info.setBrowser(bs.readBoolean()); + info.setDestination((OpenWireDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); + info.setPrefetchSize(dataIn.readInt()); + info.setMaximumPendingMessageLimit(dataIn.readInt()); + info.setDispatchAsync(bs.readBoolean()); + info.setSelector(tightUnmarshalString(dataIn, bs)); + if (version >= 10) { + info.setClientId(tightUnmarshalString(dataIn, bs)); + } + info.setSubscriptionName(tightUnmarshalString(dataIn, bs)); + info.setNoLocal(bs.readBoolean()); + info.setExclusive(bs.readBoolean()); + info.setRetroactive(bs.readBoolean()); + info.setPriority(dataIn.readByte()); + if (bs.readBoolean()) { + short size = dataIn.readShort(); + BrokerId value[] = new BrokerId[size]; + for (int i = 0; i < size; i++) { + value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs); + } + info.setBrokerPath(value); + } else { + info.setBrokerPath(null); + } + info.setAdditionalPredicate((Object) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); + info.setNetworkSubscription(bs.readBoolean()); + info.setOptimizedAcknowledge(bs.readBoolean()); + info.setNoRangeAcks(bs.readBoolean()); + if (version >= 4) { + if (bs.readBoolean()) { + short size = dataIn.readShort(); + ConsumerId value[] = new ConsumerId[size]; + for (int i = 0; i < size; i++) { + value[i] = (ConsumerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs); + } + info.setNetworkConsumerPath(value); + } else { + info.setNetworkConsumerPath(null); + } + } + } + + /** + * Write the booleans that this object uses to a BooleanStream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException { + ConsumerInfo info = (ConsumerInfo) source; + int version = wireFormat.getVersion(); + + int rc = super.tightMarshal1(wireFormat, source, bs); + rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs); + bs.writeBoolean(info.isBrowser()); + rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs); + bs.writeBoolean(info.isDispatchAsync()); + rc += tightMarshalString1(info.getSelector(), bs); + if (version >= 10) { + rc += tightMarshalString1(info.getClientId(), bs); + } + rc += tightMarshalString1(info.getSubscriptionName(), bs); + bs.writeBoolean(info.isNoLocal()); + bs.writeBoolean(info.isExclusive()); + bs.writeBoolean(info.isRetroactive()); + rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs); + rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getAdditionalPredicate(), bs); + bs.writeBoolean(info.isNetworkSubscription()); + bs.writeBoolean(info.isOptimizedAcknowledge()); + bs.writeBoolean(info.isNoRangeAcks()); + if (version >= 4) { + rc += tightMarshalObjectArray1(wireFormat, info.getNetworkConsumerPath(), bs); + } + + return rc + 9; + } + + /** + * Write a object instance to data output stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param dataOut the DataOut where the properties are written + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, source, dataOut, bs); + + ConsumerInfo info = (ConsumerInfo) source; + int version = wireFormat.getVersion(); + + tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs); + bs.readBoolean(); + tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs); + dataOut.writeInt(info.getPrefetchSize()); + dataOut.writeInt(info.getMaximumPendingMessageLimit()); + bs.readBoolean(); + tightMarshalString2(info.getSelector(), dataOut, bs); + if (version >= 10) { + tightMarshalString2(info.getClientId(), dataOut, bs); + } + tightMarshalString2(info.getSubscriptionName(), dataOut, bs); + bs.readBoolean(); + bs.readBoolean(); + bs.readBoolean(); + dataOut.writeByte(info.getPriority()); + tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs); + tightMarshalNestedObject2(wireFormat, (DataStructure)info.getAdditionalPredicate(), dataOut, bs); + bs.readBoolean(); + bs.readBoolean(); + bs.readBoolean(); + if (version >= 4) { + tightMarshalObjectArray2(wireFormat, info.getNetworkConsumerPath(), dataOut, bs); + } + } + + /** + * Write the object to the output using loose marshaling. + * + * @throws IOException if an error occurs while writing the data + */ + public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException { + ConsumerInfo info = (ConsumerInfo) source; + int version = wireFormat.getVersion(); + + super.looseMarshal(wireFormat, source, dataOut); + looseMarshalCachedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut); + dataOut.writeBoolean(info.isBrowser()); + looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut); + dataOut.writeInt(info.getPrefetchSize()); + dataOut.writeInt(info.getMaximumPendingMessageLimit()); + dataOut.writeBoolean(info.isDispatchAsync()); + looseMarshalString(info.getSelector(), dataOut); + if (version >= 10) { + looseMarshalString(info.getClientId(), dataOut); + } + looseMarshalString(info.getSubscriptionName(), dataOut); + dataOut.writeBoolean(info.isNoLocal()); + dataOut.writeBoolean(info.isExclusive()); + dataOut.writeBoolean(info.isRetroactive()); + dataOut.writeByte(info.getPriority()); + looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut); + looseMarshalNestedObject(wireFormat, (DataStructure)info.getAdditionalPredicate(), dataOut); + dataOut.writeBoolean(info.isNetworkSubscription()); + dataOut.writeBoolean(info.isOptimizedAcknowledge()); + dataOut.writeBoolean(info.isNoRangeAcks()); + if (version >= 4) { + looseMarshalObjectArray(wireFormat, info.getNetworkConsumerPath(), dataOut); + } + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * + * @throws IOException if an error occurs while writing the data + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException { + super.looseUnmarshal(wireFormat, target, dataIn); + + ConsumerInfo info = (ConsumerInfo) target; + int version = wireFormat.getVersion(); + + info.setConsumerId((ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn)); + info.setBrowser(dataIn.readBoolean()); + info.setDestination((OpenWireDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); + info.setPrefetchSize(dataIn.readInt()); + info.setMaximumPendingMessageLimit(dataIn.readInt()); + info.setDispatchAsync(dataIn.readBoolean()); + info.setSelector(looseUnmarshalString(dataIn)); + if (version >= 10) { + info.setClientId(looseUnmarshalString(dataIn)); + } + info.setSubscriptionName(looseUnmarshalString(dataIn)); + info.setNoLocal(dataIn.readBoolean()); + info.setExclusive(dataIn.readBoolean()); + info.setRetroactive(dataIn.readBoolean()); + info.setPriority(dataIn.readByte()); + if (dataIn.readBoolean()) { + short size = dataIn.readShort(); + BrokerId value[] = new BrokerId[size]; + for (int i = 0; i < size; i++) { + value[i] = (BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn); + } + info.setBrokerPath(value); + } else { + info.setBrokerPath(null); + } + info.setAdditionalPredicate((Object) looseUnmarsalNestedObject(wireFormat, dataIn)); + info.setNetworkSubscription(dataIn.readBoolean()); + info.setOptimizedAcknowledge(dataIn.readBoolean()); + info.setNoRangeAcks(dataIn.readBoolean()); + if (version >= 4) { + if (dataIn.readBoolean()) { + short size = dataIn.readShort(); + ConsumerId value[] = new ConsumerId[size]; + for (int i = 0; i < size; i++) { + value[i] = (ConsumerId) looseUnmarsalNestedObject(wireFormat,dataIn); + } + info.setNetworkConsumerPath(value); + } else { + info.setNetworkConsumerPath(null); + } + } + } +} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ControlCommandMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ControlCommandMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ControlCommandMarshaller.java new file mode 100644 index 0000000..536b7cf --- /dev/null +++ b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/ControlCommandMarshaller.java @@ -0,0 +1,131 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.openwire.codec.universal; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.activemq.openwire.codec.*; +import org.apache.activemq.openwire.commands.*; + +/** + * Marshalling code for Open Wire for ControlCommand + * + * NOTE!: This file is auto generated - do not modify! + * + */ +public class ControlCommandMarshaller extends BaseCommandMarshaller { + + /** + * Return the type of Data Structure handled by this Marshaler + * + * @return short representation of the type data structure + */ + public byte getDataStructureType() { + return ControlCommand.DATA_STRUCTURE_TYPE; + } + + /** + * @return a new instance of the managed type. + */ + public DataStructure createObject() { + return new ControlCommand(); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * @param bs the boolean stream where the type's booleans were marshaled + * + * @throws IOException if an error occurs while reading the data + */ + public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, target, dataIn, bs); + + ControlCommand info = (ControlCommand) target; + + info.setCommand(tightUnmarshalString(dataIn, bs)); + } + + /** + * Write the booleans that this object uses to a BooleanStream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException { + ControlCommand info = (ControlCommand) source; + + int rc = super.tightMarshal1(wireFormat, source, bs); + rc += tightMarshalString1(info.getCommand(), bs); + + return rc + 0; + } + + /** + * Write a object instance to data output stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param dataOut the DataOut where the properties are written + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, source, dataOut, bs); + + ControlCommand info = (ControlCommand) source; + + tightMarshalString2(info.getCommand(), dataOut, bs); + } + + /** + * Write the object to the output using loose marshaling. + * + * @throws IOException if an error occurs while writing the data + */ + public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException { + ControlCommand info = (ControlCommand) source; + + super.looseMarshal(wireFormat, source, dataOut); + looseMarshalString(info.getCommand(), dataOut); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * + * @throws IOException if an error occurs while writing the data + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException { + super.looseUnmarshal(wireFormat, target, dataIn); + + ControlCommand info = (ControlCommand) target; + + info.setCommand(looseUnmarshalString(dataIn)); + } +} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DataArrayResponseMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DataArrayResponseMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DataArrayResponseMarshaller.java new file mode 100644 index 0000000..8c50f26 --- /dev/null +++ b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DataArrayResponseMarshaller.java @@ -0,0 +1,149 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.openwire.codec.universal; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.activemq.openwire.codec.*; +import org.apache.activemq.openwire.commands.*; + +/** + * Marshalling code for Open Wire for DataArrayResponse + * + * NOTE!: This file is auto generated - do not modify! + * + */ +public class DataArrayResponseMarshaller extends ResponseMarshaller { + + /** + * Return the type of Data Structure handled by this Marshaler + * + * @return short representation of the type data structure + */ + public byte getDataStructureType() { + return DataArrayResponse.DATA_STRUCTURE_TYPE; + } + + /** + * @return a new instance of the managed type. + */ + public DataStructure createObject() { + return new DataArrayResponse(); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * @param bs the boolean stream where the type's booleans were marshaled + * + * @throws IOException if an error occurs while reading the data + */ + public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, target, dataIn, bs); + + DataArrayResponse info = (DataArrayResponse) target; + + if (bs.readBoolean()) { + short size = dataIn.readShort(); + DataStructure value[] = new DataStructure[size]; + for (int i = 0; i < size; i++) { + value[i] = (DataStructure) tightUnmarsalNestedObject(wireFormat,dataIn, bs); + } + info.setData(value); + } else { + info.setData(null); + } + } + + /** + * Write the booleans that this object uses to a BooleanStream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException { + DataArrayResponse info = (DataArrayResponse) source; + + int rc = super.tightMarshal1(wireFormat, source, bs); + rc += tightMarshalObjectArray1(wireFormat, info.getData(), bs); + + return rc + 0; + } + + /** + * Write a object instance to data output stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param dataOut the DataOut where the properties are written + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, source, dataOut, bs); + + DataArrayResponse info = (DataArrayResponse) source; + + tightMarshalObjectArray2(wireFormat, info.getData(), dataOut, bs); + } + + /** + * Write the object to the output using loose marshaling. + * + * @throws IOException if an error occurs while writing the data + */ + public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException { + DataArrayResponse info = (DataArrayResponse) source; + + super.looseMarshal(wireFormat, source, dataOut); + looseMarshalObjectArray(wireFormat, info.getData(), dataOut); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * + * @throws IOException if an error occurs while writing the data + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException { + super.looseUnmarshal(wireFormat, target, dataIn); + + DataArrayResponse info = (DataArrayResponse) target; + + if (dataIn.readBoolean()) { + short size = dataIn.readShort(); + DataStructure value[] = new DataStructure[size]; + for (int i = 0; i < size; i++) { + value[i] = (DataStructure) looseUnmarsalNestedObject(wireFormat,dataIn); + } + info.setData(value); + } else { + info.setData(null); + } + } +} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DataResponseMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DataResponseMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DataResponseMarshaller.java new file mode 100644 index 0000000..e51fbed --- /dev/null +++ b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DataResponseMarshaller.java @@ -0,0 +1,131 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.openwire.codec.universal; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.activemq.openwire.codec.*; +import org.apache.activemq.openwire.commands.*; + +/** + * Marshalling code for Open Wire for DataResponse + * + * NOTE!: This file is auto generated - do not modify! + * + */ +public class DataResponseMarshaller extends ResponseMarshaller { + + /** + * Return the type of Data Structure handled by this Marshaler + * + * @return short representation of the type data structure + */ + public byte getDataStructureType() { + return DataResponse.DATA_STRUCTURE_TYPE; + } + + /** + * @return a new instance of the managed type. + */ + public DataStructure createObject() { + return new DataResponse(); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * @param bs the boolean stream where the type's booleans were marshaled + * + * @throws IOException if an error occurs while reading the data + */ + public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, target, dataIn, bs); + + DataResponse info = (DataResponse) target; + + info.setData((DataStructure) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); + } + + /** + * Write the booleans that this object uses to a BooleanStream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException { + DataResponse info = (DataResponse) source; + + int rc = super.tightMarshal1(wireFormat, source, bs); + rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getData(), bs); + + return rc + 0; + } + + /** + * Write a object instance to data output stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param dataOut the DataOut where the properties are written + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, source, dataOut, bs); + + DataResponse info = (DataResponse) source; + + tightMarshalNestedObject2(wireFormat, (DataStructure)info.getData(), dataOut, bs); + } + + /** + * Write the object to the output using loose marshaling. + * + * @throws IOException if an error occurs while writing the data + */ + public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException { + DataResponse info = (DataResponse) source; + + super.looseMarshal(wireFormat, source, dataOut); + looseMarshalNestedObject(wireFormat, (DataStructure)info.getData(), dataOut); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * + * @throws IOException if an error occurs while writing the data + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException { + super.looseUnmarshal(wireFormat, target, dataIn); + + DataResponse info = (DataResponse) target; + + info.setData((DataStructure) looseUnmarsalNestedObject(wireFormat, dataIn)); + } +} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DestinationInfoMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DestinationInfoMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DestinationInfoMarshaller.java new file mode 100644 index 0000000..a55be2a --- /dev/null +++ b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DestinationInfoMarshaller.java @@ -0,0 +1,168 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.openwire.codec.universal; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.activemq.openwire.codec.*; +import org.apache.activemq.openwire.commands.*; + +/** + * Marshalling code for Open Wire for DestinationInfo + * + * NOTE!: This file is auto generated - do not modify! + * + */ +public class DestinationInfoMarshaller extends BaseCommandMarshaller { + + /** + * Return the type of Data Structure handled by this Marshaler + * + * @return short representation of the type data structure + */ + public byte getDataStructureType() { + return DestinationInfo.DATA_STRUCTURE_TYPE; + } + + /** + * @return a new instance of the managed type. + */ + public DataStructure createObject() { + return new DestinationInfo(); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * @param bs the boolean stream where the type's booleans were marshaled + * + * @throws IOException if an error occurs while reading the data + */ + public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, target, dataIn, bs); + + DestinationInfo info = (DestinationInfo) target; + + info.setConnectionId((ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); + info.setDestination((OpenWireDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); + info.setOperationType(dataIn.readByte()); + info.setTimeout(tightUnmarshalLong(wireFormat, dataIn, bs)); + if (bs.readBoolean()) { + short size = dataIn.readShort(); + BrokerId value[] = new BrokerId[size]; + for (int i = 0; i < size; i++) { + value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs); + } + info.setBrokerPath(value); + } else { + info.setBrokerPath(null); + } + } + + /** + * Write the booleans that this object uses to a BooleanStream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException { + DestinationInfo info = (DestinationInfo) source; + + int rc = super.tightMarshal1(wireFormat, source, bs); + rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs); + rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs); + rc += tightMarshalLong1(wireFormat, info.getTimeout(), bs); + rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs); + + return rc + 1; + } + + /** + * Write a object instance to data output stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param dataOut the DataOut where the properties are written + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, source, dataOut, bs); + + DestinationInfo info = (DestinationInfo) source; + + tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs); + tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs); + dataOut.writeByte(info.getOperationType()); + tightMarshalLong2(wireFormat, info.getTimeout(), dataOut, bs); + tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs); + } + + /** + * Write the object to the output using loose marshaling. + * + * @throws IOException if an error occurs while writing the data + */ + public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException { + DestinationInfo info = (DestinationInfo) source; + + super.looseMarshal(wireFormat, source, dataOut); + looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut); + looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut); + dataOut.writeByte(info.getOperationType()); + looseMarshalLong(wireFormat, info.getTimeout(), dataOut); + looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * + * @throws IOException if an error occurs while writing the data + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException { + super.looseUnmarshal(wireFormat, target, dataIn); + + DestinationInfo info = (DestinationInfo) target; + + info.setConnectionId((ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn)); + info.setDestination((OpenWireDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); + info.setOperationType(dataIn.readByte()); + info.setTimeout(looseUnmarshalLong(wireFormat, dataIn)); + if (dataIn.readBoolean()) { + short size = dataIn.readShort(); + BrokerId value[] = new BrokerId[size]; + for (int i = 0; i < size; i++) { + value[i] = (BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn); + } + info.setBrokerPath(value); + } else { + info.setBrokerPath(null); + } + } +} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DiscoveryEventMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DiscoveryEventMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DiscoveryEventMarshaller.java new file mode 100644 index 0000000..3a79c4e --- /dev/null +++ b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/universal/DiscoveryEventMarshaller.java @@ -0,0 +1,136 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.openwire.codec.universal; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.activemq.openwire.codec.*; +import org.apache.activemq.openwire.commands.*; + +/** + * Marshalling code for Open Wire for DiscoveryEvent + * + * NOTE!: This file is auto generated - do not modify! + * + */ +public class DiscoveryEventMarshaller extends BaseDataStreamMarshaller { + + /** + * Return the type of Data Structure handled by this Marshaler + * + * @return short representation of the type data structure + */ + public byte getDataStructureType() { + return DiscoveryEvent.DATA_STRUCTURE_TYPE; + } + + /** + * @return a new instance of the managed type. + */ + public DataStructure createObject() { + return new DiscoveryEvent(); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * @param bs the boolean stream where the type's booleans were marshaled + * + * @throws IOException if an error occurs while reading the data + */ + public void tightUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, target, dataIn, bs); + + DiscoveryEvent info = (DiscoveryEvent) target; + + info.setServiceName(tightUnmarshalString(dataIn, bs)); + info.setBrokerName(tightUnmarshalString(dataIn, bs)); + } + + /** + * Write the booleans that this object uses to a BooleanStream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public int tightMarshal1(OpenWireFormat wireFormat, Object source, BooleanStream bs) throws IOException { + DiscoveryEvent info = (DiscoveryEvent) source; + + int rc = super.tightMarshal1(wireFormat, source, bs); + rc += tightMarshalString1(info.getServiceName(), bs); + rc += tightMarshalString1(info.getBrokerName(), bs); + + return rc + 0; + } + + /** + * Write a object instance to data output stream + * + * @param wireFormat the OpenWireFormat instance to use + * @param source the object to marshal + * @param dataOut the DataOut where the properties are written + * @param bs the boolean stream where the type's booleans are written + * + * @throws IOException if an error occurs while writing the data + */ + public void tightMarshal2(OpenWireFormat wireFormat, Object source, DataOutput dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, source, dataOut, bs); + + DiscoveryEvent info = (DiscoveryEvent) source; + + tightMarshalString2(info.getServiceName(), dataOut, bs); + tightMarshalString2(info.getBrokerName(), dataOut, bs); + } + + /** + * Write the object to the output using loose marshaling. + * + * @throws IOException if an error occurs while writing the data + */ + public void looseMarshal(OpenWireFormat wireFormat, Object source, DataOutput dataOut) throws IOException { + DiscoveryEvent info = (DiscoveryEvent) source; + + super.looseMarshal(wireFormat, source, dataOut); + looseMarshalString(info.getServiceName(), dataOut); + looseMarshalString(info.getBrokerName(), dataOut); + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param target the object to un-marshal + * @param dataIn the data input stream to build the object from + * + * @throws IOException if an error occurs while writing the data + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object target, DataInput dataIn) throws IOException { + super.looseUnmarshal(wireFormat, target, dataIn); + + DiscoveryEvent info = (DiscoveryEvent) target; + + info.setServiceName(looseUnmarshalString(dataIn)); + info.setBrokerName(looseUnmarshalString(dataIn)); + } +}
