public final class MartiniMethods extends Object
Constructor and Description |
---|
MartiniMethods(io.toro.martini.ipackage.EndpointStateAttacher endpointStateAttacher,
PackageManager packageManager,
io.toro.martini.ipackage.MartiniPackageSerializer martiniPackageSerializer,
io.toro.martini.ipackage.MartiniPackageDependencyResolver martiniPackageDependencyResolver,
io.toro.martini.ipackage.MartiniPackageImportExportService martiniPackageImportExportService,
io.toro.martini.ipackage.PackageInfoService packageInfoService,
com.google.common.base.Converter<io.toro.martini.ipackage.PackageDescriptor,io.toro.gloop.object.property.GloopModel> packageDescriptorGloopModelConverter,
com.google.common.base.Converter<io.toro.martini.ipackage.PackageConfig,io.toro.gloop.object.property.GloopModel> packageConfigGloopModelConverter) |
Modifier and Type | Method and Description |
---|---|
static io.toro.gloop.object.property.GloopModel |
addPackage(io.toro.gloop.object.property.GloopModel martiniPackage,
String stateOnCreate,
boolean resolveParent)
Add a new package to the current instance using data from the provided package model.
|
static io.toro.gloop.object.property.GloopModel |
addPackage(String packageName,
String id,
String version,
String stateOnCreate,
boolean resolveParent)
Deprecated.
Prefer using
addPackage(GloopModel, String, boolean) . |
static void |
deleteEndpoint(String packageName,
String endpointName)
Delete the endpoint matching the provided name and package.
|
static void |
deletePackage(String packageName)
Delete the package matching the provided name.
|
static void |
disableEndpoint(String packageName,
String endpointName)
Disable the endpoint matching the provided name and package.
|
static void |
enableEndpoint(String packageName,
String endpointName)
Enable the endpoint matching the provided name and package.
|
static io.toro.gloop.object.property.GloopModel |
getChildPackages(String packageName)
Get the packages dependent on (child packages of) the package matching the provided name.
|
static io.toro.gloop.object.property.GloopModel |
getEndpoint(String packageName,
String endpointName)
Get the endpoint matching the provided name and package.
|
static io.toro.gloop.object.property.GloopModel |
getEndpoints(String packageName)
Get all the endpoints on the matching package.
|
static io.toro.gloop.object.property.GloopModel |
getPackage(String packageName)
Get the package matching the provided name, if it exists.
|
static io.toro.gloop.object.property.GloopModel |
getPackages()
Get all the packages installed on the current Martini instance.
|
static String |
getPackageXml(String packageName)
Get the XML descriptor of the package matching the provided name as a string.
|
static io.toro.gloop.object.property.GloopModel |
getParentPackages(String packageName)
Gets the dependencies of the package matching the provided name.
|
static MartiniPackage |
getRealPackage(String packageName)
Get the package matching the provided name, if it exists.
|
static io.toro.gloop.object.property.GloopModel |
importPackage(InputStream inputStream,
String stateOnCreate,
boolean resolveParent,
boolean replaceExisting)
Import the package from the provided stream.
|
static io.toro.gloop.object.property.GloopModel |
importPackage(Path path,
String stateOnCreate,
boolean resolveParent,
boolean replaceExisting)
Import the package from the provided path.
|
static void |
loadPackage(String packageName,
boolean resolveParent)
Load the package matching the provided name.
|
static io.toro.gloop.object.property.GloopModel |
packageConfigToGloopModel(MartiniPackage martiniPackage)
Fetch the configuration of the provided package, and then return it as a Gloop model.
|
static io.toro.gloop.object.property.GloopModel |
packageConfigToGloopModel(io.toro.martini.ipackage.PackageConfig packageConfig)
Return the provided package configuration as a Gloop model.
|
static void |
saveEndpoint(String packageName,
io.toro.gloop.object.property.GloopModel endpoint)
Save an endpoint to the package matching the provided name.
|
static void |
savePackage(io.toro.gloop.object.property.GloopModel martiniPackage)
Save a package using data from the provided package model.
|
static void |
startEndpoint(String packageName,
String endpointName)
Start the endpoint matching the provided name and package.
|
static void |
startPackage(String packageName)
Start the package matching the provided name.
|
static void |
stopEndpoint(String packageName,
String endpointName)
Stop the endpoint matching the provided name and package.
|
static void |
stopPackage(String packageName)
Stop the package matching the provided name.
|
static void |
unloadPackage(String packageName,
boolean resolveChild)
Unload the package matching the provided name.
|
static void |
validateEndpoint(String packageName,
io.toro.gloop.object.property.GloopModel endpoint)
Validate the endpoint of a package; throwing an exception if the endpoint turns out to be invalid.
|
@Autowired public MartiniMethods(io.toro.martini.ipackage.EndpointStateAttacher endpointStateAttacher, PackageManager packageManager, io.toro.martini.ipackage.MartiniPackageSerializer martiniPackageSerializer, io.toro.martini.ipackage.MartiniPackageDependencyResolver martiniPackageDependencyResolver, io.toro.martini.ipackage.MartiniPackageImportExportService martiniPackageImportExportService, io.toro.martini.ipackage.PackageInfoService packageInfoService, @Qualifier(value="packageDescriptorConverter") com.google.common.base.Converter<io.toro.martini.ipackage.PackageDescriptor,io.toro.gloop.object.property.GloopModel> packageDescriptorGloopModelConverter, @Qualifier(value="packageConfigConverter") com.google.common.base.Converter<io.toro.martini.ipackage.PackageConfig,io.toro.gloop.object.property.GloopModel> packageConfigGloopModelConverter)
@GloopObjectParameter(value="martiniPackages{\n martiniPackages#io.toro.martini.package.Package[]{\n }\n}") public static io.toro.gloop.object.property.GloopModel getPackages()
@GloopObjectParameter(value="martiniPackage{\n martiniPackage#io.toro.martini.package.Package{\n }\n}") public static io.toro.gloop.object.property.GloopModel getPackage(@GloopParameter(allowNull=false) String packageName)
packageName
- the name of the Martini packagepublic static MartiniPackage getRealPackage(@GloopParameter(allowNull=false) String packageName)
packageName
- the name of the Martini packagepublic static void loadPackage(@GloopParameter(allowNull=false) String packageName, @GloopParameter(defaultValue="true") boolean resolveParent) throws io.toro.martini.ipackage.exception.PackageLifeCycleException
packageName
- the name of the Martini packageresolveParent
- flag determining whether or not to also load the dependencies of the specified packageio.toro.martini.ipackage.exception.PackageLifeCycleException
public static void unloadPackage(@GloopParameter(allowNull=false) String packageName, @GloopParameter(defaultValue="true") boolean resolveChild) throws io.toro.martini.ipackage.exception.PackageLifeCycleException
packageName
- the name of the Martini packageresolveChild
- flag determining whether or not to also unload packages dependent on the specified packageio.toro.martini.ipackage.exception.PackageLifeCycleException
@Deprecated @GloopObjectParameter(value="martiniPackage{\n martiniPackage#io.toro.martini.package.Package{\n }\n}") public static io.toro.gloop.object.property.GloopModel addPackage(@GloopParameter(allowNull=false) String packageName, @GloopParameter(allowNull=false) String id, @GloopParameter(allowNull=false) String version, @GloopParameter(choices={"STARTED","LOADED","UNLOADED"},allowNull=false) String stateOnCreate, @GloopParameter(defaultValue="true") boolean resolveParent) throws io.toro.martini.ipackage.exception.PackageLifeCycleException
addPackage(GloopModel, String, boolean)
.packageName
- the name of the Martini packageid
- TORO Marketplace ID of the Martini packageversion
- version of the Martini packageio.toro.martini.ipackage.exception.PackageLifeCycleException
@GloopObjectParameter(value="martiniPackage{\n martiniPackage#io.toro.martini.package.Package{\n }\n}") public static io.toro.gloop.object.property.GloopModel addPackage(@GloopObjectParameter(value="martiniPackage#io.toro.martini.package.PackageDescriptor::false{\n}") io.toro.gloop.object.property.GloopModel martiniPackage, @GloopParameter(choices={"STARTED","LOADED","UNLOADED"},allowNull=false) String stateOnCreate, @GloopParameter(defaultValue="true") boolean resolveParent) throws io.toro.martini.ipackage.exception.PackageLifeCycleException
name
, id
, and version
.martiniPackage
- a model representing the package to be addedio.toro.martini.ipackage.exception.PackageLifeCycleException
public static void savePackage(@GloopObjectParameter(value="martiniPackage#io.toro.martini.package.Package::false{\n}") io.toro.gloop.object.property.GloopModel martiniPackage)
name
, id
, and version
.martiniPackage
- a model representing the package to be savedpublic static void deletePackage(@GloopParameter(allowNull=false) String packageName)
packageName
- the name of the Martini packagepublic static void startPackage(@GloopParameter(allowNull=false) String packageName) throws io.toro.martini.ipackage.exception.PackageLifeCycleException
packageName
- the name of the Martini packageio.toro.martini.ipackage.exception.PackageLifeCycleException
public static void stopPackage(@GloopParameter(allowNull=false) String packageName) throws io.toro.martini.ipackage.exception.PackageLifeCycleException
packageName
- the name of the Martini packageio.toro.martini.ipackage.exception.PackageLifeCycleException
@GloopObjectParameter(value="martiniPackages{\n martiniPackages#io.toro.martini.package.PackageDescriptor[]{\n }\n}") public static io.toro.gloop.object.property.GloopModel getChildPackages(@GloopParameter(allowNull=false) String packageName)
packageName
- the name of the Martini packagepublic static String getPackageXml(@GloopParameter(allowNull=false) String packageName)
packageName
- the name of the Martini package@GloopObjectParameter(value="martiniPackages{\n martiniPackages#io.toro.martini.package.PackageDescriptor[]{\n }\n}") public static io.toro.gloop.object.property.GloopModel getParentPackages(@GloopParameter(allowNull=false) String packageName)
packageName
- the name of the Martini package@GloopObjectParameter(value="martiniPackages{\n martiniPackages#io.toro.martini.package.Package[]{\n }\n}") public static io.toro.gloop.object.property.GloopModel importPackage(@GloopParameter(allowNull=false) Path path, @GloopParameter(choices={"STARTED","LOADED","UNLOADED"}) String stateOnCreate, @GloopParameter(defaultValue="true") boolean resolveParent, @GloopParameter(allowNull=false,defaultValue="false") boolean replaceExisting) throws IOException
path
- the path of the to-be-imported packagestateOnCreate
- the desired state of the package upon successful importreplaceExisting
- flag determining whether or not to replace an existing package of the same name, if anyIOException
@GloopObjectParameter(value="martiniPackages{\n martiniPackages#io.toro.martini.package.Package[]{\n }\n}") public static io.toro.gloop.object.property.GloopModel importPackage(@GloopParameter(allowNull=false) InputStream inputStream, @GloopParameter(choices={"STARTED","LOADED","UNLOADED"}) String stateOnCreate, @GloopParameter(defaultValue="true") boolean resolveParent, @GloopParameter(allowNull=false,defaultValue="false") boolean replaceExisting) throws IOException
inputStream
- the stream containing the to-be-imported packagestateOnCreate
- the desired state of the package upon successful importreplaceExisting
- flag determining whether or not to replace an existing package of the same name, if anyIOException
public static void validateEndpoint(@GloopParameter(allowNull=false) String packageName, @GloopObjectParameter(value="endpoint#io.toro.martini.package.Endpoint::false{\n}") io.toro.gloop.object.property.GloopModel endpoint)
packageName
- the name of the Martini package where the endpoint belongsendpoint
- name of endpointpublic static void saveEndpoint(@GloopParameter(allowNull=false) String packageName, @GloopObjectParameter(value="endpoint#io.toro.martini.package.Endpoint::false{\n}") io.toro.gloop.object.property.GloopModel endpoint)
packageName
- the name of the Martini package where the endpoint belongsendpoint
- name of endpointpublic static void startEndpoint(@GloopParameter(allowNull=false) String packageName, @GloopParameter(allowNull=false) String endpointName)
packageName
- the name of the Martini package where the endpoint belongsendpointName
- name of endpointpublic static void enableEndpoint(@GloopParameter(allowNull=false) String packageName, @GloopParameter(allowNull=false) String endpointName)
packageName
- the name of the Martini packageendpointName
- name of endpointpublic static void disableEndpoint(@GloopParameter(allowNull=false) String packageName, @GloopParameter(allowNull=false) String endpointName)
packageName
- the name of the Martini packageendpointName
- name of endpointpublic static void stopEndpoint(@GloopParameter(allowNull=false) String packageName, @GloopParameter(allowNull=false) String endpointName)
packageName
- the name of the Martini packageendpointName
- name of endpointpublic static void deleteEndpoint(@GloopParameter(allowNull=false) String packageName, @GloopParameter(allowNull=false) String endpointName)
packageName
- the name of the Martini packageendpointName
- name of endpoint@GloopObjectParameter(value="endpoints{\n endpoints#io.toro.martini.package.Endpoint[]{\n }\n}") public static io.toro.gloop.object.property.GloopModel getEndpoints(@GloopParameter(allowNull=false) String packageName) throws io.toro.martini.ipackage.exception.PackageIllegalStateException
packageName
- the name of the Martini packageio.toro.martini.ipackage.exception.PackageIllegalStateException
- if package is not loaded@GloopObjectParameter(value="endpoint{\n endpoint#io.toro.martini.package.Endpoint{\n }\n}") public static io.toro.gloop.object.property.GloopModel getEndpoint(@GloopParameter(allowNull=false) String packageName, @GloopParameter(allowNull=false) String endpointName) throws io.toro.martini.ipackage.exception.PackageIllegalStateException
null
if the endpoint is not existing.packageName
- the name of the Martini packageendpointName
- name of endpointio.toro.martini.ipackage.exception.PackageIllegalStateException
- if package is not loadedpublic static io.toro.gloop.object.property.GloopModel packageConfigToGloopModel(MartiniPackage martiniPackage)
martiniPackage
- the package whose configuration will be retrievedpublic static io.toro.gloop.object.property.GloopModel packageConfigToGloopModel(io.toro.martini.ipackage.PackageConfig packageConfig)
packageConfig
- the package configurationCopyright © 2020. All rights reserved.