|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.buildforge.services.client.dbo.Server
public class Server
Servers are the execution platforms for the Build
s of a
Project
. Servers expose their specific properties via
Collector
s, and are queried by Selector
s in order
to match their exposed properties against the required properties
to determine suitability as an execution platform for a specific
Build
of a certain Project
.
Field Summary | |
---|---|
static java.lang.Class<Server> |
CLASS
|
static int |
DEFAULT_TEST_INTERVAL
Default interval to wait between polls while blocking for a server test to complete. |
static int |
DEFAULT_TEST_TIMEOUT
Default maximum time to wait for a server test to complete. |
Constructor Summary | |
---|---|
Server(APIClientConnection conn)
|
Method Summary | |
---|---|
void |
activate()
Activates a server. |
void |
activate(boolean active)
Activates or deactivates a server. |
boolean |
canGet()
Returns whether ( true ) or not (false ) files
may be retrieved from this Server via the dot command .get |
boolean |
canPut()
Returns whether ( true ) or not (false ) files
may be placed onto this Server via the dot command .put |
Server |
create()
Creates this new Server in the database |
void |
delete()
Removes this Server from the database |
static java.util.List<Server> |
findAll(APIClientConnection conn)
Retrieves all defined Server objects in the database |
static Server |
findById(APIClientConnection conn,
int serverId)
Retrieves a particular Server by identifier |
static Server |
findByName(APIClientConnection conn,
java.lang.String serverName)
Retrives a particular Server by name |
boolean |
getActive()
Returns whether this Server is active ( true ) or inactive (false ) |
java.lang.String |
getAuthId()
Returns the identifier of the ServerAuth authentication object associated with this Server |
java.lang.String |
getCollectorId()
Returns the identifier of the Collector associated with this Server |
int |
getEnvironmentId()
Returns the identifier of the Environment associated with this Server |
ServerDBO.Error |
getError()
Returns the error state of this Server, see ServerDBO.Error for more details |
java.lang.String |
getHost()
Returns the hostname of this Server, i.e.: "myhost.domain.tld" |
int |
getLevel()
Returns the security level that must be possessed in order to access this Server object |
Manifest |
getManifest()
Retrieves the Manifest for this Server. |
java.lang.String |
getName()
Returns the friendly name of the Server, i.e.: "myFirstBuildServer" |
java.lang.String |
getPath()
Returns the Server-local path on which build information will be generated, i.e.: "/builds" |
ServerDBO.Publish |
getPublish()
Returns whether gets (.get) and puts (.put) are allowed on this server |
int |
getServerId()
Returns the unique identifier of this Server |
java.lang.String |
getTestText()
Returns the literal text of the results of the last connection test |
ServerDBO.Upstate |
getUpstate()
Returns the current state of the server with respect to availability - currently one of either updating or ready |
void |
refreshManifest()
Requests that the server's manifest be refreshed |
Manifest |
refreshManifest(int timeout)
Requests that the server's manifest be refreshed and waits the specified time period for the refresh to complete. |
Manifest |
refreshManifest(int timeout,
int interval)
Requests that the server's manifest be refreshed and waits the specified time period for the refresh to complete. |
void |
setActive(boolean active)
Sets whether this Server is active ( true ) or inactive (false ) |
void |
setAuthId(java.lang.String authId)
Sets the identifier of the ServerAuth authentication object associated with this Server |
void |
setCollectorId(java.lang.String collectorId)
Sets he identifier of the Collector associated with this Server |
void |
setEnvironmentId(int environmentId)
Sets the identifier of the Environment associated with this Server |
void |
setError(ServerDBO.Error error)
Sets the error state of this Server, see ServerDBO.Error for more details |
void |
setHost(java.lang.String host)
Sets the hostname of this Server, i.e.: "myhost.domain.tld" |
void |
setLevel(int level)
Sets the security level that must be possessed in order to access this Server object |
void |
setName(java.lang.String name)
Sets the friendly name of the Server, i.e.: "myFirstBuildServer" |
void |
setPath(java.lang.String path)
Sets the Server-local path on which build information will be generated, i.e.: "/builds" |
void |
setPublish(ServerDBO.Publish publish)
sets whether gets (.get) and puts (.put) are allowed on this server |
void |
setTestText(java.lang.String testText)
Sets the literal text of the results of the last connection test |
void |
setUpstate(ServerDBO.Upstate upstate)
Sets the current state of the server with respect to availability - currently one of either updating or ready |
void |
test()
Requests that the server test be run. |
ServerDBO.Error |
test(int timeout)
Requests that the server test be run and waits the specified time period for the test to complete. |
ServerDBO.Error |
test(int timeout,
int interval)
Requests that the server test be run and waits the specified time period for the test to complete. |
java.lang.String |
toString()
|
Server |
update()
Commits all changes to this Server to the database |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_TEST_TIMEOUT
30000
millis.
public static final int DEFAULT_TEST_INTERVAL
3000
millis.
public static final java.lang.Class<Server> CLASS
Constructor Detail |
---|
public Server(APIClientConnection conn)
Method Detail |
---|
public boolean canGet()
true
) or not (false
) files
may be retrieved from this Server via the dot command .get
public boolean canPut()
true
) or not (false
) files
may be placed onto this Server via the dot command .put
public static java.util.List<Server> findAll(APIClientConnection conn) throws java.io.IOException, ServiceException
conn
-
java.io.IOException
ServiceException
public static Server findById(APIClientConnection conn, int serverId) throws java.io.IOException, ServiceException
conn
- serverId
-
java.io.IOException
ServiceException
public static Server findByName(APIClientConnection conn, java.lang.String serverName) throws java.io.IOException, ServiceException
conn
- serverName
-
java.io.IOException
ServiceException
public void activate() throws java.io.IOException, ServiceException
This convenience method is exactly equivalent to calling
activate(true)
.
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic void activate(boolean active) throws java.io.IOException, ServiceException
setActive(boolean)
method requires an explicit call to
update()
, this method takes effect immediately.
active
- true
to activate the server, or
false
to deactivate it.
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic Server create() throws java.io.IOException, ServiceException
java.io.IOException
ServiceException
public Server update() throws java.io.IOException, ServiceException
java.io.IOException
ServiceException
public void delete() throws java.io.IOException, ServiceException
java.io.IOException
ServiceException
public Manifest getManifest() throws java.io.IOException, ServiceException
Manifest
for this Server. The Manifest will
include all information collected by the Collector
associated
with this Server.
java.io.IOException
ServiceException
public void test() throws java.io.IOException, ServiceException
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic ServerDBO.Error test(int timeout) throws java.io.IOException, ServiceException
This convenience method is exactly equivalent to
test(timeout,DEFAULT_TEST_INTERVAL)
.
timeout
- as for test(int,int)
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic ServerDBO.Error test(int timeout, int interval) throws java.io.IOException, ServiceException
timeout
- the maximum time to wait for the server test to
complete. If the specified value is not positive, then
DEFAULT_TEST_TIMEOUT
is used. If the test has
not completed before the timeout expires, then an exception
is thrown.interval
- the minimum time to wait between polls. The server
test executes asynchronously, and this method must poll to
detect when it has finished. The minimum allowed value is
250
, and smaller values are treated as if
250
had been specified.
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request fails
APIException
- if the timeout limit is reachedpublic void refreshManifest() throws java.io.IOException, ServiceException
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic Manifest refreshManifest(int timeout) throws java.io.IOException, ServiceException
This convenience method is exactly equivalent to
refreshManifest(timeout,DEFAULT_TEST_INTERVAL)
.
timeout
- as for refreshManifest(int,int)
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request fails
APIException
- if the timeout limit is reachedpublic Manifest refreshManifest(int timeout, int interval) throws java.io.IOException, ServiceException
timeout
- the maximum time to wait for the server test to
complete. If the specified value is not positive, then
DEFAULT_TEST_TIMEOUT
is used. If the test has
not completed before the timeout expires, then an exception
is thrown.interval
- the minimum time to wait between polls. The server
test executes asynchronously, and this method must poll to
detect when it has finished. The minimum allowed value is
250
, and smaller values are treated as if
250
had been specified.
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request fails
APIException
- if the timeout limit is reachedpublic boolean getActive()
true
) or inactive (false
)
public java.lang.String getAuthId()
ServerAuth
authentication object associated with this Server
public java.lang.String getCollectorId()
Collector
associated with this Server
public int getEnvironmentId()
Environment
associated with this Server
public ServerDBO.Error getError()
ServerDBO.Error
for more details
public java.lang.String getHost()
public int getLevel()
public java.lang.String getName()
public java.lang.String getPath()
public ServerDBO.Publish getPublish()
public int getServerId()
public java.lang.String getTestText()
public ServerDBO.Upstate getUpstate()
public void setActive(boolean active)
true
) or inactive (false
)
active
- public void setAuthId(java.lang.String authId)
ServerAuth
authentication object associated with this Server
authId
- public void setCollectorId(java.lang.String collectorId)
Collector
associated with this Server
collectorId
- public void setEnvironmentId(int environmentId)
Environment
associated with this Server
environmentId
- public void setError(ServerDBO.Error error)
ServerDBO.Error
for more details
error
- public void setHost(java.lang.String host)
host
- public void setLevel(int level)
level
- public void setName(java.lang.String name)
name
- public void setPath(java.lang.String path)
path
- public void setPublish(ServerDBO.Publish publish)
publish
- public void setTestText(java.lang.String testText)
testText
- public void setUpstate(ServerDBO.Upstate upstate)
upstate
- public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |