Мои интенсивные мысли - это что -то вроде этого < /p>
Код: Выделить всё
multiversion-sdk/
├── build.gradle
├── settings.gradle
├── README.md
├── sdk-common/
│ ├── build.gradle
│ └── src/main/java/com/emc/server/
│ ├── ServerClient.java
│ ├── ApiProvider.java
Реализация провайдера API < /p>
public class ApiProvider {
private final Map implementationClass = Class.forName(implementationClassName);
Constructor constructor = implementationClass.getConstructor(ApiClient.class);
return (T) constructor.newInstance(this.apiClient);
} catch (Exception exception) {
throw new RuntimeException("Failed to create API implementation", exception);
}
}
}
< /code>
Основное использование проекта < /p>
// Create client in the Hyperion project.
// we can either pass the version directly or just pass the credentials and let the lib do a common api call to get the version first and then build the Apiclient accordingly
IsilonClient client = new IsilonClient(
"https://isilon:8080",
"admin",
"password",
"9.3.0" // Will use 9.2.1
);
// Use APIs
SnapshotApi snapshotApi = client.api(SnapshotApi.class);
snapshotApi.createSnapshot(params);
Подробнее здесь: https://stackoverflow.com/questions/796 ... the-api-ve