Interface OsidRelationship

All Superinterfaces:
Browsable, Extensible, Identifiable, OsidObject, Temporal
All Known Subinterfaces:
Activity, ActivityRegistration, Appointment, AssessmentEntry, Authorization, Availability, AwardEntry, Bid, Budget, BudgetEntry, Candidate, Comment, Commission, Commitment, Conferral, Contact, CourseEntry, CourseOffering, CourseRegistration, CredentialEntry, Credit, Deed, Docet, Edge, Effort, Enrollment, Entry, GradeEntry, Hold, Input, Instruction, Issue, Item, Lease, Lesson, Offering, Participant, Path, Plan, Proficiency, ProfileEntry, ProgramEntry, ProgramOffering, Provision, Provisionable, Registration, Relationship, Relevancy, Request, RequestTransaction, ResourceRelationship, Response, Route, Subscription, Vote

public interface OsidRelationship extends OsidObject, Temporal

A Relationship associates two OSID objects. Relationships are transient. They define a date range for which they are in effect.

Unlike other OsidObjects that rely on the auxiliary Journaling OSID to track variance over time, OsidRelationships introduce a different concept of time independent from journaling. For example, in the present, a student was registered in a course and dropped it. The relationship between the student and the course remains pertinent, independent of any journaled changes that may have occurred to either the student or the course.

Once the student has dropped the course, the relationship has expired such that isEffective() becomes false. It can be inferred that during the period of the effective dates, the student was actively registered in the course. Here is an example:

  • T1. September 1: Student registers for course for grades
  • T2. September 10: Student drops course
  • T3. September 15: Student re-registers for course pass/fail

The relationships are:

T1. R1 {effective,   September 1  -> end of term,  data=grades}
T2. R1 {ineffective, September 1  -> September 10, data=grades}
T3. R1 {ineffective, September 1  -> September 10, data=grades}
    R2 {effective,   September 10 -> end of term,  data=p/f}            
  

An OSID Provider may also permit dates to be set in the future in which case the relationship can become automatically become effective at a future time and later expire. More complex effectiveness management can be done through other rule-based services.

OSID Consumer lookups and queries of relationships need to consider that it may be only effective relationshps are of interest.

  • Method Details

    • hasEndReason

      boolean hasEndReason()
      Tests if a reason this relationship came to an end is known.
      Returns:
      true if an end reason is available, false otherwise
      Throws:
      IllegalStateException - isEffective() is true
      Compliance:
      mandatory - This method must be implemented.
    • getEndReasonId

      Id getEndReasonId()
      Gets a state Id indicating why this relationship has ended.
      Returns:
      a state Id
      Throws:
      IllegalStateException - hasEndReason() is false
      Compliance:
      mandatory - This method must be implemented.
    • getEndReason

      State getEndReason() throws OperationFailedException
      Gets a state indicating why this relationship has ended.
      Returns:
      a state
      Throws:
      IllegalStateException - hasEndReason() is false
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.