1 package org.tanukisoftware.wrapper; 2 3 27 28 import java.util.Date ; 29 30 37 public class WrapperWin32User 38 extends WrapperUser 39 { 40 41 private String m_sid; 42 43 44 private String m_domain; 45 46 47 private long m_loginTime; 48 49 52 WrapperWin32User( byte[] sid, byte[] user, byte[] domain, int loginTime) 53 { 54 super( user ); 55 56 m_sid = new String ( sid ); 58 m_domain = new String ( domain ); 59 60 m_loginTime = loginTime * 1000L; 62 } 63 64 67 72 public String getSID() 73 { 74 return m_sid; 75 } 76 77 82 public String getDomain() 83 { 84 return m_domain; 85 } 86 87 92 public String getAccount() 93 { 94 return m_domain + "/" + getUser(); 95 } 96 97 102 public long getLoginTime() 103 { 104 return m_loginTime; 105 } 106 107 void addGroup( byte[] sid, byte[] user, byte[] domain ) 108 { 109 addGroup( new WrapperWin32Group( sid, user, domain ) ); 110 } 111 112 117 public String toString() 118 { 119 StringBuffer sb = new StringBuffer (); 120 sb.append( "WrapperWin32User[" ); 121 sb.append( getAccount() ); 122 sb.append( ", " ); 123 sb.append( new Date ( m_loginTime ).toString() ); 124 125 sb.append( ", groups {" ); 126 WrapperGroup[] groups = getGroups(); 127 for ( int i = 0; i < groups.length; i++ ) 128 { 129 if ( i > 0 ) 130 { 131 sb.append( ", " ); 132 } 133 sb.append( groups[i].toString() ); 134 } 135 sb.append( "}" ); 136 137 sb.append( "]" ); 138 return sb.toString(); 139 } 140 } 141 142 | Popular Tags |