IBM WebSphere Application ServerTM
Release 7

com.ibm.wbiserver.brules.mgmt
Interface OperationSelectionRecordList

All Superinterfaces:
BusinessRuleChangeDetector, BusinessRuleValidateable, java.lang.Iterable<OperationSelectionRecord>, java.io.Serializable

public interface OperationSelectionRecordList
extends BusinessRuleValidateable, BusinessRuleChangeDetector, java.io.Serializable, java.lang.Iterable<OperationSelectionRecord>

This interface represents a list of operation selection records. Specific methods are provided for getting an iterator to iterate through the list and to add and remove elements from the list. In order to change an existing OperationSelectionRecord in the list, use an iterator obtained using the iterator method to get the object to be changed and then simply use set methods to change the object.


Field Summary
static java.lang.String COPYRIGHT
           
 
Method Summary
 void addOperationSelectionRecord(OperationSelectionRecord newSelectionRecord)
          Add the specified operation selection record to the list.
 OperationSelectionRecord get(int index)
          Get the OperationSelectionRecord at the specified index in the list.
 boolean isEmpty()
          Determine whether or not this list is empty.
 java.util.Iterator<OperationSelectionRecord> iterator()
          Get an iterator over this list.
 OperationSelectionRecord newOperationSelectionRecord()
          Create a new OperationSelectionRecord object that is associated with the operation containing this operation selection record list.
 OperationSelectionRecord newOperationSelectionRecord(java.util.Date startDate, java.util.Date endDate, BusinessRule businessRuleTarget)
          Create a new OperationSelectionRecord object that is associated with the operation containing this operation selection record list.
 boolean removeOperationSelectionRecord(OperationSelectionRecord selectionRecord)
          Remove the specified operation selection record from the list.
 int size()
          Get the number of operation selection records in this list.
 
Methods inherited from interface com.ibm.wbiserver.brules.mgmt.BusinessRuleValidateable
validate
 
Methods inherited from interface com.ibm.wbiserver.brules.mgmt.BusinessRuleChangeDetector
hasChanges
 

Field Detail

COPYRIGHT

static final java.lang.String COPYRIGHT
See Also:
Constant Field Values
Method Detail

iterator

java.util.Iterator<OperationSelectionRecord> iterator()
Get an iterator over this list. The iterator returned does not support making changes to the underlying list, i.e. it does not support the remove method of the Iterator interface. If that method is called, an UnsupportedOperationException is thrown.

In order to add or remove elements from the list, the addOperationSelectionRecord or removeOperationSelectionRecord methods should be used. These two methods synchronize on this OperationSelectionRecordList object. If the client code is multi-threaded, then the client should synchronize on the OperationSelectionRecordList object while using the iterator.

Specified by:
iterator in interface java.lang.Iterable<OperationSelectionRecord>
Returns:
An iterator over the underlying list that does not support modifications.

get

OperationSelectionRecord get(int index)
Get the OperationSelectionRecord at the specified index in the list. The index is 0-based so the first element in the list has index 0.

Parameters:
index - The index of the OperationSelectionRecord to return.
Returns:
The OperationSelectionRecord at the specified index.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size()).

addOperationSelectionRecord

void addOperationSelectionRecord(OperationSelectionRecord newSelectionRecord)
                                 throws ValidationException
Add the specified operation selection record to the list. This method is used to add a new date-based target to the associated operation.

Note that this method does not check to see if the date range in the new selection record overlaps with any date ranges in the existing selection records. This is because it is assumed that, in general, many changes are being made to the list of selection records and any overlapping ranges could just be temporary and will go away as other changes are made. Overlapping ranges are detected when the validate method is called on the OperationSelectionRecordList or when the changes are finally published.

This method synchronizes on the object on which it is called. Clients using an iterator to iterate over the list should also synchronize on this object to ensure thread safety.

Parameters:
newSelectionRecord - The OperationSelectionRecord object to be added to the list. Must not be null.
Throws:
java.lang.IllegalArgumentException - if the specified parameter is null.
ValidationException - if one of the following validation errors is detected:
  1. the operation associated with the specified selection record is not the same as the operation containing this operation selection record list
  2. the start or end date is not set
  3. the start date is after the end date
  4. the target business rule is not set
ChangesNotAllowedException - if changes to this object are temporarily disallowed while other changes are being published.

removeOperationSelectionRecord

boolean removeOperationSelectionRecord(OperationSelectionRecord selectionRecord)
Remove the specified operation selection record from the list. This method is used to remove an existing date-based target from the associated operation. If this operation selection record list does not contain the specified operation selection record, then the list is unchanged.

This method synchronizes on the object on which it is called. Clients using an iterator to iterate over the list should also synchronize on this object to ensure thread-safety.

Parameters:
selectionRecord - The OperationSelectionRecord to be removed. Must not be null.
Returns:
true if the OperationSelectionRecordList contained the specified OperationSelectionRecord. Otherwise false.
Throws:
java.lang.IllegalArgumentException - if the passed in parameter is null.
ChangesNotAllowedException - if changes to this object are temporarily disallowed while other changes are being published.

newOperationSelectionRecord

OperationSelectionRecord newOperationSelectionRecord()
Create a new OperationSelectionRecord object that is associated with the operation containing this operation selection record list. This method can be used when you want to add a new date/time range to an existing operation. This method creates an empty operation selection record. The set methods should then be used to set the start date, end date, and business rule target. Alternatively, you can use the newOperationSelectionRecord(Date,Date,BusinessRule) method to pass all the required data on one method call.

Returns:
The new operation selection record.
Throws:
ChangesNotAllowedException - if changes to this object are temporarily disallowed while other changes are being published.

newOperationSelectionRecord

OperationSelectionRecord newOperationSelectionRecord(java.util.Date startDate,
                                                     java.util.Date endDate,
                                                     BusinessRule businessRuleTarget)
                                                     throws ValidationException
Create a new OperationSelectionRecord object that is associated with the operation containing this operation selection record list. This method can be used when you want to add a new date/time range to an existing operation.

Parameters:
startDate - The start date for the operation selection record.
endDate - The end date for the operation selection record.
businessRuleTarget - The business rule target for the operation selection record.
Returns:
The new operation selection record.
Throws:
java.lang.IllegalArgumentException - if the businessRuleTarget parameter is null.
ValidationException - if any of the following is true:
  1. If the start date is after the end date.
  2. If the specified business rule target is not in the list of available targets for the operation with which this operation selection record is associated.
ChangesNotAllowedException - if changes to this object are temporarily disallowed while other changes are being published.

size

int size()
Get the number of operation selection records in this list.

Returns:
The number of operation selection records in this list.

isEmpty

boolean isEmpty()
Determine whether or not this list is empty.

Returns:
true if this list is empty; otherwise false.

IBM WebSphere Application ServerTM
Release 7