Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.wli.calendar.api
Interface BusinessCalendar

All Superinterfaces:
  javax.ejb.EJBObject, Remote

public interface BusinessCalendar
extends javax.ejb.EJBObject

Method Summary
`Date` | `addBusinessTime(String interval, com.bea.wli.calendar.schema.CalendarDocument cDoc)`
`Date` | `addBusinessTime(String interval, com.bea.wli.calendar.schema.CalendarDocument cDoc, Date startTime)`
`Date` | `addBusinessTime(String interval, String userOrGroupId)` Use startTime as current time.
`Date` | `addBusinessTime(String interval, String userOrGroupId, Date startTime)` Determines if userOrGroupId is a user id or group id.
`Date` | `addBusinessTimeCalendarName(String interval, String calendarName)`
`Date` | `addBusinessTimeCalendarName(String interval, String calendarName, Date startTime)`
`Date` | `addBusinessTimeSystemCalendar(String interval, Date startTime)`
`Date` | `addExactTimeCalendarName(String interval, String calendarName, Date startTime)`
`boolean` | `calendarNameExists(String name)` Checks if a calendar with the given name exists.
`void` | `createCalendar(com.bea.wli.calendar.schema.CalendarDocument cDoc)` Creates a new calendar from the information passed in the CalendarDocument.
`void` | `deleteCalendar(String calendarName)`
`void` | `deleteCalendars(String[] names)`
`String[]` | `getAllCalendarNames()`
`com.bea.wli.calendar.schema.CalendarDocument[]` | `getAllCalendars()` Gets all calendars, including rules info and mapped groups and users.
`com.bea.wli.calendar.schema.CalendarDocument` | `getCalendar(String calendarName)`
`com.bea.wli.calendar.schema.CalendarDocument` | `getGroupCalendar(String groupId)`
`com.bea.wli.calendar.schema.CalendarDocument` | `getGroupCalendarWalkHierarchy(String groupId)` If a calendar is mapped to the group then that calendar is returned, otherwise returns the system calendar.
`Date` | `getNextFreeMinute(com.bea.wli.calendar.schema.CalendarDocument cDoc, Date time)` Returns the next free minute given the rules in the calendar passed from the time passed.
`com.bea.wli.calendar.schema.CalendarDocument` | `getSystemCalendar()`
`com.bea.wli.calendar.schema.CalendarDocument` | `getUserCalendar(String userId)`
`com.bea.wli.calendar.schema.CalendarDocument` | `getUserCalendarWalkHierarchy(String userId)` If a calendar is mapped to the user then that calendar is returned, otherwise returns the system calendar.
`void` | `insertUserCalendarMapping(String userid, String calendarId)` Same as updateUserCalendar.
`boolean` | `isTimeFree(com.bea.wli.calendar.schema.CalendarDocument cDoc, Date time)`
`boolean` | `isUserTimeFree(String userId, Date time)` Looks up the user's calendar using getUserCalendarWalkHierarchy and checks if the time passed is free based on the rules in the calendar.
`void` | `setGroupCalendar(String groupId, String calendarName)`
`void` | `setUserCalendar(String userId, String calendarName)` Set the user's calendar.
`Date` | `subtractBusinessTime(String interval, com.bea.wli.calendar.schema.CalendarDocument cDoc)`
`Date` | `subtractBusinessTime(String interval, com.bea.wli.calendar.schema.CalendarDocument cDoc, Date startTime)`
`Date` | `subtractBusinessTime(String interval, String userOrGroupId)`
`Date` | `subtractBusinessTime(String interval, String userOrGroupId, Date startTime)` Go back in time by the given interval.
`Date` | `subtractBusinessTimeCalendarName(String interval, String calendarName)`
`Date` | `subtractBusinessTimeCalendarName(String interval, String calendarName, Date startTime)`
`Date` | `subtractBusinessTimeSystemCalendar(String interval, Date startTime)`
`boolean` | `systemCalendarExists()`
`void` | `unsetGroupCalendar(String groupId)`
`void` | `unsetUserCalendar(String userId)` Unset the user's calendar.
`void` | `updateCalendar(String oldCalendarName, com.bea.wli.calendar.schema.CalendarDocument cDoc)` Update the calendar - oldCalendarName, using the passed CalendarDocument.
`void` | `updateSystemCalendar(com.bea.wli.calendar.schema.CalendarDocument cDoc)` Update the system calendar using the passed CalendarDocument.

Methods inherited from interface javax.ejb.EJBObject
`getEJBHome, getHandle, getPrimaryKey, isIdentical, remove`

Method Detail

### calendarNameExists

    public boolean calendarNameExists(String name)
                               throws BusinessCalendarException,
                                      RemoteException

  Checks if a calendar with the given name exists.

  Parameters:
    `name` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`

### createCalendar

    public void createCalendar(com.bea.wli.calendar.schema.CalendarDocument cDoc)
                        throws BusinessCalendarException,
                               RemoteException

  Creates a new calendar from the information passed in the CalendarDocument.

  Parameters:
    `cDoc` -
  Throws:
    `BusinessCalendarException` - if a calendar with the given name exists or of the document is not valid.
    `RemoteException`
    `NullPointerException` - if cDoc is null.

### getCalendar

    public com.bea.wli.calendar.schema.CalendarDocument getCalendar(String calendarName)
                                                             throws BusinessCalendarException,
                                                                    RemoteException

  Parameters:
    `calendarName` -
  Returns:
    The CalendarDocument or null if a calendar with the given name does not exist.
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if calendarName is null.

### updateCalendar

    public void updateCalendar(String oldCalendarName,
                               com.bea.wli.calendar.schema.CalendarDocument cDoc)
                        throws BusinessCalendarException,
                               RemoteException

  Update the calendar - oldCalendarName, using the passed CalendarDocument. The name of the calendar is also updated based on the name passed in. Use updateSystemCalendar to update the system calendar.

  Parameters:
    `oldCalendarName` -
    `cDoc` -
  Throws:
    `BusinessCalendarException` - if the CalendarDocument indicates that this is a system calendar or if the system calendar has the same name as this calendar or if the name is being updated and a calendar already exists with that name.
    `RemoteException`
    `NullPointerException` - if oldCalendarName or cDoc is null.

### updateSystemCalendar

    public void updateSystemCalendar(com.bea.wli.calendar.schema.CalendarDocument cDoc)
                              throws BusinessCalendarException,
                                     RemoteException

  Update the system calendar using the passed CalendarDocument. If the name of the calendar is differnt than the name of the existing system calendar, then the existing system calendar is changed to non-system calendar. If a calendar with this name does not exist then it is created.

  Parameters:
    `cDoc` -
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if cDoc is null.

### deleteCalendar

    public void deleteCalendar(String calendarName)
                        throws BusinessCalendarException,
                               RemoteException

  Parameters:
    `calendarName` -
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if calendarName is null.

### deleteCalendars

    public void deleteCalendars(String[] names)
                         throws BusinessCalendarException,
                                RemoteException

  Parameters:
    `names` -
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if names is null.

### systemCalendarExists

    public boolean systemCalendarExists()
                                 throws BusinessCalendarException,
                                        RemoteException

  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`

### getSystemCalendar

    public com.bea.wli.calendar.schema.CalendarDocument getSystemCalendar()
                                                                   throws BusinessCalendarException,
                                                                          RemoteException

  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`

### getAllCalendarNames

    public String[] getAllCalendarNames()
                                 throws BusinessCalendarException,
                                        RemoteException

  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`

