Class AbstractOsidEnabler

All Implemented Interfaces:
Browsable, Extensible, Identifiable, Operable, OsidEnabler, OsidObject, OsidRule, Temporal
Direct Known Subclasses:
AbstractActionEnabler, AbstractAuctionConstrainerEnabler, AbstractAuctionProcessorEnabler, AbstractAuditEnabler, AbstractAvailabilityEnabler, AbstractBallotConstrainerEnabler, AbstractBrokerConstrainerEnabler, AbstractBrokerProcessorEnabler, AbstractCanonicalUnitEnabler, AbstractCanonicalUnitProcessorEnabler, AbstractCatalogEnabler, AbstractCommissionEnabler, AbstractCommitmentEnabler, AbstractCompositionEnabler, AbstractContactEnabler, AbstractDemographicEnabler, AbstractDeviceEnabler, AbstractEdgeEnabler, AbstractHoldEnabler, AbstractInputEnabler, AbstractInquiryEnabler, AbstractJobConstrainerEnabler, AbstractJobProcessorEnabler, AbstractObstacleEnabler, AbstractOfferingConstrainerEnabler, AbstractOffsetEventEnabler, AbstractOsidEffectuator, AbstractOsidRuleApplicator, AbstractParameterProcessorEnabler, AbstractPoolConstrainerEnabler, AbstractPoolProcessorEnabler, AbstractPriceEnabler, AbstractProcessEnabler, AbstractProfileEntryEnabler, AbstractQueueConstrainerEnabler, AbstractQueueConstrainerEnabler, AbstractQueueProcessorEnabler, AbstractQueueProcessorEnabler, AbstractRaceConstrainerEnabler, AbstractRaceProcessorEnabler, AbstractRecurringEventEnabler, AbstractRelationshipEnabler, AbstractRelevancyEnabler, AbstractRequisite, AbstractSequenceRuleEnabler, AbstractSignalEnabler, AbstractSpeedZoneEnabler, AbstractStepConstrainerEnabler, AbstractStepProcessorEnabler, AbstractSubscriptionEnabler, AbstractSupersedingEventEnabler, AbstractTriggerEnabler, AbstractValueEnabler

