1 /** 2 * 2007, Digitalis Informatica. All rights reserved. Distribuicao e Gestao de Informatica, Lda. Estrada de Paco de Arcos 3 * num.9 - Piso -1 2780-666 Paco de Arcos Telefone: (351) 21 4408990 Fax: (351) 21 4408999 http://www.digitalis.pt 4 */ 5 6 package pt.digitalis.dif.dem.objects; 7 8 import java.util.Date; 9 10 /** 11 * @author Pedro Viegas <a href="mailto:pviegas@digitalis.pt">pviegas@digitalis.pt</a><br/> 12 * @created Nov 1, 2007 13 */ 14 public interface ILicense { 15 16 /** 17 * Generates full version key 18 * 19 * @param client 20 * the client name to the key association 21 * @param entity 22 * the entity to register 23 * @param date 24 * date to use in the encryption 25 * @param edition 26 * The edition type 27 * @return the generated full version key 28 */ 29 public String generateKey(String client, String entity, String date, LicenseEditionType edition); 30 31 /** 32 * Returns the License Edition 33 * 34 * @return {@link LicenseEditionType} 35 */ 36 public LicenseEditionType getEdition(); 37 38 /** 39 * Checks if the current license has expired 40 * 41 * @return The expiration date, or null it it is a final license 42 */ 43 public Date getExpirationDate(); 44 45 /** 46 * @return the key 47 */ 48 public String getKey(); 49 50 /** 51 * @return the name 52 */ 53 public String getName(); 54 55 /** 56 * Checks if the current license has an expiration date 57 * 58 * @return T if it has 59 */ 60 public boolean hasExpirationDate(); 61 62 /** 63 * Checks if the current license has expired 64 * 65 * @return T if the expiration date has passed 66 */ 67 public boolean hasExpired(); 68 69 /** 70 * Checks if it is registered 71 * 72 * @return T if the key exists and is correct 73 */ 74 public boolean isRegistered(); 75 76 /** 77 * Checks if the element is registrable 78 * 79 * @return T if it is registrable 80 */ 81 public boolean isRegistrable(); 82 83 /** 84 * Create the registration 85 * 86 * @param key 87 * the key to register 88 * @param entityId 89 * @return the registered record 90 */ 91 public boolean register(String key, String entityId); 92 93 /** 94 * @param name 95 * the name to set 96 */ 97 public void setName(String name); 98 99 /** 100 * Sets the registrability of this element 101 * 102 * @param registrable 103 * the registrability to set 104 */ 105 public void setRegistrable(boolean registrable); 106 107 /** 108 * Delete the registration 109 */ 110 public void unregister(); 111 }