### getAllCalendars

    public com.bea.wli.calendar.schema.CalendarDocument[] getAllCalendars()
                                                                   throws BusinessCalendarException,
                                                                          RemoteException

  Gets all calendars, including rules info and mapped groups and users.

  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`

### setUserCalendar

    public void setUserCalendar(String userId,
                                String calendarName)
                         throws BusinessCalendarException,
                                RemoteException

  Set the user's calendar. Does not do anything is either the given user or the calendar does not exist. A user can have only one calendar, so if a calendar is already mapped to the user then it is unmapped.

  Parameters:
    `userId` -
    `calendarName` -
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the userId passed is null.

### unsetUserCalendar

    public void unsetUserCalendar(String userId)
                           throws BusinessCalendarException,
                                  RemoteException

  Unset the user's calendar.

  Parameters:
    `userId` -
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the userId passed is null.

### getUserCalendar

    public com.bea.wli.calendar.schema.CalendarDocument getUserCalendar(String userId)
                                                                 throws BusinessCalendarException,
                                                                        RemoteException

  Parameters:
    `userId` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the userId passed is null.

### getUserCalendarWalkHierarchy

    public com.bea.wli.calendar.schema.CalendarDocument getUserCalendarWalkHierarchy(String userId)
                                                                              throws BusinessCalendarException,
                                                                                     RemoteException

  If a calendar is mapped to the user then that calendar is returned, otherwise returns the system calendar. Note that the existance of a system calendar is ensured by the sytem so this method always returns a calendar.

  Parameters:
    `userId` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the userId passed is null.

### insertUserCalendarMapping

    public void insertUserCalendarMapping(String userid,
                                          String calendarId)
                                   throws BusinessCalendarException,
                                          RemoteException

  Same as updateUserCalendar.

  Parameters:
    `userid` -
    `calendarId` -
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the userId passed is null.

### setGroupCalendar

    public void setGroupCalendar(String groupId,
                                 String calendarName)
                          throws BusinessCalendarException,
                                 RemoteException

  Parameters:
    `groupId` -
    `calendarName` -
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the groupId passed is null.

### unsetGroupCalendar

    public void unsetGroupCalendar(String groupId)
                            throws BusinessCalendarException,
                                   RemoteException

  Parameters:
    `groupId` -
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the groupId passed is null.

### getGroupCalendar

    public com.bea.wli.calendar.schema.CalendarDocument getGroupCalendar(String groupId)
                                                                  throws BusinessCalendarException,
                                                                         RemoteException

  Parameters:
    `groupId` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the groupId passed is null.

### getGroupCalendarWalkHierarchy

    public com.bea.wli.calendar.schema.CalendarDocument getGroupCalendarWalkHierarchy(String groupId)
                                                                               throws BusinessCalendarException,
                                                                                      RemoteException

  If a calendar is mapped to the group then that calendar is returned, otherwise returns the system calendar.

  Parameters:
    `groupId` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the groupId passed is null.

### getNextFreeMinute

    public Date getNextFreeMinute(com.bea.wli.calendar.schema.CalendarDocument cDoc,
                                  Date time)
                           throws BusinessCalendarException,
                                  RemoteException

  Returns the next free minute given the rules in the calendar passed from the time passed.

  Parameters:
    `cDoc` -
    `time` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if cDoc is null.

### isUserTimeFree

    public boolean isUserTimeFree(String userId,
                                  Date time)
                           throws BusinessCalendarException,
                                  RemoteException

  Looks up the user's calendar using getUserCalendarWalkHierarchy and checks if the time passed is free based on the rules in the calendar.

  Parameters:
    `userId` -
    `time` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if userId is null.

### isTimeFree

    public boolean isTimeFree(com.bea.wli.calendar.schema.CalendarDocument cDoc,
                              Date time)
                       throws BusinessCalendarException,
                              RemoteException

  Parameters:
    `cDoc` -
    `time` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the userId passed is null.

### addBusinessTime

    public Date addBusinessTime(String interval,
                                String userOrGroupId,
                                Date startTime)
                         throws BusinessCalendarException,
                                RemoteException

  Determines if userOrGroupId is a user id or group id. Looks up the calendar using the appropriate "walk hierarchy" method. Adds the business time interval specified by the interval parameter to the given startTime based on the rules of the calendar looked up. Note that the interval time periods are "Business times". Business time for a unit of time (days, hours, minutes) is defined as a period of the equivalent "real" time minutes which contains at least one free minute. E.g. 1 business day is a period of 24*60 minutes which has at least one minute free.

  Parameters:
    `interval` - - a string in the format "d days, h hours, m minutes". e.g. "5 days", "5 days 2 minutes" Note that only days, hours, and minutes are supported.
    `userOrGroupId` -
    `startTime` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the userId passed is null.

### addBusinessTime

    public Date addBusinessTime(String interval,
                                String userOrGroupId)
                         throws BusinessCalendarException,
                                RemoteException

  Use startTime as current time.

  Parameters:
    `interval` -
    `userOrGroupId` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the userId passed is null.

### addBusinessTimeCalendarName

    public Date addBusinessTimeCalendarName(String interval,
                                            String calendarName)
                                     throws BusinessCalendarException,
                                            RemoteException

  Parameters:
    `interval` -
    `calendarName` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`

