PageRenderTime 80ms CodeModel.GetById 72ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/protocols/ss7/isup/isup-impl/src/main/java/org/mobicents/protocols/ss7/isup/impl/message/BlockingMessageImpl.java

http://mobicents.googlecode.com/
Java | 129 lines | 39 code | 28 blank | 62 comment | 0 complexity | 48600d7b1e46bd7005217863dd5b21e7 MD5 | raw file
  1/*
  2 * JBoss, Home of Professional Open Source
  3 * Copyright 2011, Red Hat, Inc. and individual contributors
  4 * by the @authors tag. See the copyright.txt in the distribution for a
  5 * full listing of individual contributors.
  6 *
  7 * This is free software; you can redistribute it and/or modify it
  8 * under the terms of the GNU Lesser General Public License as
  9 * published by the Free Software Foundation; either version 2.1 of
 10 * the License, or (at your option) any later version.
 11 *
 12 * This software is distributed in the hope that it will be useful,
 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 15 * Lesser General Public License for more details.
 16 *
 17 * You should have received a copy of the GNU Lesser General Public
 18 * License along with this software; if not, write to the Free
 19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 21 */
 22
 23/**
 24 * Start time:00:03:30 2009-09-07<br>
 25 * Project: mobicents-isup-stack<br>
 26 * 
 27 * @author <a href="mailto:baranowb@gmail.com">Bartosz Baranowski </a>
 28 */
 29package org.mobicents.protocols.ss7.isup.impl.message;
 30
 31import java.util.Map;
 32import java.util.Set;
 33
 34import org.mobicents.protocols.ss7.isup.ISUPParameterFactory;
 35import org.mobicents.protocols.ss7.isup.ParameterException;
 36import org.mobicents.protocols.ss7.isup.impl.message.parameter.MessageTypeImpl;
 37import org.mobicents.protocols.ss7.isup.message.BlockingMessage;
 38import org.mobicents.protocols.ss7.isup.message.parameter.MessageType;
 39
 40/**
 41 * Start time:00:03:30 2009-09-07<br>
 42 * Project: mobicents-isup-stack<br>
 43 * 
 44 * @author <a href="mailto:baranowb@gmail.com">Bartosz Baranowski </a>
 45 */
 46public class BlockingMessageImpl extends ISUPMessageImpl implements BlockingMessage {
 47
 48	public static final MessageTypeImpl _MESSAGE_TYPE = new MessageTypeImpl(MESSAGE_CODE);
 49
 50	private static final int _MANDATORY_VAR_COUNT = 0;
 51
 52	static final int _INDEX_F_MessageType = 0;
 53
 54	BlockingMessageImpl(Set<Integer> mandatoryCodes, Set<Integer> mandatoryVariableCodes, Set<Integer> optionalCodes, Map<Integer, Integer> mandatoryCode2Index,
 55			Map<Integer, Integer> mandatoryVariableCode2Index, Map<Integer, Integer> optionalCode2Index) {
 56		super(mandatoryCodes, mandatoryVariableCodes, optionalCodes, mandatoryCode2Index, mandatoryVariableCode2Index, optionalCode2Index);
 57
 58		super.f_Parameters.put(_INDEX_F_MessageType, this.getMessageType());
 59		
 60	}
 61
 62	/*
 63	 * (non-Javadoc)
 64	 * 
 65	 * @see
 66	 * org.mobicents.protocols.ss7.isup.ISUPMessageImpl#decodeMandatoryVariableBody(byte
 67	 * [], int)
 68	 */
 69	
 70	protected void decodeMandatoryVariableBody(ISUPParameterFactory parameterFactory,byte[] parameterBody, int parameterIndex) throws ParameterException {
 71		throw new UnsupportedOperationException("This message does not support mandatory variable parameters.");
 72
 73	}
 74
 75	/*
 76	 * (non-Javadoc)
 77	 * 
 78	 * @see org.mobicents.protocols.ss7.isup.ISUPMessageImpl#decodeOptionalBody(byte[],
 79	 * byte)
 80	 */
 81	
 82	protected void decodeOptionalBody(ISUPParameterFactory parameterFactory,byte[] parameterBody, byte parameterCode) throws ParameterException {
 83		throw new UnsupportedOperationException("This message does not support optional parameters.");
 84
 85	}
 86
 87	
 88	protected int decodeMandatoryVariableParameters(ISUPParameterFactory parameterFactory,byte[] b, int index) throws ParameterException {
 89		throw new UnsupportedOperationException("This message does not support mandatory variable parameters.");
 90	}
 91
 92	/*
 93	 * (non-Javadoc)
 94	 * 
 95	 * @see org.mobicents.protocols.ss7.isup.ISUPMessageImpl#getMessageType()
 96	 */
 97	
 98	public MessageType getMessageType() {
 99		return this._MESSAGE_TYPE;
100	}
101
102	/*
103	 * (non-Javadoc)
104	 * 
105	 * @seeorg.mobicents.protocols.ss7.isup.ISUPMessageImpl#
106	 * getNumberOfMandatoryVariableLengthParameters()
107	 */
108	
109	protected int getNumberOfMandatoryVariableLengthParameters() {
110		return _MANDATORY_VAR_COUNT;
111	}
112
113	/*
114	 * (non-Javadoc)
115	 * 
116	 * @see org.mobicents.protocols.ss7.isup.ISUPMessageImpl#hasAllMandatoryParameters()
117	 */
118	
119	public boolean hasAllMandatoryParameters() {
120		return true;
121	}
122
123	
124	protected boolean optionalPartIsPossible() {
125
126		return false;
127	}
128
129}