Class AbstractOsidEnabler
java.lang.Object
net.okapia.osid.jamocha.spi.AbstractIdentifiable
net.okapia.osid.jamocha.spi.AbstractOsidObject
net.okapia.osid.jamocha.spi.AbstractOperableOsidObject
net.okapia.osid.jamocha.spi.AbstractOsidRule
net.okapia.osid.jamocha.spi.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
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classThe composed Temporal.Nested classes/interfaces inherited from class AbstractOperableOsidObject
AbstractOperableOsidObject.OperableModifier and TypeClassDescriptionprotected classThe composed OPerable.Nested classes/interfaces inherited from class AbstractOsidObject
AbstractOsidObject.BrowsableModifier and TypeClassDescriptionprotected classComposed Browsable. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the cyclic event.Gets the cyclic eventId.Gets the cyclic time period.Gets the cyclic time periodId.Gets the end date.getEvent()Gets the event.Gets the eventId.Gets the schedule.Gets the scheduleId.Gets the start date.Gets the time period.Gets the time periodId.booleanTests if the current date is within the start and end dates inclusive.booleanTests if the effectiveness of the enabler is governed by aCyclicEvent.booleanTests if this enabler is applied to a recurringCyclicTimePeriod.booleanTests if the effectiveness of the enabler is governed by anEventsuch that the start and end dates of the event govern the effectiveness.booleanTests if this enabler is applied to aTimePeriod.booleanTests if the effectiveness of the enabler is governed by aSchedule.booleanTests if thisOsidEnableris a requirement.protected voidsetCyclicEvent(CyclicEvent cyclicEvent) Sets the cyclic event and makes this enabler effective by cyclic event.protected voidsetCyclicTimePeriod(CyclicTimePeriod cyclicTimePeriod) Sets the cyclic time period.protected voidsetDemographic(Resource demographic) Sets the demographic resource.protected voidsetEndDate(DateTime date) Sets the end date.protected voidSets the event and makes this enabler effective by event.protected voidsetRequirement(boolean requirement) Sets this enabler as a requirement.protected voidsetSchedule(Schedule schedule) Sets the schedule and makes this enabler effective by schedule.protected voidsetStartDate(DateTime date) Sets the start date.protected voidsetTimePeriod(TimePeriod timePeriod) Sets the time period.Methods inherited from class AbstractOsidRule
addConditionRecordType, getConditionRecordTypes, getRule, getRuleId, hasRule, setRuleModifier and TypeMethodDescriptionprotected voidaddConditionRecordType(Type conditionRecordType) Adds a condition record type.Gets the list ofOsidConditionrecordTypesthis rule requires.getRule()Gets the rule.Gets the ruleId.booleanhasRule()Tests if an explicit rule is available.protected voidSets the rule.Methods inherited from class AbstractOperableOsidObject
isActive, isDisabled, isEnabled, isOperational, setDisabled, setEnabled, setOperationalModifier and TypeMethodDescriptionbooleanisActive()Tests if this operable is active.booleanTests if this operable is administravely disabled.booleanTests if this operable is administravely enabled.booleanTests if this operable is operational in that all rules pertaining to this operation except for an administrative disable aretrue.protected voidsetDisabled(boolean disabled) Sets the disabled flag.protected voidsetEnabled(boolean enabled) Sets the enabled flag.protected voidsetOperational(boolean operational) Sets the operational flag.Methods inherited from class AbstractOsidObject
addProperties, addRecordType, getDescription, getDisplayName, getGenusType, getProperties, getPropertiesByRecordType, getRecordTypes, hasRecordType, isOfGenusType, setDescription, setDisplayName, setGenusTypeModifier and TypeMethodDescriptionprotected voidaddProperties(Collection<Property> set, Type recordType) Adds a property set.protected voidaddRecordType(Type recordType) Adds a record type.Gets the description associated with this instance of this OSID object.Gets the preferred display name associated with this instance of this OSID object appropriate for display to the user.Gets the genus type of this object.Gets a list of all properties of this object including those corresponding to data within this object's records.getPropertiesByRecordType(Type recordType) Gets the properties by record type.Gets the record types available in this object.booleanhasRecordType(Type recordType) Tests if this object supports the given recordType.booleanisOfGenusType(Type genusType) Tests if this object is of the given genusType.protected voidsetDescription(DisplayText description) Sets the description of this object.protected voidsetDisplayName(DisplayText displayName) Sets the displayName for this object.protected voidsetGenusType(Type genusType) Sets a genus type.Methods inherited from class AbstractIdentifiable
current, equals, getId, hashCode, isCurrent, setId, stale, toStringModifier and TypeMethodDescriptionprotected voidcurrent()Sets the current flag totrue.final booleanDetermines if the givenIdis equal to this one.getId()Gets theIdassociated with this instance of this OSID object.inthashCode()Returns a hash code value for thisOsidObjectbased on theId.booleanTests to see if the last method invoked retrieved up-to-date data.protected voidSets theIdassociated with this instance of this OSID object.protected voidstale()Sets the current flag tofalse.toString()Returns a string representation of this OsidObject.
-
Constructor Details
-
AbstractOsidEnabler
public AbstractOsidEnabler()Constructs a newAbstractOsidEnabler.
-
-
Method Details
-
isEffective
Tests if the current date is within the start and end dates inclusive.- Specified by:
isEffectivein interfaceTemporal- Returns:
trueif this is effective,falseotherwise
-
getStartDate
Gets the start date.- Specified by:
getStartDatein interfaceTemporal- Returns:
- the start date
-
setStartDate
Sets the start date.- Parameters:
date- the start date- Throws:
NullArgumentException-dateisnull
-
getEndDate
Gets the end date.- Specified by:
getEndDatein interfaceTemporal- Returns:
- the end date
-
setEndDate
Sets the end date.- Parameters:
date- the end date- Throws:
NullArgumentException-dateisnull
-
isRequirement
Tests if thisOsidEnableris a requirement.- Specified by:
isRequirementin interfaceOsidEnabler- Returns:
trueif this enabler is a requirement,falseotherwise
-
setRequirement
protected void setRequirement(boolean requirement) Sets this enabler as a requirement.- Parameters:
requirement-trueif a requirement
-
isOperationalOnSchedule
Tests if the effectiveness of the enabler is governed by aSchedule.If a schedule exists, it is bounded by the effective dates of this enabler. IfisOperationalOnSchedule()istrue,isOperationalDuringEvent()andisOperationalDuringCyclicEvent()must befalse.- Specified by:
isOperationalOnSchedulein interfaceOsidEnabler- Returns:
trueif the enabler is governed by schedule,falseotherwise
-
getScheduleId
Gets the scheduleId.- Specified by:
getScheduleIdin interfaceOsidEnabler- Returns:
- the schedule
Id - Throws:
IllegalStateException-isOperationalOnSchedule()isfalse
-
getSchedule
Gets the schedule.- Specified by:
getSchedulein interfaceOsidEnabler- Returns:
- the schedule
- Throws:
IllegalStateException-isOperationalOnSchedule()isfalseOperationFailedException- unable to complete request
-
setSchedule
Sets the schedule and makes this enabler effective by schedule.- Parameters:
schedule- the schedule- Throws:
NullArgumentException-scheduleisnull
-
isOperationalDuringEvent
Tests if the effectiveness of the enabler is governed by anEventsuch that the start and end dates of the event govern the effectiveness. The event may also be aRecurringEventin 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. IfisOperationalDuringEvent()istrue,isOperationalOnSchedule()andisOperationalDuringCyclicEvent()must befalse.- Specified by:
isOperationalDuringEventin interfaceOsidEnabler- Returns:
trueif the enabler is governed by an event,falseotherwise
-
getEventId
Gets the eventId.- Specified by:
getEventIdin interfaceOsidEnabler- Returns:
- the event
Id - Throws:
IllegalStateException-isOperationalDuringEvent()isfalse
-
getEvent
Gets the event.- Specified by:
getEventin interfaceOsidEnabler- Returns:
- the event
- Throws:
IllegalStateException-isOperationalDuringEvent()isfalseOperationFailedException- unable to complete request
-
setEvent
Sets the event and makes this enabler effective by event.- Parameters:
event- the event- Throws:
NullArgumentException-eventisnull
-
isOperationalDuringCyclicEvent
Tests if the effectiveness of the enabler is governed by aCyclicEvent.If a cyclic event exists, it is evaluated by the accompanying cyclic time period. IfisOperationalDuringCyclicEvent()istrue,isOperationalOnSchedule()andisOperationalDuringEvent()must befalse.- Specified by:
isOperationalDuringCyclicEventin interfaceOsidEnabler- Returns:
trueif the enabler is governed by a cyclic event,falseotherwise
-
getCyclicEventId
Gets the cyclic eventId.- Specified by:
getCyclicEventIdin interfaceOsidEnabler- Returns:
- the cyclic event
Id - Throws:
IllegalStateException-isOperationalDuringCyclicEvent()isfalse
-
getCyclicEvent
Gets the cyclic event.- Specified by:
getCyclicEventin interfaceOsidEnabler- Returns:
- the cyclic event
- Throws:
IllegalStateException-isOperationalDuringCyclicEvent()isfalseOperationFailedException- unable to complete request
-
setCyclicEvent
Sets the cyclic event and makes this enabler effective by cyclic event.- Parameters:
cyclicEvent- the cyclic event- Throws:
NullArgumentException-cyclicEventisnull
-
isOperationalDuringTimePeriod
Tests if this enabler is applied to aTimePeriod.- Specified by:
isOperationalDuringTimePeriodin interfaceOsidEnabler- Returns:
trueif the enabler is applied to a time period,falseotherwise
-
getTimePeriodId
Gets the time periodId.- Specified by:
getTimePeriodIdin interfaceOsidEnabler- Returns:
- the time period
Id - Throws:
IllegalStateException-isOperationalDuringTimePeriod()isfalse
-
getTimePeriod
Gets the time period.- Specified by:
getTimePeriodin interfaceOsidEnabler- Returns:
- the time period
- Throws:
IllegalStateException-isOperationalDuringTimePeriod()isfalseOperationFailedException- unable to complete request
-
setTimePeriod
Sets the time period.- Parameters:
timePeriod- the time period- Throws:
NullArgumentException-timePeriodisnull
-
isOperationalDuringCyclicTimePeriod
Tests if this enabler is applied to a recurringCyclicTimePeriod.- Specified by:
isOperationalDuringCyclicTimePeriodin interfaceOsidEnabler- Returns:
trueif the enabler is applied to a cyclic time period,falseotherwise
-
getCyclicTimePeriodId
Gets the cyclic time periodId.- Specified by:
getCyclicTimePeriodIdin interfaceOsidEnabler- Returns:
- the cyclic time period
Id - Throws:
IllegalStateException-isOperationalDuringCyclicTimePeriod()isfalse
-
getCyclicTimePeriod
Gets the cyclic time period.- Specified by:
getCyclicTimePeriodin interfaceOsidEnabler- Returns:
- the cyclic time period
- Throws:
IllegalStateException-isOperationalDuringCyclicTimePeriod()isfalseOperationFailedException- unable to complete request
-
setCyclicTimePeriod
Sets the cyclic time period.- Parameters:
cyclicTimePeriod- the cyclic time period- Throws:
NullArgumentException-cyclicTimePeriodisnull
-
setDemographic
Sets the demographic resource.- Parameters:
demographic- the resource- Throws:
NullArgumentException-demographicisnull
-