com.infoteria.asteria.security.aac
Class User

java.lang.Object
  |
  +--com.infoteria.asteria.security.aac.User
All Implemented Interfaces:
Cloneable, Principal, Serializable

public class User
extends Object
implements Principal, Cloneable, Serializable

ユーザー自身表すクラスです。 各種クライアントのgetUserメソッドを呼び出すことにより、取得すること ができます。

See Also:
Group, Serialized Form

Field Summary
static String ATTRNAME_HOMEDIR
          ホームディレクトリを保存するアトリビュート名
 
Method Summary
 Object clone()
           
 boolean equals(Object o)
           
 boolean existAttribute(String key)
          ユーザーに付加されたアトリビュートが存在するか確認します。
 Object getAttribute(String key)
          ユーザーに付加されたアトリビュートを取得します。
 String[] getAttributesString()
          ユーザーに付加されたアトリビュートの名前一覧を取得します。
 String getCanonicalHomeDirectory()
          正規の形式のホームディレクトリを取得します。
 String getCanonicalHomeDirectory(boolean bdefault)
           
 String getCanonicalName()
          ユーザー名を取得します。
 Group getGroup()
          グループを取得します。
 String getHomeDirectory()
          ホームディレクトリを取得します。
 String getHomeDirectory(boolean bdefault)
           
 String getHomeDirectory(boolean bdefault, boolean brelative)
           
 long getID()
          ユーザーIDを取得します。
 String getName()
          ユーザー名を取得します。
 Password getPassword()
          パスワードを取得します。 元のパスワード文字列を取得する手段はありません。
 String[] getRolesString()
          ユーザーが持っている、権限一覧を取得します。
 int hashCode()
           
 boolean hasRole(String role)
          ユーザーに権限があるか、確認します。
static boolean isValidName(String username)
          ユーザー名として使用可能な文字列のみで構成されているか確認します。
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Principal
implies
 

Field Detail

ATTRNAME_HOMEDIR

public static final String ATTRNAME_HOMEDIR
ホームディレクトリを保存するアトリビュート名
Method Detail

getID

public long getID()
ユーザーIDを取得します。
Returns:
ユーザーID

getName

public String getName()
ユーザー名を取得します。
Specified by:
getName in interface Principal
Returns:
ユーザー名

getCanonicalName

public String getCanonicalName()
ユーザー名を取得します。
Returns:
ユーザー名

getPassword

public Password getPassword()
パスワードを取得します。 元のパスワード文字列を取得する手段はありません。
Returns:
パスワード

getGroup

public Group getGroup()
グループを取得します。
Returns:
グループ

existAttribute

public boolean existAttribute(String key)
ユーザーに付加されたアトリビュートが存在するか確認します。
Parameters:
key - アトリビュートにつけられた名前
Returns:
trueが戻った時は存在します。

getAttribute

public Object getAttribute(String key)
ユーザーに付加されたアトリビュートを取得します。
Parameters:
key - アトリビュートにつけられた名前
Returns:
任意のオブジェクト。アトリビュートがない場合はnullが戻ります。

getAttributesString

public String[] getAttributesString()
ユーザーに付加されたアトリビュートの名前一覧を取得します。
Returns:
名前一覧。1つもアトリビュートがない場合でも、サイズ0の配列が戻ります。

getHomeDirectory

public String getHomeDirectory()
ホームディレクトリを取得します。
Returns:
ホームディレクトリ。設定されていない場合はnullが戻ります。

getCanonicalHomeDirectory

public String getCanonicalHomeDirectory()
                                 throws IOException
正規の形式のホームディレクトリを取得します。
Returns:
ホームディレクトリ。設定されていない場合はnullが戻ります。
Throws:
IOException - 入出力エラーが発生した場合

getHomeDirectory

public String getHomeDirectory(boolean bdefault)

getHomeDirectory

public String getHomeDirectory(boolean bdefault,
                               boolean brelative)

getCanonicalHomeDirectory

public String getCanonicalHomeDirectory(boolean bdefault)
                                 throws IOException

hasRole

public boolean hasRole(String role)
ユーザーに権限があるか、確認します。
Parameters:
role - 確認したい権限文字列
Returns:
trueが戻った場合は、権限があります。

getRolesString

public String[] getRolesString()
ユーザーが持っている、権限一覧を取得します。
Returns:
権限一覧。権限が1つもない場合でも、サイズ0の配列が戻ります。

equals

public boolean equals(Object o)
Specified by:
equals in interface Principal
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Principal
Overrides:
hashCode in class Object

toString

public String toString()
Specified by:
toString in interface Principal
Overrides:
toString in class Object

clone

public Object clone()
Overrides:
clone in class Object

isValidName

public static boolean isValidName(String username)
ユーザー名として使用可能な文字列のみで構成されているか確認します。
Parameters:
username - 確認したいユーザー名
Returns:
trueが戻った時は、ユーザー名として使用可能です。