/** * An event is to be sent down the stack. The layer may want to examine its type and perform * some action on it, depending on the event's type. If the event is a message MSG, then * the layer may need to add a header to it (or do nothing at all) before sending it down * the stack using <code>down_prot.down()</code>. In case of a GET_ADDRESS event (which tries to * retrieve the stack's address from one of the bottom layers), the layer may need to send * a new response event back up the stack using <code>up_prot.up()</code>. */ public Object down(Event evt) { GMS.GmsHeader hdr = isJoinMessage(evt); if((hdr != null) && (hdr.getType() == GMS.GmsHeader.JOIN_REQ)){ if(log.isDebugEnabled()){ log.debug("AUTH got down event"); } //we found a join request message - now add an AUTH Header Message msg = (Message)evt.getArg(); AuthHeader authHeader = new AuthHeader(); authHeader.setToken(this.serverSideToken); msg.putHeader(AUTH.NAME, authHeader); if(log.isDebugEnabled()){ log.debug("AUTH passing down event"); } } if((hdr != null) && (hdr.getType() == GMS.GmsHeader.JOIN_RSP)){ if(log.isDebugEnabled()){ log.debug(hdr.toString()); } } return down_prot.down(evt); }