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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * Copyright (c) 2006-2014 DMDirc Developers
  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 item.
  33. *
  34. * @return A group containing or equal to this item
  35. */
  36. ServerGroup getGroup();
  37. /**
  38. * Retrieves the name of this item.
  39. *
  40. * @return A string containing this item's name
  41. */
  42. String getName();
  43. /**
  44. * Sets the name of this group.
  45. *
  46. * @param name The new name for the group
  47. */
  48. void setName(final String name);
  49. /**
  50. * Retrieves the path and name of this item in textual format.
  51. *
  52. * @return A string containing the items path and name
  53. */
  54. String getPath();
  55. /**
  56. * Initiates a connection attempt for this item.
  57. */
  58. void connect();
  59. /**
  60. * Retrieves a URI for this item.
  61. *
  62. * @return A URI that represents this item or one of its children, or null if the item has no
  63. * URIs associated with it.
  64. */
  65. URI getAddress();
  66. /**
  67. * Determines whether this item has been modified since the last time
  68. * {@link #setModified(boolean)} was called with a
  69. * <code>false</code> argument (or since this item was created).
  70. *
  71. * @return True if the item has been modified, false otherwise
  72. */
  73. boolean isModified();
  74. /**
  75. * Sets the modified status of this item.
  76. *
  77. * @param isModified The new status of the 'modified' property of this item
  78. */
  79. void setModified(final boolean isModified);
  80. /**
  81. * Retrieves the name of the profile which should be used when connecting to this item.
  82. *
  83. * @return The profile name used by this entry, or <code>null</code> if the default or parent
  84. * group's profile should be used
  85. */
  86. String getProfile();
  87. /**
  88. * Sets the profile to be used for this server entry.
  89. *
  90. * @param profile The new profile name for this entry, or <code>null</code> if the default or
  91. * parent group's profile should be used
  92. */
  93. void setProfile(final String profile);
  94. }