Permalink
Browse files

Initial beta of the monitor

  • Loading branch information...
1 parent 126bd3b commit b849cc54b4b05bcfd10b4f603a4d7ae209abdbfa @trondn trondn committed Nov 6, 2011
Showing with 1,016 additions and 0 deletions.
  1. +7 −0 .classpath
  2. +33 −0 .project
  3. +5 −0 .settings/org.eclipse.jdt.core.prefs
  4. +29 −0 AndroidManifest.xml
  5. BIN ic_launcher_logo-web.png
  6. BIN ic_launcher_logo_green-web.png
  7. +36 −0 proguard.cfg
  8. +11 −0 project.properties
  9. BIN res/drawable-hdpi-v11/ic_stat_looking_bad.png
  10. BIN res/drawable-hdpi-v11/ic_stat_looking_good.png
  11. BIN res/drawable-hdpi-v11/ic_stat_update_error.png
  12. BIN res/drawable-hdpi-v9/ic_stat_looking_bad.png
  13. BIN res/drawable-hdpi-v9/ic_stat_looking_good.png
  14. BIN res/drawable-hdpi-v9/ic_stat_update_error.png
  15. BIN res/drawable-hdpi/ic_launcher_logo.png
  16. BIN res/drawable-hdpi/ic_launcher_logo_green.png
  17. BIN res/drawable-hdpi/ic_stat_looking_bad.png
  18. BIN res/drawable-hdpi/ic_stat_looking_good.png
  19. BIN res/drawable-hdpi/ic_stat_update_error.png
  20. BIN res/drawable-hdpi/icon.png
  21. BIN res/drawable-ldpi-v11/ic_stat_looking_bad.png
  22. BIN res/drawable-ldpi-v11/ic_stat_looking_good.png
  23. BIN res/drawable-ldpi-v11/ic_stat_update_error.png
  24. BIN res/drawable-ldpi-v9/ic_stat_looking_bad.png
  25. BIN res/drawable-ldpi-v9/ic_stat_looking_good.png
  26. BIN res/drawable-ldpi-v9/ic_stat_update_error.png
  27. BIN res/drawable-ldpi/ic_launcher_logo.png
  28. BIN res/drawable-ldpi/ic_launcher_logo_green.png
  29. BIN res/drawable-ldpi/ic_stat_looking_bad.png
  30. BIN res/drawable-ldpi/ic_stat_looking_good.png
  31. BIN res/drawable-ldpi/ic_stat_update_error.png
  32. BIN res/drawable-ldpi/icon.png
  33. BIN res/drawable-mdpi-v11/ic_stat_looking_bad.png
  34. BIN res/drawable-mdpi-v11/ic_stat_looking_good.png
  35. BIN res/drawable-mdpi-v11/ic_stat_update_error.png
  36. BIN res/drawable-mdpi-v9/ic_stat_looking_bad.png
  37. BIN res/drawable-mdpi-v9/ic_stat_looking_good.png
  38. BIN res/drawable-mdpi-v9/ic_stat_update_error.png
  39. BIN res/drawable-mdpi/ic_launcher_logo.png
  40. BIN res/drawable-mdpi/ic_launcher_logo_green.png
  41. BIN res/drawable-mdpi/ic_stat_looking_bad.png
  42. BIN res/drawable-mdpi/ic_stat_looking_good.png
  43. BIN res/drawable-mdpi/ic_stat_update_error.png
  44. BIN res/drawable-mdpi/icon.png
  45. BIN res/drawable-xhdpi-v11/ic_stat_looking_bad.png
  46. BIN res/drawable-xhdpi-v11/ic_stat_looking_good.png
  47. BIN res/drawable-xhdpi-v11/ic_stat_update_error.png
  48. BIN res/drawable-xhdpi-v9/ic_stat_looking_bad.png
  49. BIN res/drawable-xhdpi-v9/ic_stat_looking_good.png
  50. BIN res/drawable-xhdpi-v9/ic_stat_update_error.png
  51. BIN res/drawable-xhdpi/ic_launcher_logo.png
  52. BIN res/drawable-xhdpi/ic_launcher_logo_green.png
  53. BIN res/drawable-xhdpi/ic_stat_looking_bad.png
  54. BIN res/drawable-xhdpi/ic_stat_looking_good.png
  55. BIN res/drawable-xhdpi/ic_stat_update_error.png
  56. +60 −0 res/layout-land/main.xml
  57. +62 −0 res/layout/main.xml
  58. +4 −0 res/menu/options_menu.xml
  59. +8 −0 res/values/strings.xml
  60. +241 −0 src/org/couchbase/health/CouchbaseActivity.java
  61. +158 −0 src/org/couchbase/health/PoolHealthReader.java
  62. +20 −0 src/org/couchbase/health/State.java
  63. +244 −0 src/org/couchbase/health/StateMonitorService.java
  64. +98 −0 src/org/couchbase/health/WebSpider.java
