*** This class provides Binary Compatibility only, not Source Compatibility ***
Class Comment
java.lang.Object
com.sas.services.information.metadata.Comment
- All Implemented Interfaces:
CommentInterface,Serializable,Remote
@SASScope("ALL")
@BinaryCompatibilityOnly
public class Comment
extends Object
implements CommentInterface, Serializable
Represents a comment in a discussion thread
- Since:
- 1.1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionComment()Creates a new comment.Comment(UserContextInterface author, String text) Creates a new comment with the author coming from the user context.Comment(UserContextInterface author, String text, boolean secret) Creates a new private comment with the author coming from the user context. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttachment(String name, String desc, String mimeType, InputStream content) Add an attachment to the comment.voiddelete()Delete the comment - only available to the owner of the comment groupStringformatComment(String xsl) Format the content of the comment with the transformationListReturns the list of attachments for this commentStringGet the comment authorStringgetText()Get the comment textlongGet the comment timestampStringgetTimestamp(DateFormat dtFormat) Get the formatted comment timestampbooleanDoes the comment have an attachment?booleanReturns whether this comment is private or notvoidsetAuthor(String author) Sets the author for a comment.voidsetText(String text) Sets the text for a comment.voidsetTimeStamp(long timestamp) Sets the timestamp for a comment.StringtoString()Format a comment for processing as a String.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
Comment
public Comment() throws RemoteExceptionCreates a new comment. Reserved for internal use.- Throws:
RemoteException- In the event of remote object failure.
-
Comment
Creates a new comment with the author coming from the user context. This is the preferred way of creating comments.- Parameters:
author- The user context under which the comment is authoredtext- The text of the comment- Throws:
RemoteException- in the event of remote object failure.
-
Comment
Creates a new private comment with the author coming from the user context. This is the preferred way of creating comments.- Parameters:
author- The user context under which the comment is authoredtext- The text of the commentsecret- Is this a private comment or not?- Throws:
RemoteException- in the event of remote object failure.
-
-
Method Details
-
getText
public String getText() throws RemoteExceptionDescription copied from interface:CommentInterfaceGet the comment text- Specified by:
getTextin interfaceCommentInterface- Returns:
- String The comment text
- Throws:
RemoteException- In the event of remote object failure.
-
getTimestamp
public String getTimestamp(DateFormat dtFormat) throws RemoteException Description copied from interface:CommentInterfaceGet the formatted comment timestamp- Specified by:
getTimestampin interfaceCommentInterface- Parameters:
dtFormat- A DateFormat with which to format the comment timestamp- Returns:
- String The formatted timestamp
- Throws:
RemoteException- In the event of remote object failure.
-
getTimestamp
public long getTimestamp() throws RemoteExceptionDescription copied from interface:CommentInterfaceGet the comment timestamp- Specified by:
getTimestampin interfaceCommentInterface- Returns:
- long The timestamp when the comment was initially created
- Throws:
RemoteException- In the event of remote object failure.
-
getAuthor
public String getAuthor() throws RemoteExceptionDescription copied from interface:CommentInterfaceGet the comment author- Specified by:
getAuthorin interfaceCommentInterface- Returns:
- String The comment author
- Throws:
RemoteException- In the event of remote object failure.
-
hasAttachments
public boolean hasAttachments() throws RemoteExceptionDescription copied from interface:CommentInterfaceDoes the comment have an attachment?- Specified by:
hasAttachmentsin interfaceCommentInterface- Returns:
- boolean True if there are attachments, false otherwise
- Throws:
RemoteException- In the event of remote object failure.
-
getAttachments
public List getAttachments() throws RemoteExceptionDescription copied from interface:CommentInterfaceReturns the list of attachments for this comment- Specified by:
getAttachmentsin interfaceCommentInterface- Returns:
- List(of AttachmentInterface) The list of attachments for this comment
- Throws:
RemoteException- In the event of remote object failure.
-
addAttachment
public void addAttachment(String name, String desc, String mimeType, InputStream content) throws RemoteException Description copied from interface:CommentInterfaceAdd an attachment to the comment. Multiple attachments can be made to each comment- Specified by:
addAttachmentin interfaceCommentInterface- Parameters:
name- A name for this attachmentdesc- A description for this attachmentmimeType- A MIME type for this attachmentcontent- An input stream with the content for this attachment- Throws:
RemoteException- In the event of remote object failure.
-
formatComment
public String formatComment(String xsl) throws RemoteException Description copied from interface:CommentInterfaceFormat the content of the comment with the transformation- Specified by:
formatCommentin interfaceCommentInterface- Parameters:
xsl- The XSL transformation to use to format the comment.- Returns:
- The formatted comment string.
- Throws:
RemoteException- In the event of remote object failure.
-
delete
public void delete() throws RemoteExceptionDescription copied from interface:CommentInterfaceDelete the comment - only available to the owner of the comment group- Specified by:
deletein interfaceCommentInterface- Throws:
RemoteException- In the event of remote object failure.
-
setTimeStamp
public void setTimeStamp(long timestamp) throws IllegalStateException, RemoteException Description copied from interface:CommentInterfaceSets the timestamp for a comment. This method may only be called if the timestamp is missing. If it has already set then an illegalStateException is thrown. The preferred method of creating a comment is to use the non-default constructor- Specified by:
setTimeStampin interfaceCommentInterface- Parameters:
timestamp- The timestamp for the comment- Throws:
IllegalStateException- If the timestamp has already been set once.RemoteException- In the event of remote object failure.
-
setAuthor
public void setAuthor(String author) throws IllegalStateException, RemoteException Description copied from interface:CommentInterfaceSets the author for a comment. This method may only be called if the author is missing. If it has already set then an illegalStateException is thrown. The preferred method of creating a comment is to use the non-default constructor- Specified by:
setAuthorin interfaceCommentInterface- Parameters:
author- The author for the comment- Throws:
IllegalStateException- If the author has already been set once.RemoteException- In the event of remote object failure.
-
setText
public void setText(String text) throws IllegalStateException, RemoteException Description copied from interface:CommentInterfaceSets the text for a comment. This method may only be called if the comment text is missing. If it has already set then an illegalStateException is thrown. The preferred method of creating a comment is to use the non-default constructor- Specified by:
setTextin interfaceCommentInterface- Parameters:
text- The text for the comment- Throws:
IllegalStateException- If the text is already been set once.RemoteException- In the event of remote object failure.
-
isPrivate
public boolean isPrivate()Description copied from interface:CommentInterfaceReturns whether this comment is private or not- Specified by:
isPrivatein interfaceCommentInterface- Returns:
- boolean True if comment is private, false otherwise
-
toString
public String toString()Format a comment for processing as a String. The format is [timestamp: (Author) Text]- Overrides:
toStringin classObject
-