com.sap.ip.collaboration.gw.impl.transport.file.filesystem
Class FileTransport

java.lang.Object
  |
  +--com.sap.ip.collaboration.gw.impl.transport.file.filesystem.FileTransport
All Implemented Interfaces:
ICalendarReadTransport, IReadTransport, ISendTransport, ITransport

public class FileTransport
extends java.lang.Object
implements ICalendarReadTransport, ISendTransport

This is a transport class which uses filesystem as groupware server instead of a groupware server. Title: TestCalendarTransport.java Description: Copyright: Copyright (c) 2002 Company: SAP Labs India

Version:
1.0

Inner Class Summary
(package private)  class FileTransport.AvailData
          Class used to represent Availability information.
 
Field Summary
private  java.lang.String ADDRESS_SEPARATOR
          email addresses seperator in to,cc & bcc lists.
private  java.lang.String aliasName
          System's Name.
private  java.io.File appDirectory
          File object holding the appointment directory.
private  java.lang.String APPOINTMENTS
          folder in which the appointments are stored & it is relative to startLocation.
private  java.lang.String ATTACHMENT
          attachements to groupware items are stored with the extension .attachment
private  java.lang.String AVAILABILITY
          folder in which the availability information is stored & it is relative to startLocation.
private  java.io.File availDirectory
          File object holding the availability directory.
private  java.util.Calendar calendar
           
private  java.util.List configuration
           
private  java.text.SimpleDateFormat formatter
           
private  IGroupwareManager gwManager
          Groupware Manager.
private static IGWObjectsFactoryService gwObjFactory
           
private  java.lang.String id
           
private  int idCounter
          Count of the calendar items in cache.
private  java.util.Map idStore
           
private  java.util.Map itemStore
          cache to store calendar items.
private  java.lang.String SEPARATOR
          files which represent groupware items.
private  java.lang.String startLocation
          Starting Location of the file transport.
 
Constructor Summary
FileTransport()
           
 
Method Summary
private  void addAvailabilityInfoForUser(java.lang.String user, java.util.Properties properties)
          Adds the user availability information to availability file.
private  void addToCache(ICalendarItem item)
          Stores the given Calendar item in Cache.
private  java.lang.String addToFileSystem(ICalendarItem pItem, java.util.Properties props, boolean reflect)
          It Creates or saves file corresponding to given calendar item.
private  java.io.File calendarSaveItem(java.lang.String id)
          Method to return the file representing the calendar item.
private  java.io.File calendarStoreItem(java.util.Date date, java.lang.StringBuffer pSb)
          Creates file to store appointment information based on date value.
private  void cleanDirs(java.io.File dir)
          Deletes all the files under a given directory.
private  java.util.Date clearHourTimeSecond(java.util.Date date)
          Sets the hour,minutes,seconds of an date object to 0
private  void computeAvailabilityInfo(java.util.Hashtable availableAppointments, java.util.List slots, java.lang.String user, java.util.Map map)
          Scans the all existing appointments in file system and depending on time slots it calculates the availability status.
private  void convertToAvailabilityInfoImpl(java.util.Map map, IDateRange range, int interval)
          Stores Availability info for given date range & interval in its implementation object.
private  void convertValuesToAvailData(java.util.Hashtable pHt)
          Stores the Availability info for the existing appointments using the (Inner Class) AvailData
private  void createActualAttachment(java.io.File dir, IAttachment attachment)
          Creates the attachment file for a given attachment.
private  void createAttachments(java.io.File calendarStoreFile, ICalendarItem item, java.util.Properties props)
           
private  ICalendarItem createCalendarItem(java.util.Properties props, java.io.File file)
          Creates the calendar item from Calendar item properties and attachements if any from the file directory associated the item.
private  java.io.File createDirectory(java.lang.String tempLocation)
          Creates the directory if it is not already present.
private  void createItem(ICalendarItem item, boolean reflect)
          Creates a file for the given CalendarItem Object.
private  void fillInAttendees(java.util.Set set, java.lang.String addresses)
          Extracts the list of email addresses from the String containg the email addresses seperated by seperator.
