Package MarcSync
Class Collection
- java.lang.Object
-
- MarcSync.Collection
-
public class Collection extends Object
-
-
Constructor Summary
Constructors Constructor Description Collection(String accessToken, String collectionName)Creates a new instance of the MarcSync collection
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EntrycreateEntry(EntryData entryData)Creates an entry in the collectionvoiddeleteEntries(EntryData filters)Deletes the entries matching with the specified filtervoiddeleteEntryById(String id)Deletes the entry with the specified IDvoiddrop()Warning:booleanexists()Entry[]getEntries(EntryData filters)EntrygetEntryById(String id)StringgetName()StringsetName(String name)voidupdateEntries(EntryData filters, EntryData entryData)Updates the entries matching with the specified filtervoidupdateEntryById(String id, EntryData entryData)Updates the entry with the specified ID
-
-
-
Method Detail
-
drop
public void drop() throws URISyntaxException, IOExceptionWarning:- Throws:
URISyntaxExceptionIOException-Note: This method will delete the collection and all of its entries. This action cannot be undone.
-
setName
public String setName(String name) throws URISyntaxException, IOException
- Returns:
- The name of the collection
- Throws:
URISyntaxExceptionIOException
-
getName
public String getName()
- Returns:
- The name of the collection
-
exists
public boolean exists()
- Returns:
- Whether or not the collection exists
Note: This method is useful if you want to fetch the collection from the server to check if it exists before using it.
-
createEntry
public Entry createEntry(EntryData entryData) throws URISyntaxException, IOException
Creates an entry in the collection- Returns:
- A new instance of the MarcSync entry
- Throws:
URISyntaxExceptionIOException
-
getEntryById
public Entry getEntryById(String id) throws URISyntaxException, IOException, InterruptedException
- Returns:
- The entry with the specified ID
- Throws:
URISyntaxExceptionIOExceptionInterruptedException
-
getEntries
public Entry[] getEntries(EntryData filters) throws IOException, InterruptedException, URISyntaxException
- Returns:
- The entries with the specified filter
Note: This method is useful if you want to fetch multiple entries from the server at once.
- Throws:
IOExceptionInterruptedExceptionURISyntaxException- See Also:
Entry,EntryData
-
deleteEntryById
public void deleteEntryById(String id) throws URISyntaxException, IOException
Deletes the entry with the specified IDNote: Will delete the entry from the collection. This action cannot be undone.
- Throws:
URISyntaxExceptionIOException
-
deleteEntries
public void deleteEntries(EntryData filters) throws URISyntaxException, IOException
Deletes the entries matching with the specified filterNote: Will delete the matching entries from the collection. This action cannot be undone.
- Throws:
URISyntaxExceptionIOException- See Also:
EntryData
-
updateEntryById
public void updateEntryById(String id, EntryData entryData) throws URISyntaxException, IOException
Updates the entry with the specified ID- Throws:
URISyntaxExceptionIOException- See Also:
Entry,EntryData
-
updateEntries
public void updateEntries(EntryData filters, EntryData entryData) throws URISyntaxException, IOException
Updates the entries matching with the specified filter- Throws:
URISyntaxExceptionIOException- See Also:
Entry,EntryData
-
-