Browse Source

Remove lombok from next set of plugins

Change-Id: I912eb22c4612741e60626f8c59e065ad98a5c05a
Reviewed-on: http://gerrit.dmdirc.com/2997
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
tags/0.8
Greg Holmes 10 years ago
parent
commit
f43be1d40c

+ 11
- 7
src/com/dmdirc/addons/nma/NotifyMyAndroidClient.java View File

@@ -31,16 +31,15 @@ import java.util.HashMap;
31 31
 import java.util.List;
32 32
 import java.util.Map;
33 33
 
34
-import lombok.RequiredArgsConstructor;
35
-import lombok.extern.slf4j.Slf4j;
34
+import org.slf4j.LoggerFactory;
36 35
 
37 36
 /**
38 37
  * Simple client for sending events to NotifyMyAndroid.
39 38
  */
40
-@Slf4j
41
-@RequiredArgsConstructor
42 39
 public class NotifyMyAndroidClient {
43 40
 
41
+    private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(NotifyMyAndroidClient.class);
42
+
44 43
     /** The base URL for the NMA API. */
45 44
     private static final String BASE_URL = "https://www.notifymyandroid.com";
46 45
     /** The method to call to send a notification. */
@@ -52,6 +51,11 @@ public class NotifyMyAndroidClient {
52 51
     /** The application to report ourselves as. */
53 52
     private final String application;
54 53
 
54
+    public NotifyMyAndroidClient(Collection<String> apiKeys, String application) {
55
+        this.apiKeys = apiKeys;
56
+        this.application = application;
57
+    }
58
+
55 59
     /**
56 60
      * Creates a new instance of {@link NotifyMyAndroidClient} with a single
57 61
      * API key.
@@ -78,11 +82,11 @@ public class NotifyMyAndroidClient {
78 82
         arguments.put("event", event);
79 83
         arguments.put("description", description);
80 84
 
81
-        log.info("Sending notification to NMA for event '{}'", event);
82
-        log.debug("Arguments: {}", arguments);
85
+        LOG.info("Sending notification to NMA for event '{}'", event);
86
+        LOG.debug("Arguments: {}", arguments);
83 87
 
84 88
         final List<String> response = Downloader.getPage(BASE_URL + NOTIFY_PATH, arguments);
85
-        log.debug("Response: {}", response);
89
+        LOG.debug("Response: {}", response);
86 90
     }
87 91
 
88 92
     /**

+ 10
- 7
src/com/dmdirc/addons/nma/NotifyMyAndroidCommand.java View File

@@ -32,15 +32,15 @@ import com.dmdirc.interfaces.CommandController;
32 32
 
33 33
 import java.io.IOException;
34 34
 
35
-import lombok.Setter;
36
-import lombok.extern.slf4j.Slf4j;
35
+import org.slf4j.LoggerFactory;
37 36
 
38 37
 /**
39 38
  * Command to raise notifications with NotifyMyAndroid.
40 39
  */
41
-@Slf4j
42 40
 public class NotifyMyAndroidCommand extends Command {
43 41
 
42
+    private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(NotifyMyAndroidCommand.class);
43
+
44 44
     /** A command info object for this command. */
45 45
     public static final BaseCommandInfo INFO = new BaseCommandInfo(
46 46
             "notifymyandroid",
@@ -49,7 +49,6 @@ public class NotifyMyAndroidCommand extends Command {
49 49
             CommandType.TYPE_GLOBAL);
50 50
 
51 51
     /** The configuration domain to retrieve settings from. */
52
-    @Setter
53 52
     private String configDomain;
54 53
 
55 54
     /**
@@ -61,18 +60,22 @@ public class NotifyMyAndroidCommand extends Command {
61 60
         super(controller);
62 61
     }
63 62
 
63
+    public void setConfigDomain(final String configDomain) {
64
+        this.configDomain = configDomain;
65
+    }
66
+
64 67
     /** {@inheritDoc} */
65 68
     @Override
66 69
     public void execute(final FrameContainer origin,
67 70
             final CommandArguments args, final CommandContext context) {
68 71
         final String[] parts = args.getArgumentsAsString().split("\\s+--\\s+", 2);
69
-        log.trace("Split input: {}", (Object[]) parts);
72
+        LOG.trace("Split input: {}", (Object[]) parts);
70 73
 
71 74
         if (parts.length != 2) {
72 75
             showUsage(origin, args.isSilent(), INFO.getName(), INFO.getHelp());
73 76
         }
74 77
 
75
-        log.trace("Retrieving settings from domain '{}'", configDomain);
78
+        LOG.trace("Retrieving settings from domain '{}'", configDomain);
76 79
         final NotifyMyAndroidClient client = new NotifyMyAndroidClient(
77 80
                 origin.getConfigManager().getOption(configDomain, "apikey"),
78 81
                 origin.getConfigManager().getOption(configDomain, "application"));
@@ -85,7 +88,7 @@ public class NotifyMyAndroidCommand extends Command {
85 88
                     client.notify(parts[0], parts[1]);
86 89
                     sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Notification sent");
87 90
                 } catch (IOException ex) {
88
-                    log.info("Exception when trying to notify NMA", ex);
91
+                    LOG.info("Exception when trying to notify NMA", ex);
89 92
                     sendLine(origin, args.isSilent(), FORMAT_ERROR, "Unable to send: " + ex.getMessage());
90 93
                 }
91 94
             }

+ 8
- 3
src/com/dmdirc/addons/osd/OsdManager.java View File

@@ -33,14 +33,11 @@ import java.util.List;
33 33
 import java.util.Queue;
34 34
 import java.util.concurrent.Callable;
35 35
 
36
-import lombok.RequiredArgsConstructor;
37
-
38 36
 /**
39 37
  * Class to manage OSD Windows.
40 38
  *
41 39
  * @since 0.6.3
42 40
  */
43
-@RequiredArgsConstructor
44 41
 public class OsdManager {
45 42
 
46 43
     /** The window the OSD will be associated with. */
@@ -56,6 +53,14 @@ public class OsdManager {
56 53
     /** List of messages to be queued. */
57 54
     private final Queue<QueuedMessage> windowQueue = new LinkedList<>();
58 55
 
56
+    public OsdManager(final MainFrame mainFrame, final IdentityController identityController,
57
+            final OsdPlugin plugin, final ColourManager colourManager) {
58
+        this.mainFrame = mainFrame;
59
+        this.identityController = identityController;
60
+        this.plugin = plugin;
61
+        this.colourManager = colourManager;
62
+    }
63
+
59 64
     /**
60 65
      * Add messages to the queue and call displayWindows.
61 66
      *

+ 9
- 9
src/com/dmdirc/addons/parser_xmpp/XmppParser.java View File

@@ -57,8 +57,6 @@ import java.util.Map;
57 57
 import java.util.regex.Matcher;
58 58
 import java.util.regex.Pattern;
59 59
 
60
-import lombok.extern.slf4j.Slf4j;
61
-
62 60
 import org.jivesoftware.smack.Chat;
63 61
 import org.jivesoftware.smack.ChatManagerListener;
64 62
 import org.jivesoftware.smack.ConnectionConfiguration;
@@ -76,6 +74,7 @@ import org.jivesoftware.smackx.ChatState;
76 74
 import org.jivesoftware.smackx.ChatStateListener;
77 75
 import org.jivesoftware.smackx.ChatStateManager;
78 76
 import org.jivesoftware.smackx.muc.MultiUserChat;
77
+import org.slf4j.LoggerFactory;
79 78
 
80 79
 /**
81 80
  * A parser which can understand the XMPP protocol.
@@ -84,9 +83,10 @@ import org.jivesoftware.smackx.muc.MultiUserChat;
84 83
     XmppClientInfo.class, XmppLocalClientInfo.class, XmppFakeChannel.class,
85 84
     XmppChannelClientInfo.class
86 85
 })
87
-@Slf4j
88 86
 public class XmppParser extends BaseSocketAwareParser {
89 87
 
88
+    private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(XmppParser.class);
89
+
90 90
     /** Pattern to use to extract priority. */
91 91
     private static final Pattern PRIORITY_PATTERN
92 92
             = Pattern.compile("(?i)(?:^|&)priority=([0-9]+)(?:$|&)");
@@ -130,7 +130,7 @@ public class XmppParser extends BaseSocketAwareParser {
130 130
             priority = matcher.find() ? Integer.parseInt(matcher.group(1)) : 0;
131 131
         }
132 132
 
133
-         log.debug("XMPP parser created with query string {}, parsed fake channel = {}, priority = {}",
133
+         LOG.debug("XMPP parser created with query string {}, parsed fake channel = {}, priority = {}",
134 134
                  new Object[] { address.getQuery(), useFakeChannel, priority });
135 135
     }
136 136
 
@@ -397,7 +397,7 @@ public class XmppParser extends BaseSocketAwareParser {
397 397
     @Override
398 398
     public void sendMessage(final String target, final String message) {
399 399
         if (!chats.containsKey(target)) {
400
-            log.debug("Creating new chat for {}", target);
400
+            LOG.debug("Creating new chat for {}", target);
401 401
             chats.put(target, connection.getChatManager().createChat(target, new MessageListenerImpl()));
402 402
         }
403 403
 
@@ -511,7 +511,7 @@ public class XmppParser extends BaseSocketAwareParser {
511 511
                 }
512 512
             }
513 513
         } catch (XMPPException ex) {
514
-            log.debug("Go an XMPP exception", ex);
514
+            LOG.debug("Go an XMPP exception", ex);
515 515
 
516 516
             connection = null;
517 517
 
@@ -536,7 +536,7 @@ public class XmppParser extends BaseSocketAwareParser {
536 536
      * @param isBack True if the client is coming back, false if they're going away
537 537
      */
538 538
     public void handleAwayStateChange(final XmppClientInfo client, final boolean isBack) {
539
-        log.debug("Handling away state change for {} to {}", client.getNickname(), isBack);
539
+        LOG.debug("Handling away state change for {} to {}", client.getNickname(), isBack);
540 540
 
541 541
         if (useFakeChannel) {
542 542
             getCallback(OtherAwayStateListener.class)
@@ -573,7 +573,7 @@ public class XmppParser extends BaseSocketAwareParser {
573 573
     /** {@inheritDoc} */
574 574
     @Override
575 575
     public void setCompositionState(final String host, final CompositionState state) {
576
-        log.debug("Setting composition state for {} to {}", host, state);
576
+        LOG.debug("Setting composition state for {} to {}", host, state);
577 577
 
578 578
         final Chat chat = chats.get(parseHostmask(host)[0]);
579 579
 
@@ -597,7 +597,7 @@ public class XmppParser extends BaseSocketAwareParser {
597 597
                 stateManager.setCurrentState(newState, chat);
598 598
             } catch (XMPPException ex) {
599 599
                 // Can't set chat state... Oh well?
600
-                log.info("Couldn't set composition state", ex);
600
+                LOG.info("Couldn't set composition state", ex);
601 601
             }
602 602
         }
603 603
     }

+ 7
- 3
src/com/dmdirc/addons/relaybot/RelayBotPlugin.java View File

@@ -51,12 +51,9 @@ import java.util.HashMap;
51 51
 import java.util.Map;
52 52
 import java.util.concurrent.Callable;
53 53
 
54
-import lombok.RequiredArgsConstructor;
55
-
56 54
 /**
57 55
  * This plugin makes certain relay bots less obnoxious looking.
58 56
  */
59
-@RequiredArgsConstructor
60 57
 public class RelayBotPlugin extends BasePlugin implements ActionListener, ConfigChangeListener {
61 58
 
62 59
     /** Known RelayChannelHandlers. */
@@ -68,6 +65,13 @@ public class RelayBotPlugin extends BasePlugin implements ActionListener, Config
68 65
     /** The controller to read/write settings with. */
69 66
     private final IdentityController identityController;
70 67
 
68
+    public RelayBotPlugin(final PluginInfo pluginInfo, final ServerManager serverManager,
69
+            final IdentityController identityController) {
70
+        this.pluginInfo = pluginInfo;
71
+        this.serverManager = serverManager;
72
+        this.identityController = identityController;
73
+    }
74
+
71 75
     /** {@inheritDoc} */
72 76
     @Override
73 77
     public void onLoad() {

Loading…
Cancel
Save