KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > util > license > License


1 package org.sapia.util.license;
2
3 import java.io.IOException JavaDoc;
4 import java.io.Serializable JavaDoc;
5
6 /**
7  * This interface specifies the basic behavior of all licenses.
8  *
9  * @author Yanick Duchesne
10  *
11  * <dl>
12  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2004 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
13  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
14  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
15  * </dl>
16  */

17 public interface License extends Serializable JavaDoc{
18   
19   /**
20    * Returns if this license is valid or not. This method takes an
21    * arbitratry context object that can be passed in by client applications.
22    * This has been thought in cases where license validity may depend on
23    * external parameters (max connected users, etc.).
24    * <p>
25    * This requires client apps to know about the concrete type of licenses
26    * they deal with.
27    *
28    * @return <code>true</code> if this license is valid.
29    * @param an arbitraty context <code>Object</code>.
30    */

31   public boolean isValid(Object JavaDoc context);
32   
33   /**
34    * This method is called by application code on the client-side
35    * to activate this license. This method should only be called once in
36    * a given license's lifecycle.
37    * <p>
38    * An object holding arbitrary contextual data can be passed in. This
39    * requires client apps to know abou the concrete type of licenses
40    * that deal with.
41    *
42    * @param an arbitraty context <code>Object</code>.
43    */

44   public void activate(Object JavaDoc context);
45   
46   /**
47    * @return the byte representation of this license; these bytes will
48    * be signed, so the representation must be constant.
49    *
50    * @throws IOException if a problem occurs generating the bytes for
51    * this instance.
52    */

53   public byte[] getBytes() throws IOException JavaDoc;
54
55 }
56
Popular Tags