You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ServerGroupItem.java 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5. * of this software and associated documentation files (the "Software"), to deal
  6. * in the Software without restriction, including without limitation the rights
  7. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. * copies of the Software, and to permit persons to whom the Software is
  9. * furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  20. * SOFTWARE.
  21. */
  22. package com.dmdirc.addons.serverlists;
  23. import java.net.URI;
  24. /**
  25. * An item which is included in a server group.
  26. *
  27. * @author chris
  28. * @since 0.6.4
  29. */
  30. public interface ServerGroupItem {
  31. /**
  32. * Retrieves a group that is either the same as this item, or contains this
  33. * item.
  34. *
  35. * @return A group containing or equal to this item
  36. */
  37. ServerGroup getGroup();
  38. /**
  39. * Retrieves the name of this item.
  40. *
  41. * @return A string containing this item's name
  42. */
  43. String getName();
  44. /**
  45. * Sets the name of this group.
  46. *
  47. * @param name The new name for the group
  48. */
  49. void setName(final String name);
  50. /**
  51. * Retrieves the path and name of this item in textual format.
  52. *
  53. * @return A string containing the items path and name
  54. */
  55. String getPath();
  56. /**
  57. * Initiates a connection attempt for this item.
  58. */
  59. void connect();
  60. /**
  61. * Retrieves a URI for this item.
  62. *
  63. * @return A URI that represents this item or one of its children, or null
  64. * if the item has no URIs associated with it.
  65. */
  66. URI getAddress();
  67. /**
  68. * Determines whether this item has been modified since the last time
  69. * {@link #setModified(boolean)} was called with a <code>false</code>
  70. * argument (or since this item was created).
  71. *
  72. * @return True if the item has been modified, false otherwise
  73. */
  74. boolean isModified();
  75. /**
  76. * Sets the modified status of this item.
  77. *
  78. * @param isModified The new status of the 'modified' property of this item
  79. */
  80. void setModified(final boolean isModified);
  81. /**
  82. * Retrieves the name of the profile which should be used when connecting
  83. * to this item.
  84. *
  85. * @return The profile name used by this entry, or <code>null</code> if the
  86. * default or parent group's profile should be used
  87. */
  88. String getProfile();
  89. /**
  90. * Sets the profile to be used for this server entry.
  91. *
  92. * @param profile The new profile name for this entry, or <code>null</code>
  93. * if the default or parent group's profile should be used
  94. */
  95. void setProfile(final String profile);
  96. }