1 23 package com.sun.enterprise.deployment; 24 25 import com.sun.enterprise.deployment.xml.ConnectorTagNames; 26 27 32 public class AuthMechanism extends Descriptor{ 33 34 private int authMechVal; 35 private String credInterface; 36 37 40 public AuthMechanism(){} 41 42 48 public AuthMechanism(String description, int authMechVal, 49 String credInterface) { 50 super.setDescription(description); 51 this.authMechVal = authMechVal; 52 this.credInterface = credInterface; 53 } 54 55 59 public void setCredentialInterface(String cred) { 60 credInterface = cred; 61 } 62 63 67 public String getCredentialInterface() { 68 return credInterface; 69 } 70 71 75 public String getDescription(){ 76 return super.getDescription(); 77 } 78 79 83 public void setDescription(String description){ 84 super.setDescription(description); 85 } 86 87 91 public String getAuthMechType() { 92 if(authMechVal == PoolManagerConstants.BASIC_PASSWORD) 93 return ConnectorTagNames.DD_BASIC_PASSWORD; 94 else 95 return ConnectorTagNames.DD_KERBEROS; 96 } 97 98 101 public int getAuthMechVal() { 102 return authMechVal; 103 } 104 105 108 public void setAuthMechVal(int value) { 109 authMechVal = value; 110 } 111 112 115 public void setAuthMechVal(String value) { 116 if((value.trim()).equals(ConnectorTagNames.DD_BASIC_PASSWORD)) 117 authMechVal = PoolManagerConstants.BASIC_PASSWORD; 118 else if((value.trim()).equals(ConnectorTagNames.DD_KERBEROS)) 119 authMechVal = PoolManagerConstants.KERBV5; 120 else throw new IllegalArgumentException ("Invalid auth-mech-type"); } 122 } 123 | Popular Tags |