View
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry kind="output" path="bin/classes"/>
+</classpath>
View
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>CouchbaseMonitor</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,5 @@
+#Tue Oct 18 07:17:39 PDT 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5
View
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="org.couchbase.health"
+ android:versionCode="1"
+ android:versionName="1.0" >
+
+ <uses-sdk android:minSdkVersion="8" />
+
+ <uses-permission android:name="android.permission.INTERNET" />
+
+ <application
+ android:icon="@drawable/ic_launcher_logo"
+ android:label="@string/app_name" >
+ <service
+ android:enabled="true"
+ android:name=".StateMonitorService" />
+
+ <activity
+ android:label="@string/app_name"
+ android:name=".CouchbaseActivity" >
+ <intent-filter >
+ <action android:name="android.intent.action.MAIN" />
+
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+
+</manifest>
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -0,0 +1,36 @@
+-optimizationpasses 5
+-dontusemixedcaseclassnames
+-dontskipnonpubliclibraryclasses
+-dontpreverify
+-verbose
+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
+
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+-keep public class * extends android.app.backup.BackupAgentHelper
+-keep public class * extends android.preference.Preference
+-keep public class com.android.vending.licensing.ILicensingService
+
+-keepclasseswithmembernames class * {
+ native <methods>;
+}
+
+-keepclasseswithmembernames class * {
+ public <init>(android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembernames class * {
+ public <init>(android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclassmembers enum * {
+ public static **[] values();
+ public static ** valueOf(java.lang.String);
+}
+
+-keep class * implements android.os.Parcelable {
+ public static final android.os.Parcelable$Creator *;
+}
View
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-8
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
View
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
View
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+
+ <TextView
+ android:id="@+id/servername_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_x="0dp"
+ android:layout_y="4dp"
+ android:text="@string/servername"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
+
+ <ImageView
+ android:id="@+id/widget_logo"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:layout_centerVertical="true"
+ android:src="@drawable/ic_launcher_logo" />
+
+ <EditText
+ android:id="@+id/servername_field"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:layout_toLeftOf="@+id/save_button"
+ android:layout_toRightOf="@+id/servername_label" />
+
+ <TextView
+ android:id="@+id/poll_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/servername_field"
+ android:layout_toLeftOf="@+id/servername_field"
+ android:text="@string/poll_interval"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
+
+ <EditText
+ android:id="@+id/poll_field"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignLeft="@+id/servername_field"
+ android:layout_alignRight="@+id/servername_field"
+ android:layout_alignTop="@+id/poll_label"
+ android:inputType="number" >
+
+ <requestFocus />
+ </EditText>
+
+ <Button
+ android:id="@+id/save_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_below="@+id/servername_label"
+ android:text="@string/save" />
+
+</RelativeLayout>
View
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+
+ <TextView
+ android:id="@+id/servername_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_x="0dp"
+ android:layout_y="4dp"
+ android:text="@string/servername"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
+
+ <EditText
+ android:id="@+id/servername_field"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentRight="true"
+ android:layout_below="@+id/servername_label" >
+
+ <requestFocus />
+ </EditText>
+
+ <ImageView
+ android:id="@+id/widget_logo"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:layout_centerVertical="true"
+ android:src="@drawable/ic_launcher_logo" />
+
+ <TextView
+ android:id="@+id/poll_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_below="@+id/servername_field"
+ android:text="@string/poll_interval"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
+
+ <EditText
+ android:id="@+id/poll_field"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentRight="true"
+ android:layout_below="@+id/poll_label"
+ android:inputType="number" />
+
+ <Button
+ android:id="@+id/save_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentRight="true"
+ android:layout_below="@+id/poll_field"
+ android:text="@string/save" />
+
+
+</RelativeLayout>
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@+id/exit" android:title="@string/exit"/>
+</menu>
View
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">Couchbase monitor</string>
+ <string name="exit">Exit</string>
+ <string name="save">Save</string>
+ <string name="servername">Server name</string>
+ <string name="poll_interval">Poll interval</string>
+</resources>
Oops, something went wrong.

0 comments on commit b849cc5

Please sign in to comment.