Class HashedStringAttribute

All Implemented Interfaces:
Viewable, Cacheable, Observed, Retrievable, Serializable, ColumnAccessByName, ObjectModel, Persistent
Direct Known Subclasses:
EncryptAttribute

public class HashedStringAttribute extends StringAttribute
plain text 를 hash 하여 저장하는 문자열 속성.
See Also:
  • Constructor Details

    • HashedStringAttribute

      public HashedStringAttribute()
      Creates a new HashedStringAttribute object.
  • Method Details

    • setPassword

      public void setPassword(String plain, String salt) throws Exception
      plain text password 를 encryptPassword 로 변경 저장한다.
      Parameters:
      plain - text
      salt - hash 에 사용할 salt
      Throws:
      Exception - hash 중 오류가 발생한 경우
    • getPassword

      public String getPassword()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • toHashedString

      public String toHashedString(String plain, String salt) throws Exception
      plain text 를 hash 문자열로 변환한다. 반복 횟수는 item id 로부터 결정한다.
      Parameters:
      plain - hash 할 문자열
      salt - hash 에 사용할 salt
      Returns:
      hash 문자열
      Throws:
      Exception - hash 중 오류가 발생한 경우
      UnsupportedOperationException - item 이 아직 저장되지 않은 경우
    • toHashedString

      public String toHashedString(String plain, String algorithm, String salt, int iteration) throws Exception
      plain text 를 hash 문자열로 변환한다. 현재는 구현되어 있지 않다.
      Parameters:
      plain - hash 할 문자열
      algorithm - hash 알고리즘, null 이면 기본 알고리즘을 사용한다.
      salt - hash 에 사용할 salt
      iteration - hash 반복 횟수
      Returns:
      hash 문자열
      Throws:
      Exception - hash 중 오류가 발생한 경우
      UnsupportedOperationException - 항상 발생 (미구현)
    • getDisplayedValue

      public CharSequence getDisplayedValue(String type) throws Exception
      기본 locale(아이템의 locale)로 화면에 표시할 값을 구한다.
      Overrides:
      getDisplayedValue in class FreeFormAttribute
      Parameters:
      type - 표시 형식
      Returns:
      화면에 표시할 값
      Throws:
      Exception - 값을 구하는 중 오류가 발생한 경우
    • getDisplayedValue

      public CharSequence getDisplayedValue(String type, Locale locale) throws Exception
      지정한 locale 로 화면에 표시할 값을 구한다. 기본 구현은 저장된 값을 그대로 반환한다.
      Overrides:
      getDisplayedValue in class FreeFormAttribute
      Parameters:
      type - 표시 형식
      locale - 표시에 사용할 locale
      Returns:
      화면에 표시할 값
      Throws:
      Exception - 값을 구하는 중 오류가 발생한 경우