CopaApp
Change of Plan Application
 All Classes Functions Variables Pages
Public Member Functions | Static Public Member Functions | List of all members
unicopa.copa.app.ServerConnection Class Reference

This singleton class manages the connection with the server. More...

Collaboration diagram for unicopa.copa.app.ServerConnection:
Collaboration graph

Public Member Functions

boolean getConnected ()
 This method returns the value of the connected attribute. More...
 
boolean login (String userName, String password, Context context) throws ClientProtocolException, IOException
 This method opens connection to the server and saves the session cookie. More...
 
boolean logout ()
 This method erases the session cookie and tells the server to invalidate the session. More...
 
CategoryNode getCategory () throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException
 This method returns the category tree. More...
 
List< EventGroupgetEventGroups (int categoryNodeID, String searchTerm) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException
 This method returns for a given categoryID and searchTerm a list of EventGroup. More...
 
List< EventgetEvents (int eventGroupID, int categoryNodeID) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException
 This method returns for a given eventGroupID and categoryID a list of Event. More...
 
List< SingleEventgetCurrentSingleEvents (int eventID, Date date) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException
 This method returns to a given eventID the current SingleEvents. More...
 
Event getEvent (int eventID) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException
 This method returns for a given eventID an Event. More...
 
EventGroup getEventGroup (int eventGroupID) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException
 This method returns to a given eventGroupID a EventGroup. More...
 
List< List< Integer > > getMyEvents () throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException
 This method updates the user rights in the local database. More...
 
int setSingleEventUpdate (SingleEvent sEvent, String msg) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException
 This method returns the new singleEventID for a SingleEvent update. More...
 
boolean removeSingleEvent (int singleEventID, String msg) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException
 This method removes a SingleEvent. More...
 
List< List< SingleEventUpdate > > getSingleEventUpdates (int eventID, Date date) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException
 This method returns to a given eventID all SingleEventUpdates since a given date. More...
 
SingleEvent getSingleEvent (int singleEventID) throws APIException, PermissionException, RequestNotPracticableException, InternalErrorException, ClientProtocolException, IOException
 This method returns to a given singleEventID a SingleEvent. More...
 
List< List< SingleEventUpdate > > getSubscribedSingleEventUpdates (Date date) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException
 This method returns all updates since a given date for subscribed SingeEvents. More...
 
boolean setSettings (UserSettings settings) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException
 This method sends the UserSettings to the server. More...
 
SettingsLocal getSettings () throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException, NoStorageException
 This method returns the UserSettings. More...
 
List< String > getRightholders (int eventID) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException
 This method returns to a given eventID all rightholders. More...
 
List< String > getDeputies (int eventID) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException
 This method returns to a given eventID all deputies. More...
 
List< String > getOwners (int eventID) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException
 This method returns to a given eventID all owners. More...
 
boolean connectionCheck ()
 This method checks the connection status with the server. More...
 

Static Public Member Functions

static ServerConnection getInstance ()
 This method is called to get an instance of ServerConnection. More...
 

Detailed Description

This singleton class manages the connection with the server.

Author
Martin Rabe

Member Function Documentation

boolean unicopa.copa.app.ServerConnection.connectionCheck ( )

This method checks the connection status with the server.

Returns
True if connected. / False if disconnected.
CategoryNode unicopa.copa.app.ServerConnection.getCategory ( ) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException

This method returns the category tree.

Returns
The root node of the CategoryTree.
Exceptions
ClientProtocolException
IOException
APIException
PermissionException
RequestNotPracticableException
InternalErrorException
boolean unicopa.copa.app.ServerConnection.getConnected ( )

This method returns the value of the connected attribute.

Returns
True if connected. / False if disconnected.
List<SingleEvent> unicopa.copa.app.ServerConnection.getCurrentSingleEvents ( int  eventID,
Date  date 
) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException

This method returns to a given eventID the current SingleEvents.

Parameters
EventID
Date
Returns
A list of SingleEvents.
Exceptions
ClientProtocolException
IOException
APIException
PermissionException
RequestNotPracticableException
InternalErrorException
List<String> unicopa.copa.app.ServerConnection.getDeputies ( int  eventID) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException

This method returns to a given eventID all deputies.

Parameters
EventID
Returns
A list of names.
Exceptions
ClientProtocolException
IOException
APIException
PermissionException
RequestNotPracticableException
InternalErrorException
Event unicopa.copa.app.ServerConnection.getEvent ( int  eventID) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException

This method returns for a given eventID an Event.

Parameters
EventID
Returns
An Event.
Exceptions
ClientProtocolException
IOException
APIException
PermissionException
RequestNotPracticableException
InternalErrorException
EventGroup unicopa.copa.app.ServerConnection.getEventGroup ( int  eventGroupID) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException

This method returns to a given eventGroupID a EventGroup.

Parameters
EventID
Returns
An EventGroup.
Exceptions
IOException
ClientProtocolException
InternalErrorException
RequestNotPracticableException
PermissionException
APIException
List<EventGroup> unicopa.copa.app.ServerConnection.getEventGroups ( int  categoryNodeID,
String  searchTerm 
) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException

