public class HubotNotifier extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_ROOM_EXPRESSION |
static String |
HUBOT_SERVICE_NAME |
Constructor and Description |
---|
HubotNotifier(String username,
String password,
String roomExpression) |
HubotNotifier(String hubotUrl,
String username,
String password,
String roomExpression) |
Modifier and Type | Method and Description |
---|---|
protected <T> T |
createWebClient(Class<T> clientType,
String hubotUrl)
Creates a JAXRS web client for the given JAXRS client
|
protected HubotRestApi |
getHubotRestApi() |
String |
getHubotUrl() |
void |
notifyBuild(String namespace,
String buildConfig,
String message)
Notifies the room for the given namespace and build config name with the given message.
|
void |
notifyRoom(String room,
String message)
Sends a message to a given room in the chat bot
|
public static final String HUBOT_SERVICE_NAME
public static final String DEFAULT_ROOM_EXPRESSION
@Inject public HubotNotifier(@ConfigProperty(name="HUBOT_USERNAME") String username, @ConfigProperty(name="HUBOT_PASSWORD") String password, @ConfigProperty(name="HUBOT_BUILD_ROOM",defaultValue="#fabric8_${namespace}") String roomExpression)
public String getHubotUrl()
public void notifyRoom(String room, String message)
room
- the name of the room usually using IRC style starting with #message
- the notification message to send which can include links or refer to people via @somenickpublic void notifyBuild(String namespace, String buildConfig, String message)
namespace
- the kubernetes namespace for the buildbuildConfig
- the name of the build configurationmessage
- the notification messageprotected HubotRestApi getHubotRestApi()
Copyright © 2011–2016 Red Hat. All rights reserved.