com.evdb.javaapi.operations
Class EventOperations

java.lang.Object
  extended by com.evdb.javaapi.operations.BaseOperations
      extended by com.evdb.javaapi.operations.EventOperations

public class EventOperations
extends BaseOperations

Class encapsulating event operations

Sample code for dealing with events:

        //Create our operation objects
        EventOperations eo = new EventOperations();
        Event e = eo.get("E0-123-1234-00");

        e.setTitle("New Event Title ");
        eo.modify(e);
        e = eo.get("E0-123-1234-00");

        assertEquals(e.getTitle(), "New Event Title ");
        

Author:
tylerv

Field Summary
 
Fields inherited from class com.evdb.javaapi.operations.BaseOperations
serverCommunication
 
Constructor Summary
EventOperations()
           
 
Method Summary
 void addCategory(java.lang.String seid, Category category)
          Add a category to an event
 void addComment(java.lang.String seid, Comment comment)
          Add a comment to an event
 void addImage(java.lang.String seid, Image image)
          Add an image to the given event
 void addLink(java.lang.String seid, Link link)
          Add a link to an event
 void addPerformer(java.lang.String seid, Performer performer)
          Add a performer
 int addProperty(java.lang.String seid, Property property)
          Add a property
 void addTags(java.lang.String seid, java.util.List<Tag> tagList)
          Add tags to an event
 Event create(Event e)
          Creates a new event.
 void deleteCategory(java.lang.String seid, Category category)
          Remove a category from an event
 void deleteComment(Comment comment)
          Delete a comment
 void deleteImage(java.lang.String seid, Image image)
          Remove the image
 void deleteLink(Link link)
          Remove a link from an event
 void deletePerformer(java.lang.String seid, Performer performer)
          Remove a performer
 void deleteProperty(java.lang.String seid, Property property)
          Delete a property
 void deleteTags(java.lang.String seid, java.util.List<Tag> tagList)
          Add tags to an event
 Event get(Event e)
          Fills in the data for an event given an event object
 Event get(java.lang.String seid)
          Get an event from the EVDB website
 java.util.List<Property> getProperties(java.lang.String seid)
          Return a list of properties
 java.util.List<Tag> getTags(java.lang.String seid)
          List the tags for a given SEID
 Event modify(Event e)
          Modifies an existing event
 void modifyComment(Comment comment)
          Modify a comment
 void restore(java.lang.String seid)
          Restores (un-withdraws) an event
 SearchResult search(EventSearchRequest searchRequest)
          Event search request
 void withdraw(java.lang.String seid, java.lang.String withdrawNote)
          Withdraws an event
 
Methods inherited from class com.evdb.javaapi.operations.BaseOperations
addComment, addImage, addLink, addProperty, deleteComment, deleteImage, deleteLink, deleteProperty, getUnmarshaller, listProperties, listTags, modifyComment, modifyTags, unmarshallRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventOperations

public EventOperations()
Method Detail

get

public Event get(java.lang.String seid)
          throws EVDBRuntimeException,
                 EVDBAPIException
Get an event from the EVDB website

Parameters:
seid - SEID to lookup
Returns:
The event object
Throws:
java.lang.Exception
EVDBRuntimeException
EVDBAPIException

search

public SearchResult search(EventSearchRequest searchRequest)
                    throws EVDBRuntimeException,
                           EVDBAPIException
Event search request
                EventOperations eo = new EventOperations();

                //create the search request for music events in San Diego
                EventSearchRequest esr = new EventSearchRequest();
                esr.setKeywords("music");
                esr.setLocation("San Diego");

                SearchResult sr = eo.search(esr);

                assert(sr.getTotalItems() > 1);

                //here is our list of results
                List events = sr.getEvents();     
           

Parameters:
searchRequest -
Returns:
Search result object
Throws:
java.lang.Exception
EVDBRuntimeException
EVDBAPIException

get

public Event get(Event e)
          throws EVDBRuntimeException,
                 EVDBAPIException
Fills in the data for an event given an event object

Parameters:
e - Event to lookup, must have an SEID
Returns:
The Event object
Throws:
java.lang.Exception
EVDBRuntimeException
EVDBAPIException

create

public Event create(Event e)
             throws EVDBRuntimeException,
                    EVDBAPIException
Creates a new event. Sample code:
                EventOperations eo = new EventOperations();

                //set our start date
                Calendar calStart = Calendar.getInstance();

                calStart.set(2007, 11, 22, 15, 15);

                Event e = new Event();
                e.setTitle("API test event");
                e.setDescription("An API Test Event");
                e.setFree(true);
                e.setStartTime(calStart.getTime());;

                List tagList = new ArrayList();

                //add some tags
                tagList.add(new Tag("ttest9"));
                tagList.add(new Tag("music"));

                e.setTags(tagList);

                //create the event
                Event newEvent = eo.create(e);

                assertNotNull(newEvent.getSeid()); 
           

Parameters:
e - The new event object
Returns:
The updated event object with SEID set
Throws:
java.lang.Exception
EVDBRuntimeException
EVDBAPIException

getTags

public java.util.List<Tag> getTags(java.lang.String seid)
                            throws EVDBRuntimeException,
                                   EVDBAPIException
List the tags for a given SEID

Parameters:
seid -
Returns:
List of Tags
Throws:
EVDBRuntimeException
EVDBAPIException

getProperties

public java.util.List<Property> getProperties(java.lang.String seid)
                                       throws EVDBRuntimeException,
                                              EVDBAPIException
Return a list of properties

Parameters:
seid -
Returns:
List of Properties
Throws:
EVDBRuntimeException
EVDBAPIException

addTags

public void addTags(java.lang.String seid,
                    java.util.List<Tag> tagList)
             throws EVDBRuntimeException,
                    EVDBAPIException
Add tags to an event

Parameters:
seid - Event SEID
tagList - The list of tags to add
Throws:
EVDBRuntimeException
EVDBAPIException

deleteTags

public void deleteTags(java.lang.String seid,
                       java.util.List<Tag> tagList)
                throws EVDBRuntimeException,
                       EVDBAPIException
Add tags to an event

Parameters:
seid - Event SEID
tagList - The list of tags to add
Throws:
EVDBRuntimeException
EVDBAPIException

addComment

public void addComment(java.lang.String seid,
                       Comment comment)
                throws EVDBRuntimeException,
                       EVDBAPIException
Add a comment to an event

Parameters:
seid -
comment -
Throws:
EVDBRuntimeException
EVDBAPIException

modifyComment

public void modifyComment(Comment comment)
                   throws EVDBRuntimeException,
                          EVDBAPIException
Modify a comment

Parameters:
comment -
Throws:
EVDBRuntimeException
EVDBAPIException

addImage

public void addImage(java.lang.String seid,
                     Image image)
              throws EVDBRuntimeException,
                     EVDBAPIException
Add an image to the given event

Parameters:
seid -
image -
Throws:
EVDBRuntimeException
EVDBAPIException

deleteImage

public void deleteImage(java.lang.String seid,
                        Image image)
                 throws EVDBRuntimeException,
                        EVDBAPIException
Remove the image

Parameters:
seid -
image -
Throws:
EVDBRuntimeException
EVDBAPIException

deleteProperty

public void deleteProperty(java.lang.String seid,
                           Property property)
                    throws EVDBRuntimeException,
                           EVDBAPIException
Delete a property

Parameters:
seid -
property -
Throws:
EVDBRuntimeException
EVDBAPIException

addProperty

public int addProperty(java.lang.String seid,
                       Property property)
                throws EVDBRuntimeException,
                       EVDBAPIException
Add a property

Parameters:
seid -
property -
Throws:
EVDBRuntimeException
EVDBAPIException

addPerformer

public void addPerformer(java.lang.String seid,
                         Performer performer)
                  throws EVDBRuntimeException,
                         EVDBAPIException
Add a performer

Parameters:
seid -
performer -
Throws:
EVDBRuntimeException
EVDBAPIException

deletePerformer

public void deletePerformer(java.lang.String seid,
                            Performer performer)
                     throws EVDBRuntimeException,
                            EVDBAPIException
Remove a performer

Parameters:
seid -
performer -
Throws:
EVDBRuntimeException
EVDBAPIException

addCategory

public void addCategory(java.lang.String seid,
                        Category category)
                 throws EVDBRuntimeException,
                        EVDBAPIException
Add a category to an event

Parameters:
seid -
category -
Throws:
EVDBRuntimeException
EVDBAPIException

deleteCategory

public void deleteCategory(java.lang.String seid,
                           Category category)
                    throws EVDBRuntimeException,
                           EVDBAPIException
Remove a category from an event

Parameters:
seid -
category -
Throws:
EVDBRuntimeException
EVDBAPIException

deleteComment

public void deleteComment(Comment comment)
                   throws EVDBRuntimeException,
                          EVDBAPIException
Delete a comment

Parameters:
comment -
Throws:
EVDBRuntimeException
EVDBAPIException

modify

public Event modify(Event e)
             throws EVDBRuntimeException,
                    EVDBAPIException
Modifies an existing event

Parameters:
e - The event object
Returns:
The updated event object
Throws:
java.lang.Exception
EVDBRuntimeException
EVDBAPIException

addLink

public void addLink(java.lang.String seid,
                    Link link)
             throws EVDBRuntimeException,
                    EVDBAPIException
Add a link to an event

Parameters:
seid - SEID to add
link - Link object
Throws:
EVDBRuntimeException
EVDBAPIException

deleteLink

public void deleteLink(Link link)
                throws EVDBRuntimeException,
                       EVDBAPIException
Remove a link from an event

Parameters:
link - Link object to remove
Throws:
EVDBRuntimeException
EVDBAPIException

withdraw

public void withdraw(java.lang.String seid,
                     java.lang.String withdrawNote)
              throws EVDBRuntimeException,
                     EVDBAPIException
Withdraws an event

Parameters:
seid - SEID of the event to withdraw
withdrawNote - Note explaining the withdraw
Throws:
java.lang.Exception
EVDBRuntimeException
EVDBAPIException

restore

public void restore(java.lang.String seid)
             throws EVDBRuntimeException,
                    EVDBAPIException
Restores (un-withdraws) an event

Parameters:
seid - SEID of the event to restore
Throws:
java.lang.Exception
EVDBRuntimeException
EVDBAPIException


Copyright © 2007 Eventful Inc. All Rights Reserved.