-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #872 from eclipse-passage/575166
Bug 575166 License Agreement management: license issuing
- Loading branch information
Showing
3 changed files
with
99 additions
and
33 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
31 changes: 31 additions & 0 deletions
31
...lipse.passage.loc.api/src/org/eclipse/passage/loc/internal/equinox/AgreementsService.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,31 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021 ArSysOp | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0/. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.passage.loc.internal.equinox; | ||
|
||
import java.util.Optional; | ||
|
||
import org.eclipse.passage.lic.api.LicensingException; | ||
import org.eclipse.passage.loc.internal.api.workspace.Agreements; | ||
|
||
public final class AgreementsService { | ||
|
||
public Agreements get() throws LicensingException { | ||
Optional<Agreements> service = new OperatorGearAware() | ||
.withGear(gear -> Optional.of(gear.workspace().agreements())); | ||
if (!service.isPresent()) { | ||
throw new LicensingException("There is no Agreements service supplied by Operator Workspace"); //$NON-NLS-1$ | ||
} | ||
return service.get(); | ||
} | ||
|
||
} |
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