public synchronized void postRic(String ricName, Map fields) throws RemoteException { try { if (fields.size() == 0) { return; } OMMMsg postMsg = this.pool.acquireMsg(); postMsg.clear(); // OMMMsg updateMessage = this.pool.acquireMsg(); // updateMessage.clear(); // // updateMessage.setMsgModelType(RDMMsgTypes.MARKET_PRICE); // updateMessage.setMsgType(OMMMsg.MsgType.UPDATE_RESP); this.encoder.initialize(OMMTypes.MSG, 1000); // this.encoder.encodeMsgInit(postMsg, OMMTypes.NO_DATA, OMMTypes.FIELD_LIST); postMsg.setMsgModelType(RDMMsgTypes.MARKET_PRICE); // postMsg.setMsgType(OMMMsg.MsgType.POST); postMsg.setMsgType(OMMMsg.MsgType.UPDATE_RESP); postMsg.setId(getNextPostingId()); // int indicationFlags = (OMMMsg.Indication.POST_COMPLETE | OMMMsg.Indication.POST_INIT); // postMsg.setIndicationFlags(indicationFlags); postMsg.setIndicationFlags(OMMMsg.Indication.DO_NOT_CONFLATE); postMsg.setRespTypeNum((short)1); postMsg.setState(OMMState.Stream.OPEN, OMMState.Data.OK, OMMState.Code.NONE, "All is Well!"); postMsg.setAttribInfo(this.serviceNameProv, ricName, RDMInstrument.NameType.RIC); this.encoder.encodeMsgInit(postMsg, OMMTypes.NO_DATA, OMMTypes.FIELD_LIST); this.pool.releaseMsg(postMsg); this.encoder.encodeFieldListInit(OMMFieldList.HAS_STANDARD_DATA, (short)0, (short)1, (short)0); for (Iterator iterator = fields.keySet().iterator(); iterator.hasNext();) { String fieldName = (String) iterator.next(); String fieldValue = fields.get(fieldName); FidDef fiddef1 = Dictionary.CURRENT_DICTIONARY.getFidDef(fieldName); switch (fiddef1.getMfeedType()) { case FidDef.MfeedType.PRICE: if (!fieldValue.matches("[0-9]+[\\.]?[0-9]*")) { _logger.log(Level.WARNING, "Invalid value ("+fieldValue+") for field="+fieldName+" and RIC="+ricName); return; } byte exponent = OMMNumeric.EXPONENT_0; int pointIndex = fieldValue.indexOf("."); if (pointIndex >= 0) { int fractionLength = fieldValue.substring(pointIndex+1).length(); if (fractionLength == 4) { exponent = OMMNumeric.EXPONENT_NEG4; } else if (fractionLength == 3) { exponent = OMMNumeric.EXPONENT_NEG3; } else if (fractionLength == 2) { exponent = OMMNumeric.EXPONENT_NEG2; } else if (fractionLength == 1) { exponent = OMMNumeric.EXPONENT_NEG1; } } this.encoder.encodeFieldEntryInit(fiddef1.getFieldId() , OMMTypes.REAL); this.encoder.encodeReal(Long.parseLong(fieldValue.replace(".", "")), exponent); break; default: break; } } this.encoder.encodeAggregateComplete(); OMMHandleItemCmd ommPostHandleItemCmd = new OMMHandleItemCmd(); ommPostHandleItemCmd.setMsg((OMMMsg)this.encoder.getEncodedObject()); ommPostHandleItemCmd.setHandle(this.loginHandle); this.consumer.submit(ommPostHandleItemCmd, ricName); } catch (Exception e) { _logger.log(Level.SEVERE, e.getMessage()); throw new RemoteException(e.getMessage()); } }