|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hackystat.dailyprojectdata.client.DailyProjectDataClient
public class DailyProjectDataClient
Provides a client to support access to the DailyProjectData service.
Field Summary | |
---|---|
static java.lang.String |
DAILYPROJECTDATACLIENT_TIMEOUT_KEY
The System property key used to retrieve the default timeout value in milliseconds. |
Constructor Summary | |
---|---|
DailyProjectDataClient(java.lang.String host,
java.lang.String email,
java.lang.String password)
Initializes a new DailyProjectDataClient, given the host, userEmail, and password. |
Method Summary | |
---|---|
DailyProjectDataClient |
authenticate()
Authenticates this user and password with this DailyProjectData service, throwing a DailyProjectDataException if the user and password associated with this instance are not valid credentials. |
void |
clearLocalCache()
Delete all entries from the local cache of DailyProjectData instances associated with this DailyProjectDataClient instance. |
void |
clearLocalCache(java.lang.String user,
java.lang.String project)
Delete all cache entries associated with the specified project and its owner. |
boolean |
clearServerCache()
Clears the (front side) DPD cache associated with this user on the DailyProjectData server to which this DailyProjectDataClient instance is connected. |
boolean |
clearServerCache(java.lang.String owner,
java.lang.String project)
Clears the (front side) DPD cache entries associated with the specified project and its owner on the DailyProjectData server to which this DailyProjectDataClient instance is connected. |
void |
enableCaching(java.lang.String cacheName,
java.lang.String subDir,
java.lang.Double maxLife,
java.lang.Long capacity)
Enables caching in this client. |
BuildDailyProjectData |
getBuild(java.lang.String user,
java.lang.String project,
javax.xml.datatype.XMLGregorianCalendar timestamp)
Returns a BuildDailyProjectData instance from this server, or throws a DailyProjectData exception if problems occurred. |
BuildDailyProjectData |
getBuild(java.lang.String user,
java.lang.String project,
javax.xml.datatype.XMLGregorianCalendar timestamp,
java.lang.String type)
Returns a BuildDailyProjectData instance from this server, or throws a DailyProjectData exception if problems occurred. |
CodeIssueDailyProjectData |
getCodeIssue(java.lang.String user,
java.lang.String project,
javax.xml.datatype.XMLGregorianCalendar timestamp,
java.lang.String tool,
java.lang.String type)
Returns a CodeIssueDailyProjectData instance from this server, or throws a DailyProjectData exception if problems occurred. |
CommitDailyProjectData |
getCommit(java.lang.String user,
java.lang.String project,
javax.xml.datatype.XMLGregorianCalendar timestamp)
Returns a CommitDailyProjectData instance from this server, or throws a DailyProjectData exception if problems occurred. |
ComplexityDailyProjectData |
getComplexity(java.lang.String user,
java.lang.String project,
javax.xml.datatype.XMLGregorianCalendar timestamp,
java.lang.String type,
java.lang.String tool)
Returns a ComplexityDailyProjectData instance from this server, or throws a DailyProjectData exception if problems occurred. |
CouplingDailyProjectData |
getCoupling(java.lang.String user,
java.lang.String project,
javax.xml.datatype.XMLGregorianCalendar timestamp,
java.lang.String type,
java.lang.String tool)
Returns a CouplingDailyProjectData instance from this server, or throws a DailyProjectData exception if problems occurred. |
CoverageDailyProjectData |
getCoverage(java.lang.String user,
java.lang.String project,
javax.xml.datatype.XMLGregorianCalendar timestamp,
java.lang.String granularity)
Returns a CoverageDailyProjectData instance from this server, or throws a DailyProjectData exception if problems occurred. |
DevTimeDailyProjectData |
getDevTime(java.lang.String user,
java.lang.String project,
javax.xml.datatype.XMLGregorianCalendar timestamp)
Returns a DevTimeDailyProjectData instance from this server, or throws a DailyProjectData exception if problems occurred. |
FileMetricDailyProjectData |
getFileMetric(java.lang.String user,
java.lang.String project,
javax.xml.datatype.XMLGregorianCalendar timestamp,
java.lang.String sizeMetric)
Returns a FileMetricDailyProjectData instance from this server, or throws a DailyProjectData exception if problems occurred. |
FileMetricDailyProjectData |
getFileMetric(java.lang.String user,
java.lang.String project,
javax.xml.datatype.XMLGregorianCalendar timestamp,
java.lang.String sizeMetric,
java.lang.String tool)
Returns a FileMetricDailyProjectData instance from this server, or throws a DailyProjectData exception if problems occurred. |
IssueDailyProjectData |
getIssue(java.lang.String user,
java.lang.String project,
javax.xml.datatype.XMLGregorianCalendar timestamp)
Returns a IssueDailyProjectData instance from this server, or throws a DailyProjectData exception if problems occurred. |
IssueDailyProjectData |
getIssue(java.lang.String user,
java.lang.String project,
javax.xml.datatype.XMLGregorianCalendar timestamp,
java.lang.String status)
Returns a IssueDailyProjectData instance from this server, or throws a DailyProjectData exception if problems occurred. |
IssueChangeDailyProjectData |
getIssueChange(java.lang.String user,
java.lang.String project,
javax.xml.datatype.XMLGregorianCalendar timestamp)
Returns a IssueDailyProjectData instance from this server, or throws a DailyProjectData exception if problems occurred. |
UnitTestDailyProjectData |
getUnitTest(java.lang.String user,
java.lang.String project,
javax.xml.datatype.XMLGregorianCalendar timestamp)
Returns a UnitTestDailyProjectData instance from this server, or throws a DailyProjectData exception if problems occurred. |
static boolean |
isHost(java.lang.String host)
Returns true if the passed host is a DailyProjectData host. |
int |
localCacheSize(java.lang.String user,
java.lang.String project)
Returns the number of cached entries for the given project and its owner. |
void |
setTimeout(int milliseconds)
Sets the timeout value for this client. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DAILYPROJECTDATACLIENT_TIMEOUT_KEY
Constructor Detail |
---|
public DailyProjectDataClient(java.lang.String host, java.lang.String email, java.lang.String password)
host
- The host, such as 'http://localhost:9877/dailyprojectdata'.email
- The user's email used for authentication.password
- The password used for authentication.Method Detail |
---|
public final void setTimeout(int milliseconds)
milliseconds
- The number of milliseconds to wait before timing out.public DailyProjectDataClient authenticate() throws DailyProjectDataClientException
DailyProjectDataClientException
- If authentication is not successful.public DevTimeDailyProjectData getDevTime(java.lang.String user, java.lang.String project, javax.xml.datatype.XMLGregorianCalendar timestamp) throws DailyProjectDataClientException
user
- The user that owns the project.project
- The project owned by user.timestamp
- The Timestamp indicating the start of the 24 hour period of DevTime.
DailyProjectDataClientException
- If the credentials associated with this instance are
not valid, or if the underlying SensorBase service cannot be reached, or if one or more
of the supplied user, password, or timestamp is not valid.public UnitTestDailyProjectData getUnitTest(java.lang.String user, java.lang.String project, javax.xml.datatype.XMLGregorianCalendar timestamp) throws DailyProjectDataClientException
user
- The user that owns the project.project
- The project owned by user.timestamp
- The Timestamp indicating the start of the 24 hour period of DevTime.
DailyProjectDataClientException
- If the credentials associated with this instance are
not valid, or if the underlying SensorBase service cannot be reached, or if one or more
of the supplied user, password, or timestamp is not valid.public static boolean isHost(java.lang.String host)
host
- The URL of a DailyProjectData host, "http://localhost:9876/dailyprojectdata".
public FileMetricDailyProjectData getFileMetric(java.lang.String user, java.lang.String project, javax.xml.datatype.XMLGregorianCalendar timestamp, java.lang.String sizeMetric) throws DailyProjectDataClientException
user
- The user that owns the project.project
- The project owned by user.timestamp
- The Timestamp indicating the start of the 24 hour period of DevTime.sizeMetric
- The size metric to be retrieved.
DailyProjectDataClientException
- If the credentials associated with this instance are
not valid, or if the underlying SensorBase service cannot be reached, or if one or more
of the supplied user, password, or timestamp is not valid.public FileMetricDailyProjectData getFileMetric(java.lang.String user, java.lang.String project, javax.xml.datatype.XMLGregorianCalendar timestamp, java.lang.String sizeMetric, java.lang.String tool) throws DailyProjectDataClientException
user
- The user that owns the project.project
- The project owned by user.timestamp
- The Timestamp indicating the start of the 24 hour period of DevTime.sizeMetric
- The size metric to be retrieved.tool
- The tool whose data is to be retrieved, or null for no tool.
DailyProjectDataClientException
- If the credentials associated with this instance are
not valid, or if the underlying SensorBase service cannot be reached, or if one or more
of the supplied user, password, or timestamp is not valid.public ComplexityDailyProjectData getComplexity(java.lang.String user, java.lang.String project, javax.xml.datatype.XMLGregorianCalendar timestamp, java.lang.String type, java.lang.String tool) throws DailyProjectDataClientException
user
- The user that owns the project.project
- The project owned by user.timestamp
- The Timestamp indicating the start of the 24 hour period of DevTime.type
- The type of complexity, such as "Cyclometric".tool
- The tool that provided the complexity data, such as "JavaNCSS".
DailyProjectDataClientException
- If the credentials associated with this instance are
not valid, or if the underlying SensorBase service cannot be reached, or if one or more
of the supplied user, password, or timestamp is not valid.public CouplingDailyProjectData getCoupling(java.lang.String user, java.lang.String project, javax.xml.datatype.XMLGregorianCalendar timestamp, java.lang.String type, java.lang.String tool) throws DailyProjectDataClientException
user
- The user that owns the project.project
- The project owned by user.timestamp
- The Timestamp indicating the start of the 24 hour period of DevTime.type
- The type of coupling, such as "class".tool
- The tool that provided the coupling data, such as "DependencyFinder".
DailyProjectDataClientException
- If the credentials associated with this instance are
not valid, or if the underlying SensorBase service cannot be reached, or if one or more
of the supplied user, password, or timestamp is not valid.public CodeIssueDailyProjectData getCodeIssue(java.lang.String user, java.lang.String project, javax.xml.datatype.XMLGregorianCalendar timestamp, java.lang.String tool, java.lang.String type) throws DailyProjectDataClientException
user
- The user that owns the project.project
- The project owned by user.timestamp
- The Timestamp indicating the start of the 24 hour period of CodeIssue data.tool
- An optional tool for matching CodeIssue data.type
- An optional type for matching CodeIssue types.
DailyProjectDataClientException
- If the credentials associated with this instance are
not valid, or if the underlying SensorBase service cannot be reached, or if one or more
of the supplied user, password, or timestamp is not valid.public CoverageDailyProjectData getCoverage(java.lang.String user, java.lang.String project, javax.xml.datatype.XMLGregorianCalendar timestamp, java.lang.String granularity) throws DailyProjectDataClientException
user
- The user that owns the project.project
- The project owned by user.timestamp
- The Timestamp indicating the start of the 24 hour period of CodeIssue data.granularity
- the granularity of the coverage data.
DailyProjectDataClientException
- If the credentials associated with this instance are
not valid, or if the underlying SensorBase service cannot be reached, or if one or more
of the supplied user, password, or timestamp is not valid.public CommitDailyProjectData getCommit(java.lang.String user, java.lang.String project, javax.xml.datatype.XMLGregorianCalendar timestamp) throws DailyProjectDataClientException
user
- The user that owns the project.project
- The project owned by user.timestamp
- The Timestamp indicating the start of the 24 hour period of CodeIssue data.
DailyProjectDataClientException
- If the credentials associated with this instance are
not valid, or if the underlying SensorBase service cannot be reached, or if one or more
of the supplied user, password, or timestamp is not valid.public BuildDailyProjectData getBuild(java.lang.String user, java.lang.String project, javax.xml.datatype.XMLGregorianCalendar timestamp, java.lang.String type) throws DailyProjectDataClientException
user
- The user that owns the project.project
- The project owned by user.timestamp
- The Timestamp indicating the start of the 24 hour period of build data.type
- The type of build to retrieve data for.
DailyProjectDataClientException
- If the credentials associated with this instance are
not valid, or if the underlying SensorBase service cannot be reached, or if one or more
of the supplied user, password, or timestamp is not valid.public BuildDailyProjectData getBuild(java.lang.String user, java.lang.String project, javax.xml.datatype.XMLGregorianCalendar timestamp) throws DailyProjectDataClientException
user
- The user that owns the project.project
- The project owned by user.timestamp
- The Timestamp indicating the start of the 24 hour period of build data.
DailyProjectDataClientException
- If the credentials associated with this instance are
not valid, or if the underlying SensorBase service cannot be reached, or if one or more
of the supplied user, password, or timestamp is not valid.public IssueDailyProjectData getIssue(java.lang.String user, java.lang.String project, javax.xml.datatype.XMLGregorianCalendar timestamp, java.lang.String status) throws DailyProjectDataClientException
user
- The user that owns the project.project
- The project owned by user.timestamp
- The Timestamp indicating the start of the 24 hour period of build data.status
- The status of the issue, open or closed,
or a specified status such as "Accepted" or "Fixed"
DailyProjectDataClientException
- If the credentials associated with this instance are
not valid, or if the underlying SensorBase service cannot be reached, or if one or more
of the supplied user, password, or timestamp is not valid.public IssueDailyProjectData getIssue(java.lang.String user, java.lang.String project, javax.xml.datatype.XMLGregorianCalendar timestamp) throws DailyProjectDataClientException
user
- The user that owns the project.project
- The project owned by user.timestamp
- The Timestamp indicating the start of the 24 hour period of build data.
DailyProjectDataClientException
- If the credentials associated with this instance are
not valid, or if the underlying SensorBase service cannot be reached, or if one or more
of the supplied user, password, or timestamp is not valid.public IssueChangeDailyProjectData getIssueChange(java.lang.String user, java.lang.String project, javax.xml.datatype.XMLGregorianCalendar timestamp) throws DailyProjectDataClientException
user
- The user that owns the project.project
- The project owned by user.timestamp
- The Timestamp indicating the start of the 24 hour period of build data.
DailyProjectDataClientException
- If the credentials associated with this instance are
not valid, or if the underlying SensorBase service cannot be reached, or if one or more
of the supplied user, password, or timestamp is not valid.public void enableCaching(java.lang.String cacheName, java.lang.String subDir, java.lang.Double maxLife, java.lang.Long capacity)
cacheName
- The name of the cache.subDir
- The subdirectory in which the cache backend store is saved.maxLife
- The default expiration time for cached objects in days.capacity
- The maximum number of instances to be held in-memory.public void clearLocalCache()
public void clearLocalCache(java.lang.String user, java.lang.String project)
user
- The user.project
- The project.public int localCacheSize(java.lang.String user, java.lang.String project)
user
- The owner of this project.project
- The project.
public boolean clearServerCache() throws DailyProjectDataClientException
DailyProjectDataClientException
- If problems occur.public boolean clearServerCache(java.lang.String owner, java.lang.String project) throws DailyProjectDataClientException
owner
- The owner of the project whose entries are to be cleared.project
- The project DPDs to be cleared on the server.
DailyProjectDataClientException
- If problems occur.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |