|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.evdb.javaapi.operations.BaseOperations
com.evdb.javaapi.operations.DemandOperations
public class DemandOperations
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);
| 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 |
|---|
public DemandOperations()
| Method Detail |
|---|
public Demand get(java.lang.String sdid)
throws EVDBRuntimeException,
EVDBAPIException
//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);
sdid - SDID of the demand to lookup
EVDBRuntimeException
EVDBAPIException
public Demand create(Demand d)
throws EVDBRuntimeException,
EVDBAPIException
d - Demand to create
EVDBRuntimeException
EVDBAPIException
public Demand modify(Demand d)
throws EVDBRuntimeException,
EVDBAPIException
d - Demand to modify
EVDBRuntimeException
EVDBAPIException
public void withdraw(java.lang.String sdid,
java.lang.String withdrawNote)
throws EVDBRuntimeException,
EVDBAPIException
sdid - SDID of the demand to withdrawwithdrawNote - Note explaining the withdraw
java.lang.Exception
EVDBRuntimeException
EVDBAPIException
public void restore(java.lang.String sdid)
throws EVDBRuntimeException,
EVDBAPIException
sdid - SVID of the demand to restore
java.lang.Exception
EVDBRuntimeException
EVDBAPIException
public void addTags(java.lang.String sdid,
java.util.List<Tag> tagList)
throws EVDBRuntimeException,
EVDBAPIException
sdid - SDIDtagList - The list of tags to add
EVDBRuntimeException
EVDBAPIException
public void deleteTags(java.lang.String sdid,
java.util.List<Tag> tagList)
throws EVDBRuntimeException,
EVDBAPIException
sdid - Demand SDIDtagList - The list of tags to delete
EVDBRuntimeException
EVDBAPIException
public java.util.List<Tag> getTags(java.lang.String sdid)
throws EVDBRuntimeException,
EVDBAPIException
sdid - SDID to return the list of tags for
EVDBRuntimeException
EVDBAPIException
public void addComment(java.lang.String sdid,
Comment comment)
throws EVDBRuntimeException,
EVDBAPIException
sdid - SDID to add the comment tocomment - Comment object to add
EVDBRuntimeException
EVDBAPIException
public void modifyComment(Comment comment)
throws EVDBRuntimeException,
EVDBAPIException
comment - Comment object
EVDBRuntimeException
EVDBAPIException
public void deleteComment(Comment comment)
throws EVDBRuntimeException,
EVDBAPIException
comment - Comment object
EVDBRuntimeException
EVDBAPIException
public void addLink(java.lang.String sdid,
Link link)
throws EVDBRuntimeException,
EVDBAPIException
sdid - SDID to add the link tolink - Link object to add
EVDBRuntimeException
EVDBAPIException
public void deleteLink(Link link)
throws EVDBRuntimeException,
EVDBAPIException
link - Link to remove
EVDBRuntimeException
EVDBAPIException
public void addImage(java.lang.String sdid,
Image image)
throws EVDBRuntimeException,
EVDBAPIException
sdid - SDID to add the image toimage - New image object
EVDBRuntimeException
EVDBAPIException
public void deleteImage(java.lang.String sdid,
Image image)
throws EVDBRuntimeException,
EVDBAPIException
sdid - SDID to remove the imageimage - Image object
EVDBRuntimeException
EVDBAPIException
public SearchResult search(DemandSearchRequest searchRequest)
throws EVDBRuntimeException,
EVDBAPIException
//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());
searchRequest -
java.lang.Exception
EVDBRuntimeException
EVDBAPIException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||