Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.database
Class DbAvatar

java.lang.Object
  extended by com.jivesoftware.forum.database.DbAvatar
All Implemented Interfaces:
Avatar, Cacheable, com.tangosol.io.ExternalizableLite, java.io.Serializable

public class DbAvatar
extends java.lang.Object
implements Avatar, Cacheable, com.tangosol.io.ExternalizableLite

See Also:
Serialized Form

Constructor Summary
DbAvatar()
          Constructor for internal use only, needed for clustering.
DbAvatar(long id)
          Acquires an existing DbAvatar object by its id
DbAvatar(User owner, java.lang.String name, java.lang.String contentType, java.io.InputStream in)
           
 
Method Summary
 void deleteProperty(java.lang.String name)
          Deletes an extended property.
 boolean equals(java.lang.Object o)
           
 Attachment getAttachment()
          Returns the attachment for this avatar
 int getCachedSize()
          Returns the approximate size of the Object in bytes.
 long getID()
          Returns the unique ID of the avatar
 int getModValue()
          Returns the moderation value for this Avatar
 User getOwner()
          Returns user who created this avatar, if the user is null then this is a global avatar
 java.lang.String getProperty(java.lang.String name)
          Returns an extended property of the attachment.
 java.util.Iterator getPropertyNames()
          Returns an Iterator for the names of the extended properties.
 int hashCode()
           
 void readExternal(java.io.DataInput in)
           
 void setModValue(int modValue)
          Modifies the moderation value of this specific avatar
 void setProperty(java.lang.String name, java.lang.String value)
          Sets an extended property of the attachment.
 java.lang.String toString()
           
 void writeExternal(java.io.DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DbAvatar

public DbAvatar(User owner,
                java.lang.String name,
                java.lang.String contentType,
                java.io.InputStream in)
         throws UnauthorizedException,
                AvatarException
Throws:
UnauthorizedException
AvatarException

DbAvatar

public DbAvatar(long id)
         throws AvatarNotFoundException
Acquires an existing DbAvatar object by its id

Parameters:
id - unique identifier of the DbAvatar object
Throws:
AvatarNotFoundException - thrown if no matching avatar exists

DbAvatar

public DbAvatar()
Constructor for internal use only, needed for clustering.

Method Detail

getID

public long getID()
Description copied from interface: Avatar
Returns the unique ID of the avatar

Specified by:
getID in interface Avatar
Returns:
the unique ID of the avatar

getOwner

public User getOwner()
Description copied from interface: Avatar
Returns user who created this avatar, if the user is null then this is a global avatar

Specified by:
getOwner in interface Avatar
Returns:
user who created the avatar

getModValue

public int getModValue()
Description copied from interface: Avatar
Returns the moderation value for this Avatar

Specified by:
getModValue in interface Avatar
Returns:
the moderation value for this Avatar

setModValue

public void setModValue(int modValue)
                 throws UnauthorizedException
Description copied from interface: Avatar
Modifies the moderation value of this specific avatar

Specified by:
setModValue in interface Avatar
Parameters:
modValue - change the moderation value
Throws:
UnauthorizedException - thrown if the user does not have moderation privileges

getAttachment

public Attachment getAttachment()
                         throws AttachmentNotFoundException
Description copied from interface: Avatar
Returns the attachment for this avatar

Specified by:
getAttachment in interface Avatar
Returns:
the attachment for this avatar
Throws:
AttachmentNotFoundException - if we could not find an attachment for this avatar

getProperty

public java.lang.String getProperty(java.lang.String name)
Description copied from interface: Avatar
Returns an extended property of the attachment. Each attachment can have an arbitrary number of extended properties. This allows for enhanced functionality that is not part of the base interface.

Specified by:
getProperty in interface Avatar
Parameters:
name - the name of the property to get.
Returns:
the value of the property specified by name.

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
                 throws UnauthorizedException
Description copied from interface: Avatar
Sets an extended property of the attachment. Each attachment can have an arbitrary number of extended properties. This allows for enhanced functionality that is not part of the base interface.

If the property referenced by name already exists, its value will be updated.

Specified by:
setProperty in interface Avatar
Parameters:
name - the name of the property to set.
value - the new value for the property.
Throws:
UnauthorizedException - if does not have admin permissions.

deleteProperty

public void deleteProperty(java.lang.String name)
                    throws UnauthorizedException
Description copied from interface: Avatar
Deletes an extended property. If the property specified by name does not exist, this method will do nothing.

Specified by:
deleteProperty in interface Avatar
Parameters:
name - the name of the property to delete.
Throws:
UnauthorizedException - if does not have ADMIN permissions.

getPropertyNames

public java.util.Iterator getPropertyNames()
Description copied from interface: Avatar
Returns an Iterator for the names of the extended properties.

Specified by:
getPropertyNames in interface Avatar
Returns:
an Iterator for the names of the extended properties.

getCachedSize

public int getCachedSize()
Description copied from interface: Cacheable
Returns the approximate size of the Object in bytes. The size should be considered to be a best estimate of how much memory the Object occupies and may be based on empirical trials or dynamic calculations.

Specified by:
getCachedSize in interface Cacheable
Returns:
the size of the Object in bytes.

readExternal

public void readExternal(java.io.DataInput in)
                  throws java.io.IOException
Specified by:
readExternal in interface com.tangosol.io.ExternalizableLite
Throws:
java.io.IOException

writeExternal

public void writeExternal(java.io.DataOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface com.tangosol.io.ExternalizableLite
Throws:
java.io.IOException

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.