***  This API provides Binary Compatibility only, not Source Compatibility  ***

com.sas.services.information.metadata
Class Comment

java.lang.Object
  |
  +--com.sas.services.information.metadata.Comment
All Implemented Interfaces:
CommentInterface,

public class Comment
extends Object
implements CommentInterface, java.io.Serializable

Represents a comment in a discussion thread

Since:
1.1
See Also:
Serialized Form

Field Summary
protected  boolean _private
           
 
Constructor Summary
Comment()
          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
 void addAttachment(String name, String desc, String mimeType, InputStream content)
          Add an attachment to the comment.
 void delete()
          Delete the comment - only available to the owner of the comment group
 String formatComment(String xsl)
          Format the content of the comment with the transformation
 List getAttachments()
          Returns the list of attachments for this comment
 String getAuthor()
          Get the comment author
 String getText()
          Get the comment text
 long getTimestamp()
          Get the comment timestamp
 String getTimestamp(DateFormat dtFormat)
          Get the formatted comment timestamp
 boolean hasAttachments()
          Does the comment have an attachment?
 boolean isPrivate()
          Returns whether this comment is private or not
 void setAuthor(String author)
          Sets the author for a comment.
 void setText(String text)
          Sets the text for a comment.
 void setTimeStamp(long timestamp)
          Sets the timestamp for a comment.
 String toString()
          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
 

Field Detail

_private

protected boolean _private
Constructor Detail

Comment

public Comment()
        throws RemoteException
Creates a new comment. Reserved for internal use.

Comment

public Comment(UserContextInterface author,
               String text)
        throws RemoteException
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 authored
text - The text of the comment

Comment

public Comment(UserContextInterface author,
               String text,
               boolean secret)
        throws RemoteException
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 authored
text - The text of the comment
secret - Is this a private comment or not?
Method Detail

getText

public String getText()
               throws RemoteException
Description copied from interface: CommentInterface
Get the comment text
Specified by:
getText in interface CommentInterface
Following copied from interface: com.sas.services.information.metadata.CommentInterface
Returns:
String The comment text

getTimestamp

public String getTimestamp(DateFormat dtFormat)
                    throws RemoteException
Description copied from interface: CommentInterface
Get the formatted comment timestamp
Specified by:
getTimestamp in interface CommentInterface
Following copied from interface: com.sas.services.information.metadata.CommentInterface
Parameters:
dtFormat - A DateFormat with which to format the comment timestamp
Returns:
String The formatted timestamp

getTimestamp

public long getTimestamp()
                  throws RemoteException
Description copied from interface: CommentInterface
Get the comment timestamp
Specified by:
getTimestamp in interface CommentInterface
Following copied from interface: com.sas.services.information.metadata.CommentInterface
Returns:
long The timestamp when the comment was initially created

getAuthor

public String getAuthor()
                 throws RemoteException
Description copied from interface: CommentInterface
Get the comment author
Specified by:
getAuthor in interface CommentInterface
Following copied from interface: com.sas.services.information.metadata.CommentInterface
Returns:
String The comment author

hasAttachments

public boolean hasAttachments()
                       throws RemoteException
Description copied from interface: CommentInterface
Does the comment have an attachment?
Specified by:
hasAttachments in interface CommentInterface
Following copied from interface: com.sas.services.information.metadata.CommentInterface
Returns:
boolean True if there are attachments, false otherwise

getAttachments

public List getAttachments()
                    throws RemoteException
Description copied from interface: CommentInterface
Returns the list of attachments for this comment
Specified by:
getAttachments in interface CommentInterface
Following copied from interface: com.sas.services.information.metadata.CommentInterface
Returns:
List(of AttachmentInterface) The list of attachments for this comment

addAttachment

public void addAttachment(String name,
                          String desc,
                          String mimeType,
                          InputStream content)
                   throws RemoteException
Description copied from interface: CommentInterface
Add an attachment to the comment. Multiple attachments can be made to each comment
Specified by:
addAttachment in interface CommentInterface
Following copied from interface: com.sas.services.information.metadata.CommentInterface
Parameters:
name - A name for this attachment
desc - A description for this attachment
mimeType - A MIME type for this attachment
content - An input stream with the content for this attachment

formatComment

public String formatComment(String xsl)
                     throws RemoteException
Description copied from interface: CommentInterface
Format the content of the comment with the transformation
Specified by:
formatComment in interface CommentInterface

delete

public void delete()
            throws RemoteException
Description copied from interface: CommentInterface
Delete the comment - only available to the owner of the comment group
Specified by:
delete in interface CommentInterface

setTimeStamp

public void setTimeStamp(long timestamp)
                  throws IllegalStateException,
                         RemoteException
Description copied from interface: CommentInterface
Sets 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:
setTimeStamp in interface CommentInterface
Following copied from interface: com.sas.services.information.metadata.CommentInterface
Parameters:
timestamp - The timestamp for the comment
Throws:
IllegalStateException - If the timestamp has already been set once.

setAuthor

public void setAuthor(String author)
               throws IllegalStateException,
                      RemoteException
Description copied from interface: CommentInterface
Sets 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:
setAuthor in interface CommentInterface
Following copied from interface: com.sas.services.information.metadata.CommentInterface
Parameters:
author - The author for the comment
Throws:
IllegalStateException - If the author has already been set once.

setText

public void setText(String text)
             throws IllegalStateException,
                    RemoteException
Description copied from interface: CommentInterface
Sets 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:
setText in interface CommentInterface
Following copied from interface: com.sas.services.information.metadata.CommentInterface
Parameters:
text - The text for the comment
Throws:
IllegalStateException - If the text is already been set once.

isPrivate

public boolean isPrivate()
Description copied from interface: CommentInterface
Returns whether this comment is private or not
Specified by:
isPrivate in interface CommentInterface
Following copied from interface: com.sas.services.information.metadata.CommentInterface
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:
toString in class Object

***  This API provides Binary Compatibility only, not Source Compatibility  ***




Copyright © 2006 SAS Institute Inc. All Rights Reserved.
javadoc generated Fri, 10 Feb 2006 17:28:57