net.lin2win.calendar
Class Calendar

java.lang.Object
  extended by net.lin2win.calendar.Calendar

public class Calendar
extends java.lang.Object

Web Service Class for the Calendar Project. Each call is stateless so you have to provide username and password. For security issues the return value of some method is false or empty. That means the operantion was successful or was not. The attacker shall not see a stack trace.

Hint for Admins:
If you use this service class ofer a public network ensure that you use encryption ! Lookup the Application Server Manual for proper configuration.


Constructor Summary
Calendar()
           
 
Method Summary
 java.lang.String createAppointment(java.lang.String username, java.lang.String password, java.lang.String title, java.lang.String description, java.lang.String time, java.lang.String type, int priority)
          Create a new Appointment.
 boolean createType(java.lang.String name)
          Create a new Appointment Type.
 boolean createUser(java.lang.String username, java.lang.String password)
          Create a new User Account for the Calendar Service.
 boolean deleteAppointment(java.lang.String username, java.lang.String password, java.lang.String id)
          Delete an appointment.
 boolean deleteType(java.lang.String typeId)
          Delete an appointment type.
 boolean deleteUser(java.lang.String username, java.lang.String password)
          Delete a User Account from the Calendar Service.
 java.lang.String getTime()
          Simple Daytime Service.
 java.lang.String[][] getTypes()
          Returns an Array of available Types.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Calendar

public Calendar()
Method Detail

createUser

public boolean createUser(java.lang.String username,
                          java.lang.String password)
Create a new User Account for the Calendar Service. Username must be unique, password must be at least 3 Characters. A unique user ID is generated automatically.

Returns:
True if Creation was successful, FALSE if username already exists or operation failed.

deleteUser

public boolean deleteUser(java.lang.String username,
                          java.lang.String password)
Delete a User Account from the Calendar Service. All Appointments for this user will be deleted too. Authentication with Username and Password is required.

Returns:
True if Delete Operation was Successful.

createAppointment

public java.lang.String createAppointment(java.lang.String username,
                                          java.lang.String password,
                                          java.lang.String title,
                                          java.lang.String description,
                                          java.lang.String time,
                                          java.lang.String type,
                                          int priority)
Create a new Appointment. Authentication with username and password is required. You must also provide a valid title, time and Appointment Type ID. Use the Web Method getTypes to get Appointment Type IDs and Name

Parameters:
username - A valid username like "Hans".
password - The user password like "123456".
title - A short heading for your appointment like "Meeting with Mr.Smith".
description - A longtext description for your apppointment. An empty String is allowed here "".
time - Time in Miliseconds since 1.1.1970 UTC when you appointment takes place.
type - A type ID like "1a5a46f04704433093d09431c51893ad" . User getTypes to get Type IDs and Name.
priority - Integer Value.
Returns:
Appointment ID if creation was successful otherwise a Error String starting with "ERROR:"

deleteAppointment

public boolean deleteAppointment(java.lang.String username,
                                 java.lang.String password,
                                 java.lang.String id)
Delete an appointment. Authentication with username and password is required.

Returns:
True if appointment was deleted successful otherwise FALSE.

getTime

public java.lang.String getTime()
Simple Daytime Service. Implemented for testing purpose. It tells you the date and time on the server.


getTypes

public java.lang.String[][] getTypes()
Returns an Array of available Types. A Type has a unique Type ID and a natural Name like "Meeting".

Returns:
2 Dimensional String Array

createType

public boolean createType(java.lang.String name)
Create a new Appointment Type. An Appointment Type consists of a Name and a unique type ID. The type ID is automatically generated, you dont have to worry about.

Returns:
True if operation was successful. FALSE if the type already exists or in case of an exception.

deleteType

public boolean deleteType(java.lang.String typeId)
Delete an appointment type.

See Also:
getTypes()