選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

IdentityController.java 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * Copyright (c) 2006-2017 DMDirc Developers
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
  5. * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
  6. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
  7. * permit persons to whom the Software is furnished to do so, subject to the following conditions:
  8. *
  9. * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
  10. * Software.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  13. * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
  14. * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  15. * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  16. */
  17. package com.dmdirc.interfaces.config;
  18. import com.dmdirc.config.ConfigFileBackedConfigProvider;
  19. import com.dmdirc.config.provider.AggregateConfigProvider;
  20. import com.dmdirc.config.provider.ConfigProvider;
  21. import java.util.Collection;
  22. /**
  23. * Defines the interface implemented by the object in charge of DMDirc's identities.
  24. */
  25. public interface IdentityController {
  26. /**
  27. * Retrieves the identity used for addons defaults.
  28. *
  29. * @return The addons defaults identity
  30. */
  31. ConfigProvider getAddonSettings();
  32. /**
  33. * Retrieves the identity used for the global config.
  34. *
  35. * @return The global config identity
  36. */
  37. ConfigProvider getUserSettings();
  38. /**
  39. * Retrieves the global config manager.
  40. *
  41. * @return The global config manager
  42. */
  43. AggregateConfigProvider getGlobalConfiguration();
  44. /**
  45. * Retrieves the identity bundled with the DMDirc client containing version information.
  46. *
  47. * @return The version identity
  48. *
  49. * @since 0.6.3m2
  50. */
  51. ReadOnlyConfigProvider getVersionSettings();
  52. /**
  53. * Retrieves a list of identities that belong to the specified custom type.
  54. *
  55. * @param type The type of identity to search for
  56. *
  57. * @return A list of matching identities
  58. *
  59. * @since 0.6.4
  60. */
  61. Collection<ConfigProvider> getProvidersByType(String type);
  62. /**
  63. * Loads user-defined identity files.
  64. */
  65. void loadUserIdentities();
  66. /**
  67. * Loads the version information.
  68. */
  69. void loadVersionIdentity();
  70. /**
  71. * Adds the specific identity to this manager.
  72. *
  73. * @param identity The identity to be added
  74. */
  75. void addConfigProvider(final ConfigFileBackedConfigProvider identity);
  76. /**
  77. * Saves all modified identity files to disk.
  78. */
  79. void saveAll();
  80. /**
  81. * Removes an identity from this manager.
  82. *
  83. * @param identity The identity to be removed
  84. */
  85. void removeConfigProvider(final ConfigFileBackedConfigProvider identity);
  86. }