private  java.lang.String[] findResultantDirNames(java.util.Date startDate, java.util.Date endDate)
          Constructs the directory name's (in the format yyyy-MM-dd) list from startdate to enddate.
 IAttachment getAttachmentContent(java.lang.String id, java.lang.String attachmentId, IGroupwareCredentials credentials)
          Returns content of the attachment based on the id specified.
private  java.io.File getAttachmentDir(java.lang.String id)
          It gets the attachment directory of the given calendar item id.
private  IAttachment getAttachmentFromFileSystem(java.io.File attachmentDir, java.lang.String attachmentId, java.lang.String attachmentFileName)
          Reads the attachment from the given attachment directory and file name & wraps it into IAttachment object.
private  IAvailabilityInfo getAvailabilityImpl(java.lang.String data, IDateRange range, int interval)
          Creates the availability info implementaion with the given availability info.
 java.util.Map getAvailabilityInfo(IDateRange range, int timeInterval, java.util.List addresses, IGroupwareCredentials credential)
          Returns the availability information for a list of users.
private  ICalendarItem getCalendarItem(java.io.File file)
          Loads the Calendar item from the file.
 java.lang.String getContent(java.lang.String id, IGroupwareCredentials credential)
          Returns content of the groupware item based on the id specified.
private  java.util.Date getDateFromString(java.lang.String pFormattedDate)
          Converts string representation of date to date object.
private  java.util.Date getDateFromString(java.lang.String formattedDate, java.lang.String format)
          converts datestring of format yy-MM-dd-HH-mm to date object.
 IGroupwareItem getItem(java.lang.String id, IGroupwareCredentials credential)
          Returns a groupware item from the transport based on the id specified.
 java.util.List getItemList(IDateRange range, IGroupwareCredentials credential)
          Returns all items from the transport for the specified date range
 java.util.List getItemList(IDateRange range, java.util.Properties searchCriteria, IGroupwareCredentials credentials)
          Returns all items from the transport for the specified date range and search criteria.
 java.lang.String getServerAlias()
          Returns the alias name of the server used by the transport.
private  java.lang.String getStringFromDate(java.util.Date date, java.lang.String format)
          Method to create string representation of Date object of given format.
 GroupwareItemType getSupportedItemType()
          Returns the groupware item type supported by the transport i.e Mail, Calendar, Task etc.
private  int getTotalTimeSlots(IDateRange range, int timeInterval, java.util.List list)
          Constructs the timeslots within given date range & time interval.
 java.lang.String getTransportDescription(java.util.Locale locale)
          Returns the description of the groupware transport.
 java.lang.String getTransportName()
          Returns the name of the groupware transport.
 TransportType getTransportType()
          Returns the transport type of the groupware transport i.e.
private  void initFileSystemDetails()
          Initializes the Filesystem details like the default appointment and availability directories.
private  void initGWObjectsFactory()
          Initializes the Groupware Service.
 void initialize(IGroupwareManager gwManager, java.util.List configuration)
          Initializes the groupware transport with different congiguration properties.
private  void loadItemFromFile(java.lang.String absolutePath, java.lang.String fileName, java.util.List result)
          Loads the calendar item from file
private  void loadItemsFromDirectory(java.lang.String subDirectoryName, java.util.List result)
          Load all the calendar items from a given directory.
private  void loadItemsFromFiles(java.lang.String[] files, java.util.List result, java.lang.String absolutePath)
          Loads the calendar items from a given list of files.
private  void readAttachmentsIfAny(java.util.Properties props, java.io.File file, ICalendarItem item)
          Method to attach attachments for a given calendar item.
 void remove(java.lang.String id, IGroupwareCredentials credentials)
          Removes the groupware item based on the id specified.
private  void removeAttachmentsIfAny(java.lang.String id)
          removes all the attachments with a given calendar item.
private  void removeAvailableInfo(java.io.File calendarStoreFile, java.lang.String id)
          Find the users go to their respective folders delete the availability info and save it.
private  void removeFromUserAppointment(java.lang.String user, java.lang.String id)
          deletes the appointment entry from the user availability info.
