-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CODENVY-502 allow to create factories object by providing a pluggable…
… mechanism based on url parameters Change-Id: I0c9554ac6d767e110f9bc39c30e2fb2712ad413f Signed-off-by: Florent BENOIT <fbenoit@codenvy.com>
- Loading branch information
Showing
8 changed files
with
533 additions
and
85 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
46 changes: 46 additions & 0 deletions
46
...i-factory/src/main/java/org/eclipse/che/api/factory/server/FactoryParametersResolver.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,46 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2012-2016 Codenvy, S.A. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Codenvy, S.A. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.che.api.factory.server; | ||
|
||
import org.eclipse.che.api.core.BadRequestException; | ||
import org.eclipse.che.api.factory.shared.dto.Factory; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import java.util.Map; | ||
|
||
/** | ||
* Defines a resolver that will produce factories for some parameters | ||
* | ||
* @author Florent Benoit | ||
*/ | ||
public interface FactoryParametersResolver { | ||
|
||
/** | ||
* Resolver acceptance based on the given parameters. | ||
* | ||
* @param factoryParameters | ||
* map of parameters dedicated to factories | ||
* @return true if it will be accepted by the resolver implementation or false if it is not accepted | ||
*/ | ||
boolean accept(@NotNull Map<String, String> factoryParameters); | ||
|
||
/** | ||
* Create factory object based on provided parameters | ||
* | ||
* @param factoryParameters | ||
* map containing factory data parameters provided through URL | ||
* @throws BadRequestException | ||
* when data are invalid | ||
*/ | ||
Factory createFactory(@NotNull Map<String, String> factoryParameters) throws BadRequestException; | ||
|
||
|
||
} |
Oops, something went wrong.