1 45 package org.openejb.server.ejbd; 46 47 import java.io.ObjectInputStream ; 48 import java.io.ObjectOutputStream ; 49 50 import org.openejb.client.AuthenticationRequest; 51 import org.openejb.client.AuthenticationResponse; 52 import org.openejb.client.ClientMetaData; 53 import org.openejb.client.RequestMethods; 54 import org.openejb.client.ResponseCodes; 55 56 57 60 class AuthRequestHandler implements ResponseCodes, RequestMethods { 61 private final EjbDaemon daemon; 62 65 AuthRequestHandler(EjbDaemon daemon) { 66 this.daemon = daemon; 67 } 69 70 public void processRequest(ObjectInputStream in, ObjectOutputStream out) { 71 AuthenticationRequest req = new AuthenticationRequest(); 72 AuthenticationResponse res = new AuthenticationResponse(); 73 74 try { 75 req.readExternal( in ); 76 77 79 ClientMetaData client = new ClientMetaData(); 80 81 client.setClientIdentity( new String ( (String )req.getPrinciple() ) ); 82 83 res.setIdentity( client ); 84 res.setResponseCode( AUTH_GRANTED ); 85 86 res.writeExternal( out ); 87 } catch (Throwable t) { 88 return; 91 } 92 } 93 } | Popular Tags |