@Path(value="/replicamanager") @RequestScoped public class RestAPI extends Object
Modifier and Type | Field and Description |
---|---|
private javax.ws.rs.core.UriInfo |
context |
(package private) NodeSessionBeanLocal |
nodeSessionBean |
Constructor and Description |
---|
RestAPI()
Creates a new instance of RestAPI
|
Modifier and Type | Method and Description |
---|---|
String |
delete(String k)
Delete a key
|
String |
findSuccessor(String k)
Retrieves successor for the given Key (findSuccessor)
|
String |
get(String k)
Get Data
|
String |
getPredecessor()
Retrieves node's predecessor
|
private NodeSessionBeanLocal |
lookupNodeSessionBeanLocal() |
String |
moving(String k)
Get Data
|
String |
notify(String u)
Call notify
|
String |
ping() |
String |
put(String k,
String u)
Creates data
|
String |
putList(String k,
String u)
Update data
|
NodeSessionBeanLocal nodeSessionBean
@Context private javax.ws.rs.core.UriInfo context
@GET @Path(value="{key : ([A-Za-z0-9]+)}") @Consumes(value="text/plain") public String get(@PathParam(value="key") String k)
k
- |@POST @Path(value="{key : ([A-Za-z0-9]+)}") @Consumes(value="text/plain") public String put(@PathParam(value="key") String k, String u)
k
- |u
- |@PUT @Path(value="{key : ([A-Za-z0-9]+)}") @Consumes(value="text/plain") public String putList(@PathParam(value="key") String k, String u)
k
- |u
- |@DELETE @Path(value="{key : ([A-Za-z0-9]+)}") @Consumes(value="text/plain") public String delete(@PathParam(value="key") String k)
k
- |@GET @Path(value="/moving/{key : ([A-Za-z0-9]+)}") @Consumes(value="text/plain") public String moving(@PathParam(value="key") String k) throws com.fasterxml.jackson.core.JsonProcessingException
k
- |com.fasterxml.jackson.core.JsonProcessingException
- |@GET @Path(value="/successor/{key : ([A-Za-z0-9]+)}") @Consumes(value="text/plain") public String findSuccessor(@PathParam(value="key") String k) throws com.fasterxml.jackson.core.JsonProcessingException
k
- |com.fasterxml.jackson.core.JsonProcessingException
- |@GET @Path(value="/predecessor") @Consumes(value="text/plain") public String getPredecessor() throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingException
- |@POST @Path(value="/notify") @Consumes(value="text/plain") public String notify(String u) throws com.fasterxml.jackson.core.JsonProcessingException, IOException
u
- |com.fasterxml.jackson.core.JsonProcessingException
IOException
@GET @Path(value="/ping") @Consumes(value="text/plain") public String ping() throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingException
private NodeSessionBeanLocal lookupNodeSessionBeanLocal()
Copyright © 2018. All rights reserved.