This method returns for a given categoryID and searchTerm a list of EventGroup.

Parameters
CategoryNodeID
SearchTerm
Returns
A list of EventGroups.
Exceptions
IOException
ClientProtocolException
InternalErrorException
RequestNotPracticableException
PermissionException
APIException
List<Event> unicopa.copa.app.ServerConnection.getEvents ( int  eventGroupID,
int  categoryNodeID 
) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException

This method returns for a given eventGroupID and categoryID a list of Event.

Parameters
EventGroupID
CategoryNodeID
Returns
A list of Events.
Exceptions
ClientProtocolException
IOException
APIException
PermissionException
RequestNotPracticableException
InternalErrorException
static ServerConnection unicopa.copa.app.ServerConnection.getInstance ( )
static

This method is called to get an instance of ServerConnection.

Returns
The instance of ServerConnection.
List<List<Integer> > unicopa.copa.app.ServerConnection.getMyEvents ( ) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException

This method updates the user rights in the local database.

Returns
A list of lists of Events where the user has higher rights.
Exceptions
ClientProtocolException
IOException
APIException
PermissionException
RequestNotPracticableException
InternalErrorException
List<String> unicopa.copa.app.ServerConnection.getOwners ( int  eventID) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException

This method returns to a given eventID all owners.

Parameters
EventID
Returns
A list of names.
Exceptions
ClientProtocolException
IOException
APIException
PermissionException
RequestNotPracticableException
InternalErrorException
List<String> unicopa.copa.app.ServerConnection.getRightholders ( int  eventID) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException

This method returns to a given eventID all rightholders.

Parameters
EventID
Returns
A list of names.
Exceptions
ClientProtocolException
IOException
APIException
PermissionException
RequestNotPracticableException
InternalErrorException
SettingsLocal unicopa.copa.app.ServerConnection.getSettings ( ) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException, NoStorageException

This method returns the UserSettings.

Returns
The UserSettings.
Exceptions
ClientProtocolException
IOException
APIException
PermissionException
RequestNotPracticableException
InternalErrorException
NoStorageException
SingleEvent unicopa.copa.app.ServerConnection.getSingleEvent ( int  singleEventID) throws APIException, PermissionException, RequestNotPracticableException, InternalErrorException, ClientProtocolException, IOException

This method returns to a given singleEventID a SingleEvent.

Parameters
EventID
Returns
A SingleEvent.
Exceptions
InternalErrorException
RequestNotPracticableException
PermissionException
APIException
IOException
ClientProtocolException
List<List<SingleEventUpdate> > unicopa.copa.app.ServerConnection.getSingleEventUpdates ( int  eventID,
Date  date 
) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException

This method returns to a given eventID all SingleEventUpdates since a given date.

Parameters
EventID
Date
Returns
A list per Event, this list contains SingleEventUpdates.
Exceptions
ClientProtocolException
IOException
APIException
PermissionException
RequestNotPracticableException
InternalErrorException
List<List<SingleEventUpdate> > unicopa.copa.app.ServerConnection.getSubscribedSingleEventUpdates ( Date  date) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException

This method returns all updates since a given date for subscribed SingeEvents.

Parameters
date
Returns
A list per Event, this list contains SingleEventUpdates.
Exceptions
ClientProtocolException
IOException
APIException
PermissionException
RequestNotPracticableException
InternalErrorException
boolean unicopa.copa.app.ServerConnection.login ( String  userName,
String  password,
Context  context 
) throws ClientProtocolException, IOException

This method opens connection to the server and saves the session cookie.

Parameters
UserName
Password
Context
Returns
True for success. / False for failure.
Exceptions
IOException
ClientProtocolException
boolean unicopa.copa.app.ServerConnection.logout ( )

This method erases the session cookie and tells the server to invalidate the session.

Returns
True for success. / False for failure.
boolean unicopa.copa.app.ServerConnection.removeSingleEvent ( int  singleEventID,
String  msg 
) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException

This method removes a SingleEvent.

Parameters
SingleEventID
Message
Returns
True for success. / False for failure.
Exceptions
ClientProtocolException
IOException
APIException
PermissionException
RequestNotPracticableException
InternalErrorException
boolean unicopa.copa.app.ServerConnection.setSettings ( UserSettings  settings) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException

This method sends the UserSettings to the server.

Parameters
UserSettings
Returns
True for success. / False for Failure.
Exceptions
ClientProtocolException
IOException
APIException
PermissionException
RequestNotPracticableException
InternalErrorException
int unicopa.copa.app.ServerConnection.setSingleEventUpdate ( SingleEvent  sEvent,
String  msg 
) throws ClientProtocolException, IOException, APIException, PermissionException, RequestNotPracticableException, InternalErrorException

This method returns the new singleEventID for a SingleEvent update.

Parameters
SingleEvent
Message
Returns
The new SingleEventID.
Exceptions
ClientProtocolException
IOException
InternalErrorException
RequestNotPracticableException
PermissionException
APIException

The documentation for this class was generated from the following file: