Skip to content

Commit

Permalink
Merge pull request #47 from eparovyshnaya/547289-6
Browse files Browse the repository at this point in the history
547289 Provide javadoc for org.eclipse.passage.lic.api package
  • Loading branch information
ruspl-afed authored Nov 8, 2019
2 parents da04c81 + b3cd995 commit d0f59c8
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,26 @@
package org.eclipse.passage.lic.api;

/**
* Runtime descriptor for the configuration being examined for restrictions.
* <p>
* It represents the pair <code>{id, version</code>} for the running product.
* </p>
* <p>Runtime descriptor for the configuration being examined for restrictions.</p>
*
* <p>Represents the pair <code>{id, version}</code> for the running product. </p>
*
* @since 0.4.0
*/
public interface LicensingConfiguration {

/**
* Id of the running product
*
* @since 0.4.0
*/
String getProductIdentifier();

/**
* Precise version of the running product
*
* @since 0.4.0
*/
String getProductVersion();

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
package org.eclipse.passage.lic.api;

/**
*
* Codes of licensing events
*
* @since 0.4.0
*/
public final class LicensingEvents {
Expand All @@ -21,25 +24,43 @@ public final class LicensingEvents {
public static final String PROPERTY_SOURCE = "org.eclipse.passage.lic.api.event.source"; //$NON-NLS-1$
public static final String PROPERTY_DATA = "org.eclipse.passage.lic.api.event.data"; //$NON-NLS-1$
public static final String PROPERTY_MESSAGE = "org.eclipse.passage.lic.api.event.message"; //$NON-NLS-1$

private LicensingEvents() {
// block
}

/**
* Segment for events of type <code>create</code>
*
* @since 0.4.0
*/
public static final String CREATE = "create"; //$NON-NLS-1$

/**
* Segment for events of type <code>read</code>
*
* @since 0.4.0
*/
public static final String READ = "read"; //$NON-NLS-1$

/**
* Segment for events of type <code>update</code>
*
* @since 0.4.0
*/
public static final String UPDATE = "update"; //$NON-NLS-1$

/**
* Segment for events of type <code>delete</code>
*
* @since 0.4.0
*/
public static final String DELETE = "delete"; //$NON-NLS-1$

/**
* Topic separator character
*
* @since 0.4.0
*/
public static final String TOPIC_SEP = "/"; //$NON-NLS-1$

Expand All @@ -50,11 +71,11 @@ public final class LicensingEvents {

/**
* Base name of all Licensing events
*
* @since 0.4.0
*/
public static final String TOPIC_BASE = "org/eclipse/passage/lic/api"; //$NON-NLS-1$

private LicensingEvents() {
// block
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,29 @@
package org.eclipse.passage.lic.api;

/**
* A checked exception representing a failure.
* <p>
* Licensing exceptions contain a result object describing the cause of the
* exception.
* </p>
* <p>A checked exception representing a failure.</p>
* <p> Licensing exceptions contain a result object describing the cause of the exception. </p>
*
* @since 0.4.0
* @see LicensingResult
* @since 0.4.0
*/
public class LicensingException extends Exception {

private static final long serialVersionUID = 1L;

private LicensingResult diagnostic;

/**
* @since 0.4.0
*/
public LicensingException(LicensingResult result) {
super(result.getMessage(), result.getException());
this.diagnostic = result;
}

/**
* @since 0.4.0
*/
public final LicensingResult getResult() {
return diagnostic;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,23 @@ public interface LicensingReporter {
* Log the result
*
* @param result
* @since 0.4.0
*/
void logResult(LicensingResult result);

/**
* Post the result (asynchronous delivery)
*
* @param result
* @since 0.4.0
*/
void postResult(LicensingResult result);

/**
* Send the result (synchronous delivery)
*
* @param result
* @since 0.4.0
*/
void sendResult(LicensingResult result);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,60 +22,82 @@ public interface LicensingResult {
/**
* The bit mask value <code>0x0</code> for a {@link #getSeverity severity}
* indicating the nominal case.
*
* @since 0.4.0
*/
int OK = 0x0;

/**
* The bit mask value <code>0x1</code> for a {@link #getSeverity severity}
* indicating the information.
*
* @since 0.4.0
*/
int INFO = 0x1;

/**
* The bit mask value <code>0x2</code> for a {@link #getSeverity severity}
* indicating the warning.
*
* @since 0.4.0
*/
int WARNING = 0x2;

/**
* The bit mask value <code>0x4</code> for a {@link #getSeverity severity}
* indicating the error.
*
* @since 0.4.0
*/
int ERROR = 0x4;

/**
* The bit mask value <code>0x8</code> for a {@link #getSeverity severity}
* indicating that the activity was canceled.
*
* @since 0.4.0
*/
int CANCEL = 0x8;

/**
* Returns an indicator of the severity of the problem.
*
* @since 0.4.0
*/
int getSeverity();

/**
* Returns a message describing the situation.
*
* @since 0.4.0
*/
String getMessage();

/**
* Returns the unique identifier of the source.
*
* @since 0.4.0
*/
String getSource();

/**
* Returns {@link #getSource source-specific} identity code.
*
* @since 0.4.0
*/
int getCode();

/**
* Returns the exception that caused this result, or <code>null</code> if none.
*
* @since 0.4.0
*/
Throwable getException();

/**
* Returns the keys for the attached data.
*
* @since 0.4.0
*/
Iterable<String> getAttachmentKeys();

Expand All @@ -85,11 +107,15 @@ public interface LicensingResult {
* @param key the key whose associated value is to be returned
* @return the attached object or <code>null</code> if none
* @see #getAttachmentKeys()
*
* @since 0.4.0
*/
Object getAttachment(String key);

/**
* Returns the list of child {@link LicensingResult licensing results}.
*
* @since 0.4.0
*/
Iterable<LicensingResult> getChildren();

Expand Down
Loading

0 comments on commit d0f59c8

Please sign in to comment.