View Javadoc

1   /*
2    * Copyright (c) 2004-2007 Creative Sphere Limited.
3    * All rights reserved. This program and the accompanying materials
4    * are made available under the terms of the Eclipse Public License v1.0
5    * which accompanies this distribution, and is available at
6    * http://www.eclipse.org/legal/epl-v10.html
7    *
8    * Contributors:
9    *
10   *   Creative Sphere - initial API and implementation
11   *
12   */
13  package org.abstracthorizon.mercury.common;
14  
15  import org.abstracthorizon.pasulj.PasuljInfo;
16  
17  /**
18   * Bean info for {@link SimpleStorageManager} class
19   *
20   * @author Daniel Sendula
21   */
22  public class SimpleStorageManagerBeanInfo extends PasuljInfo {
23  
24      /**
25       * Constructor
26       */
27      public SimpleStorageManagerBeanInfo() {
28          this(SimpleStorageManager.class);
29      }
30  
31      /**
32       * Constructor
33       * @param cls class
34       */
35      protected SimpleStorageManagerBeanInfo(Class<?> cls) {
36          super(cls);
37      }
38  
39      /**
40       * Init method
41       */
42      public void init() {
43          addProperty("mainDomain", "Main domain server is defined for");
44  
45          addProperty("propertiesFile", "File where properties - state of this bean is going to be loaded and saved", true, false);
46          addProperty("caseSensitive", "Defines if mailboxes and aliases are case sensitve", true, false);
47          addProperty("autosave", "Defines if changing properties will trigger automatic saving", true, false);
48  
49          addParameterDescriptions(
50                  addMethod("addDomain", "Adds new domain", String.class),
51                  "Domain name");
52          addParameterDescriptions(
53                  addMethod("removeDomain", "Removes existing domain", String.class),
54                  "Domain name");
55          addProperty("domains", "List of existing domains");
56          // addMethod("getDomains", "Returns an array of defined domains");
57          addParameterDescriptions(
58                  addMethod("hasDomain", "Returns if domain exists", String.class),
59                  "Domain name");
60  
61  
62          addParameterDescriptions(
63                  addMethod("addMailbox", "Adds new mailbox. Note: This is internal method", true, false, String.class, String.class),
64                  "Mailbox name in \"mailbox@domain format\"", "Store (probably in JavaMail URLName format)");
65          addParameterDescriptions(
66                  addMethod("removeMailbox", "Removes existing mailbox. Note: This is internal method", true, false, String.class, String.class),
67                  "Mailbox name", "Domain name");
68          // addMethod("getMailboxNames", "Returns a list of mailbox names");
69          addProperty("mailboxNames", "List of mailboxes");
70          addParameterDescriptions(
71                  addMethod("getMailboxNames", "Returns a list of mailbox names", String.class),
72                  "Domain name");
73  
74          addParameterDescriptions(
75                  addMethod("addAlias", "Adds new alias", String.class, String.class),
76                  "Source mailbox (in mailbox@domain format)", "Destination mailbox (in mailbox@domain format");
77          addParameterDescriptions(
78                  addMethod("removeAlias", "Removes existing alias", String.class),
79                  "Alias mailbox (in mailbox@domain format)");
80          addProperty("aliases", "List of alias mailboxes");
81          // addMethod("getAliases", "Returns a list of alias mailboxes");
82  
83  
84          addMethod("load", "Loads the state of the bean", true, false);
85          addMethod("save", "Saves the state of the bean", true, false);
86  
87      }
88  
89  }