Interface IScheduleMechanics

All Superinterfaces:
IAccessMechanics, IBasicMechanics, IClipboardMechanics, IComponent, IInitializable, IMechanics, ISubscribableMechanics, ISystemHandler, IViewableContainerMechanics, IViewableMechanics

public interface IScheduleMechanics extends IBasicMechanics, IViewableContainerMechanics
  • Method Details

    • canCreate

      boolean canCreate(IThingID userID, Map<?,?> capabilities) throws PortalException
      Returns true if the specified user can create a schedule.
      Throws:
      PortalException
    • checkCreate

      void checkCreate(IThingID userID, Map<?,?> capabilities) throws PortalException, PortalAccessException
      Throws a PortalAccessException if the specified user cannot create a schedule.
      Throws:
      PortalException
      PortalAccessException
    • createSchedule

      IThingID createSchedule(IThingID ownerID, String interval, String timeAt, String eventName) throws PortalException
      Creates a schedule
      Parameters:
      ownerID - the Thing ID of the owner
      interval - the time period that the schedule should repeat
      examples: "1H" "1D" "4W" "04:00:00"
      timeAt - the time that the schedule should occur
      examples: "4F" "4FT12:00" "04:00:00"
      eventName - name of event that will be raised
      Returns:
      the Thing ID of the schedule. This can be used to create a subscription.
      Throws:
      PortalException
      See Also:
    • createSchedule

      IThingID createSchedule(IThingID ownerID, String interval, String timeAt, String eventName, String callbackInfo) throws PortalException
      Creates a schedule
      Parameters:
      ownerID - the Thing ID of the owner
      interval - the time period that the schedule should repeat
      examples: "1H" "1D" "4W" "04:00:00"
      timeAt - the time that the schedule should occur
      examples: "4F" "4FT12:00" "04:00:00"
      eventName - name of event that will be raised
      callbackInfo - additional info to be passed in the schedule event
      Returns:
      the Thing ID of the schedule. This can be used to create a subscription.
      Throws:
      PortalException
      See Also:
    • destroySchedule

      void destroySchedule(IThingID scheduleID) throws PortalException
      Destroys the given schedule.
      Parameters:
      scheduleID - IThingID of the schedule to destroy
      Throws:
      PortalException
    • setScheduleProperties

      void setScheduleProperties(IThingID scheduleID, String interval, String timeAt, String eventName) throws PortalException
      Updates the schedule properties.
      Parameters:
      scheduleID - top update
      interval -
      timeAt -
      eventName - Properties include: timeAt, interval, and eventName.
      Throws:
      PortalException
    • setScheduleNextTime

      void setScheduleNextTime(IThingID scheduleID, long nextTime) throws PortalException
      Updates the schedule next firing time.
      Parameters:
      nextTime -
      Throws:
      PortalException
    • triggerSchedule

      void triggerSchedule(IThingID scheduleID) throws PortalException
      Causes an event to be fired for the schedule as if it's scheduled time was now.
      Parameters:
      scheduleID -
      Throws:
      PortalException
    • setSchedulePaused

      void setSchedulePaused(IThingID scheduleID, boolean paused) throws PortalException
      Pauses/Unpauses schedule
      Parameters:
      scheduleID -
      paused -
      Throws:
      PortalException
    • view

      IView view(IURI itemId) throws PortalException
      Returns the standard view of the specified schedule.
      Specified by:
      view in interface IViewableMechanics
      Parameters:
      itemId - schedule to view.
      Returns:
      View of item or null.
      Throws:
      PortalException - if an error occurs.
    • view

      IView view(IURI itemId, IThingID userId) throws PortalException
      Returns the view of the specified schedule, filtered for the specified user.
      Specified by:
      view in interface IViewableMechanics
      Parameters:
      itemId - Schedule to view.
      userId - User for which to filter the view.
      Returns:
      View of item or null.
      Throws:
      PortalException - if an error occurs.
    • listSchedules

      IListView<IView> listSchedules(IPagingCookie cookie) throws PortalException
      Lists the schedules in the system
      Returns:
      IListView
      Throws:
      PortalException
    • listSchedules

      IListView<IView> listSchedules(IThingID userID, IPagingCookie cookie) throws PortalException
      Lists the schedules in the system filter for the user
      Parameters:
      userID -
      cookie -
      Returns:
      IListView
      Throws:
      PortalException
    • fireScheduleCreateEvent

      void fireScheduleCreateEvent(IThingID scheduleID, IThingID userID, int status) throws PortalException
      Fires a schedule create event
      Parameters:
      scheduleID - ThingID of the created schedule
      userID - User creating the schedule
      status - Status of the event (sucessful, denied, error)
      Throws:
      PortalException
    • fireScheduleDestroyEvent

      void fireScheduleDestroyEvent(IThingID scheduleID, IThingID userID, int status) throws PortalException
      Fires a schedule destroy event
      Parameters:
      scheduleID - ThingID of the destroyed schedule
      userID - User destroying the schedule
      status - Status of the event (successful, denied, error)
      Throws:
      PortalException
    • fireScheduleUpdateEvent

      void fireScheduleUpdateEvent(IThingID scheduleID, IThingID userID, int status) throws PortalException
      Fires a schedule update event
      Parameters:
      scheduleID - ThingID of the updated schedule
      userID - User updating the schedule
      status - Status of the event (successful, denied, error)
      Throws:
      PortalException