package org.tomac.protocol.fix.messaging;
import org.tomac.protocol.fix.FixMessage;
import org.tomac.protocol.fix.FixValidationError;
import java.nio.ByteBuffer;
import org.tomac.protocol.fix.messaging.FixTags;
import org.tomac.protocol.fix.FixInMessage;
import org.tomac.protocol.fix.FixUtils;
public class FixSecurityTypes extends FixInMessage {
private short hasSecurityReqID;
byte[] securityReqID = new byte[FixUtils.FIX_MAX_STRING_LENGTH];
private short hasSecurityResponseID;
byte[] securityResponseID = new byte[FixUtils.FIX_MAX_STRING_LENGTH];
private short hasSecurityResponseType;
long securityResponseType = 0;
private short hasTotNoSecurityTypes;
long totNoSecurityTypes = 0;
private short hasLastFragment;
boolean lastFragment = false;
private short hasText;
byte[] text = new byte[FixUtils.FIX_MAX_STRING_TEXT_LENGTH];
private short hasEncodedTextLen;
long encodedTextLen = 0;
private short hasEncodedText;
byte[] encodedText = new byte[FixUtils.FIX_MAX_STRING_TEXT_LENGTH];
private short hasMarketID;
byte[] marketID = new byte[FixUtils.FIX_MAX_STRING_LENGTH];
private short hasMarketSegmentID;
byte[] marketSegmentID = new byte[FixUtils.FIX_MAX_STRING_LENGTH];
private short hasTradingSessionID;
byte[] tradingSessionID = new byte[FixUtils.FIX_MAX_STRING_LENGTH];
private short hasTradingSessionSubID;
byte[] tradingSessionSubID = new byte[FixUtils.FIX_MAX_STRING_LENGTH];
private short hasSubscriptionRequestType;
byte subscriptionRequestType = (byte)' ';
public FixApplicationSequenceControl applicationSequenceControl;
public FixSecTypesGrp[] secTypesGrp;
public FixSecurityTypes() {
super(FixMessageInfo.MessageTypes.SECURITYTYPES);
hasSecurityReqID = FixUtils.TAG_HAS_NO_VALUE;
securityReqID = new byte[FixUtils.FIX_MAX_STRING_LENGTH];
hasSecurityResponseID = FixUtils.TAG_HAS_NO_VALUE;
securityResponseID = new byte[FixUtils.FIX_MAX_STRING_LENGTH];
hasSecurityResponseType = FixUtils.TAG_HAS_NO_VALUE;
hasTotNoSecurityTypes = FixUtils.TAG_HAS_NO_VALUE;
hasLastFragment = FixUtils.TAG_HAS_NO_VALUE;
hasText = FixUtils.TAG_HAS_NO_VALUE;
text = new byte[FixUtils.FIX_MAX_STRING_TEXT_LENGTH];
hasEncodedTextLen = FixUtils.TAG_HAS_NO_VALUE;
hasEncodedText = FixUtils.TAG_HAS_NO_VALUE;
encodedText = new byte[FixUtils.FIX_MAX_STRING_TEXT_LENGTH];
hasMarketID = FixUtils.TAG_HAS_NO_VALUE;
marketID = new byte[FixUtils.FIX_MAX_STRING_LENGTH];
hasMarketSegmentID = FixUtils.TAG_HAS_NO_VALUE;
marketSegmentID = new byte[FixUtils.FIX_MAX_STRING_LENGTH];
hasTradingSessionID = FixUtils.TAG_HAS_NO_VALUE;
tradingSessionID = new byte[FixUtils.FIX_MAX_STRING_LENGTH];
hasTradingSessionSubID = FixUtils.TAG_HAS_NO_VALUE;
tradingSessionSubID = new byte[FixUtils.FIX_MAX_STRING_LENGTH];
hasSubscriptionRequestType = FixUtils.TAG_HAS_NO_VALUE;
applicationSequenceControl = new FixApplicationSequenceControl();
secTypesGrp = new FixSecTypesGrp[FixUtils.FIX_MAX_NOINGROUP];
for (int i= 0; i<FixUtils.FIX_MAX_NOINGROUP; i++) secTypesGrp[i] = new FixSecTypesGrp();
}
public void setBuffer( ByteBuffer buf, FixValidationError err)
{
super.setBuffer(buf, err);
if (err.hasError()) return;
int tag = FixUtils.getTag(buf, err);
if (err.hasError()) return;
while ( buf.hasRemaining() ) {
switch (tag) {
case FixTags.SECURITYREQID_INT:
hasSecurityReqID = (short) buf.position();
FixUtils.getNext(buf, err);
break;
case FixTags.SECURITYRESPONSEID_INT:
hasSecurityResponseID = (short) buf.position();
FixUtils.getNext(buf, err);
break;
case FixTags.SECURITYRESPONSETYPE_INT:
hasSecurityResponseType = (short) buf.position();
FixUtils.getNext(buf, err);
break;
case FixTags.TOTNOSECURITYTYPES_INT:
hasTotNoSecurityTypes = (short) buf.position();
FixUtils.getNext(buf, err);
break;
case FixTags.LASTFRAGMENT_INT:
hasLastFragment = (short) buf.position();
FixUtils.getNext(buf, err);
break;
case FixTags.TEXT_INT:
hasText = (short) buf.position();
FixUtils.getNext(buf, err);
break;
case FixTags.ENCODEDTEXTLEN_INT:
hasEncodedTextLen = (short) buf.position();
FixUtils.getNext(buf, err);
break;
case FixTags.ENCODEDTEXT_INT:
hasEncodedText = (short) buf.position();
FixUtils.getNext(buf, err);
break;
case FixTags.MARKETID_INT:
hasMarketID = (short) buf.position();
FixUtils.getNext(buf, err);
break;
case FixTags.MARKETSEGMENTID_INT:
hasMarketSegmentID = (short) buf.position();
FixUtils.getNext(buf, err);
break;
case FixTags.TRADINGSESSIONID_INT:
hasTradingSessionID = (short) buf.position();
FixUtils.getNext(buf, err);
break;
case FixTags.TRADINGSESSIONSUBID_INT:
hasTradingSessionSubID = (short) buf.position();
FixUtils.getNext(buf, err);
break;
case FixTags.SUBSCRIPTIONREQUESTTYPE_INT:
hasSubscriptionRequestType = (short) buf.position();
FixUtils.getNext(buf, err);
break;
default:
if ( standardHeader.isKeyTag(tag)) {
tag = standardHeader.setBuffer( tag, buf, err);
if (err.hasError()) break;
else continue;
} else if ( standardTrailer.isKeyTag(tag)) {
tag = standardTrailer.setBuffer( tag, buf, err);
FixUtils.unreadLastTag(tag, buf);
if (!err.hasError()) hasRequiredTags(err);
return; // always last, we are done now
} else if ( applicationSequenceControl.isKeyTag(tag)) {
tag = applicationSequenceControl.setBuffer( tag, buf, err);
if (err.hasError()) break;
else continue;
} else if ( tag == FixTags.NOSECURITYTYPES_INT ) {
int count = 0;
int noInGroupNumber = FixUtils.getTagIntValue(buf, err);
if (err.hasError()) break;
int repeatingGroupTag = FixUtils.getTag(buf, err);
if (err.hasError()) break;
if (noInGroupNumber <= 0 || noInGroupNumber > FixUtils.FIX_MAX_NOINGROUP) { err.setError((int)FixMessageInfo.SessionRejectReason.INCORRECT_NUMINGROUP_COUNT_FOR_REPEATING_GROUP, "no in group count exceeding max", tag);
return; }
while ( count < noInGroupNumber ) {
if ( !secTypesGrp[count].isKeyTag(repeatingGroupTag) ) {
err.setError((int)FixMessageInfo.SessionRejectReason.INCORRECT_NUMINGROUP_COUNT_FOR_REPEATING_GROUP, "Incorrect NumInGroup count for repeating group", FixTags.NOSECURITYTYPES_INT);
return;
}
count++;
repeatingGroupTag = secTypesGrp[count].setBuffer( repeatingGroupTag, buf, err);
if (err.hasError()) break;
}
if (err.hasError()) break;
else { tag = repeatingGroupTag; continue; }
} else {
FixUtils.getNext(buf, err);
if (err.hasError()) break;
else if (FixUtils.validateOnlyDefinedTagsAllowed) {
err.setError((int)FixMessageInfo.SessionRejectReason.TAG_NOT_DEFINED_FOR_THIS_MESSAGE_TYPE, "Tag not defined for this message type", tag, FixMessageInfo.MessageTypes.SECURITYTYPES_INT);
break;
}
}
}
if (err.hasError()) return;
tag = FixUtils.getTag(buf, err);
if (err.hasError()) break;
}
}
public boolean hasRequiredTags(FixValidationError err) {
if (!hasSecurityReqID()) {
err.setError((int)FixMessageInfo.SessionRejectReason.REQUIRED_TAG_MISSING, "Required tag missing", FixTags.SECURITYREQID_INT, FixMessageInfo.MessageTypes.SECURITYTYPES_INT);
return false;
}
if (!hasSecurityResponseID()) {
err.setError((int)FixMessageInfo.SessionRejectReason.REQUIRED_TAG_MISSING, "Required tag missing", FixTags.SECURITYRESPONSEID_INT, FixMessageInfo.MessageTypes.SECURITYTYPES_INT);
return false;
}
if (!hasSecurityResponseType()) {
err.setError((int)FixMessageInfo.SessionRejectReason.REQUIRED_TAG_MISSING, "Required tag missing", FixTags.SECURITYRESPONSETYPE_INT, FixMessageInfo.MessageTypes.SECURITYTYPES_INT);
return false;
}
return true;
}
@Override
public void getAll() {
getSecurityReqID();
getSecurityResponseID();
getSecurityResponseType();
getTotNoSecurityTypes();
getLastFragment();
getText();
getEncodedTextLen();
getEncodedText();
getMarketID();
getMarketSegmentID();
getTradingSessionID();
getTradingSessionSubID();
getSubscriptionRequestType();
}
@Override
public int encode(ByteBuffer out) {
int startPos = out.position();
super.standardHeader.setBodyLength(1000);
// if this is the standardHeader for an out-bound message wee need to set default tags
if (buf == null) {
super.standardHeader.setBeginString(FixMessageInfo.BEGINSTRING_VALUE);
}
super.standardHeader.encode(out);
if (hasSecurityReqID()) {
out.put(FixTags.SECURITYREQID);
out.put((byte) '=');
FixUtils.put(out,securityReqID);
out.put(FixUtils.SOH);
}
if (hasSecurityResponseID()) {
out.put(FixTags.SECURITYRESPONSEID);
out.put((byte) '=');
FixUtils.put(out,securityResponseID);
out.put(FixUtils.SOH);
}
if (hasSecurityResponseType()) {
out.put(FixTags.SECURITYRESPONSETYPE);
out.put((byte) '=');
FixUtils.put(out, (long)securityResponseType);
out.put(FixUtils.SOH);
}
if (hasTotNoSecurityTypes()) {
out.put(FixTags.TOTNOSECURITYTYPES);
out.put((byte) '=');
FixUtils.put(out, (long)totNoSecurityTypes);
out.put(FixUtils.SOH);
}
if (hasLastFragment()) {
out.put(FixTags.LASTFRAGMENT);
out.put((byte) '=');
out.put(lastFragment?(byte)'Y':(byte)'N' );
out.put(FixUtils.SOH);
}
if (hasText()) {
out.put(FixTags.TEXT);
out.put((byte) '=');
FixUtils.put(out,text);
out.put(FixUtils.SOH);
}
if (hasEncodedTextLen()) {
out.put(FixTags.ENCODEDTEXTLEN);
out.put((byte) '=');
FixUtils.put(out, (long)encodedTextLen);
out.put(FixUtils.SOH);
}
if (hasEncodedText()) {
out.put(FixTags.ENCODEDTEXT);
out.put((byte) '=');
FixUtils.put(out,encodedText);
out.put(FixUtils.SOH);
}
if (hasMarketID()) {
out.put(FixTags.MARKETID);
out.put((byte) '=');
FixUtils.put(out,marketID);
out.put(FixUtils.SOH);
}
if (hasMarketSegmentID()) {
out.put(FixTags.MARKETSEGMENTID);
out.put((byte) '=');
FixUtils.put(out,marketSegmentID);
out.put(FixUtils.SOH);
}
if (hasTradingSessionID()) {
out.put(FixTags.TRADINGSESSIONID);
out.put((byte) '=');
FixUtils.put(out,tradingSessionID);
out.put(FixUtils.SOH);
}
if (hasTradingSessionSubID()) {
out.put(FixTags.TRADINGSESSIONSUBID);
out.put((byte) '=');
FixUtils.put(out,tradingSessionSubID);
out.put(FixUtils.SOH);
}
if (hasSubscriptionRequestType()) {
out.put(FixTags.SUBSCRIPTIONREQUESTTYPE);
out.put((byte) '=');
FixUtils.put(out,subscriptionRequestType);
out.put(FixUtils.SOH);
}
applicationSequenceControl.encode(out);
if (FixUtils.getNoInGroup(secTypesGrp)>0) {
out.put(FixTags.NOSECURITYTYPES);
out.put((byte) '=' );
FixUtils.put(out, FixUtils.getNoInGroup(secTypesGrp));
out.put(FixUtils.SOH);
}
for (FixSecTypesGrp fixSecTypesGrp : secTypesGrp) if (fixSecTypesGrp.hasGroup()) fixSecTypesGrp.encode(out);
// set body length
int endPos = out.position();
super.standardHeader.setBodyLength(endPos - FixUtils.FIX_MESSAGE_START);
out.position(startPos + FixUtils.FIX_HEADER);
if (super.standardHeader.getBodyLength()>999) {
FixUtils.put(out, super.standardHeader.getBodyLength());
} else if (super.standardHeader.getBodyLength()>99) {
FixUtils.put(out, 0);
FixUtils.put(out, super.standardHeader.getBodyLength());
} else {
FixUtils.put(out, 0);
FixUtils.put(out, 0);
FixUtils.put(out, super.standardHeader.getBodyLength());
}
final byte[] tmpCheckSum = new byte[FixTags.CHECKSUM_LENGTH];
FixUtils.generateCheckSum(tmpCheckSum, out, startPos, endPos);
super.standardTrailer.setCheckSum(tmpCheckSum);
out.position(endPos);
super.standardTrailer.encode(out);
out.limit(out.position());
out.flip();
return (int) super.standardHeader.getBodyLength();
}
@Override
public void printBuffer(ByteBuffer out) {
int startPos = out.position();
super.standardHeader.encode(out);
if (hasSecurityReqID()) {
FixUtils.put(out,securityReqID);
out.put( (byte)' ' );
}
if (hasSecurityResponseID()) {
FixUtils.put(out,securityResponseID);
out.put( (byte)' ' );
}
if (hasSecurityResponseType()) {
FixUtils.put(out, (long)securityResponseType);
out.put( (byte)' ' );
}
if (hasTotNoSecurityTypes()) {
FixUtils.put(out, (long)totNoSecurityTypes);
out.put( (byte)' ' );
}
if (hasLastFragment()) {
out.put(lastFragment?(byte)'Y':(byte)'N' );
out.put( (byte)' ' );
}
if (hasText()) {
FixUtils.put(out,text);
out.put( (byte)' ' );
}
if (hasEncodedTextLen()) {
FixUtils.put(out, (long)encodedTextLen);
out.put( (byte)' ' );
}
if (hasEncodedText()) {
FixUtils.put(out,encodedText);
out.put( (byte)' ' );
}
if (hasMarketID()) {
FixUtils.put(out,marketID);
out.put( (byte)' ' );
}
if (hasMarketSegmentID()) {
FixUtils.put(out,marketSegmentID);
out.put( (byte)' ' );
}
if (hasTradingSessionID()) {
FixUtils.put(out,tradingSessionID);
out.put( (byte)' ' );
}
if (hasTradingSessionSubID()) {
FixUtils.put(out,tradingSessionSubID);
out.put( (byte)' ' );
}
if (hasSubscriptionRequestType()) {
FixUtils.put(out,subscriptionRequestType);
out.put( (byte)' ' );
}
super.standardTrailer.encode(out);
int endPos = out.position();
// set body length
super.standardHeader.setBodyLength( out.position() - startPos );
out.position(startPos + FixUtils.FIX_HEADER);
FixUtils.put( out, super.standardHeader.getBodyLength() );
out.position(endPos);
}
public void crackSecurityReqID() {
getSecurityReqID();
}
public byte[] getSecurityReqID() {
if ( hasSecurityReqID()) {
if (hasSecurityReqID == FixUtils.TAG_HAS_VALUE) {
return securityReqID;
} else {
buf.position(hasSecurityReqID);
FixUtils.getTagStringValue(buf, securityReqID, 0, securityReqID.length, err);
if (err.hasError()) {
buf.position(0);
return null;
}
}
hasSecurityReqID = FixUtils.TAG_HAS_VALUE;
buf.position(0);
return securityReqID;
} else {
return null;
}
}
public boolean hasSecurityReqID() { return hasSecurityReqID != FixUtils.TAG_HAS_NO_VALUE; }
public void setSecurityReqID(byte[] src) {
if (src == null ) return;
if (hasSecurityReqID()) FixUtils.fillNul(securityReqID);
FixUtils.copy(securityReqID, src);
hasSecurityReqID = FixUtils.TAG_HAS_VALUE;
}
public void setSecurityReqID(String str) {
if (str == null ) return;
if (hasSecurityReqID()) FixUtils.fillNul(securityReqID);
byte[] src = str.getBytes();
FixUtils.copy(securityReqID, src);
hasSecurityReqID = FixUtils.TAG_HAS_VALUE;
}
public void crackSecurityResponseID() {
getSecurityResponseID();
}
public byte[] getSecurityResponseID() {
if ( hasSecurityResponseID()) {
if (hasSecurityResponseID == FixUtils.TAG_HAS_VALUE) {
return securityResponseID;
} else {
buf.position(hasSecurityResponseID);
FixUtils.getTagStringValue(buf, securityResponseID, 0, securityResponseID.length, err);
if (err.hasError()) {
buf.position(0);
return null;
}
}
hasSecurityResponseID = FixUtils.TAG_HAS_VALUE;
buf.position(0);
return securityResponseID;
} else {
return null;
}
}
public boolean hasSecurityResponseID() { return hasSecurityResponseID != FixUtils.TAG_HAS_NO_VALUE; }
public void setSecurityResponseID(byte[] src) {
if (src == null ) return;
if (hasSecurityResponseID()) FixUtils.fillNul(securityResponseID);
FixUtils.copy(securityResponseID, src);
hasSecurityResponseID = FixUtils.TAG_HAS_VALUE;
}
public void setSecurityResponseID(String str) {
if (str == null ) return;
if (hasSecurityResponseID()) FixUtils.fillNul(securityResponseID);
byte[] src = str.getBytes();
FixUtils.copy(securityResponseID, src);
hasSecurityResponseID = FixUtils.TAG_HAS_VALUE;
}
public void crackSecurityResponseType() {
getSecurityResponseType();
}
public long getSecurityResponseType() {
if ( hasSecurityResponseType()) {
if (hasSecurityResponseType == FixUtils.TAG_HAS_VALUE) {
return securityResponseType;
} else {
buf.position(hasSecurityResponseType);
securityResponseType = FixUtils.getTagIntValue(buf, err);
if (err.hasError()) {
buf.position(0);
return 0;
}
}
hasSecurityResponseType = FixUtils.TAG_HAS_VALUE;
buf.position(0);
return securityResponseType;
} else {
return 0;
}
}
public boolean hasSecurityResponseType() { return hasSecurityResponseType != FixUtils.TAG_HAS_NO_VALUE; }
public void setSecurityResponseType(byte[] src) {
if (src == null ) return;
if (hasSecurityResponseType()) securityResponseType = FixUtils.TAG_HAS_NO_VALUE;
securityResponseType = FixUtils.longValueOf(src, 0, src.length);
hasSecurityResponseType = FixUtils.TAG_HAS_VALUE;
}
public void setSecurityResponseType(long src) {
securityResponseType = src;
hasSecurityResponseType = FixUtils.TAG_HAS_VALUE;
}
public void setSecurityResponseType(String str) {
if (str == null ) return;
if (hasSecurityResponseType()) securityResponseType = FixUtils.TAG_HAS_NO_VALUE;
byte[] src = str.getBytes();
securityResponseType = FixUtils.longValueOf(src, 0, src.length);
hasSecurityResponseType = FixUtils.TAG_HAS_VALUE;
}
public void crackTotNoSecurityTypes() {
getTotNoSecurityTypes();
}
public long getTotNoSecurityTypes() {
if ( hasTotNoSecurityTypes()) {
if (hasTotNoSecurityTypes == FixUtils.TAG_HAS_VALUE) {
return totNoSecurityTypes;
} else {
buf.position(hasTotNoSecurityTypes);
totNoSecurityTypes = FixUtils.getTagIntValue(buf, err);
if (err.hasError()) {
buf.position(0);
return 0;
}
}
hasTotNoSecurityTypes = FixUtils.TAG_HAS_VALUE;
buf.position(0);
return totNoSecurityTypes;
} else {
return 0;
}
}
public boolean hasTotNoSecurityTypes() { return hasTotNoSecurityTypes != FixUtils.TAG_HAS_NO_VALUE; }
public void setTotNoSecurityTypes(byte[] src) {
if (src == null ) return;
if (hasTotNoSecurityTypes()) totNoSecurityTypes = FixUtils.TAG_HAS_NO_VALUE;
totNoSecurityTypes = FixUtils.longValueOf(src, 0, src.length);
hasTotNoSecurityTypes = FixUtils.TAG_HAS_VALUE;
}
public void setTotNoSecurityTypes(long src) {
totNoSecurityTypes = src;
hasTotNoSecurityTypes = FixUtils.TAG_HAS_VALUE;
}
public void setTotNoSecurityTypes(String str) {
if (str == null ) return;
if (hasTotNoSecurityTypes()) totNoSecurityTypes = FixUtils.TAG_HAS_NO_VALUE;
byte[] src = str.getBytes();
totNoSecurityTypes = FixUtils.longValueOf(src, 0, src.length);
hasTotNoSecurityTypes = FixUtils.TAG_HAS_VALUE;
}
public void crackLastFragment() {
getLastFragment();
}
public boolean getLastFragment() {
if ( hasLastFragment()) {
if (hasLastFragment == FixUtils.TAG_HAS_VALUE) {
return lastFragment;
} else {
buf.position(hasLastFragment);
lastFragment = FixUtils.getTagCharValue(buf, err)=='Y'?true:false;
if (err.hasError()) {
buf.position(0);
return false;
}
}
hasLastFragment = FixUtils.TAG_HAS_VALUE;
buf.position(0);
return lastFragment;
} else {
return false;
}
}
public boolean hasLastFragment() { return hasLastFragment != FixUtils.TAG_HAS_NO_VALUE; }
public void setLastFragment(byte[] src) {
if (src == null ) return;
if (hasLastFragment()) lastFragment = false;
lastFragment = src[0]==(byte)'Y'?true:false;
hasLastFragment = FixUtils.TAG_HAS_VALUE;
}
public void setLastFragment(boolean src) {
lastFragment = src;
hasLastFragment = FixUtils.TAG_HAS_VALUE;
}
public void setLastFragment(String str) {
if (str == null ) return;
if (hasLastFragment()) lastFragment = false;
byte[] src = str.getBytes();
lastFragment = src[0]==(byte)'Y'?true:false;
hasLastFragment = FixUtils.TAG_HAS_VALUE;
}
public void crackText() {
getText();
}
public byte[] getText() {
if ( hasText()) {
if (hasText == FixUtils.TAG_HAS_VALUE) {
return text;
} else {
buf.position(hasText);
FixUtils.getTagStringValue(buf, text, 0, text.length, err);
if (err.hasError()) {
buf.position(0);
return null;
}
}
hasText = FixUtils.TAG_HAS_VALUE;
buf.position(0);
return text;
} else {
return null;
}
}
public boolean hasText() { return hasText != FixUtils.TAG_HAS_NO_VALUE; }
public void setText(byte[] src) {
if (src == null ) return;
if (hasText()) FixUtils.fillNul(text);
FixUtils.copy(text, src);
hasText = FixUtils.TAG_HAS_VALUE;
}
public void setText(String str) {
if (str == null ) return;
if (hasText()) FixUtils.fillNul(text);
byte[] src = str.getBytes();
FixUtils.copy(text, src);
hasText = FixUtils.TAG_HAS_VALUE;
}
public void crackEncodedTextLen() {
getEncodedTextLen();
}
public long getEncodedTextLen() {
if ( hasEncodedTextLen()) {
if (hasEncodedTextLen == FixUtils.TAG_HAS_VALUE) {
return encodedTextLen;
} else {
buf.position(hasEncodedTextLen);
encodedTextLen = FixUtils.getTagIntValue(buf, err);
if (err.hasError()) {
buf.position(0);
return 0;
}
}
hasEncodedTextLen = FixUtils.TAG_HAS_VALUE;
buf.position(0);
return encodedTextLen;
} else {
return 0;
}
}
public boolean hasEncodedTextLen() { return hasEncodedTextLen != FixUtils.TAG_HAS_NO_VALUE; }
public void setEncodedTextLen(byte[] src) {
if (src == null ) return;
if (hasEncodedTextLen()) encodedTextLen = FixUtils.TAG_HAS_NO_VALUE;
encodedTextLen = FixUtils.longValueOf(src, 0, src.length);
hasEncodedTextLen = FixUtils.TAG_HAS_VALUE;
}
public void setEncodedTextLen(long src) {
encodedTextLen = src;
hasEncodedTextLen = FixUtils.TAG_HAS_VALUE;
}
public void setEncodedTextLen(String str) {
if (str == null ) return;
if (hasEncodedTextLen()) encodedTextLen = FixUtils.TAG_HAS_NO_VALUE;
byte[] src = str.getBytes();
encodedTextLen = FixUtils.longValueOf(src, 0, src.length);
hasEncodedTextLen = FixUtils.TAG_HAS_VALUE;
}
public void crackEncodedText() {
getEncodedText();
}
public byte[] getEncodedText() {
if ( hasEncodedText()) {
if (hasEncodedText == FixUtils.TAG_HAS_VALUE) {
return encodedText;
} else {
buf.position(hasEncodedText);
FixUtils.getTagStringValue(buf, encodedText, 0, encodedText.length, err);
if (err.hasError()) {
buf.position(0);
return null;
}
}
hasEncodedText = FixUtils.TAG_HAS_VALUE;
buf.position(0);
return encodedText;
} else {
return null;
}
}
public boolean hasEncodedText() { return hasEncodedText != FixUtils.TAG_HAS_NO_VALUE; }
public void setEncodedText(byte[] src) {
if (src == null ) return;
if (hasEncodedText()) FixUtils.fillNul(encodedText);
FixUtils.copy(encodedText, src);
hasEncodedText = FixUtils.TAG_HAS_VALUE;
}
public void setEncodedText(String str) {
if (str == null ) return;
if (hasEncodedText()) FixUtils.fillNul(encodedText);
byte[] src = str.getBytes();
FixUtils.copy(encodedText, src);
hasEncodedText = FixUtils.TAG_HAS_VALUE;
}
public void crackMarketID() {
getMarketID();
}
public byte[] getMarketID() {
if ( hasMarketID()) {
if (hasMarketID == FixUtils.TAG_HAS_VALUE) {
return marketID;
} else {
buf.position(hasMarketID);
FixUtils.getTagStringValue(buf, marketID, 0, marketID.length, err);
if (err.hasError()) {
buf.position(0);
return null;
}
}
hasMarketID = FixUtils.TAG_HAS_VALUE;
buf.position(0);
return marketID;
} else {
return null;
}
}
public boolean hasMarketID() { return hasMarketID != FixUtils.TAG_HAS_NO_VALUE; }
public void setMarketID(byte[] src) {
if (src == null ) return;
if (hasMarketID()) FixUtils.fillNul(marketID);
FixUtils.copy(marketID, src);
hasMarketID = FixUtils.TAG_HAS_VALUE;
}
public void setMarketID(String str) {
if (str == null ) return;
if (hasMarketID()) FixUtils.fillNul(marketID);
byte[] src = str.getBytes();
FixUtils.copy(marketID, src);
hasMarketID = FixUtils.TAG_HAS_VALUE;
}
public void crackMarketSegmentID() {
getMarketSegmentID();
}
public byte[] getMarketSegmentID() {
if ( hasMarketSegmentID()) {
if (hasMarketSegmentID == FixUtils.TAG_HAS_VALUE) {
return marketSegmentID;
} else {
buf.position(hasMarketSegmentID);
FixUtils.getTagStringValue(buf, marketSegmentID, 0, marketSegmentID.length, err);
if (err.hasError()) {
buf.position(0);
return null;
}
}
hasMarketSegmentID = FixUtils.TAG_HAS_VALUE;
buf.position(0);
return marketSegmentID;
} else {
return null;
}
}
public boolean hasMarketSegmentID() { return hasMarketSegmentID != FixUtils.TAG_HAS_NO_VALUE; }
public void setMarketSegmentID(byte[] src) {
if (src == null ) return;
if (hasMarketSegmentID()) FixUtils.fillNul(marketSegmentID);
FixUtils.copy(marketSegmentID, src);
hasMarketSegmentID = FixUtils.TAG_HAS_VALUE;
}
public void setMarketSegmentID(String str) {
if (str == null ) return;
if (hasMarketSegmentID()) FixUtils.fillNul(marketSegmentID);
byte[] src = str.getBytes();
FixUtils.copy(marketSegmentID, src);
hasMarketSegmentID = FixUtils.TAG_HAS_VALUE;
}
public void crackTradingSessionID() {
getTradingSessionID();
}
public byte[] getTradingSessionID() {
if ( hasTradingSessionID()) {
if (hasTradingSessionID == FixUtils.TAG_HAS_VALUE) {
return tradingSessionID;
} else {
buf.position(hasTradingSessionID);
FixUtils.getTagStringValue(buf, tradingSessionID, 0, tradingSessionID.length, err);
if (err.hasError()) {
buf.position(0);
return null;
}
}
hasTradingSessionID = FixUtils.TAG_HAS_VALUE;
buf.position(0);
return tradingSessionID;
} else {
return null;
}
}
public boolean hasTradingSessionID() { return hasTradingSessionID != FixUtils.TAG_HAS_NO_VALUE; }
public void setTradingSessionID(byte[] src) {
if (src == null ) return;
if (hasTradingSessionID()) FixUtils.fillNul(tradingSessionID);
FixUtils.copy(tradingSessionID, src);
hasTradingSessionID = FixUtils.TAG_HAS_VALUE;
}
public void setTradingSessionID(String str) {
if (str == null ) return;
if (hasTradingSessionID()) FixUtils.fillNul(tradingSessionID);
byte[] src = str.getBytes();
FixUtils.copy(tradingSessionID, src);
hasTradingSessionID = FixUtils.TAG_HAS_VALUE;
}
public void crackTradingSessionSubID() {
getTradingSessionSubID();
}
public byte[] getTradingSessionSubID() {
if ( hasTradingSessionSubID()) {
if (hasTradingSessionSubID == FixUtils.TAG_HAS_VALUE) {
return tradingSessionSubID;
} else {
buf.position(hasTradingSessionSubID);
FixUtils.getTagStringValue(buf, tradingSessionSubID, 0, tradingSessionSubID.length, err);
if (err.hasError()) {
buf.position(0);
return null;
}
}
hasTradingSessionSubID = FixUtils.TAG_HAS_VALUE;
buf.position(0);
return tradingSessionSubID;
} else {
return null;
}
}
public boolean hasTradingSessionSubID() { return hasTradingSessionSubID != FixUtils.TAG_HAS_NO_VALUE; }
public void setTradingSessionSubID(byte[] src) {
if (src == null ) return;
if (hasTradingSessionSubID()) FixUtils.fillNul(tradingSessionSubID);
FixUtils.copy(tradingSessionSubID, src);
hasTradingSessionSubID = FixUtils.TAG_HAS_VALUE;
}
public void setTradingSessionSubID(String str) {
if (str == null ) return;
if (hasTradingSessionSubID()) FixUtils.fillNul(tradingSessionSubID);
byte[] src = str.getBytes();
FixUtils.copy(tradingSessionSubID, src);
hasTradingSessionSubID = FixUtils.TAG_HAS_VALUE;
}
public void crackSubscriptionRequestType() {
getSubscriptionRequestType();
}
public byte getSubscriptionRequestType() {
if ( hasSubscriptionRequestType()) {
if (hasSubscriptionRequestType == FixUtils.TAG_HAS_VALUE) {
return subscriptionRequestType;
} else {
buf.position(hasSubscriptionRequestType);
subscriptionRequestType = FixUtils.getTagCharValue(buf, err);
if( !err.hasError() && (subscriptionRequestType != (byte)'2') && (subscriptionRequestType != (byte)'1') && (subscriptionRequestType != (byte)'0') && true)
err.setError((int)FixMessageInfo.SessionRejectReason.VALUE_IS_INCORRECT_OUT_OF_RANGE_FOR_THIS_TAG,
"Tag msgType missing got " + 263);
if (err.hasError()) {
buf.position(0);
return (byte)'0';
}
}
hasSubscriptionRequestType = FixUtils.TAG_HAS_VALUE;
buf.position(0);
return subscriptionRequestType;
} else {
return (byte)'0';
}
}
public boolean hasSubscriptionRequestType() { return hasSubscriptionRequestType != FixUtils.TAG_HAS_NO_VALUE; }
public void setSubscriptionRequestType(byte[] src) {
if (src == null ) return;
if (hasSubscriptionRequestType()) subscriptionRequestType = (byte)' ';
subscriptionRequestType = src[0];
hasSubscriptionRequestType = FixUtils.TAG_HAS_VALUE;
}
public void setSubscriptionRequestType(byte src) {
subscriptionRequestType = src;
hasSubscriptionRequestType = FixUtils.TAG_HAS_VALUE;
}
public void setSubscriptionRequestType(String str) {
if (str == null ) return;
if (hasSubscriptionRequestType()) subscriptionRequestType = (byte)' ';
byte[] src = str.getBytes();
subscriptionRequestType = src[0];
hasSubscriptionRequestType = FixUtils.TAG_HAS_VALUE;
}
/**
* If you use toString for any other purpose than administrative printout.
* You will burn in hell!
**/
@Override
public String toString() {
String s = "";
try {
if (standardHeader.hasBeginString()) s += "BeginString(8)= " + new String( FixUtils.trim(standardHeader.getBeginString()) ) + "\n" ;
if (standardHeader.hasBodyLength()) s += "BodyLength(9)= " + standardHeader.getBodyLength() + "\n" ;
if (standardHeader.hasMsgType()) s += "MsgType(35)= " + new String( FixUtils.trim(standardHeader.getMsgType()) ) + "\n" ;
if (standardHeader.hasApplVerID()) s += "ApplVerID(1128)= " + new String( FixUtils.trim(standardHeader.getApplVerID()) ) + "\n" ;
if (standardHeader.hasCstmApplVerID()) s += "CstmApplVerID(1129)= " + new String( FixUtils.trim(standardHeader.getCstmApplVerID()) ) + "\n" ;
if (standardHeader.hasApplExtID()) s += "ApplExtID(1156)= " + standardHeader.getApplExtID() + "\n" ;
if (standardHeader.hasSenderCompID()) s += "SenderCompID(49)= " + new String( FixUtils.trim(standardHeader.getSenderCompID()) ) + "\n" ;
if (standardHeader.hasTargetCompID()) s += "TargetCompID(56)= " + new String( FixUtils.trim(standardHeader.getTargetCompID()) ) + "\n" ;
if (standardHeader.hasOnBehalfOfCompID()) s += "OnBehalfOfCompID(115)= " + new String( FixUtils.trim(standardHeader.getOnBehalfOfCompID()) ) + "\n" ;
if (standardHeader.hasDeliverToCompID()) s += "DeliverToCompID(128)= " + new String( FixUtils.trim(standardHeader.getDeliverToCompID()) ) + "\n" ;
if (standardHeader.hasSecureDataLen()) s += "SecureDataLen(90)= " + standardHeader.getSecureDataLen() + "\n" ;
if (standardHeader.hasSecureData()) s += "SecureData(91)= " + new String( FixUtils.trim(standardHeader.getSecureData()) ) + "\n" ;
if (standardHeader.hasMsgSeqNum()) s += "MsgSeqNum(34)= " + standardHeader.getMsgSeqNum() + "\n" ;
if (standardHeader.hasSenderSubID()) s += "SenderSubID(50)= " + new String( FixUtils.trim(standardHeader.getSenderSubID()) ) + "\n" ;
if (standardHeader.hasSenderLocationID()) s += "SenderLocationID(142)= " + new String( FixUtils.trim(standardHeader.getSenderLocationID()) ) + "\n" ;
if (standardHeader.hasTargetSubID()) s += "TargetSubID(57)= " + new String( FixUtils.trim(standardHeader.getTargetSubID()) ) + "\n" ;
if (standardHeader.hasTargetLocationID()) s += "TargetLocationID(143)= " + new String( FixUtils.trim(standardHeader.getTargetLocationID()) ) + "\n" ;
if (standardHeader.hasOnBehalfOfSubID()) s += "OnBehalfOfSubID(116)= " + new String( FixUtils.trim(standardHeader.getOnBehalfOfSubID()) ) + "\n" ;
if (standardHeader.hasOnBehalfOfLocationID()) s += "OnBehalfOfLocationID(144)= " + new String( FixUtils.trim(standardHeader.getOnBehalfOfLocationID()) ) + "\n" ;
if (standardHeader.hasDeliverToSubID()) s += "DeliverToSubID(129)= " + new String( FixUtils.trim(standardHeader.getDeliverToSubID()) ) + "\n" ;
if (standardHeader.hasDeliverToLocationID()) s += "DeliverToLocationID(145)= " + new String( FixUtils.trim(standardHeader.getDeliverToLocationID()) ) + "\n" ;
if (standardHeader.hasPossDupFlag()) s += "PossDupFlag(43)= " + standardHeader.getPossDupFlag() + "\n" ;
if (standardHeader.hasPossResend()) s += "PossResend(97)= " + standardHeader.getPossResend() + "\n" ;
if (standardHeader.hasSendingTime()) s += "SendingTime(52)= " + new String( FixUtils.trim(standardHeader.getSendingTime()) ) + "\n" ;
if (standardHeader.hasOrigSendingTime()) s += "OrigSendingTime(122)= " + new String( FixUtils.trim(standardHeader.getOrigSendingTime()) ) + "\n" ;
if (standardHeader.hasXmlDataLen()) s += "XmlDataLen(212)= " + standardHeader.getXmlDataLen() + "\n" ;
if (standardHeader.hasXmlData()) s += "XmlData(213)= " + new String( FixUtils.trim(standardHeader.getXmlData()) ) + "\n" ;
if (standardHeader.hasMessageEncoding()) s += "MessageEncoding(347)= " + new String( FixUtils.trim(standardHeader.getMessageEncoding()) ) + "\n" ;
if (standardHeader.hasLastMsgSeqNumProcessed()) s += "LastMsgSeqNumProcessed(369)= " + standardHeader.getLastMsgSeqNumProcessed() + "\n" ;
if (hasSecurityReqID()) s += "SecurityReqID(320)= " + new String( FixUtils.trim(getSecurityReqID()) ) + "\n" ;
if (hasSecurityResponseID()) s += "SecurityResponseID(322)= " + new String( FixUtils.trim(getSecurityResponseID()) ) + "\n" ;
if (hasSecurityResponseType()) s += "SecurityResponseType(323)= " + getSecurityResponseType() + "\n" ;
if (hasTotNoSecurityTypes()) s += "TotNoSecurityTypes(557)= " + getTotNoSecurityTypes() + "\n" ;
if (hasLastFragment()) s += "LastFragment(893)= " + getLastFragment() + "\n" ;
if (hasText()) s += "Text(58)= " + new String( FixUtils.trim(getText()) ) + "\n" ;
if (hasEncodedTextLen()) s += "EncodedTextLen(354)= " + getEncodedTextLen() + "\n" ;
if (hasEncodedText()) s += "EncodedText(355)= " + new String( FixUtils.trim(getEncodedText()) ) + "\n" ;
if (hasMarketID()) s += "MarketID(1301)= " + new String( FixUtils.trim(getMarketID()) ) + "\n" ;
if (hasMarketSegmentID()) s += "MarketSegmentID(1300)= " + new String( FixUtils.trim(getMarketSegmentID()) ) + "\n" ;
if (hasTradingSessionID()) s += "TradingSessionID(336)= " + new String( FixUtils.trim(getTradingSessionID()) ) + "\n" ;
if (hasTradingSessionSubID()) s += "TradingSessionSubID(625)= " + new String( FixUtils.trim(getTradingSessionSubID()) ) + "\n" ;
if (hasSubscriptionRequestType()) s += "SubscriptionRequestType(263)= " + getSubscriptionRequestType() + "\n" ;
if (standardTrailer.hasSignatureLength()) s += "SignatureLength(93)= " + standardTrailer.getSignatureLength() + "\n" ;
if (standardTrailer.hasSignature()) s += "Signature(89)= " + new String( FixUtils.trim(standardTrailer.getSignature()) ) + "\n" ;
if (standardTrailer.hasCheckSum()) s += "CheckSum(10)= " + new String( FixUtils.trim(standardTrailer.getCheckSum()) ) + "\n" ;
} catch(Exception e) { };
return s;
}
@Override
public boolean equals(Object o) {
if (! ( o instanceof FixSecurityTypes)) return false;
FixSecurityTypes msg = (FixSecurityTypes) o;
if (!standardHeader.equals(msg.standardHeader)) return false;
if ((hasSecurityReqID() && !msg.hasSecurityReqID()) || (!hasSecurityReqID() && msg.hasSecurityReqID())) return false;
if (!(!hasSecurityReqID() && !msg.hasSecurityReqID()) && !FixUtils.equals(getSecurityReqID(), msg.getSecurityReqID())) return false;
if ((hasSecurityResponseID() && !msg.hasSecurityResponseID()) || (!hasSecurityResponseID() && msg.hasSecurityResponseID())) return false;
if (!(!hasSecurityResponseID() && !msg.hasSecurityResponseID()) && !FixUtils.equals(getSecurityResponseID(), msg.getSecurityResponseID())) return false;
if ((hasSecurityResponseType() && !msg.hasSecurityResponseType()) || (!hasSecurityResponseType() && msg.hasSecurityResponseType())) return false;
if (!(!hasSecurityResponseType() && !msg.hasSecurityResponseType()) && !(getSecurityResponseType()==msg.getSecurityResponseType())) return false;
if ((hasTotNoSecurityTypes() && !msg.hasTotNoSecurityTypes()) || (!hasTotNoSecurityTypes() && msg.hasTotNoSecurityTypes())) return false;
if (!(!hasTotNoSecurityTypes() && !msg.hasTotNoSecurityTypes()) && !(getTotNoSecurityTypes()==msg.getTotNoSecurityTypes())) return false;
if ((hasLastFragment() && !msg.hasLastFragment()) || (!hasLastFragment() && msg.hasLastFragment())) return false;
if (!(!hasLastFragment() && !msg.hasLastFragment()) && !(getLastFragment()==msg.getLastFragment())) return false;
if ((hasText() && !msg.hasText()) || (!hasText() && msg.hasText())) return false;
if (!(!hasText() && !msg.hasText()) && !FixUtils.equals(getText(), msg.getText())) return false;
if ((hasEncodedTextLen() && !msg.hasEncodedTextLen()) || (!hasEncodedTextLen() && msg.hasEncodedTextLen())) return false;
if (!(!hasEncodedTextLen() && !msg.hasEncodedTextLen()) && !(getEncodedTextLen()==msg.getEncodedTextLen())) return false;
if ((hasEncodedText() && !msg.hasEncodedText()) || (!hasEncodedText() && msg.hasEncodedText())) return false;
if (!(!hasEncodedText() && !msg.hasEncodedText()) && !FixUtils.equals(getEncodedText(), msg.getEncodedText())) return false;
if ((hasMarketID() && !msg.hasMarketID()) || (!hasMarketID() && msg.hasMarketID())) return false;
if (!(!hasMarketID() && !msg.hasMarketID()) && !FixUtils.equals(getMarketID(), msg.getMarketID())) return false;
if ((hasMarketSegmentID() && !msg.hasMarketSegmentID()) || (!hasMarketSegmentID() && msg.hasMarketSegmentID())) return false;
if (!(!hasMarketSegmentID() && !msg.hasMarketSegmentID()) && !FixUtils.equals(getMarketSegmentID(), msg.getMarketSegmentID())) return false;
if ((hasTradingSessionID() && !msg.hasTradingSessionID()) || (!hasTradingSessionID() && msg.hasTradingSessionID())) return false;
if (!(!hasTradingSessionID() && !msg.hasTradingSessionID()) && !FixUtils.equals(getTradingSessionID(), msg.getTradingSessionID())) return false;
if ((hasTradingSessionSubID() && !msg.hasTradingSessionSubID()) || (!hasTradingSessionSubID() && msg.hasTradingSessionSubID())) return false;
if (!(!hasTradingSessionSubID() && !msg.hasTradingSessionSubID()) && !FixUtils.equals(getTradingSessionSubID(), msg.getTradingSessionSubID())) return false;
if ((hasSubscriptionRequestType() && !msg.hasSubscriptionRequestType()) || (!hasSubscriptionRequestType() && msg.hasSubscriptionRequestType())) return false;
if (!(!hasSubscriptionRequestType() && !msg.hasSubscriptionRequestType()) && !(getSubscriptionRequestType()==msg.getSubscriptionRequestType())) return false;
return true;
}
@Override
public FixSecurityTypes clone () {
FixSecurityTypes out = new FixSecurityTypes();
standardHeader.clone(out.standardHeader);
standardTrailer.clone(out.standardTrailer);
return clone(out);
}
public FixSecurityTypes clone ( FixSecurityTypes out ) {
if ( hasSecurityReqID())
out.setSecurityReqID(getSecurityReqID());
if ( hasSecurityResponseID())
out.setSecurityResponseID(getSecurityResponseID());
if ( hasSecurityResponseType())
out.setSecurityResponseType(getSecurityResponseType());
if ( hasTotNoSecurityTypes())
out.setTotNoSecurityTypes(getTotNoSecurityTypes());
if ( hasLastFragment())
out.setLastFragment(getLastFragment());
if ( hasText())
out.setText(getText());
if ( hasEncodedTextLen())
out.setEncodedTextLen(getEncodedTextLen());
if ( hasEncodedText())
out.setEncodedText(getEncodedText());
if ( hasMarketID())
out.setMarketID(getMarketID());
if ( hasMarketSegmentID())
out.setMarketSegmentID(getMarketSegmentID());
if ( hasTradingSessionID())
out.setTradingSessionID(getTradingSessionID());
if ( hasTradingSessionSubID())
out.setTradingSessionSubID(getTradingSessionSubID());
if ( hasSubscriptionRequestType())
out.setSubscriptionRequestType(getSubscriptionRequestType());
if (applicationSequenceControl.hasGroup())
out.applicationSequenceControl = applicationSequenceControl.clone( out.applicationSequenceControl);
int count = 0;
count = 0;
for (FixSecTypesGrp fixSecTypesGrp : secTypesGrp) {
if (!fixSecTypesGrp.hasGroup()) continue;
out.secTypesGrp[count] = fixSecTypesGrp.clone( out.secTypesGrp[count] );
count++;
}
return out;
}
}
|