private  void removeItem(java.lang.String id)
          It deletes file associated with a calendar item from file system & updates the cache & availability information
 java.lang.String save(IGroupwareItem item, IGroupwareCredentials credential)
          Saves the groupware item using the credentials specified.
 java.lang.String send(IGroupwareItem item, IGroupwareCredentials credential)
          Sends the groupware item to the intended recipient list.
private  java.lang.String send(IGroupwareItem item, IGroupwareCredentials credential, boolean reflect)
          Sends or saves a given calendar item depending on its status(existing/new).
private  void swapDatesAfterComparison(java.util.Date pStartDate, java.util.Date pEndDate)
          compares the 2 dates and swaps the dates in case second date is greater than first date.
 void terminate()
          Terminates the groupware transport.
private  void transferContent(IAttachment attachment, java.io.File attachmentFile)
          writes the attachment file with its content.
private  void updateAvailableInfo(java.lang.String fileName, ICalendarItem item, java.util.Properties properties, boolean reflect)
          Updates the availability info of all the attenedees of the appointment.
private  int updateStatus(char actual, boolean isFree, FileTransport.AvailData appointmentData)
          Compares the current status & new status and updates with current status of higher degree.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

ADDRESS_SEPARATOR

private java.lang.String ADDRESS_SEPARATOR
email addresses seperator in to,cc & bcc lists.

aliasName

private java.lang.String aliasName
System's Name.

appDirectory

private java.io.File appDirectory
File object holding the appointment directory.

APPOINTMENTS

private java.lang.String APPOINTMENTS
folder in which the appointments are stored & it is relative to startLocation.

ATTACHMENT

private java.lang.String ATTACHMENT
attachements to groupware items are stored with the extension .attachment

AVAILABILITY

private java.lang.String AVAILABILITY
folder in which the availability information is stored & it is relative to startLocation.

availDirectory

private java.io.File availDirectory
File object holding the availability directory.

calendar

private java.util.Calendar calendar

configuration

private java.util.List configuration

formatter

private java.text.SimpleDateFormat formatter

gwManager

private IGroupwareManager gwManager
Groupware Manager.

gwObjFactory

private static IGWObjectsFactoryService gwObjFactory

id

private java.lang.String id

idCounter

private int idCounter
Count of the calendar items in cache.

idStore

private java.util.Map idStore

itemStore

private java.util.Map itemStore
cache to store calendar items.

SEPARATOR

private java.lang.String SEPARATOR
files which represent groupware items.

startLocation

private java.lang.String startLocation
Starting Location of the file transport.
Constructor Detail

FileTransport

public FileTransport()
Method Detail

addAvailabilityInfoForUser

private void addAvailabilityInfoForUser(java.lang.String user,
                                        java.util.Properties properties)
                                 throws GroupwareException
Adds the user availability information to availability file.
Parameters:
user -  
properties -  
Throws:
GroupwareException -  

addToCache

private void addToCache(ICalendarItem item)
                 throws GroupwareException
Stores the given Calendar item in Cache.
Parameters:
item -  
Throws:
GroupwareException -  

addToFileSystem

private java.lang.String addToFileSystem(ICalendarItem pItem,
                                         java.util.Properties props,
                                         boolean reflect)
                                  throws GroupwareException
It Creates or saves file corresponding to given calendar item.
Parameters:
pItem - Calendar Item object
props - Property Object used to write the Calendar Item Object file.
reflect -  
Returns:
 
Throws:
GroupwareException -  

calendarSaveItem

private java.io.File calendarSaveItem(java.lang.String id)
                               throws GroupwareException
Method to return the file representing the calendar item.
Parameters:
id - Groupware item id.
Returns:
File representing the given calendar item.
Throws:
GroupwareException -  

calendarStoreItem

private java.io.File calendarStoreItem(java.util.Date date,
                                       java.lang.StringBuffer pSb)
                                throws GroupwareException
Creates file to store appointment information based on date value. Appointment file is created under directory by name (yyyy-MM-dd) of given date. Appointment file name is generated based on the hour,minutes,second & current time so that uniquness is guaranteed.
Parameters:
date - Apponintment start date.
pSb - Stores the generated appointment file name.
Returns:
 
Throws:
GroupwareException -  

cleanDirs

private void cleanDirs(java.io.File dir)
Deletes all the files under a given directory.
Parameters:
dir -  

clearHourTimeSecond

private java.util.Date clearHourTimeSecond(java.util.Date date)
Sets the hour,minutes,seconds of an date object to 0
Parameters:
date - Date object.
Returns:
 

computeAvailabilityInfo

private void computeAvailabilityInfo(java.util.Hashtable availableAppointments,
                                     java.util.List slots,
                                     java.lang.String user,
                                     java.util.Map map)
Scans the all existing appointments in file system and depending on time slots it calculates the availability status.
Parameters:
availableAppointments -  
slots -  
user -  
map -  

convertToAvailabilityInfoImpl

private void convertToAvailabilityInfoImpl(java.util.Map map,
                                           IDateRange range,
                                           int interval)
                                    throws GroupwareException
Stores Availability info for given date range & interval in its implementation object.
Parameters:
map -  

convertValuesToAvailData

private void convertValuesToAvailData(java.util.Hashtable pHt)
Stores the Availability info for the existing appointments using the (Inner Class) AvailData
Parameters:
ht - Existing appointments.

createActualAttachment

private void createActualAttachment(java.io.File dir,
                                    IAttachment attachment)
                             throws GroupwareException
Creates the attachment file for a given attachment.
Parameters:
dir - Attachment directory.
attachment - Attachment Object.
Throws:
GroupwareException -  

createAttachments

private void createAttachments(java.io.File calendarStoreFile,
                               ICalendarItem item,
                               java.util.Properties props)
                        throws GroupwareException
Parameters:
calendarStoreFile -  
item -  
props -  
Throws:
GroupwareException -  

createCalendarItem

private ICalendarItem createCalendarItem(java.util.Properties props,
                                         java.io.File file)
                                  throws GroupwareException
Creates the calendar item from Calendar item properties and attachements if any from the file directory associated the item.
Parameters:
props - Calendar Item Properties.
file - directory in which the Calendar item is stored.
Returns:
Calendar Item object.

createDirectory

private java.io.File createDirectory(java.lang.String tempLocation)
                              throws GroupwareException
Creates the directory if it is not already present.
Parameters:
tempLocation - Location in which the directory needs to be created.
Returns:
 
Throws:
GroupwareException -  

createItem

private void createItem(ICalendarItem item,
                        boolean reflect)
                 throws GroupwareException
Creates a file for the given CalendarItem Object.
Parameters:
item -  
reflect -  
Throws:
GroupwareException -  

fillInAttendees

private void fillInAttendees(java.util.Set set,
                             java.lang.String addresses)
Extracts the list of email addresses from the String containg the email addresses seperated by seperator.
Parameters:
set - contains the list of email addresses.
addresses - String containing email addresses seperated by seperator.

findResultantDirNames

private java.lang.String[] findResultantDirNames(java.util.Date startDate,
                                                 java.util.Date endDate)
Constructs the directory name's (in the format yyyy-MM-dd) list from startdate to enddate.
Parameters:
startDate - Start Date
endDate - End Date
Returns:
Array of directory names between 2 given dates.

getAttachmentContent

public IAttachment getAttachmentContent(java.lang.String id,
                                        java.lang.String attachmentId,
                                        IGroupwareCredentials credentials)
                                 throws GroupwareException
Description copied from interface: IReadTransport
Returns content of the attachment based on the id specified.
Specified by:
getAttachmentContent in interface IReadTransport
Following copied from interface: com.sap.ip.collaboration.gw.api.framework.groupware.IReadTransport
Parameters:
Id - id of the groupware item
attachmentId - id of the attchment id
IGroupwareCredentials - groupware credentials
Returns:
IAttachment
Throws:
GroupwareException -  

getAttachmentDir

private java.io.File getAttachmentDir(java.lang.String id)
                               throws GroupwareException
It gets the attachment directory of the given calendar item id.
Parameters:
id - Calendar item id.
Returns:
attachment directory of the calendar item.
Throws:
GroupwareException -  

getAttachmentFromFileSystem

private IAttachment getAttachmentFromFileSystem(java.io.File attachmentDir,
                                                java.lang.String attachmentId,
                                                java.lang.String attachmentFileName)
                                         throws GroupwareException
