private boolean hasEqualBindType(BindParameter other) { if (bindType == null) { if (other.bindType != null) { return false; } } return bindType.equals(other.bindType); }
/** * Get the <tt>BindType</tt> by specified command_id. * * @param bindCommandId is the command_id. * @return the enum const associated with the specified * <tt>bindCommandId</tt>. * @throws IllegalArgumentException if there is no <tt>BindType</tt> * associated with specified <tt>bindCommandId</tt> found. */ public static final BindType valueOf(int bindCommandId) throws IllegalArgumentException { for (BindType bindType : values()) { if (bindType.bindCommandId == bindCommandId) { return bindType; } } throw new IllegalArgumentException( "No enum const BindType with command id " + bindCommandId); } }
/** * Reject the bind request. * * @param errorCode is the reason of rejection. * @throws IllegalStateException if the acceptance or rejection has been made. * @throws IOException if the connection already closed. * @see {@link #accept(String systemId, InterfaceVersion interfaceVersion)} */ public void reject(int errorCode) throws IllegalStateException, IOException { lock.lock(); try { if (done) { throw new IllegalStateException("Response already initiated"); } else { done = true; try { responseHandler.sendNegativeResponse(bindType.commandId(), errorCode, originalSequenceNumber); } finally { condition.signal(); } } } finally { lock.unlock(); } } }
public void sendBindResp(String systemId, InterfaceVersion interfaceVersion, BindType bindType, int sequenceNumber) throws IOException { SMPPOutboundSession.this.sessionContext.bound(bindType); try { pduSender().sendBindResp(SMPPOutboundSession.this.out, bindType.responseCommandId(), sequenceNumber, systemId, interfaceVersion); } catch (PDUStringException e) { logger.error("Failed sending bind response", e); // TODO uudashr: we have double checking when accept the bind request } }
public BindRequest(Bind bind, ServerResponseHandler responseHandler) { this(bind.getSequenceNumber(), BindType.valueOf(bind.getCommandId()), bind.getSystemId(), bind.getPassword(), bind.getSystemType(), TypeOfNumber.valueOf(bind.getAddrTon()), NumberingPlanIndicator.valueOf(bind.getAddrNpi()), bind.getAddressRange(), responseHandler); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((addrNpi == null) ? 0 : addrNpi.hashCode()); result = prime * result + ((addrTon == null) ? 0 : addrTon.hashCode()); result = prime * result + ((addressRange == null) ? 0 : addressRange.hashCode()); result = prime * result + ((bindType == null) ? 0 : bindType.hashCode()); result = prime * result + ((password == null) ? 0 : password.hashCode()); result = prime * result + ((systemId == null) ? 0 : systemId.hashCode()); result = prime * result + ((systemType == null) ? 0 : systemType.hashCode()); return result; }
/** * Reject the bind request. * * @param errorCode is the reason of rejection. * @throws IllegalStateException if the acceptance or rejection has been made. * @throws IOException if the connection already closed. * @see {@link #accept()} */ public void reject(int errorCode) throws IllegalStateException, IOException { lock.lock(); try { if (done) { throw new IllegalStateException("Response already initiated"); } else { done = true; try { responseHandler.sendNegativeResponse(bindType.commandId(), errorCode, originalSequenceNumber); } finally { condition.signal(); } } } finally { lock.unlock(); } } }
public void sendBindResp(String systemId, BindType bindType, int sequenceNumber) throws IOException { sessionContext.bound(bindType); try { pduSender().sendBindResp(out, bindType.responseCommandId(), sequenceNumber, systemId); } catch (PDUStringException e) { logger.error("Failed sending bind response", e); // TODO uudashr: we have double checking when accept the bind request } }
public BindRequest(Bind bind, ServerResponseHandler responseHandler) { this(bind.getSequenceNumber(), BindType.valueOf(bind.getCommandId()), bind.getSystemId(), bind.getPassword(), bind.getSystemType(), TypeOfNumber.valueOf(bind.getAddrTon()), NumberingPlanIndicator.valueOf(bind.getAddrNpi()), bind.getAddressRange(), responseHandler); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((addrNpi == null) ? 0 : addrNpi.hashCode()); result = prime * result + ((addrTon == null) ? 0 : addrTon.hashCode()); result = prime * result + ((addressRange == null) ? 0 : addressRange.hashCode()); result = prime * result + ((bindType == null) ? 0 : bindType.hashCode()); result = prime * result + ((password == null) ? 0 : password.hashCode()); result = prime * result + ((systemId == null) ? 0 : systemId.hashCode()); result = prime * result + ((systemType == null) ? 0 : systemType.hashCode()); return result; }
private boolean hasEqualBindType(BindParameter other) { if (bindType == null && other.bindType != null) { return false; } return bindType.equals(other.bindType); }
/** * Reject the bind request. * * @param errorCode is the reason of rejection. * @throws IllegalStateException if the acceptance or rejection has been made. * @throws IOException if the connection already closed. * @see {@link #accept()} */ public void reject(int errorCode) throws IllegalStateException, IOException { lock.lock(); try { if (done) { throw new IllegalStateException("Response already initiated"); } else { done = true; try { responseHandler.sendNegativeResponse(bindType.commandId(), errorCode, originalSequenceNumber); } finally { condition.signal(); } } } finally { lock.unlock(); } } }
public void sendBindResp(String systemId, InterfaceVersion interfaceVersion, BindType bindType, int sequenceNumber) throws IOException { sessionContext.bound(bindType); try { pduSender().sendBindResp(out, bindType.responseCommandId(), sequenceNumber, systemId, interfaceVersion); } catch (PDUStringException e) { logger.error("Failed sending bind response", e); // TODO uudashr: we have double checking when accept the bind request } }
public BindRequest(Bind bind, GenericServerResponseHandler responseHandler) { this(bind.getSequenceNumber(), BindType.valueOf(bind.getCommandId()), bind.getSystemId(), bind.getPassword(), bind.getSystemType(), TypeOfNumber.valueOf(bind.getAddrTon()), NumberingPlanIndicator.valueOf(bind.getAddrNpi()), bind.getAddressRange(), InterfaceVersion.valueOf(bind.getInterfaceVersion()), responseHandler); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((addrNpi == null) ? 0 : addrNpi.hashCode()); result = prime * result + ((addrTon == null) ? 0 : addrTon.hashCode()); result = prime * result + ((addressRange == null) ? 0 : addressRange.hashCode()); result = prime * result + ((bindType == null) ? 0 : bindType.hashCode()); result = prime * result + ((password == null) ? 0 : password.hashCode()); result = prime * result + ((systemId == null) ? 0 : systemId.hashCode()); result = prime * result + ((systemType == null) ? 0 : systemType.hashCode()); result = prime * result + ((interfaceVersion == null) ? 0 : interfaceVersion.hashCode()); return result; }
/** * Get the <tt>BindType</tt> by specified command_id. * * @param bindCommandId is the command_id. * @return the enum const associated with the specified * <tt>bindCommandId</tt>. * @throws IllegalArgumentException if there is no <tt>BindType</tt> * associated with specified <tt>bindCommandId</tt> found. */ public static final BindType valueOf(int bindCommandId) throws IllegalArgumentException { for (BindType bindType : values()) { if (bindType.bindCommandId == bindCommandId) { return bindType; } } throw new IllegalArgumentException( "No enum const BindType with command id " + bindCommandId); } }
private boolean hasEqualBindType(BindParameter other) { if (bindType == null) { if (other.bindType != null) { return false; } } return bindType.equals(other.bindType); }
/** * Reject the bind request. * * @param errorCode is the reason of rejection. * @throws IllegalStateException if the acceptance or rejection has been made. * @throws IOException if the connection already closed. * @see {@link #accept()} */ public void reject(int errorCode) throws IllegalStateException, IOException { lock.lock(); try { if (done) { throw new IllegalStateException("Response already initiated"); } else { done = true; try { responseHandler.sendNegativeResponse(bindType.commandId(), errorCode, originalSequenceNumber); } finally { condition.signal(); } } } finally { lock.unlock(); } } }
public void sendBindResp(String systemId, InterfaceVersion interfaceVersion, BindType bindType, int sequenceNumber) throws IOException { SMPPOutboundSession.this.sessionContext.bound(bindType); try { pduSender().sendBindResp(SMPPOutboundSession.this.out, bindType.responseCommandId(), sequenceNumber, systemId, interfaceVersion); } catch (PDUStringException e) { logger.error("Failed sending bind response", e); // TODO uudashr: we have double checking when accept the bind request } }
public BindRequest(Bind bind, ServerResponseHandler responseHandler) { this(bind.getSequenceNumber(), BindType.valueOf(bind.getCommandId()), bind.getSystemId(), bind.getPassword(), bind.getSystemType(), TypeOfNumber.valueOf(bind.getAddrTon()), NumberingPlanIndicator.valueOf(bind.getAddrNpi()), bind.getAddressRange(), InterfaceVersion.valueOf(bind.getInterfaceVersion()), responseHandler); }