if (_authentication.type() != ClassesOfService.AuthenticationTypes.NOT_REQUIRED)
public TunnelStreamHandler() { // set the expected class of service for this provider (use defaults for common properties) _expectedClassOfService.authentication().type(ClassesOfService.AuthenticationTypes.OMM_LOGIN); _expectedClassOfService.flowControl().type(ClassesOfService.FlowControlTypes.BIDIRECTIONAL); _expectedClassOfService.dataIntegrity().type(ClassesOfService.DataIntegrityTypes.RELIABLE); }
/** * Checks if is send window open. * * @param buffer the buffer * @return true, if is send window open */ /* Determine if the recvWindow has room for sending data * (or, if no buffer is given, whether a message might be possible to send). */ boolean isSendWindowOpen(TunnelStreamBuffer buffer) { boolean retVal = true; if (_classOfService.flowControl().type() == ClassesOfService.FlowControlTypes.BIDIRECTIONAL) { if (_firstIsSendWindowOpenCall) { _firstIsSendWindowOpenCall = false; // always allow initial login if (_classOfService.authentication().type() == ClassesOfService.AuthenticationTypes.OMM_LOGIN) { return retVal; } } return _sendBytes + (buffer != null ? buffer.innerWriteBufferLength() : 0)<= _classOfService.flowControl().sendWindowSize(); } return retVal; }
private boolean isClassOfServiceValid(ClassOfService classOfService) { return (classOfService.common().maxMsgSize() == _expectedClassOfService.common().maxMsgSize() && classOfService.common().protocolType() == _expectedClassOfService.common().protocolType() && classOfService.common().protocolMajorVersion() == _expectedClassOfService.common().protocolMajorVersion() && classOfService.common().protocolMinorVersion() == _expectedClassOfService.common().protocolMinorVersion() && (classOfService.authentication().type() == _expectedClassOfService.authentication().type() || classOfService.authentication().type() == ClassesOfService.AuthenticationTypes.NOT_REQUIRED) && classOfService.flowControl().type() == _expectedClassOfService.flowControl().type() && classOfService.dataIntegrity().type() == _expectedClassOfService.dataIntegrity().type() && classOfService.guarantee().type() == _expectedClassOfService.guarantee().type()); }
_tunnelStreamOpenOptions.classOfService().authentication().type(ClassesOfService.AuthenticationTypes.OMM_LOGIN);
public int openStream(ChannelInfo chnlInfo, ReactorErrorInfo errorInfo) { int ret; _serviceId = chnlInfo.tsServiceInfo.serviceId(); _tunnelStreamOpenOptions.clear(); _tunnelStreamOpenOptions.name("BasicTunnelStream"); _tunnelStreamOpenOptions.classOfService().flowControl().type(ClassesOfService.FlowControlTypes.BIDIRECTIONAL); _tunnelStreamOpenOptions.classOfService().dataIntegrity().type(ClassesOfService.DataIntegrityTypes.RELIABLE); _tunnelStreamOpenOptions.streamId(TUNNEL_STREAM_STREAM_ID); _tunnelStreamOpenOptions.domainType(_tunnelDomain); _tunnelStreamOpenOptions.serviceId(_serviceId); _tunnelStreamOpenOptions.defaultMsgCallback(this); _tunnelStreamOpenOptions.statusEventCallback(this); if (_tunnelAuth) _tunnelStreamOpenOptions.classOfService().authentication().type(ClassesOfService.AuthenticationTypes.OMM_LOGIN); if ((ret = chnlInfo.reactorChannel.openTunnelStream(_tunnelStreamOpenOptions, errorInfo)) != ReactorReturnCodes.SUCCESS) { System.out.println("ReactorChannel.openTunnelStream() failed: " + CodecReturnCodes.toString(ret) + "(" + errorInfo.error().text() + ")"); } chnlInfo.tunnelStreamOpenSent = true; _chnlInfo = chnlInfo; return ReactorReturnCodes.SUCCESS; }
@Override public int listenerCallback(TunnelStreamRequestEvent event) { super.listenerCallback(event); /* Accept the tunnel stream request. */ _acceptOpts.clear(); _acceptOpts.statusEventCallback(this); _acceptOpts.defaultMsgCallback(this); _acceptOpts.classOfService().common().maxMsgSize(_maxMsgSize); _acceptOpts.classOfService().dataIntegrity().type(DataIntegrityTypes.RELIABLE); _acceptOpts.classOfService().flowControl().type(FlowControlTypes.BIDIRECTIONAL); _acceptOpts.classOfService().authentication().type(event.classOfService().authentication().type()); assertEquals(ReactorReturnCodes.SUCCESS, reactorChannel().acceptTunnelStream(event, _acceptOpts, _errorInfo)); return ReactorReturnCodes.SUCCESS; }
tsOpenOptions.classOfService().common().maxMsgSize(cos.common().maxMsgSize()); tsOpenOptions.classOfService().authentication().type(cos.authentication().type());
event.tunnelStream().classOfService().authentication().type() == ClassesOfService.AuthenticationTypes.OMM_LOGIN && _msg.domainType() == DomainTypes.LOGIN && _msg.msgClass() == MsgClasses.REQUEST)
_authentication.type((int)_tempUInt.toLong()); break; case ClassesOfService.FilterIds.FLOW_CONTROL:
/** This provider always rejects tunnel streams. */ class TunnelStreamRejectProvider extends Provider { TunnelStreamRejectOptions _rejectOptions = ReactorFactory.createTunnelStreamRejectOptions(); public TunnelStreamRejectProvider(TestReactor reactor) { super(reactor); } @Override public int listenerCallback(TunnelStreamRequestEvent event) { super.listenerCallback(event); /* Accept the tunnel stream request. */ _rejectOptions.clear(); _rejectOptions.state().streamState(StreamStates.CLOSED); _rejectOptions.state().dataState(DataStates.SUSPECT); _rejectOptions.state().code(StateCodes.NOT_ENTITLED); assertEquals(ReactorReturnCodes.SUCCESS, reactorChannel().rejectTunnelStream(event, _rejectOptions, _errorInfo)); return ReactorReturnCodes.SUCCESS; } }
_authentication.type() == ClassesOfService.AuthenticationTypes.OMM_LOGIN)
case ClassesOfService.FilterIds.AUTHENTICATION: _tempUInt.decode(_dIter); _authentication.type((int)_tempUInt.toLong()); break; case ClassesOfService.FilterIds.FLOW_CONTROL:
case ClassesOfService.FilterIds.AUTHENTICATION: _tempUInt.decode(_dIter); _authentication.type((int)_tempUInt.toLong()); break; case ClassesOfService.FilterIds.FLOW_CONTROL:
tsOpenOpts.domainType(DomainTypes.SYSTEM); tsOpenOpts.userSpecObject(consumer); tsOpenOpts.classOfService().authentication().type(AuthenticationTypes.OMM_LOGIN); assertEquals(614400, consTunnelStream.classOfService().common().maxMsgSize()); assertEquals(6144, consTunnelStream.classOfService().common().maxFragmentSize()); assertEquals(AuthenticationTypes.OMM_LOGIN, consTunnelStream.classOfService().authentication().type()); assertEquals(614400, provTunnelStream.classOfService().common().maxMsgSize()); assertEquals(6144, provTunnelStream.classOfService().common().maxFragmentSize()); assertEquals(AuthenticationTypes.OMM_LOGIN, provTunnelStream.classOfService().authentication().type()); assertEquals(FlowControlTypes.BIDIRECTIONAL, provTunnelStream.classOfService().flowControl().type()); assertEquals(CosCommon.DEFAULT_MAX_FRAGMENT_SIZE, provTunnelStream.classOfService().flowControl().sendWindowSize());
if (commonProperties.streamVersion() <= CosCommon.CURRENT_STREAM_VERSION) if (tunnelStream.classOfService().authentication().type() != ClassesOfService.AuthenticationTypes.OMM_LOGIN)
assertEquals(Codec.minorVersion(), consTunnelStream.classOfService().common().protocolMinorVersion()); assertEquals(maxMsgSize, consTunnelStream.classOfService().common().maxMsgSize()); assertEquals(AuthenticationTypes.NOT_REQUIRED, consTunnelStream.classOfService().authentication().type()); assertEquals(FlowControlTypes.BIDIRECTIONAL, consTunnelStream.classOfService().flowControl().type()); assertEquals(TunnelStream.DEFAULT_RECV_WINDOW, consTunnelStream.classOfService().flowControl().sendWindowSize()); assertEquals(Codec.minorVersion(), provTunnelStream.classOfService().common().protocolMinorVersion()); assertEquals(maxMsgSize, provTunnelStream.classOfService().common().maxMsgSize()); assertEquals(AuthenticationTypes.NOT_REQUIRED, provTunnelStream.classOfService().authentication().type()); assertEquals(FlowControlTypes.BIDIRECTIONAL, provTunnelStream.classOfService().flowControl().type()); assertEquals(provTunnelStream.classOfService().common().maxFragmentSize(), provTunnelStream.classOfService().flowControl().sendWindowSize());