Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 565143 - [Passage] floating licensing
added tests for mining chain at all. Signed-off-by: Nikifor Fedorov <zelenyhleb@gmail.com>
- Loading branch information
1 parent
7f1429b
commit aa96429
Showing
29 changed files
with
232 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...es/org.eclipse.passage.lbc.api/src/org/eclipse/passage/lbc/internal/api/BoundLicense.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.eclipse.passage.lbc.internal.api; | ||
|
||
/** | ||
* Represents a license that was loaded to the floating server to be operated. | ||
* | ||
* @since 1.0 | ||
*/ | ||
public interface BoundLicense { | ||
|
||
// Condition identifier | ||
String identifier(); | ||
|
||
// Grant's capacity | ||
int capacity(); | ||
|
||
// How many times it was taken | ||
int taken(); | ||
|
||
// returns true if it is takeable and false if it is not. | ||
boolean takeable(); | ||
|
||
} |
26 changes: 0 additions & 26 deletions
26
.../org.eclipse.passage.lbc.api/src/org/eclipse/passage/lbc/internal/api/ReleaseRequest.java
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
...les/org.eclipse.passage.lbc.api/src/org/eclipse/passage/lbc/internal/api/TakeRequest.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...e.passage.lbc.base/src/org/eclipse/passage/lbc/internal/base/BaseServerConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package org.eclipse.passage.lbc.internal.base; | ||
|
||
import java.util.Collection; | ||
|
||
import org.eclipse.passage.lbc.internal.api.BackendServerConfiguration; | ||
import org.eclipse.passage.lic.internal.api.LicensedProduct; | ||
import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionTransport; | ||
import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionTransportRegistry; | ||
import org.eclipse.passage.lic.internal.api.conditions.mining.ContentType; | ||
import org.eclipse.passage.lic.internal.api.io.KeyKeeper; | ||
import org.eclipse.passage.lic.internal.api.io.KeyKeeperRegistry; | ||
import org.eclipse.passage.lic.internal.api.io.StreamCodec; | ||
import org.eclipse.passage.lic.internal.api.io.StreamCodecRegistry; | ||
import org.eclipse.passage.lic.internal.api.registry.Registry; | ||
import org.eclipse.passage.lic.internal.base.registry.ReadOnlyRegistry; | ||
|
||
/** | ||
* @since 1.0 | ||
*/ | ||
public class BaseServerConfiguration implements BackendServerConfiguration { | ||
|
||
private final Registry<LicensedProduct, StreamCodec> codecs; | ||
private final Registry<LicensedProduct, KeyKeeper> keys; | ||
private final Registry<ContentType, ConditionTransport> transports; | ||
|
||
public BaseServerConfiguration(Collection<StreamCodec> codecs, Collection<KeyKeeper> keys, | ||
Collection<ConditionTransport> transports) { | ||
this.codecs = new ReadOnlyRegistry<>(codecs); | ||
this.keys = new ReadOnlyRegistry<>(keys); | ||
this.transports = new ReadOnlyRegistry<>(transports); | ||
} | ||
|
||
@Override | ||
public StreamCodecRegistry codecs() { | ||
return () -> codecs; | ||
} | ||
|
||
@Override | ||
public KeyKeeperRegistry keyKeepers() { | ||
return () -> keys; | ||
} | ||
|
||
@Override | ||
public ConditionTransportRegistry transports() { | ||
return () -> transports; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.