Class TodosJaxRsClientImpl
- java.lang.Object
-
- info.ejava.examples.jaxrs.todos.client.TodosJaxRsClientImpl
-
- All Implemented Interfaces:
TodosJaxRsClient
public class TodosJaxRsClientImpl extends Object implements TodosJaxRsClient
-
-
Field Summary
Fields Modifier and Type Field Description private URI
baseUrl
private javax.ws.rs.client.Client
client
private static org.slf4j.Logger
logger
private javax.ws.rs.core.MediaType
mediaType
-
Fields inherited from interface info.ejava.examples.jaxrs.todos.client.TodosJaxRsClient
APPLICATION_PATH, LIMIT, NAME_PARAM, OFFSET, TODO_ITEM_PATH, TODO_ITEMS_PATH, TODO_LIST_PATH, TODO_LISTS_PATH
-
-
Constructor Summary
Constructors Constructor Description TodosJaxRsClientImpl(javax.ws.rs.client.Client client, URI baseUrl, String mediaType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.Response
addTodoItem(String listName, TodoItemDTO item)
javax.ws.rs.core.Response
createTodoList(TodoListDTO todoList)
javax.ws.rs.core.Response
deleteAll()
javax.ws.rs.core.Response
deleteTodoItem(String listName, String itemName)
javax.ws.rs.core.Response
deleteTodoList(String listName)
private javax.ws.rs.core.UriBuilder
getBaseUrl(String... path)
javax.ws.rs.core.Response
getTodoList(String listName)
javax.ws.rs.core.Response
getTodoLists(Integer offset, Integer limit)
private String
marshal(Object object)
javax.ws.rs.core.Response
renameTodoList(String oldName, String newName)
void
setMediaType(String mediaType)
void
setMediaType(javax.ws.rs.core.MediaType mediaType)
javax.ws.rs.core.Response
updateTodoItem(String listName, TodoItemDTO item)
-
-
-
Field Detail
-
logger
private static final org.slf4j.Logger logger
-
baseUrl
private URI baseUrl
-
client
private javax.ws.rs.client.Client client
-
mediaType
private javax.ws.rs.core.MediaType mediaType
-
-
Method Detail
-
setMediaType
public void setMediaType(javax.ws.rs.core.MediaType mediaType)
-
setMediaType
public void setMediaType(String mediaType)
-
getBaseUrl
private javax.ws.rs.core.UriBuilder getBaseUrl(String... path)
-
deleteAll
public javax.ws.rs.core.Response deleteAll()
- Specified by:
deleteAll
in interfaceTodosJaxRsClient
-
getTodoLists
public javax.ws.rs.core.Response getTodoLists(Integer offset, Integer limit)
- Specified by:
getTodoLists
in interfaceTodosJaxRsClient
-
createTodoList
public javax.ws.rs.core.Response createTodoList(TodoListDTO todoList)
- Specified by:
createTodoList
in interfaceTodosJaxRsClient
-
getTodoList
public javax.ws.rs.core.Response getTodoList(String listName)
- Specified by:
getTodoList
in interfaceTodosJaxRsClient
-
deleteTodoList
public javax.ws.rs.core.Response deleteTodoList(String listName)
- Specified by:
deleteTodoList
in interfaceTodosJaxRsClient
-
renameTodoList
public javax.ws.rs.core.Response renameTodoList(String oldName, String newName)
- Specified by:
renameTodoList
in interfaceTodosJaxRsClient
-
addTodoItem
public javax.ws.rs.core.Response addTodoItem(String listName, TodoItemDTO item)
- Specified by:
addTodoItem
in interfaceTodosJaxRsClient
-
updateTodoItem
public javax.ws.rs.core.Response updateTodoItem(String listName, TodoItemDTO item)
- Specified by:
updateTodoItem
in interfaceTodosJaxRsClient
-
deleteTodoItem
public javax.ws.rs.core.Response deleteTodoItem(String listName, String itemName)
- Specified by:
deleteTodoItem
in interfaceTodosJaxRsClient
-
-