org.unitedfront2.domain.communication
クラス Blog

java.lang.Object
  上位を拡張 org.unitedfront2.domain.accesscontrol.AbstractResource
      上位を拡張 org.unitedfront2.domain.communication.Blog
すべての実装されたインタフェース:
Serializable, Resource, Deletable, Domain, Identifiable<Blog>, Storable

public class Blog
extends AbstractResource
implements Serializable, Identifiable<Blog>, Storable, Deletable, Domain

ブログを表すドメインモデルです。

作成者:
kurokkie
関連項目:
直列化された形式
'クラス不変表明:'
${this.writeAccessControl} is OwnerOnly, ${this.readAccessControl} is ${this.overview.readAccessControl}, ${this.writeAccessControl} is ${this.overview.writeAccessControl}, ブログ記事が存在するブログは削除できない。

フィールドの概要
 
クラス org.unitedfront2.domain.accesscontrol.AbstractResource から継承されたフィールド
logger
 
コンストラクタの概要
Blog()
           
Blog(Integer id, String code, Message overview, Integer ownerId, AccessControl readAccessControl, AccessControl writeAccessControl, AccessControl commeAccessControl)
           
Blog(String code, Message overview, Integer ownerId, AccessControl readAccessControl, AccessControl writeAccessControl, AccessControl commeAccessControl)
           
 
メソッドの概要
protected  boolean buildEqualsBuilder(EqualsBuilder eb, Object other)
          EqualsBuilder にプロパティを設定します。
protected  void buildHashCodeBuilder(HashCodeBuilder hcb)
          HashCodeBuilder にプロパティを設定します。
protected  void buildToStringBuilder(ToStringBuilder tsb)
          ToStringBuilder にプロパティを設定します。
 boolean canComment()
          匿名ユーザに投稿アクセス権限があるか判定します。
 boolean canComment(int userId)
          投稿アクセス権限があるか判定します。
 void commentAccess()
          匿名ユーザで投稿アクセスを試みます。
 void commentAccess(int userId)
          投稿アクセスを試みます。
 void delete()
          自身をデータベースから削除します。
 String getCode()
           
 AccessControl getCommentAccessControl()
           
 int getCount()
           
 List<BlogEntry> getEntries()
           
 Integer getId()
           
 Message getOverview()
           
 Profile getOwnerProfile()
           
 boolean identify(Blog blog)
          引数に指定したドメインオブジェクトが、このドメインオブジェクトと同一であるかどうかを判定します。
 void post(BlogEntry blogEntry)
          ブログ記事を投稿します。
 void retrieveCount()
          ブログ記事総件数を復元します。
 void retrieveEntries()
          全てのブログ記事を復元します。
 void retrieveEntries(int no, int num)
          指定した範囲のブログ記事を復元します。
 void setBlogDao(BlogDao blogDao)
           
 void setCode(String code)
           
 void setCommentAccessControl(AccessControl commentAccessControl)
           
 void setId(Integer id)
           
 void setOverview(Message overview)
           
 void store()
          自身を永続化します。
 
クラス org.unitedfront2.domain.accesscontrol.AbstractResource から継承されたメソッド
canRead, canRead, canRead, canWrite, canWrite, canWrite, equals, getOwner, getOwnerId, getReadAccessControl, getSimpleUserTable, getWriteAccessControl, hashCode, readAccess, readAccess, readAccess, retrieveOwner, setOwner, setOwnerId, setReadAccessControl, setSimpleUserTable, setWriteAccessControl, toString, writeAccess, writeAccess, writeAccess
 
クラス java.lang.Object から継承されたメソッド
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

Blog

public Blog()

Blog

public Blog(String code,
            Message overview,
            Integer ownerId,
            AccessControl readAccessControl,
            AccessControl writeAccessControl,
            AccessControl commeAccessControl)

Blog

public Blog(Integer id,
            String code,
            Message overview,
            Integer ownerId,
            AccessControl readAccessControl,
            AccessControl writeAccessControl,
            AccessControl commeAccessControl)
メソッドの詳細

buildEqualsBuilder

protected boolean buildEqualsBuilder(EqualsBuilder eb,
                                     Object other)
クラス AbstractResource の記述:
EqualsBuilder にプロパティを設定します。この実装では、所有者 ID 、参照権限、編集 権限を設定しています。

オーバーライド:
クラス AbstractResource 内の buildEqualsBuilder
パラメータ:
eb - EqualsBuilder
other - 比較対象のオブジェクト
戻り値:
EqualsBuilder の構築途中で AbstractResource.equals(Object)false を返すべきと判断できれば false 、そうでなければ true

buildHashCodeBuilder

protected void buildHashCodeBuilder(HashCodeBuilder hcb)
クラス AbstractResource の記述:
HashCodeBuilder にプロパティを設定します。この実装では、所有者 ID 、参照権限、 編集権限を設定しています。

オーバーライド:
クラス AbstractResource 内の buildHashCodeBuilder
パラメータ:
hcb - HashCodeBuilder

buildToStringBuilder

protected void buildToStringBuilder(ToStringBuilder tsb)
クラス AbstractResource の記述:
ToStringBuilder にプロパティを設定します。この実装では、所有者 ID 、参照権限、 編集権限を設定しています。

オーバーライド:
クラス AbstractResource 内の buildToStringBuilder
パラメータ:
tsb - ToStringBuilder

store

public void store()
           throws BlogCodeUsedByOtherException
インタフェース Storable の記述:
自身を永続化します。永続化の対象は、transient 修飾子が付いていない、全ての 永続プロパティです。主キーが設定されていなければ新規のデータとして登録し、主キーが設定されていれ ば既存のデータを更新します。永続化の過程で主キーなどが自動生成された場合、自身の対応するプロパ ティに自動生成された値が設定されます。データに不整合が生じた場合、例外が発生します。

定義:
インタフェース Storable 内の store
例外:
BlogCodeUsedByOtherException - 指定したコードが他のブログで既に使用されている

identify

public boolean identify(Blog blog)
インタフェース Identifiable の記述:
引数に指定したドメインオブジェクトが、このドメインオブジェクトと同一であるかどうかを判定します。このメソッ ドは、equals メソッドとは異なり、そのドメインオブジェクトを一意に識別できる最小のプ ロパティを用いて同一性を判別します。特に説明がない限り、比較には主キーとなるプロパティが利用されま す。このドメインオブジェクト自身または引数に指定したドメインオブジェクトに主キーが設定されていない場 合、false が返されます。

一般的な実装例を示します。

 public boolean identify(Domain other) {
     if (id == null) {
         return false;
     }
     return id.equals(other.getId());
 }
 

定義:
インタフェース Identifiable<Blog> 内の identify
パラメータ:
blog - ドメインオブジェクト
戻り値:
同一であれば true 、そうでなければ false

retrieveEntries

public void retrieveEntries(int no,
                            int num)
指定した範囲のブログ記事を復元します。記事番号は0から始まる整数で、ID の降順になります。

パラメータ:
no - 開始点となる記事番号
num - 件数

retrieveEntries

public void retrieveEntries()
全てのブログ記事を復元します。


retrieveCount

public void retrieveCount()
ブログ記事総件数を復元します。


post

public void post(BlogEntry blogEntry)
ブログ記事を投稿します。指定したブログ記事を保存し、このブログと関連付けます。

パラメータ:
blogEntry - ブログ記事

commentAccess

public void commentAccess()
                   throws AccessDeniedException
匿名ユーザで投稿アクセスを試みます。

例外:
AccessDeniedException - アクセス拒否

commentAccess

public void commentAccess(int userId)
                   throws AccessDeniedException
投稿アクセスを試みます。

パラメータ:
userId - ユーザ ID
例外:
AccessDeniedException - アクセス拒否

canComment

public boolean canComment()
匿名ユーザに投稿アクセス権限があるか判定します。

戻り値:
権限があれば true 、なければ false

canComment

public boolean canComment(int userId)
投稿アクセス権限があるか判定します。

パラメータ:
userId - ユーザ ID
戻り値:
権限があれば true 、なければ false

delete

public void delete()
            throws BlogEntryExistException
インタフェース Deletable の記述:
自身をデータベースから削除します。データに不整合が生じた場合、例外が発生します。このメソッドの呼出し 後、ドメインオブジェクトは使用できません。

定義:
インタフェース Deletable 内の delete
例外:
BlogEntryExistException - ブログ記事が存在している

getId

public Integer getId()

setId

public void setId(Integer id)

getCode

public String getCode()

setCode

public void setCode(String code)

getOverview

public Message getOverview()

setOverview

public void setOverview(Message overview)

getCommentAccessControl

public AccessControl getCommentAccessControl()

setCommentAccessControl

public void setCommentAccessControl(AccessControl commentAccessControl)

getEntries

public List<BlogEntry> getEntries()

getCount

public int getCount()

getOwnerProfile

public Profile getOwnerProfile()

setBlogDao

public void setBlogDao(BlogDao blogDao)


Copyright © 2007-2008 www.unitedfront2.org. All Rights Reserved.