Interface LicenseDescriptor
public interface LicenseDescriptor
{
// Fields
public static final int ARCHIVE;
public static final int CLASS;
public static final int DESIGN;
public static final int PACKAGE;
public static final int RUNTIME;
// Methods
public java.util.Date getDate();
public String getKey();
public String getName();
public java.net.URL getServer();
public int getStyle();
public int getType();
public String getUser();
public void setDate(java.util.Date date);
public void setKey(String key);
public void setName(String name);
public void setServer(java.net.URL server);
public void setStyle(int style) throws Exception;
public void setType(int type) throws Exception;
public void setUser(String user);
}
This interface describes the signature of a license object. The descriptor allows access to the different fields of a license.
public java.util.Date getDate();
Retrieves the expiration date of the license.
Return Value:
Returns the expiration date. If the returned date is null, the license does not have an expiration.
See Also: setDate
public String getKey();
Retrieves the license string that is used for validation of the license.
Return Value:
Returns the license string to validate.
See Also: setKey
public String getName();
Retrieves the name of the class, package, or archive licensed by the license file.
Return Value:
Returns the name of the class, package, or archive.
See Also: setName
public java.net.URL getServer();
Retrieves the server where the true license file is stored for this object.
Return Value:
Returns the URL location of the server.
See Also: setServer
public int getStyle();
Retrieves the license style. By default, all licenses are design time licenses. However, a user can have a run-time only license.
Return Value:
Returns the style of license, either DESIGN or RUNTIME.
See Also: setStyle
public int getType();
Retrieves the type of license from the descriptor object.
Return Value:
Returns the type of license. This may be one of the following:
See Also: setType
public String getUser();
Retrieves the user that is able to use the license.
Return Value:
Returns the username.
See Also: setUser
public void setDate(java.util.Date date);
Sets the expiration date in the license descriptor.
Return Value:
No return value.
Parameter | Description |
date
| The expiration date.
|
See Also: getDate
public void setKey(String key);
Sets the license string that is used to validate the license.
Return Value:
No return value.
Parameter | Description |
key
| The license string.
|
See Also: getKey
public void setName(String name);
Sets the name of the class, package, or archive that is licensed by the license descriptor.
Return Value:
No return value.
Parameter | Description |
name
| The name of the class, package, or archive (CAB, JAR, and CCF formats are currently supported).
|
See Also: getName
public void setServer(java.net.URL server);
Sets the server attribute for the license descriptor.
Return Value:
No return value.
Parameter | Description |
server
| The URL location of the server to get a remote license from.
|
See Also: getServer
public void setStyle(int style) throws Exception;
Sets the license style. If style is zero, the method defaults to a design time license.
Return Value:
No return value.
Parameter | Description |
style
| The style of license. This may be either DESIGN or RUNTIME.
|
Exceptions:
Exception
if the style is invalid.
See Also: getStyle
public void setType(int type) throws Exception;
Sets the type of license.
Return Value:
No return value.
Parameter | Description |
type
| Sets the type of license. The type can be one of the following:
|
Exceptions:
Exception
if the license type is not valid.
See Also: getType
public void setUser(String user);
Sets the valid user for the license.
Return Value:
No return value.
Parameter | Description |
user
| The username.
|
See Also: getUser
- ARCHIVE
- The archive license type.
- CLASS
- The class license type. The CLASS type is the default type if none is specified in the license.xml file.
- DESIGN
- The design license style.
- PACKAGE
- The package license type.
- RUNTIME
- The run-time license style.