Reads the attachment from the given attachment directory and file name & wraps it into IAttachment object.
Parameters:
attachmentDir -  
attachmentId -  
attachmentFileName -  
Returns:
 
Throws:
GroupwareException -  

getAvailabilityImpl

private IAvailabilityInfo getAvailabilityImpl(java.lang.String data,
                                              IDateRange range,
                                              int interval)
                                       throws GroupwareException
Creates the availability info implementaion with the given availability info.
Parameters:
data - Avaialability info.
range - Date range.
interval - Time Interval.
Returns:
 
Throws:
GroupwareException -  

getAvailabilityInfo

public java.util.Map getAvailabilityInfo(IDateRange range,
                                         int timeInterval,
                                         java.util.List addresses,
                                         IGroupwareCredentials credential)
                                  throws GroupwareException
Description copied from interface: ICalendarReadTransport
Returns the availability information for a list of users.
Specified by:
getAvailabilityInfo in interface ICalendarReadTransport
Following copied from interface: com.sap.ip.collaboration.gw.api.framework.groupware.ICalendarReadTransport
Parameters:
DateRange - range date range
int - timeInterval
List - addresses list of e-mailId of users
IGroupwareCredentials - groupware credentials
Returns:
availibilityInformation returned as a map with the address as the key and the IAvailabilityInfo as the value
Throws:
GroupwareException -  

getCalendarItem

private ICalendarItem getCalendarItem(java.io.File file)
Loads the Calendar item from the file.
Parameters:
file - object representing the calendar item.
Returns:
Calendar item contained in the file is returned.

getContent

public java.lang.String getContent(java.lang.String id,
                                   IGroupwareCredentials credential)
                            throws GroupwareException
Description copied from interface: IReadTransport
Returns content of the groupware item based on the id specified.
Specified by:
getContent in interface IReadTransport
Following copied from interface: com.sap.ip.collaboration.gw.api.framework.groupware.IReadTransport
Parameters:
Id - id of the groupware item
IGroupwareCredentials - groupware credentials
Returns:
content
Throws:
GroupwareException -  

getDateFromString

private java.util.Date getDateFromString(java.lang.String pFormattedDate)
Converts string representation of date to date object.
Parameters:
string - Input Date object in the form of string.
Returns:
 

getDateFromString

private java.util.Date getDateFromString(java.lang.String formattedDate,
                                         java.lang.String format)
converts datestring of format yy-MM-dd-HH-mm to date object.
Parameters:
formattedDate - datestring.
format - date format yy-MM-dd-HH-mm
Returns:
java.util.Date Object

getItem

public IGroupwareItem getItem(java.lang.String id,
                              IGroupwareCredentials credential)
                       throws GroupwareException
Description copied from interface: IReadTransport
Returns a groupware item from the transport based on the id specified.
Specified by:
getItem in interface IReadTransport
Following copied from interface: com.sap.ip.collaboration.gw.api.framework.groupware.IReadTransport
Parameters:
Id - id of the groupware item
IGroupwareCredentials - groupware credentials
Returns:
groupware item
Throws:
GroupwareException -  

getItemList

public java.util.List getItemList(IDateRange range,
                                  IGroupwareCredentials credential)
                           throws GroupwareException
Description copied from interface: IReadTransport
Returns all items from the transport for the specified date range
Specified by:
getItemList in interface IReadTransport
Following copied from interface: com.sap.ip.collaboration.gw.api.framework.groupware.IReadTransport
Parameters:
DateRange - date range for which the groupware items are fetched
IGroupwareCredentials - groupware credentials
Returns:
groupware item list
Throws:
GroupwareException -  

getItemList

public java.util.List getItemList(IDateRange range,
                                  java.util.Properties searchCriteria,
                                  IGroupwareCredentials credentials)
                           throws GroupwareException
Description copied from interface: IReadTransport
Returns all items from the transport for the specified date range and search criteria.
Specified by:
getItemList in interface IReadTransport
Following copied from interface: com.sap.ip.collaboration.gw.api.framework.groupware.IReadTransport
Parameters:
DateRange - date range for which the groupware items are fetched
IGroupwareCredentials - groupware credentials
Returns:
groupware item list
Throws:
GroupwareException -  

getServerAlias

public java.lang.String getServerAlias()
Description copied from interface: ITransport
Returns the alias name of the server used by the transport.
Specified by:
getServerAlias in interface ITransport
Following copied from interface: com.sap.ip.collaboration.gw.api.framework.groupware.ITransport
Returns:
server name used by the transport.

getStringFromDate

private java.lang.String getStringFromDate(java.util.Date date,
                                           java.lang.String format)
Method to create string representation of Date object of given format.
Parameters:
startDate - Date object.
format - Dateformat representation.

getSupportedItemType

public GroupwareItemType getSupportedItemType()
Description copied from interface: ITransport
Returns the groupware item type supported by the transport i.e Mail, Calendar, Task etc.
Specified by:
getSupportedItemType in interface ITransport
Following copied from interface: com.sap.ip.collaboration.gw.api.framework.groupware.ITransport
Returns:
groupware item type

getTotalTimeSlots

private int getTotalTimeSlots(IDateRange range,
                              int timeInterval,
                              java.util.List list)
Constructs the timeslots within given date range & time interval.
Parameters:
range - Date range
timeInterval - Time interval.
list - stores the time slots.
Returns:
 

getTransportDescription

public java.lang.String getTransportDescription(java.util.Locale locale)
Description copied from interface: ITransport
Returns the description of the groupware transport.
Specified by:
getTransportDescription in interface ITransport
Following copied from interface: com.sap.ip.collaboration.gw.api.framework.groupware.ITransport
Parameters:
locale -  
Returns:
description

getTransportName

public java.lang.String getTransportName()
Description copied from interface: ITransport
Returns the name of the groupware transport.
Specified by:
getTransportName in interface ITransport
Following copied from interface: com.sap.ip.collaboration.gw.api.framework.groupware.ITransport
Returns:
transport name

getTransportType

public TransportType getTransportType()
Description copied from interface: ITransport
Returns the transport type of the groupware transport i.e. READ, SEND or BOTH.
Specified by:
getTransportType in interface ITransport
Following copied from interface: com.sap.ip.collaboration.gw.api.framework.groupware.ITransport
Returns:
transport type

initFileSystemDetails

private void initFileSystemDetails()
                            throws GroupwareException
Initializes the Filesystem details like the default appointment and availability directories.
Throws:
GroupwareException -  

initGWObjectsFactory

private void initGWObjectsFactory()
                           throws com.sapportals.wcm.repository.ResourceException,
                                  com.sapportals.wcm.repository.ResourceException
Initializes the Groupware Service.
Throws:
ResourceException -  
com.sapportals.wcm.repository.ResourceException -  

initialize

public void initialize(IGroupwareManager gwManager,
                       java.util.List configuration)
                throws GroupwareException
Description copied from interface: ITransport
Initializes the groupware transport with different congiguration properties.
Specified by:
initialize in interface ITransport
Following copied from interface: com.sap.ip.collaboration.gw.api.framework.groupware.ITransport
Parameters:
GroupwareManager - groupware manager class intializing the transport
list - list of configuration properties
Throws:
GroupwareException -  

loadItemFromFile

private void loadItemFromFile(java.lang.String absolutePath,
                              java.lang.String fileName,
                              java.util.List result)
Loads the calendar item from file
Parameters:
absolutePath -  
fileName -  
result -  

loadItemsFromDirectory

private void loadItemsFromDirectory(java.lang.String subDirectoryName,
                                    java.util.List result)
Load all the calendar items from a given directory.
Parameters:
subDirectoryName - directory name from which the items to be loaded.
result - List of items loaded from a given directory.

loadItemsFromFiles

private void loadItemsFromFiles(java.lang.String[] files,
                                java.util.List result,
                                java.lang.String absolutePath)
Loads the calendar items from a given list of files.
Parameters:
files -  
result -  
absolutePath -  

readAttachmentsIfAny

private void readAttachmentsIfAny(java.util.Properties props,
                                  java.io.File file,
                                  ICalendarItem item)
                           throws GroupwareException
Method to attach attachments for a given calendar item.
Parameters:
props -  
file - directory where the attachements are for a given calendar item present.
item - groupware item like mail or appointment.
Throws:
GroupwareException - if the attachment associated with groupware item is missing from.

remove

public void remove(java.lang.String id,
                   IGroupwareCredentials credentials)
            throws GroupwareException
Description copied from interface: ISendTransport
Removes the groupware item based on the id specified.
Specified by:
remove in interface ISendTransport
Following copied from interface: com.sap.ip.collaboration.gw.api.framework.groupware.ISendTransport
Parameters:
String - id
IGroupwareCredentials - groupware credentials
Throws:
GroupwareException -  

removeAttachmentsIfAny

private void removeAttachmentsIfAny(java.lang.String id)
                             throws GroupwareException
removes all the attachments with a given calendar item.
Parameters:
id -  
Throws:
GroupwareException -  

removeAvailableInfo

private void removeAvailableInfo(java.io.File calendarStoreFile,
                                 java.lang.String id)
                          throws GroupwareException
Find the users go to their respective folders delete the availability info and save it.
Parameters:
calendarStoreFile -  
id -  

removeFromUserAppointment

private void removeFromUserAppointment(java.lang.String user,
                                       java.lang.String id)
                                throws GroupwareException
deletes the appointment entry from the user availability info.
Parameters:
user -  
id -  

removeItem

private void removeItem(java.lang.String id)
                 throws GroupwareException
It deletes file associated with a calendar item from file system & updates the cache & availability information
Parameters:
id - Calendar item Identifier.
Throws:
GroupwareException -  

save

public java.lang.String save(IGroupwareItem item,
                             IGroupwareCredentials credential)
                      throws GroupwareException
Description copied from interface: ISendTransport
Saves the groupware item using the credentials specified.
Specified by:
save in interface ISendTransport
Following copied from interface: com.sap.ip.collaboration.gw.api.framework.groupware.ISendTransport
Parameters:
item - groupware item
credentials - groupware credentials
Returns:
id of the item saved
Throws:
GroupwareException -  

send

public java.lang.String send(IGroupwareItem item,
                             IGroupwareCredentials credential)
                      throws GroupwareException
Description copied from interface: ISendTransport
Sends the groupware item to the intended recipient list.
Specified by:
send in interface ISendTransport
Following copied from interface: com.sap.ip.collaboration.gw.api.framework.groupware.ISendTransport
Parameters:
item - groupware item
credentials - groupware credentials
Returns:
id of the item sent
Throws:
GroupwareException -  

send

private java.lang.String send(IGroupwareItem item,
                              IGroupwareCredentials credential,
                              boolean reflect)
                       throws GroupwareException
Sends or saves a given calendar item depending on its status(existing/new).
Parameters:
item - Calendar Item Object.
credential - User Credential Object.
reflect - boolean indication for send or save operation.
Returns:
 
Throws:
GroupwareException -  

swapDatesAfterComparison

private void swapDatesAfterComparison(java.util.Date pStartDate,
                                      java.util.Date pEndDate)
compares the 2 dates and swaps the dates in case second date is greater than first date.
Parameters:
pStartDate - first date
pEndDate - second date

terminate

public void terminate()
               throws GroupwareException
Description copied from interface: ITransport
Terminates the groupware transport.
Specified by:
terminate in interface ITransport
Following copied from interface: com.sap.ip.collaboration.gw.api.framework.groupware.ITransport
Throws:
GroupwareException -  

transferContent

private void transferContent(IAttachment attachment,
                             java.io.File attachmentFile)
                      throws GroupwareException
writes the attachment file with its content.
Parameters:
attachment -  
attachmentFile -  

updateAvailableInfo

private void updateAvailableInfo(java.lang.String fileName,
                                 ICalendarItem item,
                                 java.util.Properties properties,
                                 boolean reflect)
                          throws GroupwareException
Updates the availability info of all the attenedees of the appointment.
Parameters:
fileName -  
item -  
properties -  
reflect -  
Throws:
GroupwareException -  

updateStatus

private int updateStatus(char actual,
                         boolean isFree,
                         FileTransport.AvailData appointmentData)
Compares the current status & new status and updates with current status of higher degree.
Parameters:
c - new status
isFree - Current Free/Busy status .
appointmentData -  
Returns:
Updates staus.