com.buildforge.services.common.dbo
Class FilterDBO

java.lang.Object
  extended by com.buildforge.services.common.dbo.DBObject
      extended by com.buildforge.services.common.dbo.FilterDBO

public class FilterDBO
extends DBObject

Database information representing a filter set for processing step logs.


Field Summary
static java.lang.String TYPE_KEY
           
 
Constructor Summary
FilterDBO()
           
 
Method Summary
 void addPattern(FilterPatternDBO pattern)
          Adds a pattern to this filter set at the end of the pattern list.
 void addPattern(FilterPatternDBO pattern, int index)
          Adds a pattern to this filter set at the specified index.
 FilterDBO clone()
           
 FilterPatternDBO copyPattern(int index)
          Returns a copy of the specified FilterPattern.
 void copyPattern(int fromIndex, int toIndex)
          Copies the specified filter pattern and inserts it at another position in the entry list.
 FilterDBO fromArray(java.lang.Object[] data)
          Deserialize the database object's settings from a request array.
 int getFilterId()
           
 int getLevel()
           
 java.lang.String getName()
           
 FilterPatternDBO getPattern(int index)
           
 java.util.List<FilterPatternDBO> getPatterns()
           
 java.lang.String getTypeKey()
          Retrieve the key that should be used to look up the display name for a data type.
 boolean isLive()
          Checks whether or not the object is live.
 void movePattern(int fromIndex, int toIndex)
          Moves a pattern from one 0-based index to another.
 FilterPatternDBO removePattern(int index)
          Removes the pattern at the specified index from this filter set.
 void setFilterId(int newFilterId)
           
 void setLevel(int newLevel)
           
 void setName(java.lang.String name)
           
 void setPatterns(java.util.List<FilterPatternDBO> newPatternList)
           
 java.lang.Object[] toArray()
          Serializes this database object as an array of objects.
 java.lang.String toString()
           
 
Methods inherited from class com.buildforge.services.common.dbo.DBObject
badId, badName, checkDead, checkLive, collision, collision
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_KEY

public static final java.lang.String TYPE_KEY
See Also:
Constant Field Values
Constructor Detail

FilterDBO

public FilterDBO()
Method Detail

getTypeKey

public java.lang.String getTypeKey()
Description copied from class: DBObject
Retrieve the key that should be used to look up the display name for a data type.

Specified by:
getTypeKey in class DBObject
Returns:
the type key for this object's class

isLive

public boolean isLive()
Description copied from class: DBObject
Checks whether or not the object is live. Note that this is not valid for object types that do not have a unique identifier. Those for which no reasonable implementation exists should always return false.

Specified by:
isLive in class DBObject
Returns:
true iff liveness is a valid concept for this object, and the object is live; otherwise, false is returned.

getFilterId

public int getFilterId()

getLevel

public int getLevel()

getName

public java.lang.String getName()

getPatterns

public java.util.List<FilterPatternDBO> getPatterns()

getPattern

public FilterPatternDBO getPattern(int index)
                            throws APIException
Throws:
APIException

setFilterId

public void setFilterId(int newFilterId)

setLevel

public void setLevel(int newLevel)

setName

public void setName(java.lang.String name)

setPatterns

public void setPatterns(java.util.List<FilterPatternDBO> newPatternList)

addPattern

public void addPattern(FilterPatternDBO pattern)
Adds a pattern to this filter set at the end of the pattern list.

Parameters:
pattern - the filter pattern to add to this filter set

addPattern

public void addPattern(FilterPatternDBO pattern,
                       int index)
Adds a pattern to this filter set at the specified index.

Parameters:
pattern - the filter pattern to add to this filter set
index - the 0-based index at which to add the new pattern to this filter set. If the value would place the pattern past the end of the list, then the value is placed at the end of the list.

movePattern

public void movePattern(int fromIndex,
                        int toIndex)
                 throws APIException
Moves a pattern from one 0-based index to another.

Parameters:
fromIndex -
toIndex -
Throws:
APIException

copyPattern

public FilterPatternDBO copyPattern(int index)
                             throws APIException
Returns a copy of the specified FilterPattern. This copy is in no way connected to the original, and will be suitable for addition to another, entirely different filter set.

Parameters:
index - the 0-based index of the pattern to copy
Returns:
the copied pattern
Throws:
APIException

copyPattern

public void copyPattern(int fromIndex,
                        int toIndex)
                 throws APIException
Copies the specified filter pattern and inserts it at another position in the entry list.

Parameters:
fromIndex - the 0-based index of the pattern to copy
toIndex - the 0-base index of the position at which the copy is to be inserted into the list. If this value would place the copy beyond the end of the list, then the copy is placed at the end of the list.
Throws:
APIException

removePattern

public FilterPatternDBO removePattern(int index)
                               throws APIException
Removes the pattern at the specified index from this filter set.

Parameters:
index - the 0-based index of the pattern to remove
Returns:
the pattern that was removed
Throws:
APIException

toString

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

fromArray

public FilterDBO fromArray(java.lang.Object[] data)
                    throws APIException
Description copied from class: DBObject
Deserialize the database object's settings from a request array. This method is used to reconstruct a database object from the array that was created by DBObject.toArray().

Specified by:
fromArray in class DBObject
Parameters:
data - the object list that renders this object
Returns:
this object, for convenience
Throws:
APIException - if there is something wrong with the serialized data that interferes with the reconstruction of the object. The most obvious reason for this would be if the serialized array contains the wrong number of fields or otherwise does not match the serialized form for this type of database object.

toArray

public java.lang.Object[] toArray()
Description copied from class: DBObject
Serializes this database object as an array of objects. As specified in the description for Protocol, all supported protocols transfer database objects in this form.

Specified by:
toArray in class DBObject

clone

public FilterDBO clone()
Overrides:
clone in class java.lang.Object