|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nitido.nim.Nugget
com.nitido.nim.CachableNugget
com.nitido.nimx.nuggets.wcap.WcapNugget
public class WcapNugget
WcapNugget - A Nugget that wraps iPlanet Calendar Server Web Calendar Access Protocol (WCAP) commands. The design is based on WCAP version 2.0 running on iCS v5.1 or later.
It requires the following settings:
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_TIMEZONE_ID
|
static java.lang.String |
KEY_AUTOLOGIN
|
static java.lang.String |
KEY_BUSY_ONLY
|
static java.lang.String |
KEY_CRED_PASSWORD
|
static java.lang.String |
KEY_CRED_USERID
|
static java.lang.String |
KEY_HOST
|
static java.lang.String |
KEY_PORT
|
static java.lang.String |
KEY_RELATIVE_ALARM
|
static java.lang.String |
KEY_RELOGIN_DELAY
|
static java.lang.String |
KEY_RELOGIN_LIMIT
|
static java.lang.String |
KEY_URL_CHARSET
|
Fields inherited from class com.nitido.nim.Nugget |
---|
_entity, _nim, _nuggetName, _settings |
Fields inherited from interface com.nitido.nim.CredentialConstants |
---|
CRED_ADMIN, CRED_CONTAINER, CRED_HELPDESK, CRED_SYSTEM, CRED_USER, KEY_PASSWORD |
Constructor Summary | |
---|---|
WcapNugget(NuggetVisa visa)
Default Nugget constructor. |
Method Summary | |
---|---|
void |
activate()
Used by NiM Nugget mechanism. |
CalendarProperty |
createCalendar(java.lang.String calId)
Create a calendar (with default properties). |
CalendarProperty |
createCalendarWithProperty(CalendarProperty calProp)
Create a calendar with the specified properties. |
void |
deactivate()
Used by NiM Nugget mechanism. |
void |
deleteCalendar(java.lang.String calId)
Delete the specific calendar. |
void |
deleteEventsById(java.lang.String calId,
java.lang.String uid,
java.lang.String rid,
WcapModifier mod,
boolean notify)
Remove the specified event and its recurrence as specified. |
void |
deleteEventsByRange(java.lang.String calId,
java.util.Date dtstart,
java.util.Date dtend)
Delete all events within the specified time range. |
void |
deleteToDosById(java.lang.String calId,
java.lang.String uid,
java.lang.String rid,
WcapModifier mod,
boolean notify)
Remove the specified todo and its recurrence as specified. |
void |
deleteToDosByRange(java.lang.String calId,
java.util.Date dtstart,
java.util.Date dtend)
Delete ToDos within the range. |
java.util.Vector |
fetchEventsByAlarmRange(java.lang.String calId,
java.util.Date dtstart,
java.util.Date dtend,
int maxResults)
Retrieve events from the specified calendar that have alarm (reminder) within the time range. |
java.util.Vector |
fetchEventsByAttendeeError(java.lang.String calId,
java.lang.String attendee,
int maxResults)
Retrieves all events from the specified calId that has errors associated to the attendee. |
java.util.Vector |
fetchEventsById(java.lang.String calId,
java.lang.String uid,
java.lang.String rid,
WcapModifier modifier)
Fetch the event and all its recurrences from the specified calendar. |
java.util.Vector |
fetchEventsByLastMod(java.lang.String calId,
java.util.Date dtstart,
java.util.Date dtend,
int maxResults)
Retrieves all events from the specified calendar that has been modified within the time range. |
java.util.Vector |
fetchEventsByRange(java.lang.String calId,
java.util.Date dtstart,
java.util.Date dtend,
int maxResults)
Retrieve all events from the specified calendar with activity within the time range. |
java.util.Vector |
fetchToDosByAlarmRange(java.lang.String calId,
java.util.Date dtstart,
java.util.Date dtend,
int maxResults)
Retrieve ToDos from the specified calendar that have alarm (reminder) within the time range. |
java.util.Vector |
fetchToDosByAttendeeError(java.lang.String calId,
java.lang.String attendee,
int maxResults)
Retrieves all todos from the specified calId that has errors associated to the attendee. |
java.util.Vector |
fetchToDosById(java.lang.String calId,
java.lang.String uid,
java.lang.String rid,
WcapModifier modifier)
Fetch the todo and all its recurrences from the specified calendar. |
java.util.Vector |
fetchToDosByLastMod(java.lang.String calId,
java.util.Date dtstart,
java.util.Date dtend,
int maxResults)
Retrieves all todos from the specified calendar that has been modified within the time range. |
java.util.Vector |
fetchToDosByRange(java.lang.String calId,
java.util.Date dtstart,
java.util.Date dtend,
int maxResults)
Retrieve all todos from the specified calendar with activity within the time range. |
java.util.Vector |
getAllTimeZoneIds()
Get a list of all TimeZone ids that are supported by the iPlanet Calendar Server. |
CalendarProperty |
getCalendarProperty(java.lang.String calId)
Retrieves the property of the specified calendar. |
java.lang.String |
getDefaultCalendarId()
Get the default calendar id associated to the user. |
java.lang.String |
getDescriptor()
Used by NiM Nugget mechanism. |
java.util.Vector |
getFreeBusy(java.lang.String calId,
java.util.Date dtstart,
java.util.Date dtend)
Get the free/busy slots within the specified time range. |
java.util.Vector |
getFreeBusyByEmail(java.lang.String email,
java.util.Date dtstart,
java.util.Date dtend)
Get the free/busy slots within the specified time range by the user's email address. |
UserPref |
getUserPreference()
Get the user's preference. |
protected void |
initImpl()
This method is called by the init() method after the member variables _nuggetName, _entity and _settings are assigned. |
boolean |
login(boolean isRelogin,
boolean needDelay)
Login to calendar server. |
void |
logout()
Logout from the calendar server. |
java.util.Vector |
searchForCalendars(java.lang.String searchString,
boolean searchCalId,
boolean searchName,
boolean searchPrimaryOwner,
SearchOption searchOption,
int maxResults)
Search for calendars that matches the criteria. |
boolean |
sessionIsAlive()
Check whether the current session is still accepted by the Calendar Server. |
void |
setCalendarProperty(CalendarProperty calProp)
Set the specified calendar property. |
void |
setUserPreference(UserPref userPref)
Set the user's preference. |
java.lang.String |
storeEvent(java.lang.String calId,
WcapModifier modifier,
Event event)
Add or modify an event. |
java.lang.String |
storeToDo(java.lang.String calId,
WcapModifier modifier,
ToDo todo)
Add or modify an todo. |
protected java.lang.String |
urlEncode(java.lang.String inStr)
|
Methods inherited from class com.nitido.nim.CachableNugget |
---|
isCachable |
Methods inherited from class com.nitido.nim.Nugget |
---|
destroy, destroyImpl, getEntity, getNuggetName, getSetting, getSettings, init, requestBegin, requestEnd |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String KEY_HOST
public static final java.lang.String KEY_PORT
public static final java.lang.String KEY_AUTOLOGIN
public static final java.lang.String KEY_RELOGIN_DELAY
public static final java.lang.String KEY_RELOGIN_LIMIT
public static final java.lang.String KEY_CRED_USERID
public static final java.lang.String KEY_CRED_PASSWORD
public static final java.lang.String KEY_URL_CHARSET
public static final java.lang.String KEY_BUSY_ONLY
public static final java.lang.String KEY_RELATIVE_ALARM
public static final java.lang.String DEFAULT_TIMEZONE_ID
Constructor Detail |
---|
public WcapNugget(NuggetVisa visa)
Method Detail |
---|
public void activate() throws ActivationException
activate
in class Nugget
ActivationException
- If unable to activate the Nuggetpublic void deactivate() throws ActivationException
deactivate
in class Nugget
ActivationException
- If unable to deactivate the Nuggetpublic java.lang.String getDescriptor()
getDescriptor
in class Nugget
protected void initImpl() throws InitializationFailedException, InvalidSettingException
Nugget
initImpl
in class Nugget
InitializationFailedException
- If unable to initialize the nugget with the given parameters.
InvalidSettingException
- If any of the expected initialization settings are null.public boolean sessionIsAlive() throws WcapServerException, WcapException
If you have enabled the auto-relogin option when instantiating this nugget, the nugget will automatically re-authenticate you.
WcapServerException
WcapException
public java.util.Vector getAllTimeZoneIds() throws WcapServerException, WcapException
WcapServerException
WcapException
public CalendarProperty createCalendar(java.lang.String calId) throws WcapServerException, WcapException
Note: If you have created a calendar, the iPlanet Calendar Server will assign "userid:calid" as the actual id of the new calendar. You should never regard calId as the new id! To ensure you should get the correct calendar id from the CalendarProperty returned.
calId
- the new calendar's id.
WcapServerException
WcapException
public CalendarProperty createCalendarWithProperty(CalendarProperty calProp) throws WcapServerException, WcapException
Note: If you have created a calendar, the iPlanet Calendar Server will assign "userid:calid" as the actual id of the new calendar. You should never regard calId as the new id! To ensure you should get the correct calendar id from the CalendarProperty returned.
For example, assume your user id is "tester" and you have:
CalendarProperty prop = new CalendarProperty( "my_cal", ... ); myWcapNugget.createCalendarWithProperty( prop );Then, the iPlanet Calendar Server will create a calendar with id "tester:my_cal". This correct calendar id will appear in the CalendarProperty object returned by this method.
calProp
- a CalendarProperty object that has the property settings.
WcapServerException
WcapException
public void deleteCalendar(java.lang.String calId) throws WcapServerException, WcapException
calId
- The full id of the calendar to be deleted. This parameter must
be valid and non-null.
WcapServerException
WcapException
public CalendarProperty getCalendarProperty(java.lang.String calId) throws WcapServerException, WcapException
calId
- the id of the calendar that you are interested. If it is null,
it assume it's the default calendar.
WcapServerException
WcapException
public java.util.Vector searchForCalendars(java.lang.String searchString, boolean searchCalId, boolean searchName, boolean searchPrimaryOwner, SearchOption searchOption, int maxResults) throws InvalidParameterException, WcapServerException, WcapException
searchString
- the string to search for.
searchCalId
- if true, will search on the calendar id against the searchString.
searchName
- if true, will search on the calendar name against the searchString.
searchPrimaryOwner
- if true, will search on the calendar's primary owner id against the
searchString.
searchOption
- the search option to be performed.
maxResults
- the maximum number of result to be returned. If 0, no limit.
InvalidParameterException
WcapServerException
WcapException
public void setCalendarProperty(CalendarProperty calProp) throws WcapServerException, WcapException
calProp
- The CalendarProperty that is going to be modified.
WcapServerException
WcapException
public boolean login(boolean isRelogin, boolean needDelay) throws WcapServerException, WcapException
WcapServerException
WcapException
public void logout() throws WcapException
WcapException
public java.lang.String getDefaultCalendarId()
public void setUserPreference(UserPref userPref) throws WcapServerException, WcapException
userPref
- The user prefs.
WcapServerException
WcapException
public UserPref getUserPreference() throws WcapServerException, WcapException
WcapServerException
WcapException
public java.util.Vector getFreeBusy(java.lang.String calId, java.util.Date dtstart, java.util.Date dtend) throws InvalidParameterException, WcapServerException, WcapException
calId
- the calendar Id to retrieve the free/busy time.
if null, assume the user's default calendar id
dtstart
- the start date/time in GMT. They must be valid dates.
dtend
- the end date/time in GMT.
InvalidParameterException
WcapServerException
WcapException
public java.util.Vector getFreeBusyByEmail(java.lang.String email, java.util.Date dtstart, java.util.Date dtend) throws InvalidParameterException, WcapServerException, WcapException
email
- the email address of the user account to retrieve the free/busy time.
if null, assume the user's default calendar id
dtstart
- the start date/time in GMT. They must be valid dates.
dtend
- the end date/time in GMT.
InvalidParameterException
WcapServerException
WcapException
public void deleteEventsById(java.lang.String calId, java.lang.String uid, java.lang.String rid, WcapModifier mod, boolean notify) throws InvalidParameterException, WcapServerException, WcapException
calId
- The target calendar id.
If it's null, it assumes it's the user's default calendar id.
uid
- The uid of the event to be deleted
rid
- The recurrence identifier of the event. If the event has no
recurrence, the value is 0.
It is the rid you got from an Event object fetched from server. In other words, you should delete an event that you have fetched and know the exact rid. * This rid is usually the starting time of the event, formatted in the ISO 8601 DateTime Z string.
mod
- A WcapModifier object indicating which recurrence to delete.
See the JavaDoc for WcapModifier class for more details.
notify
- If it is set to true, ICS will notify attendees of this deletion.
InvalidParameterException
WcapServerException
WcapException
public void deleteEventsByRange(java.lang.String calId, java.util.Date dtstart, java.util.Date dtend) throws InvalidParameterException, WcapServerException, WcapException
calId
- The id of the target calendar. If null, it is assumed to be
the user's default calendar's id.
dtstart
- The start date/time in GMT. If null, it is assumed to be from the
start of time.
dtend
- The end date/time in GMT. If null, it is assumed to be till the end
of time.
InvalidParameterException
WcapServerException
WcapException
public java.util.Vector fetchEventsByAlarmRange(java.lang.String calId, java.util.Date dtstart, java.util.Date dtend, int maxResults) throws InvalidParameterException, WcapServerException, WcapException
calId
- The id of the target calendar. If null, it is assumed to be
the user's default calendar's id.
dtstart
- The start date/time in GMT.
Due to the restriction of iPlanet Calendar WCAP command
implementation, this parameter must be valid. (The iCS 5.1
implementation of fetchcomponents_by_alarmrange.wcap does not follow
the specification described by the iCS Programmer's Reference.)
dtend
- The end date/time in GMT.
Due to the restriction of iPlanet Calendar WCAP command
implementation, this parameter must be valid. (The iCS 5.1
implementation of fetchcomponents_by_alarmrange.wcap does not follow
the specification described by the iCS Programmer's Reference.)
maxResults
- Maximum of result to be fetched. A value of 0 means no limit.
This methods will ignore all negative values.
InvalidParameterException
WcapServerException
WcapException
public java.util.Vector fetchEventsByAttendeeError(java.lang.String calId, java.lang.String attendee, int maxResults) throws InvalidParameterException, WcapServerException, WcapException
calId
- The id of the target calendar. If null, it is assumed to be
the user's default calendar's id.
attendee
- The attendee's calid to be searched on.
maxResults
- Maximum of result to be fetched. A value of 0 means no limit.
This methods will ignore all negative values.
InvalidParameterException
WcapServerException
WcapException
public java.util.Vector fetchEventsByLastMod(java.lang.String calId, java.util.Date dtstart, java.util.Date dtend, int maxResults) throws InvalidParameterException, WcapServerException, WcapException
calId
- The id of the target calendar. If null, it is assumed to be
the user's default calendar's id.
dtstart
- The start date/time in GMT. If null, it is assumed to be from the
start of time.
dtend
- The end date/time in GMT. If null, it is assumed to be till the end
of time.
maxResults
- Maximum of result to be fetched. A value of 0 means no limit.
This methods will ignore all negative values.
InvalidParameterException
WcapServerException
WcapException
public java.util.Vector fetchEventsByRange(java.lang.String calId, java.util.Date dtstart, java.util.Date dtend, int maxResults) throws InvalidParameterException, WcapServerException, WcapException
calId
- The id of the target calendar. If null, it is assumed to be
the user's default calendar's id.
dtstart
- The start date/time in GMT. If null, it is assumed to be from the
start of time.
dtend
- The end date/time in GMT. If null, it is assumed to be till the end
of time.
maxResults
- Maximum of result to be fetched. A value of 0 means no limit.
This methods will ignore all negative values.
InvalidParameterException
WcapServerException
WcapException
public java.util.Vector fetchEventsById(java.lang.String calId, java.lang.String uid, java.lang.String rid, WcapModifier modifier) throws InvalidParameterException, WcapServerException, WcapException
calId
- the calId to fetch the events from.
uid
- the uid of the event you want to be fetched.
rid
- a string for the associated rid. If the event has
no recurrence, this entry is a string "0"
modifier
- modifier that indicates which recurrences to retrieve.
InvalidParameterException
WcapServerException
WcapException
public java.lang.String storeEvent(java.lang.String calId, WcapModifier modifier, Event event) throws InvalidParameterException, WcapServerException, WcapException
If modifying an existing event, the Event object must have valid uid and rid. If you got the event object from the fetchEvents* methods, these two member variables should have been set already. For all other member variables, they can be null or some valid value. When this method encounters a null value, it will leave the original value unchanged.
If creating a new event, the caller must have created an Event object with all desired parameters. The uid and rid of the object must be null, while title and dtstart must have valid non-null values. If any of the other values are missing, the iPlanet Calendar Server will assign the default values it implies. You may read the ICS's programmer's guide for more details on the default values.
calId
- the calendar id that the change is applying to.
modifier
- modifier that indicates how the recurrence instance of the events
will be affected by the change.
event
- the Event object to be stored. If the Event object does not contains
the uid, this method assumes you are creating a new event.
InvalidParameterException
WcapServerException
WcapException
public void deleteToDosById(java.lang.String calId, java.lang.String uid, java.lang.String rid, WcapModifier mod, boolean notify) throws InvalidParameterException, WcapServerException, WcapException
calId
- The target calendar id.
If it's null, it assumes it's the user's default calendar id.
uid
- The uid of the todo to be deleted
rid
- The recurrence identifier of the todo. If the todo has no
recurrence, the value is 0.
It is the rid you got from an ToDo object fetched from server. In other words, you should delete a todo that you have fetched and know the exact rid. * This rid is usually the starting time of the todo, formatted in the ISO 8601 DateTime Z string.
mod
- A WcapModifier object indicating which recurrence to delete.
See the JavaDoc for WcapModifier class for more details.
notify
- If it is set to true, ICS will notify attendees of this deletion.
InvalidParameterException
WcapServerException
WcapException
public void deleteToDosByRange(java.lang.String calId, java.util.Date dtstart, java.util.Date dtend) throws InvalidParameterException, WcapServerException, WcapException
WARNING: Due to a bug in iPlanet Calendar Server, if you specified only one of the start and end time limit, the server will delete ALL ToDos in the system. It will remove all ToDos no matter whether they are within the range or not, and no whether they are "completed" or not. As a result, you should use this method with extreme care. If you really need to remove a bunch of non-completed ToDos within a range or a number of ToDos after OR before certain time, you should fetch the uids of those ToDos and remove them with deleteToDosById method.
calId
- the id of the target calendar.
dtstart
- the start date/time.
dtend
- the end date/time.
InvalidParameterException
WcapServerException
WcapException
public java.util.Vector fetchToDosByAlarmRange(java.lang.String calId, java.util.Date dtstart, java.util.Date dtend, int maxResults) throws InvalidParameterException, WcapServerException, WcapException
calId
- The id of the target calendar. If null, it is assumed to be
the user's default calendar's id.
dtstart
- The start date/time in GMT.
Due to the restriction of iPlanet Calendar WCAP command
implementation, this parameter must be valid. (The iCS 5.1
implementation of fetchcomponents_by_alarmrange.wcap does not follow
the specification described by the iCS Programmer's Reference.)
dtend
- The end date/time in GMT.
Due to the restriction of iPlanet Calendar WCAP command
implementation, this parameter must be valid. (The iCS 5.1
implementation of fetchcomponents_by_alarmrange.wcap does not follow
the specification described by the iCS Programmer's Reference.)
maxResults
- Maximum of result to be fetched. A value of 0 means no limit.
This methods will ignore all negative values.
InvalidParameterException
WcapServerException
WcapException
public java.util.Vector fetchToDosByAttendeeError(java.lang.String calId, java.lang.String attendee, int maxResults) throws InvalidParameterException, WcapServerException, WcapException
calId
- The id of the target calendar. If null, it is assumed to be
the user's default calendar's id.
attendee
- The attendee's calid to be searched on.
maxResults
- Maximum of result to be fetched. A value of 0 means no limit.
This methods will ignore all negative values.
InvalidParameterException
WcapServerException
WcapException
public java.util.Vector fetchToDosByLastMod(java.lang.String calId, java.util.Date dtstart, java.util.Date dtend, int maxResults) throws InvalidParameterException, WcapServerException, WcapException
calId
- The id of the target calendar. If null, it is assumed to be
the user's default calendar's id.
dtstart
- The start date/time in GMT. If null, it is assumed to be from the
start of time.
dtend
- The end date/time in GMT. If null, it is assumed to be till the end
of time.
maxResults
- Maximum of result to be fetched. A value of 0 means no limit.
This methods will ignore all negative values.
InvalidParameterException
WcapServerException
WcapException
public java.util.Vector fetchToDosByRange(java.lang.String calId, java.util.Date dtstart, java.util.Date dtend, int maxResults) throws InvalidParameterException, WcapServerException, WcapException
calId
- The id of the target calendar. If null, it is assumed to be
the user's default calendar's id.
dtstart
- The start date/time in GMT. If null, it is assumed to be from the
start of time.
dtend
- The end date/time in GMT. If null, it is assumed to be till the end
of time.
maxResults
- Maximum of result to be fetched. A value of 0 means no limit.
This methods will ignore all negative values.
InvalidParameterException
WcapServerException
WcapException
public java.util.Vector fetchToDosById(java.lang.String calId, java.lang.String uid, java.lang.String rid, WcapModifier modifier) throws InvalidParameterException, WcapServerException, WcapException
calId
- the calid to fetch the todos from.
uid
- the uid of the todo you want to be fetched.
rid
- a string for the associated rid. If the todo has
no recurrence, this entry is a string "0"
modifier
- modifier that indicates which recurrences to retrieve.
InvalidParameterException
WcapServerException
WcapException
public java.lang.String storeToDo(java.lang.String calId, WcapModifier modifier, ToDo todo) throws InvalidParameterException, WcapServerException, WcapException
If modifying an existing todo, the ToDo object must have valid uid and rid. If you got the ToDo object from the fetchToDos* methods, these two member variables should have been set already. For all other member variables, they can be null or some valid value. When this method encounters a null value, it will leave the original value unchanged.
If creating a new todo, the caller must have created an ToDo object with all desired parameters. The uid and rid of the object must be null, while title and dtstart must have valid non-null values. If any of the other values are missing, the iPlanet Calendar Server will assign the default values it implies. You may read the ICS's programmer's guide for more details on the default values.
calId
- the calendar id that the change is applying to.
modifier
- modifier that indicates how the recurrence instance of the todos
will be affected by the change.
todo
- the ToDo object to be stored. If the ToDo object does not contains
the uid, this method assumes you are creating a new todo.
InvalidParameterException
WcapServerException
WcapException
protected java.lang.String urlEncode(java.lang.String inStr) throws WcapException
WcapException
|
Nitido NiM 2.5 Java API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1999-2009 Nitido Inc. Proprietary and Confidential. All Rights Reserved.