1 23 24 package com.sun.enterprise.management.config; 25 26 import javax.management.ObjectName ; 27 import javax.management.AttributeNotFoundException ; 28 import javax.management.JMException ; 29 import javax.management.Attribute ; 30 import com.sun.enterprise.management.config.AMXConfigImplBase; 31 import com.sun.enterprise.management.support.Delegate; 32 33 import com.sun.enterprise.management.support.oldconfig.OldAuthRealmMBean; 34 35 import com.sun.appserv.management.config.AuthRealmConfig; 36 37 38 41 42 43 public final class AuthRealmConfigImpl extends AMXConfigImplBase 44 { 46 public 47 AuthRealmConfigImpl( final Delegate delegate ) 48 { 49 super( delegate ); 50 } 51 52 53 static private final String [] STRING_SIG = new String [] { String .class.getName() }; 54 static private final String [] UPG_SIG = 55 new String [] { String .class.getName(), String .class.getName(), String [].class.getName() }; 56 57 public void 58 addUser( 59 final String user, 60 final String password, 61 final String [] groupList ) 62 { 63 getDelegate().invoke( 64 "addUser", 65 new Object [] { user, password, groupList }, 66 UPG_SIG ); 67 } 68 69 public String [] 70 getGroupNames() 71 { 72 String [] result = null; 73 74 try 77 { 78 result = (String [])getDelegate().invoke( "getGroupNames", null, null ); 79 } 80 catch( Exception e ) 81 { 82 try 83 { 84 result = (String [])delegateGetAttributeNoThrow( "GroupNames" ); 85 } 86 catch( Exception ee ) 87 { 88 } 90 } 91 92 return result; 93 } 94 95 public String [] 96 getUserGroupNames( final String user ) 97 { 98 return (String [])getDelegate().invoke( 99 "getUserGroupNames", 100 new Object [] { user }, 101 STRING_SIG ); 102 } 103 104 public String [] 105 getUserNames() 106 { 107 String [] result = null; 108 109 try 112 { 113 result = (String [])getDelegate().invoke( "getUserNames", null, null ); 114 } 115 catch( Exception e ) 116 { 117 try 118 { 119 result = (String [])delegateGetAttributeNoThrow( "UserNames" ); 120 } 121 catch( Exception ee ) 122 { 123 } 125 } 126 127 return result; 128 } 129 130 public void 131 removeUser( final String user ) 132 { 133 getDelegate().invoke( "removeUser", new Object [] { user }, STRING_SIG ); 134 } 135 136 public void 137 updateUser( 138 final String user, 139 final String password, 140 final String [] groupList ) 141 { 142 getDelegate().invoke( "updateUser", 143 new Object [] { user, password, groupList }, 144 UPG_SIG ); 145 } 146 } 147 148 149 150 151 152 153 154 155 156 157 | Popular Tags |