public abstract class AbstractOsidEnabler extends AbstractOsidRule implements OsidEnabler
Defines a simple OSID enabler to draw from. Using this abstract class requires that setId() must be done before passing this interface to a consumer in order to maintain compliance with the OSID specification.
  • Constructor Details

    • AbstractOsidEnabler

      public AbstractOsidEnabler()
      Constructs a new AbstractOsidEnabler.
  • Method Details

    • isEffective

      @OSID public boolean isEffective()
      Tests if the current date is within the start and end dates inclusive.
      Specified by:
      isEffective in interface Temporal
      Returns:
      true if this is effective, false otherwise
    • getStartDate

      @OSID public DateTime getStartDate()
      Gets the start date.
      Specified by:
      getStartDate in interface Temporal
      Returns:
      the start date
    • setStartDate

      protected void setStartDate(DateTime date)
      Sets the start date.
      Parameters:
      date - the start date
      Throws:
      NullArgumentException - date is null
    • getEndDate

      @OSID public DateTime getEndDate()
      Gets the end date.
      Specified by:
      getEndDate in interface Temporal
      Returns:
      the end date
    • setEndDate

      protected void setEndDate(DateTime date)
      Sets the end date.
      Parameters:
      date - the end date
      Throws:
      NullArgumentException - date is null
    • isRequirement

      @OSID public boolean isRequirement()
      Tests if this OsidEnabler is a requirement.
      Specified by:
      isRequirement in interface OsidEnabler
      Returns:
      true if this enabler is a requirement, false otherwise
    • setRequirement

      protected void setRequirement(boolean requirement)
      Sets this enabler as a requirement.
      Parameters:
      requirement - true if a requirement
    • isOperationalOnSchedule

      @OSID public boolean isOperationalOnSchedule()
      Tests if the effectiveness of the enabler is governed by a Schedule. If a schedule exists, it is bounded by the effective dates of this enabler. If isOperationalOnSchedule() is true, isOperationalDuringEvent() and isOperationalDuringCyclicEvent() must be false.
      Specified by:
      isOperationalOnSchedule in interface OsidEnabler
      Returns:
      true if the enabler is governed by schedule, false otherwise
    • getScheduleId

      @OSID public Id getScheduleId()
      Gets the schedule Id .
      Specified by:
      getScheduleId in interface OsidEnabler
      Returns:
      the schedule Id
      Throws:
      IllegalStateException - isOperationalOnSchedule() is false
    • getSchedule

      @OSID public Schedule getSchedule() throws OperationFailedException
      Gets the schedule.
      Specified by:
      getSchedule in interface OsidEnabler
      Returns:
      the schedule
      Throws:
      IllegalStateException - isOperationalOnSchedule() is false
      OperationFailedException - unable to complete request
    • setSchedule

      protected void setSchedule(Schedule schedule)
      Sets the schedule and makes this enabler effective by schedule.
      Parameters:
      schedule - the schedule
      Throws:
      NullArgumentException - schedule is null
    • isOperationalDuringEvent

      @OSID public boolean isOperationalDuringEvent()
      Tests if the effectiveness of the enabler is governed by an Event such that the start and end dates of the event govern the effectiveness. The event may also be a RecurringEvent in which case the enabler is effective for start and end dates of each event in the series. If an event exists, it is bounded by the effective dates of this enabler. If isOperationalDuringEvent() is true, isOperationalOnSchedule() and isOperationalDuringCyclicEvent() must be false.
      Specified by:
      isOperationalDuringEvent in interface OsidEnabler
      Returns:
      true if the enabler is governed by an event, false otherwise
    • getEventId

      @OSID public Id getEventId()
      Gets the event Id .
      Specified by:
      getEventId in interface OsidEnabler
      Returns:
      the event Id
      Throws:
      IllegalStateException - isOperationalDuringEvent() is false
    • getEvent

      @OSID public Event getEvent() throws OperationFailedException
      Gets the event.
      Specified by:
      getEvent in interface OsidEnabler
      Returns:
      the event
      Throws:
      IllegalStateException - isOperationalDuringEvent() is false
      OperationFailedException - unable to complete request
    • setEvent

      protected void setEvent(Event event)
      Sets the event and makes this enabler effective by event.
      Parameters:
      event - the event
      Throws:
      NullArgumentException - event is null
    • isOperationalDuringCyclicEvent

      @OSID public boolean isOperationalDuringCyclicEvent()
      Tests if the effectiveness of the enabler is governed by a CyclicEvent. If a cyclic event exists, it is evaluated by the accompanying cyclic time period. If isOperationalDuringCyclicEvent() is true, isOperationalOnSchedule() and isOperationalDuringEvent() must be false.
      Specified by:
      isOperationalDuringCyclicEvent in interface OsidEnabler
      Returns:
      true if the enabler is governed by a cyclic event, false otherwise
    • getCyclicEventId

      @OSID public Id getCyclicEventId()
      Gets the cyclic event Id .
      Specified by:
      getCyclicEventId in interface OsidEnabler
      Returns:
      the cyclic event Id
      Throws:
      IllegalStateException - isOperationalDuringCyclicEvent() is false
    • getCyclicEvent

      @OSID public CyclicEvent getCyclicEvent() throws OperationFailedException
      Gets the cyclic event.
      Specified by:
      getCyclicEvent in interface OsidEnabler
      Returns:
      the cyclic event
      Throws:
      IllegalStateException - isOperationalDuringCyclicEvent() is false
      OperationFailedException - unable to complete request
    • setCyclicEvent

      protected void setCyclicEvent(CyclicEvent cyclicEvent)
      Sets the cyclic event and makes this enabler effective by cyclic event.
      Parameters:
      cyclicEvent - the cyclic event
      Throws:
      NullArgumentException - cyclicEvent is null
    • isOperationalDuringTimePeriod

      @OSID public boolean isOperationalDuringTimePeriod()
      Tests if this enabler is applied to a TimePeriod.
      Specified by:
      isOperationalDuringTimePeriod in interface OsidEnabler
      Returns:
      true if the enabler is applied to a time period, false otherwise
    • getTimePeriodId

      @OSID public Id getTimePeriodId()
      Gets the time period Id.
      Specified by:
      getTimePeriodId in interface OsidEnabler
      Returns:
      the time period Id
      Throws:
      IllegalStateException - isOperationalDuringTimePeriod() is false
    • getTimePeriod

      @OSID public TimePeriod getTimePeriod() throws OperationFailedException
      Gets the time period.
      Specified by:
      getTimePeriod in interface OsidEnabler
      Returns:
      the time period
      Throws:
      IllegalStateException - isOperationalDuringTimePeriod() is false
      OperationFailedException - unable to complete request
    • setTimePeriod

      protected void setTimePeriod(TimePeriod timePeriod)
      Sets the time period.
      Parameters:
      timePeriod - the time period
      Throws:
      NullArgumentException - timePeriod is null
    • isOperationalDuringCyclicTimePeriod

      @OSID public boolean isOperationalDuringCyclicTimePeriod()
      Tests if this enabler is applied to a recurring CyclicTimePeriod.
      Specified by:
      isOperationalDuringCyclicTimePeriod in interface OsidEnabler
      Returns:
      true if the enabler is applied to a cyclic time period, false otherwise
    • getCyclicTimePeriodId

      @OSID public Id getCyclicTimePeriodId()
      Gets the cyclic time period Id.
      Specified by:
      getCyclicTimePeriodId in interface OsidEnabler
      Returns:
      the cyclic time period Id
      Throws:
      IllegalStateException - isOperationalDuringCyclicTimePeriod() is false
    • getCyclicTimePeriod

      @OSID public CyclicTimePeriod getCyclicTimePeriod() throws OperationFailedException
      Gets the cyclic time period.
      Specified by:
      getCyclicTimePeriod in interface OsidEnabler
      Returns:
      the cyclic time period
      Throws:
      IllegalStateException - isOperationalDuringCyclicTimePeriod() is false
      OperationFailedException - unable to complete request
    • setCyclicTimePeriod

      protected void setCyclicTimePeriod(CyclicTimePeriod cyclicTimePeriod)
      Sets the cyclic time period.
      Parameters:
      cyclicTimePeriod - the cyclic time period
      Throws:
      NullArgumentException - cyclicTimePeriod is null
    • setDemographic

      protected void setDemographic(Resource demographic)
      Sets the demographic resource.
      Parameters:
      demographic - the resource
      Throws:
      NullArgumentException - demographic is null