001package ca.uhn.hl7v2.hoh.auth; 002 003import ca.uhn.hl7v2.hoh.api.IAuthorizationClientCallback; 004 005/** 006 * Authorization Callback which validates a single username and password 007 */ 008public class SingleCredentialClientCallback implements IAuthorizationClientCallback { 009 010 private String myPassword; 011 private String myUsername; 012 013 public SingleCredentialClientCallback() { 014 } 015 016 public SingleCredentialClientCallback(String theUsername, String thePassword) { 017 myUsername = theUsername; 018 myPassword = thePassword; 019 } 020 021 public String providePassword(String theUriPath) { 022 return myPassword; 023 } 024 025 public String provideUsername(String theUriPath) { 026 return myUsername; 027 } 028 029 /** 030 * @param thePassword 031 * the password to set 032 */ 033 public void setPassword(String thePassword) { 034 myPassword = thePassword; 035 } 036 037 /** 038 * @param theUsername 039 * the username to set 040 */ 041 public void setUsername(String theUsername) { 042 myUsername = theUsername; 043 } 044 045}