### addBusinessTimeCalendarName

    public Date addBusinessTimeCalendarName(String interval,
                                            String calendarName,
                                            Date startTime)
                                     throws BusinessCalendarException,
                                            RemoteException

  Parameters:
    `interval` -
    `calendarName` -
    `startTime` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`

### addExactTimeCalendarName

    public Date addExactTimeCalendarName(String interval,
                                         String calendarName,
                                         Date startTime)
                                  throws BusinessCalendarException,
                                         RemoteException

  Parameters:
    `interval` -
    `calendarName` -
    `startTime` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`

### addBusinessTimeSystemCalendar

    public Date addBusinessTimeSystemCalendar(String interval,
                                              Date startTime)
                                       throws BusinessCalendarException,
                                              RemoteException

  Parameters:
    `interval` -
    `startTime` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the userId passed is null.

### addBusinessTime

    public Date addBusinessTime(String interval,
                                com.bea.wli.calendar.schema.CalendarDocument cDoc)
                         throws BusinessCalendarException,
                                RemoteException

  Parameters:
    `interval` -
    `cDoc` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the userId passed is null.

### addBusinessTime

    public Date addBusinessTime(String interval,
                                com.bea.wli.calendar.schema.CalendarDocument cDoc,
                                Date startTime)
                         throws BusinessCalendarException,
                                RemoteException

  Parameters:
    `interval` -
    `cDoc` -
    `startTime` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the userId passed is null.

### subtractBusinessTime

    public Date subtractBusinessTime(String interval,
                                     String userOrGroupId,
                                     Date startTime)
                              throws BusinessCalendarException,
                                     RemoteException

  Go back in time by the given interval.

  Parameters:
    `interval` -
    `userOrGroupId` -
    `startTime` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the userId passed is null.

### subtractBusinessTime

    public Date subtractBusinessTime(String interval,
                                     String userOrGroupId)
                              throws BusinessCalendarException,
                                     RemoteException

  Parameters:
    `interval` -
    `userOrGroupId` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the userId passed is null.

### subtractBusinessTimeCalendarName

    public Date subtractBusinessTimeCalendarName(String interval,
                                                 String calendarName)
                                          throws BusinessCalendarException,
                                                 RemoteException

  Parameters:
    `interval` -
    `calendarName` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`

### subtractBusinessTimeCalendarName

    public Date subtractBusinessTimeCalendarName(String interval,
                                                 String calendarName,
                                                 Date startTime)
                                          throws BusinessCalendarException,
                                                 RemoteException

  Parameters:
    `interval` -
    `calendarName` -
    `startTime` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`

### subtractBusinessTimeSystemCalendar

    public Date subtractBusinessTimeSystemCalendar(String interval,
                                                   Date startTime)
                                            throws BusinessCalendarException,
                                                   RemoteException

  Parameters:
    `interval` -
    `startTime` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the interval passed is null.

### subtractBusinessTime

    public Date subtractBusinessTime(String interval,
                                     com.bea.wli.calendar.schema.CalendarDocument cDoc)
                              throws BusinessCalendarException,
                                     RemoteException

  Parameters:
    `interval` -
    `cDoc` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the interval or CalendarDocument passed is null.

### subtractBusinessTime

    public Date subtractBusinessTime(String interval,
                                     com.bea.wli.calendar.schema.CalendarDocument cDoc,
                                     Date startTime)
                              throws BusinessCalendarException,
                                     RemoteException

  Parameters:
    `interval` -
    `cDoc` -
    `startTime` -
  Returns:
  Throws:
    `BusinessCalendarException`
    `RemoteException`
    `NullPointerException` - if the interval or CalendarDocument passed is null.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD