public Object down(Message msg) { GMS.GmsHeader hdr = getGMSHeader(msg); if(hdr != null && needsAuthentication(hdr)) { // we found a join request message - now add an AUTH Header msg.putHeader(this.id, new AuthHeader(this.auth_token)); } return down_prot.down(msg); }
protected void sendMergeRejectionMessage(Address dest) { GMS.GmsHeader hdr=new GMS.GmsHeader(GMS.GmsHeader.MERGE_RSP).setMergeRejected(true); Message msg=new Message(dest).setFlag(Message.Flag.OOB).putHeader(GMS_ID, hdr); if(this.authenticate_coord) msg.putHeader(this.id, new AuthHeader(this.auth_token)); log.debug("merge response=%s", hdr); down_prot.down(msg); }
protected void sendJoinRejectionMessage(Address dest, String error_msg) { if(dest == null) return; JoinRsp joinRes=new JoinRsp(error_msg); // specify the error message on the JoinRsp Message msg = new Message(dest).putHeader(GMS_ID, new GMS.GmsHeader(GMS.GmsHeader.JOIN_RSP)) .setBuffer(GMS.marshal(joinRes)); if(this.authenticate_coord) msg.putHeader(this.id, new AuthHeader(this.auth_token)); down_prot.down(msg); }
Service w = new ServiceLocator(); <br> ServiceSoap ws = new ServiceSoapStub(new URL(w.getServiceSoapAddress()),w); Stub mystub = (Stub) ws; AuthHeader up = new AuthHeader("user","pass"); mystub.setHeader("namespace", "AuthHeader", up); ws.get***(); </br>
public Object down(Message msg) { GMS.GmsHeader hdr = getGMSHeader(msg); if(hdr != null && needsAuthentication(hdr)) { // we found a join request message - now add an AUTH Header msg.putHeader(this.id, new AuthHeader(this.auth_token)); } return down_prot.down(msg); }
/** * 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); }
protected void sendMergeRejectionMessage(Address dest) { GMS.GmsHeader hdr=new GMS.GmsHeader(GMS.GmsHeader.MERGE_RSP).setMergeRejected(true); Message msg=new Message(dest).setFlag(Message.Flag.OOB).putHeader(GMS_ID, hdr); if(this.authenticate_coord) msg.putHeader(this.id, new AuthHeader(this.auth_token)); log.debug("merge response=%s", hdr); down_prot.down(msg); }
protected void sendJoinRejectionMessage(Address dest, String error_msg) { if(dest == null) return; JoinRsp joinRes=new JoinRsp(error_msg); // specify the error message on the JoinRsp Message msg = new Message(dest).putHeader(GMS_ID, new GMS.GmsHeader(GMS.GmsHeader.JOIN_RSP)) .setBuffer(GMS.marshal(joinRes)); if(this.authenticate_coord) msg.putHeader(this.id, new AuthHeader(this.auth_token)); down_prot.down(msg); }