/*
 * The MIT License
 *
 * Copyright (c) 2016 Marcelo "Ataxexe" Guimarães <ataxexe@devnull.tools>
 *
 * Permission  is hereby granted, free of charge, to any person obtaining
 * a  copy  of  this  software  and  associated  documentation files (the
 * "Software"),  to  deal  in the Software without restriction, including
 * without  limitation  the  rights to use, copy, modify, merge, publish,
 * distribute,  sublicense,  and/or  sell  copies of the Software, and to
 * permit  persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 * The  above  copyright  notice  and  this  permission  notice  shall be
 * included  in  all  copies  or  substantial  portions  of the Software.
 *
 * THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY OF ANY KIND,
 * EXPRESS  OR  IMPLIED,  INCLUDING  BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN  NO  EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * CLAIM,  DAMAGES  OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT  OR  OTHERWISE,  ARISING  FROM,  OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE   OR   THE   USE   OR   OTHER   DEALINGS  IN  THE  SOFTWARE.
 */

package tools.devnull.boteco.plugins.redhat;

import tools.devnull.boteco.plugin.Notification;
import tools.devnull.boteco.plugin.Plugin;

import java.util.Collections;
import java.util.List;

import static tools.devnull.boteco.plugin.Notification.notifies;

public class RedHatPlugin implements Plugin {

  @Override
  public String id() {
    return "redhat";
  }

  @Override
  public String description() {
    return "A plugin that provides utilities for Red Hatters";
  }

  @Override
  public String listensTo() {
    return "Occurrences of links from access.redhat.com articles and solutions";
  }

  @Override
  public List<Notification> notifications() {
    return Collections.singletonList(
        notifies("status.redhat").about("Incidents from status.redhat.com")
    );
  }

}

@@ -1283,24 +1283,69 @@
 ns.redhat;%0A%0A
+import tools.devnull.boteco.plugin.Listener;%0A
 import tools
@@ -1381,16 +1381,16 @@
 cation;%0A
-
 import t
@@ -1475,24 +1475,85 @@
 util.List;%0A%0A
+import static tools.devnull.boteco.plugin.Listener.listenTo;%0A
 import stati
@@ -1847,22 +1847,30 @@
  public 
-String
+List%3CListener%3E
  listens
@@ -1887,16 +1887,60 @@
  return 
+Collections.singletonList(%0A        listenTo(
 %22Occurre
@@ -1999,16 +1999,99 @@
 lutions%22
+)%0A            .respondWith(%22Detailed information about the article/solution%22)%0A    )
 ;%0A  %7D%0A%0A 

update plugin definition