org.unitedfront2.domain.communication
Class BlogEntry

java.lang.Object
  extended by org.unitedfront2.domain.communication.BlogEntry
All Implemented Interfaces:
Serializable, Deletable, Domain, Identifiable<BlogEntry>, Storable

public class BlogEntry
extends Object
implements Serializable, Identifiable<BlogEntry>, Storable, Deletable, Domain

ブログの記事を表すドメインクラスです。

Author:
kurokkie
See Also:
Serialized Form

Field Summary
protected  Log logger
          ログ
 
Constructor Summary
BlogEntry()
           
BlogEntry(Message entry)
           
 
Method Summary
 boolean canReadAccess()
           
 boolean canReadAccess(int userId)
           
 boolean canWriteAccess()
           
 boolean canWriteAccess(int userId)
           
 void delete()
          記事とコメントを全て削除します。
 boolean equals(Object other)
           
 Comment findComment(int id)
          コメントを取得します。
 User getAuthor()
           
 Integer getAuthorId()
           
 String getCode()
           
 Integer getCommentCount()
           
 List<Comment> getComments()
           
 Message getEntry()
           
 Integer getId()
           
 Date getLastUpdateDate()
           
 User getOwner()
           
 Integer getOwnerId()
           
 AccessControl getReadAccessControl()
           
 Date getRegistrationDate()
           
 MessageEntry getRequiredEntry()
           
 AccessControl getWriteAccessControl()
           
 int hashCode()
           
 boolean identify(BlogEntry other)
          引数に指定したドメインオブジェクトが、このドメインオブジェクトと同一であるかどうかを判定します。このメソッ ドは、equals メソッドとは異なり、そのドメインオブジェクトを一意に識別できる最小のプ ロパティを用いて同一性を判別します。特に説明がない限り、比較には主キーとなるプロパティが利用されま す。このドメインオブジェクト自身または引数に指定したドメインオブジェクトに主キーが設定されていない場 合、false が返されます。
 void post(Comment comment)
          コメントを投稿します。コメントを保存し、このブログ記事と関連付けます。
 void readAccess()
           
 void readAccess(int userId)
           
 void readAccess(User user)
           
 void setBlogDao(BlogDao blogDao)
           
 void setEntry(Message entry)
           
 void setReadAccessControl(AccessControl readAccessControl)
           
 void setWriteAccessControl(AccessControl writeAccessControl)
           
 void store()
          記事の新規投稿は Blog.post(BlogEntry) を利用してください。
 String toString()
           
 void writeAccess()
           
 void writeAccess(int userId)
           
 void writeAccess(User user)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected final transient Log logger
ログ

Constructor Detail

BlogEntry

public BlogEntry()

BlogEntry

public BlogEntry(Message entry)
Method Detail

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

identify

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

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

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

Specified by:
identify in interface Identifiable<BlogEntry>
Parameters:
other - ドメインオブジェクト
Returns:
同一であれば true 、そうでなければ false

store

public void store()
記事の新規投稿は Blog.post(BlogEntry) を利用してください。

Specified by:
store in interface Storable

delete

public void delete()
記事とコメントを全て削除します。

Specified by:
delete in interface Deletable

canReadAccess

public boolean canReadAccess()

canReadAccess

public boolean canReadAccess(int userId)

canWriteAccess

public boolean canWriteAccess()

canWriteAccess

public boolean canWriteAccess(int userId)

getAuthor

public User getAuthor()

getAuthorId

public Integer getAuthorId()

getCode

public String getCode()

getId

public Integer getId()

getRegistrationDate

public Date getRegistrationDate()

getLastUpdateDate

public Date getLastUpdateDate()

getOwner

public User getOwner()

getOwnerId

public Integer getOwnerId()

getReadAccessControl

public AccessControl getReadAccessControl()

setReadAccessControl

public void setReadAccessControl(AccessControl readAccessControl)

getWriteAccessControl

public AccessControl getWriteAccessControl()

setWriteAccessControl

public void setWriteAccessControl(AccessControl writeAccessControl)

getRequiredEntry

public MessageEntry getRequiredEntry()

readAccess

public void readAccess()
                throws AccessDeniedException
Throws:
AccessDeniedException

readAccess

public void readAccess(int userId)
                throws AccessDeniedException
Throws:
AccessDeniedException

readAccess

public void readAccess(User user)
                throws AccessDeniedException
Throws:
AccessDeniedException

writeAccess

public void writeAccess()
                 throws AccessDeniedException
Throws:
AccessDeniedException

writeAccess

public void writeAccess(int userId)
                 throws AccessDeniedException
Throws:
AccessDeniedException

writeAccess

public void writeAccess(User user)
                 throws AccessDeniedException
Throws:
AccessDeniedException

post

public void post(Comment comment)
コメントを投稿します。コメントを保存し、このブログ記事と関連付けます。

Parameters:
comment - コメント

findComment

public Comment findComment(int id)
コメントを取得します。

Parameters:
id - コメント ID
Returns:
コメント、見つからなければ null

getEntry

public Message getEntry()

setEntry

public void setEntry(Message entry)

getComments

public List<Comment> getComments()

getCommentCount

public Integer getCommentCount()

setBlogDao

public void setBlogDao(BlogDao blogDao)


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