@Singleton public class RESTActivityServer extends Object implements ActivityServer
Constructor and Description |
---|
RESTActivityServer()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
List<ActivityType> |
getActivityTypes(Context context)
This method retrieves a set of activity events associated
with the supplied context value.
|
List<ActivityType> |
getActivityTypes(Context context,
long from,
long to)
This method retrieves a set of activity events associated
with the supplied context value and time range.
|
protected List<ActivityType> |
getActivityTypes(URL queryUrl)
This method retrieves the activity types associated with the supplied
query URL.
|
ActivityUnit |
getActivityUnit(String id)
This method queries the server for an activity unit
with the supplied id.
|
String |
getServerPassword()
This method gets the password for the Activity Server.
|
String |
getServerURL()
This method gets the URL of the Activity Server.
|
String |
getServerUsername()
This method gets the username for the Activity Server.
|
protected void |
initAuth(HttpURLConnection connection)
This method initializes the authentication properties on the supplied
URL connection.
|
List<ActivityType> |
query(QuerySpec query)
This method retrieves a set of activity events associated
with the supplied query.
|
void |
setServerPassword(String password)
This method sets the password for the Activity Server.
|
void |
setServerURL(String url)
This method sets the URL of the Activity Server.
|
void |
setServerUsername(String username)
This method sets the username for the Activity Server.
|
void |
store(List<ActivityUnit> activities)
This method stores the supplied activity events.
|
public void setServerURL(String url)
url
- The URLpublic String getServerURL()
public void setServerUsername(String username)
username
- The usernamepublic String getServerUsername()
public void setServerPassword(String password)
password
- The passwordpublic String getServerPassword()
protected void initAuth(HttpURLConnection connection)
connection
- The connectionpublic void store(List<ActivityUnit> activities) throws Exception
store
in interface ActivityServer
activities
- The activity eventsException
- Failed to store the activitiespublic ActivityUnit getActivityUnit(String id) throws Exception
getActivityUnit
in interface ActivityServer
id
- The activity unit idException
- Failed to get the activity unitpublic List<ActivityType> getActivityTypes(Context context, long from, long to) throws Exception
getActivityTypes
in interface ActivityServer
context
- The context valuefrom
- The 'from' timestampto
- The 'to' timestamp, where 0 represents current timeException
- Failed to retrieve the activitiespublic List<ActivityType> getActivityTypes(Context context) throws Exception
getActivityTypes
in interface ActivityServer
context
- The context valueException
- Failed to retrieve the activitiesprotected List<ActivityType> getActivityTypes(URL queryUrl) throws Exception
queryUrl
- The query URLException
- Failed to get activity typespublic List<ActivityType> query(QuerySpec query) throws Exception
query
in interface ActivityServer
query
- The queryException
- Failed to query the activitiesCopyright © 2013-2015 JBoss by Red Hat. All Rights Reserved.