|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bjorsond.timeline.service.rest.impl.TimelineResource
public class TimelineResource
REST services for bjorsond Timeline Android Application.
Constructor Summary | |
---|---|
TimelineResource()
|
Method Summary | |
---|---|
com.bjorsond.timeline.service.model.Group |
addUserToGroup(java.lang.String groupid,
java.lang.String username)
PUT Adds a user to a group URL: /group/{groupid}/user/{username}/ TODO: Register user if not registered |
com.bjorsond.timeline.service.model.Experiences |
GetAllExperiences()
GET Gets all experiences in server URL: /experiences/ Gets all the experiences stored. |
java.lang.String |
getAverageMoodByID(java.lang.String experienceid)
GET Gets the average mood of an experience by ID URL: /mood/id/{experienceid}/ Produces a string with the average mood as integer. |
java.lang.String |
getAverageMoodByName(java.lang.String title)
GET Gets the average mood of an experience by title Note: Not as accurate as ID, and is case sensitive URL: /mood/title/{title}/ |
java.lang.String |
getEvents()
GET Get events as String (Mainly for testing purposes) URL: /events/ Produces toString of all events as String |
com.bjorsond.timeline.service.model.Experiences |
GetExperiences(java.lang.String username)
GET Gets all experiences of a user URL: /experiences/{username} Takes username of the user to get experiences Produces the all experiences shared with the user as JSON or XML |
com.bjorsond.timeline.service.model.Group |
getGroup(java.lang.String groupid)
GET Gets the group with the id sent as parameter URL: /group/{groupid} Produces JSON or XML with group information. |
com.bjorsond.timeline.service.model.Groups |
getGroups()
GET Gets all the groups URL: /groups/ Produces JSON or XML with list of all groups |
com.bjorsond.timeline.service.model.Groups |
getGroupsOfUser(java.lang.String username)
GET Gets the groups the user with the username given as parameter URL: /groups/{username} Produces JSON or XML with list of groups the user is member of. |
com.bjorsond.timeline.service.model.User |
getUser(java.lang.String username)
GET Gets the user with the username sent as parameter URL: /user/{username} Produces JSON or XML with user information. |
com.bjorsond.timeline.service.model.Users |
getUsers()
GET Gets all the users URL: /users/ Produces JSON or XML with all users. |
java.lang.String |
isUserInGroup(java.lang.String groupid,
java.lang.String username)
GET Gets if user is member in a group URL: /group/{groupid}/{username}/ |
com.bjorsond.timeline.service.model.Event |
putAverageMoodByID(java.lang.String id,
java.lang.String username,
int mood)
PUT Inserts a mood to an experience only by parameters, and no content needed Uses experience id to identify experience URL: /mood/id/{id}/{username}/{mood}/ |
com.bjorsond.timeline.service.model.Event |
putAverageMoodByName(java.lang.String title,
java.lang.String username,
int mood)
PUT Inserts a mood to an experience only by parameters, and no content needed Uses experience title to identify experience URL: /mood/title/{title}/{username}/{mood}/ |
com.bjorsond.timeline.service.model.Event |
putEvent(com.bjorsond.timeline.service.model.Event event)
PUT Store or update one Event URL: /event/ Consumes a complete event as JSON or XML and stores/updates in Google App Engine. |
com.bjorsond.timeline.service.model.Experience |
putExperience(com.bjorsond.timeline.service.model.Experience experience)
PUT Store or update one Experience URL: /experience/ Consumes a complete experience as JSON or XML and stores/updates in Google App Engine. |
com.bjorsond.timeline.service.model.Experiences |
putExperiences(com.bjorsond.timeline.service.model.Experiences experiences)
PUT Stores/updates all experiences in server URL: /experiences/ Stores all the experiences sent in. |
com.bjorsond.timeline.service.model.Group |
putGroup(com.bjorsond.timeline.service.model.Group group)
PUT Registers a group URL: /group/ Consumes a JSON or XML with the group information. |
com.bjorsond.timeline.service.model.User |
putUser(com.bjorsond.timeline.service.model.User user)
PUT Registers a user URL: /user/ Consumes a JSON or XML with the user information. |
java.lang.String |
removeGroup(java.lang.String groupid)
DELETE Deletes a group URL: /group/{groupid} Takes a group id as parameter. |
java.lang.String |
removeUserFromGroup(java.lang.String groupid,
java.lang.String username)
DELETE Removes a user form a group URL: /group/{groupid}/user/{username}/ |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimelineResource()
Method Detail |
---|
public com.bjorsond.timeline.service.model.Event putEvent(com.bjorsond.timeline.service.model.Event event)
{ "className":"Event",
"creator":"anderskri@gmail.com",
"eventItems":[
{
"className":"SimpleNote",
"creator":"anderskri@gmail.com",
"id":"b44f63a4-a17e-468d-bc4f-149430a8aa20",
"noteText":"This is the content of an example note.",
"noteTitle":"This is an example of a note."
}
],
"experienceid":"13b9b0d2-c8cd-4436-9be3-bddef9ebd5a2",
"id":"d270281e-5579-429d-8570-5de901d52a0f",
"latitude":63.41652922,
"longitude":10.40268466,
"datetimemillis":1301904788593,
"shared":true,
"mood":0,
"average":false
}
public java.lang.String getEvents()
public com.bjorsond.timeline.service.model.Experience putExperience(com.bjorsond.timeline.service.model.Experience experience)
{
"creator":"anderskri@gmail.com",
"events":[
{
"className":"MoodEvent",
"creator":"anderskri@gmail.com",
"datetimemillis":"1301556003782",
"experienceid":"4cfb71dc-30f6-47e5-829a-a21e08e568b9",
"id":"43799bf7-53fa-4acc-8045-0d8a0f29ea8b",
"latitude":"63.41652448",
"longitude":"10.4027416",
"mood":"1",
"shared":"true"
},
{
"className":"MoodEvent",
"creator":"andrstor87@gmail.com",
"datetimemillis":"1301556030401",
"experienceid":"4cfb71dc-30f6-47e5-829a-a21e08e568b9",
"id":"9689012d-520b-4bf1-b19f-06c1072f9f8b",
"latitude":"63.4165383",
"longitude":"10.40269734",
"mood":"-2",
"shared":"true"
},
{
"className":"Event",
"creator":"andrstor87@gmail.com",
"datetimemillis":"1301556205024",
"emotionList":[
{
"emotionType":"LIKE",
"emotionid":"22d08b27-0266-4561-8a16-96b86b099aa9"
}
],
"eventItems":[
{
"className":"SimplePicture",
"creator":"andrstor87@gmail.com",
"filename":"-1779601815.jpg",
"id":"91e0b5ba-a384-40b4-88ac-edecf8c28e91"
},
{
"className":"SimpleNote",
"creator":"andrstor87@gmail.com",
"id":"9b3dd9a7-ac7e-44e2-a62d-e6191c2a3aff",
"noteText":"The most productive in the world.",
"noteTitle":"My workplace"
}
],
"experienceid":"4cfb71dc-30f6-47e5-829a-a21e08e568b9",
"id":"b05348b2-d827-4192-b153-c283ac251586",
"latitude":"63.41654401",
"longitude":"10.4027174",
"mood":"0",
"shared":"true"
},
{
"className":"Event",
"creator":"anderskri@gmail.com",
"datetimemillis":"1301564716999",
"eventItems":[
{
"className":"SimpleNote",
"creator":"test@timelineapp.no",
"id":"5c58f9ae-3f6a-4a79-b09e-a3ad9b58d26b",
"noteText":"Finally bjorsond is on Timeline!",
"noteTitle":"bjorsond on Timeline"
}
],
"experienceid":"4cfb71dc-30f6-47e5-829a-a21e08e568b9",
"id":"adf77be1-fc8d-4a5b-b465-16c4d09a68f6",
"latitude":"63.41654447",
"longitude":"10.402711",
"mood":"0",
"shared":"true"
},
{
"className":"Event",
"creator":"test@timelineapp.no",
"datetimemillis":"1301567596334",
"eventItems":[
{
"className":"SimplePicture",
"creator":"test@timelineapp.no",
"filename":"1689419062.mp4",
"id":"5fc3463d-31ef-42a4-8b5e-3ae5a9a58f57"
}
],
"experienceid":"4cfb71dc-30f6-47e5-829a-a21e08e568b9",
"id":"76d46599-eda8-487d-a829-b5517bc6ab43",
"latitude":"0.0",
"longitude":"0.0",
"mood":"0",
"shared":"true"
}
],
"id":"4cfb71dc-30f6-47e5-829a-a21e08e568b9",
"shared":"true",
"sharingGroup":"4bbd7541-5c49-45e5-87c9-d75ac1e3a36a",
"title":"bjorsond"
}
public com.bjorsond.timeline.service.model.Experiences GetExperiences(java.lang.String username)
public com.bjorsond.timeline.service.model.Experiences GetAllExperiences()
public com.bjorsond.timeline.service.model.Experiences putExperiences(com.bjorsond.timeline.service.model.Experiences experiences)
public com.bjorsond.timeline.service.model.User putUser(com.bjorsond.timeline.service.model.User user)
{"username":"yourusername@mail.com"}
public com.bjorsond.timeline.service.model.User getUser(java.lang.String username)
username
- of user to get
User
the user with the username sent as parameterpublic com.bjorsond.timeline.service.model.Users getUsers()
{"users":[{"username":"user1@gmail.com"},{"username":"user2@gmail.com"},{"username":"test@timelineapp.no"}]}
Users
the userspublic com.bjorsond.timeline.service.model.Group getGroup(java.lang.String groupid)
groupid
- of group to get
Group
the group with the id sent as parameterpublic com.bjorsond.timeline.service.model.Group putGroup(com.bjorsond.timeline.service.model.Group group)
public java.lang.String removeGroup(java.lang.String groupid)
groupid
- group id
public com.bjorsond.timeline.service.model.Groups getGroupsOfUser(java.lang.String username)
username
- of user to get groups from.
Groups
the user is member of.public com.bjorsond.timeline.service.model.Groups getGroups()
Groups
the user is member of.public java.lang.String isUserInGroup(java.lang.String groupid, java.lang.String username)
groupid
- username
-
public com.bjorsond.timeline.service.model.Group addUserToGroup(java.lang.String groupid, java.lang.String username)
groupid
- Id of group to add user tousername
- username of already registered user
public java.lang.String removeUserFromGroup(java.lang.String groupid, java.lang.String username)
groupid
- id of group to remove user fromusername
- of user to remove
public java.lang.String getAverageMoodByID(java.lang.String experienceid)
experienceid
- Experience id of the experience to get average mood from.public java.lang.String getAverageMoodByName(java.lang.String title)
title
- title of the experience to get average mood from.public com.bjorsond.timeline.service.model.Event putAverageMoodByName(java.lang.String title, java.lang.String username, int mood)
title
- of experience to insert moodusername
- of user to set as creatormood
- to insert. int from -2 to 2. Very sad to very happy.
Event
public com.bjorsond.timeline.service.model.Event putAverageMoodByID(java.lang.String id, java.lang.String username, int mood)
id
- of experience to insert moodusername
- of user to set as creatormood
- to insert. int from -2 to 2. Very sad to very happy.
Event
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |