com.evdb.javaapi.operations
Class DemandOperations

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

public class DemandOperations
extends BaseOperations

Demand Operations

Sample code for dealing with demands:

        //Create our operation objects
        DemandOperations dop = new DemandOperations();
        PerformerOperations po = new PerformerOperations();

        Demand d = new Demand();

        //get the performer to associate the demand with
        Performer p = po.get("P0-123-12345-00");

        d.setPerformer(p);

        //set location
        d.setLocation("Guelph, Ontario, Canada");
        d.setDescription("Go guelph!");

        //create
        d = dop.create(d);

        //once created, the demand should have an SDID
        assert(d.getSdid().length() > 0);
        

Author:
tylerv

Field Summary
 
Fields inherited from class com.evdb.javaapi.operations.BaseOperations
serverCommunication
 
Constructor Summary
DemandOperations()
           
 
Method Summary
 void addComment(java.lang.String sdid, Comment comment)
          Add a comment to a demand
 void addImage(java.lang.String sdid, Image image)
          Add an image to the given demand
 void addLink(java.lang.String sdid, Link link)
          Add a link to the demand
 void addTags(java.lang.String sdid, java.util.List<Tag> tagList)
          Add tags to a demand
 Demand create(Demand d)
          Create a new demand
 void deleteComment(Comment comment)
          Delete a comment
 void deleteImage(java.lang.String sdid, Image image)
          Remove the image
 void deleteLink(Link link)
          Remove a link from the demand
 void deleteTags(java.lang.String sdid, java.util.List<Tag> tagList)
          Add tags to an demand
 Demand get(java.lang.String sdid)
          Return a demand from an SDID
 java.util.List<Tag> getTags(java.lang.String sdid)
          List the tags for a given SDID
 Demand modify(Demand d)
          Modify a demand
 void modifyComment(Comment comment)
          Modify a comment
 void restore(java.lang.String sdid)
          Restores (i.e.
 SearchResult search(DemandSearchRequest searchRequest)
          Demand search request
 void withdraw(java.lang.String sdid, java.lang.String withdrawNote)
          Withdraws an demand
 
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

DemandOperations

public DemandOperations()
Method Detail

get

public Demand get(java.lang.String sdid)
           throws EVDBRuntimeException,
                  EVDBAPIException
Return a demand from an SDID
                //test retrieving a demand 
                DemandOperations dop = new DemandOperations();
                Demand d = dop.get("D0-123-2414-00");

                assertEquals(d.getSdid(), "D0-123-2414-00");
                assertEquals(d.getPerformer().getSpid(), "P0-123-2414-00");
                assertEquals(d.getPerformer().getName(), "Pretty Ricky");
                assert(d.getTags().size() > 0);
                

Parameters:
sdid - SDID of the demand to lookup
Returns:
the demand object
Throws:
EVDBRuntimeException
EVDBAPIException

create

public Demand create(Demand d)
              throws EVDBRuntimeException,
                     EVDBAPIException
Create a new demand

Parameters:
d - Demand to create
Returns:
The newly created Demand
Throws:
EVDBRuntimeException
EVDBAPIException

modify

public Demand modify(Demand d)
              throws EVDBRuntimeException,
                     EVDBAPIException
Modify a demand

Parameters:
d - Demand to modify
Returns:
The modified Demand
Throws:
EVDBRuntimeException
EVDBAPIException

withdraw

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

Parameters:
sdid - SDID of the demand to withdraw
withdrawNote - Note explaining the withdraw
Throws:
java.lang.Exception
EVDBRuntimeException
EVDBAPIException

restore

public void restore(java.lang.String sdid)
             throws EVDBRuntimeException,
                    EVDBAPIException
Restores (i.e. un-withdraws) a demand

Parameters:
sdid - SVID of the demand to restore
Throws:
java.lang.Exception
EVDBRuntimeException
EVDBAPIException

addTags

public void addTags(java.lang.String sdid,
                    java.util.List<Tag> tagList)
             throws EVDBRuntimeException,
                    EVDBAPIException
Add tags to a demand

Parameters:
sdid - SDID
tagList - The list of tags to add
Throws:
EVDBRuntimeException
EVDBAPIException

deleteTags

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

Parameters:
sdid - Demand SDID
tagList - The list of tags to delete
Throws:
EVDBRuntimeException
EVDBAPIException

getTags

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

Parameters:
sdid - SDID to return the list of tags for
Returns:
List of tags
Throws:
EVDBRuntimeException
EVDBAPIException

addComment

public void addComment(java.lang.String sdid,
                       Comment comment)
                throws EVDBRuntimeException,
                       EVDBAPIException
Add a comment to a demand

Parameters:
sdid - SDID to add the comment to
comment - Comment object to add
Throws:
EVDBRuntimeException
EVDBAPIException

modifyComment

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

Parameters:
comment - Comment object
Throws:
EVDBRuntimeException
EVDBAPIException

deleteComment

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

Parameters:
comment - Comment object
Throws:
EVDBRuntimeException
EVDBAPIException

addLink

public void addLink(java.lang.String sdid,
                    Link link)
             throws EVDBRuntimeException,
                    EVDBAPIException
Add a link to the demand

Parameters:
sdid - SDID to add the link to
link - Link object to add
Throws:
EVDBRuntimeException
EVDBAPIException

deleteLink

public void deleteLink(Link link)
                throws EVDBRuntimeException,
                       EVDBAPIException
Remove a link from the demand

Parameters:
link - Link to remove
Throws:
EVDBRuntimeException
EVDBAPIException

addImage

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

Parameters:
sdid - SDID to add the image to
image - New image object
Throws:
EVDBRuntimeException
EVDBAPIException

deleteImage

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

Parameters:
sdid - SDID to remove the image
image - Image object
Throws:
EVDBRuntimeException
EVDBAPIException

search

public SearchResult search(DemandSearchRequest searchRequest)
                    throws EVDBRuntimeException,
                           EVDBAPIException
Demand search request
 
                //Example of running a demand search
                DemandOperations dop = new DemandOperations();
                DemandSearchRequest psr = new DemandSearchRequest();
                psr.setKeywords("pretty ricky");

                SearchResult sr = dop.search(psr);

                assert(sr.getTotalItems() > 1);
                List demands = sr.getDemands();

                assertNotNull(demands.get(0).getSdid());
                

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


Copyright © 2007 Eventful Inc. All Rights Reserved.