shared.remotecall
Class ClientRequest

java.lang.Object
  extended byshared.remotecall.RemoteCall
      extended byshared.remotecall.ClientRequest
All Implemented Interfaces:
java.io.Serializable

public final class ClientRequest
extends RemoteCall
implements java.io.Serializable

An object of this class is sent from the calendar client to the calendar server each time a request is made. This class encapsulates all the needed information so that the server can response with a serialized server response object.

Author:
buetow
See Also:
Serialized Form

Field Summary
static int ADD_EVENT
           
static int DELETE_EVENT
           
static int FLUSH_DATABASE
           
static int MODIFY_EVENT
           
static int RELOAD_DATABASE
           
static int REQUEST_ALL_EVENTS
           
static int REQUEST_EVENTS
           
static int SHUTDOWN_SERVER
           
 
Constructor Summary
ClientRequest()
          Simple constructor, creates a client request object requesting events up from the current date.
ClientRequest(int iAction)
          Simple constructor, creates a client request object requesting events up from the current date.
 
Method Summary
 boolean actionIs(int iAction)
          This method is needed by the clanedar server to get the type of action requested.
 CalendarEvent getEvent()
          This method returns the event object.
 int getNumEventsToRequest()
          This method returns the maximum number of events the client wants to request.
 boolean match(CalendarEvent calendarEvent)
          Checks if a specific calendar event matches this client request.
 boolean requestsNewEvents()
          This method is needed by the calendar server to get the type of action requested.
 void setDateRange(java.util.Date dateRangeFrom, java.util.Date dateRangeTo)
          This method sets the date range to request.
 void setEvent(CalendarEvent event)
          This method sets a calendar event object to be transfered to the calendar server because the event has been modified.
 void setMainRegexp(boolean bMainRegexp)
          This method sets if the client contains a regexp from the main session window.
 void setNumEventsToRequest(int iNumEvents)
          With this method the client can define the maximum number of events to request.
 void setRegexpAll(java.lang.String sRegexp)
          This method compiles a specific pattern object to match with on the server part after serialization.
 void setRegexpCategory(java.lang.String sRegexp)
          This method compiles a specific pattern object to match with on the server part after serialization.
 void setRegexpDate(java.lang.String sRegexp)
          This method compiles a specific pattern object to match with on the server part after serialization.
 void setRegexpDescription(java.lang.String sRegexp)
          This method compiles a specific pattern object to match with on the server part after serialization.
 void setRegexpPlace(java.lang.String sRegexp)
          This method compiles a specific pattern object to match with on the server part after serialization.
 java.lang.String toString()
          This method returns a representation the object as a string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REQUEST_EVENTS

public static final int REQUEST_EVENTS
See Also:
Constant Field Values

REQUEST_ALL_EVENTS

public static final int REQUEST_ALL_EVENTS
See Also:
Constant Field Values

MODIFY_EVENT

public static final int MODIFY_EVENT
See Also:
Constant Field Values

DELETE_EVENT

public static final int DELETE_EVENT
See Also:
Constant Field Values

ADD_EVENT

public static final int ADD_EVENT
See Also:
Constant Field Values

RELOAD_DATABASE

public static final int RELOAD_DATABASE
See Also:
Constant Field Values

FLUSH_DATABASE

public static final int FLUSH_DATABASE
See Also:
Constant Field Values

SHUTDOWN_SERVER

public static final int SHUTDOWN_SERVER
See Also:
Constant Field Values
Constructor Detail

ClientRequest

public ClientRequest()
Simple constructor, creates a client request object requesting events up from the current date.


ClientRequest

public ClientRequest(int iAction)
Simple constructor, creates a client request object requesting events up from the current date.

Parameters:
iAction - Specifies the request type of this request.
Method Detail

actionIs

public boolean actionIs(int iAction)
This method is needed by the clanedar server to get the type of action requested.

Parameters:
iAction - Specifies the action to test against.
Returns:
Returns true if the specified action ID matches with the action ID of this request object.

requestsNewEvents

public boolean requestsNewEvents()
This method is needed by the calendar server to get the type of action requested.

Returns:
Returns true if this object requests new events from the server.

setDateRange

public void setDateRange(java.util.Date dateRangeFrom,
                         java.util.Date dateRangeTo)
This method sets the date range to request.

Parameters:
dateRangeFrom - Specifies the beginning date.
dateRangeTo - Specifies the ending date.

setEvent

public void setEvent(CalendarEvent event)
This method sets a calendar event object to be transfered to the calendar server because the event has been modified.

Parameters:
event - Specifies an event to be transfered to the calendar server.

getEvent

public CalendarEvent getEvent()
This method returns the event object.

Returns:
Returns the calendar event which is stored inside this client request.

setNumEventsToRequest

public void setNumEventsToRequest(int iNumEvents)
With this method the client can define the maximum number of events to request.

Parameters:
iNumEvents - Specifies the maximum number of events to request.

getNumEventsToRequest

public int getNumEventsToRequest()
This method returns the maximum number of events the client wants to request.

Returns:
Returns the maximum number of events the client wants to request.

setMainRegexp

public void setMainRegexp(boolean bMainRegexp)
This method sets if the client contains a regexp from the main session window.

Parameters:
bMainRegexp - Set to true if the user used the main regexp field of the main GUI window.

setRegexpAll

public void setRegexpAll(java.lang.String sRegexp)
This method compiles a specific pattern object to match with on the server part after serialization.

Parameters:
sRegexp - Compiles a Pattern object with sRegexp as the regular expression.

setRegexpCategory

public void setRegexpCategory(java.lang.String sRegexp)
This method compiles a specific pattern object to match with on the server part after serialization.

Parameters:
sRegexp - Compiles a Pattern object with sRegexp as the regular expression.

setRegexpDescription

public void setRegexpDescription(java.lang.String sRegexp)
This method compiles a specific pattern object to match with on the server part after serialization.

Parameters:
sRegexp - Compiles a Pattern object with sRegexp as the regular expression.

setRegexpPlace

public void setRegexpPlace(java.lang.String sRegexp)
This method compiles a specific pattern object to match with on the server part after serialization.

Parameters:
sRegexp - Compiles a Pattern object with sRegexp as the regular expression.

setRegexpDate

public void setRegexpDate(java.lang.String sRegexp)
This method compiles a specific pattern object to match with on the server part after serialization.

Parameters:
sRegexp - Compiles a Pattern object with sRegexp as the regular expression.

match

public boolean match(CalendarEvent calendarEvent)
Checks if a specific calendar event matches this client request.

Parameters:
calendarEvent - Specifies the event to match against.
Returns:
Returns true if the given event matched. Else, false will be returned.

toString

public java.lang.String toString()
This method returns a representation the object as a string.

Returns:
Returns the object represented as a string.