Resolve OSGi wiring issue in TL1

Change-Id: Ic749d0739e2faa0fc913dbffa78c38af56142834
diff --git a/providers/tl1/device/src/main/java/org/onosproject/tl1/device/Tl1DeviceConfig.java b/providers/tl1/device/src/main/java/org/onosproject/tl1/device/Tl1DeviceConfig.java
new file mode 100644
index 0000000..4a7fd7a
--- /dev/null
+++ b/providers/tl1/device/src/main/java/org/onosproject/tl1/device/Tl1DeviceConfig.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2015-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.tl1.device;
+
+import com.google.common.annotations.Beta;
+import org.apache.commons.lang3.tuple.Pair;
+import org.onlab.packet.IpAddress;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.config.Config;
+
+/**
+ * Configuration to push devices to the TL1 provider.
+ */
+@Beta
+public class Tl1DeviceConfig extends Config<DeviceId> {
+
+    /**
+     * TL1 provider scheme and ConfigKey.
+     */
+    public static final String TL1 = "tl1";
+
+    private static final String IP = "ip";
+    private static final String PORT = "port";
+    private static final String USERNAME = "username";
+    private static final String PASSWORD = "password";
+
+    @Override
+    public boolean isValid() {
+        return hasOnlyFields(IP, PORT, USERNAME, PASSWORD) &&
+                ip() != null;
+    }
+
+    /**
+     * Gets the Ip of the TL1 device.
+     *
+     * @return ip
+     */
+    public IpAddress ip() {
+        return IpAddress.valueOf(get(IP, extractIpPort().getKey()));
+    }
+
+    /**
+     * Gets the port of the TL1 device.
+     *
+     * @return port
+     */
+    public int port() {
+        return get(PORT, extractIpPort().getValue());
+    }
+
+    /**
+     * Gets the username of the TL1 device.
+     *
+     * @return username
+     */
+    public String username() {
+        return get(USERNAME, "");
+    }
+
+    /**
+     * Gets the password of the TL1 device.
+     *
+     * @return password
+     */
+    public String password() {
+        return get(PASSWORD, "");
+    }
+
+
+    private Pair<String, Integer> extractIpPort() {
+        String info = subject.toString();
+        if (info.startsWith(TL1)) {
+            //+1 is due to length of colon separator
+            String ip = info.substring(info.indexOf(":") + 1, info.lastIndexOf(":"));
+            int port = Integer.parseInt(info.substring(info.lastIndexOf(":") + 1));
+            return Pair.of(ip, port);
+        }
+        return null;
+    }
+}
\ No newline at end of file
diff --git a/providers/tl1/device/src/main/java/org/onosproject/tl1/device/package-info.java b/providers/tl1/device/src/main/java/org/onosproject/tl1/device/package-info.java
new file mode 100644
index 0000000..4e579ba
--- /dev/null
+++ b/providers/tl1/device/src/main/java/org/onosproject/tl1/device/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * TL1 device configuration.
+ */
+package org.onosproject.tl1.device;