Interface ProjectManagerBase
- 
- All Known Subinterfaces:
- ProjectManager
 
 public interface ProjectManagerBase
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringDEFAULT_NAME_PATTERN
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddProjectListener(ProjectListener listener)Add aProjectListener.default java.lang.StringcopyProject(java.lang.String projectName, java.lang.String newProjectName)Create a copy of theRuntimeProjectnamedprojectName, usingnewProjectNameas the new project name, if possible.voidcreateOrReplaceProject(java.lang.String projectName, ProjectManifest manifest, java.util.List<ProjectResource> resources)Create a newRuntimeProjectwith the provided manifests and resources, or replace an existing project byprojectNameif it already exists.voidcreateProject(java.lang.String projectName, ProjectManifest manifest, java.util.List<ProjectResource> resources)Create a newRuntimeProjectwith the provided manifest and resources.default java.lang.StringcreateProjectSafe(java.lang.String projectName, ProjectManifest manifest, java.util.List<ProjectResource> resources)Create a newRuntimeProjectwith the provided manifests and resources.default java.lang.StringcreateProjectSafe(java.lang.String projectName, ProjectManifest manifest, java.util.List<ProjectResource> resources, java.lang.String namePattern)Create a newRuntimeProjectwith the provided manifests and resources.voiddeleteProject(java.lang.String projectName)Delete the project namedprojectName, if it exists.voidexportProject(java.lang.String projectName, java.io.OutputStream destination)Export a copy of projectprojectNameby writing the contents to thedestinationOutputStream.default java.util.Optional<RuntimeProject>getProject(java.lang.String projectName)Get a theRuntimeProjectfor the given name with all project resources in all scopes, if it exists.default java.util.Optional<RuntimeProject>getProject(java.lang.String projectName, int applicationScope)Returns aRuntimeProjectfor the given name loaded with all project resources that meet the given application scope, if it exists.java.util.Optional<RuntimeProject>getProject(java.lang.String projectName, ResourceFilter resourceFilter)Get aRuntimeProjectby the givenprojectNamecontaining only resources that pass the providedResourceFilter, if it exists.java.util.Map<java.lang.String,ProjectManifest>getProjectManifests()Get aMapofProjectManifests for all current Projects.java.util.List<java.lang.String>getProjectNames()Get aListof all current project names.java.util.List<ProjectDiff.AbsoluteDiff>pull(java.util.List<ProjectSnapshot> snapshots)Pull any changes for the givensnapshots.java.util.List<ProjectDiff.AbsoluteDiff>pull(java.util.List<ProjectSnapshot> snapshots, ResourceFilter filter)Pull any changes for the givensnapshots, but only changes for resources that match thefilter.voidpush(java.util.List<ChangeOperation> changeOperations)Attempt to push a list ofChangeOperations.voidremoveProjectListener(ProjectListener listener)Remove a previously-registeredProjectListener.
 
- 
- 
- 
Field Detail- 
DEFAULT_NAME_PATTERNstatic final java.lang.String DEFAULT_NAME_PATTERN - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
addProjectListenervoid addProjectListener(ProjectListener listener) Add aProjectListener.- Parameters:
- listener- the- ProjectListener.
 
 - 
removeProjectListenervoid removeProjectListener(ProjectListener listener) Remove a previously-registeredProjectListener.- Parameters:
- listener- the- ProjectListener.
 
 - 
createProjectvoid createProject(java.lang.String projectName, ProjectManifest manifest, java.util.List<ProjectResource> resources) throws java.lang.IllegalArgumentException, java.io.IOException, NameInUseExceptionCreate a newRuntimeProjectwith the provided manifest and resources.- Parameters:
- projectName- the name of the project to create.
- manifest- the- ProjectManifest.
- resources- the resources, if any, to assign to the project.
- Throws:
- java.lang.IllegalArgumentException- if any of the resources indicate they belong to a project other than- projectName.
- java.io.IOException- if the project files could not be created.
- NameInUseException- if a project by- projectNamealready exists.
 
 - 
createProjectSafedefault java.lang.String createProjectSafe(java.lang.String projectName, ProjectManifest manifest, java.util.List<ProjectResource> resources) throws java.lang.IllegalArgumentException, java.io.IOExceptionCreate a newRuntimeProjectwith the provided manifests and resources.If a project by projectNamealready exists, the suffix "_N", where N increases monotonically from 1, is appended toprojectNameuntil a name that isn't already used is found.- Parameters:
- projectName- the name of the project to create.
- manifest- the- ProjectManifest.
- resources- the resources, if any, to assign to the project.
- Returns:
- the name of the new project.
- Throws:
- java.lang.IllegalArgumentException- if any of the resources indicate they belong to a project other than- projectName.
- java.io.IOException- if the project files could not be created.
 
 - 
createProjectSafedefault java.lang.String createProjectSafe(java.lang.String projectName, ProjectManifest manifest, java.util.List<ProjectResource> resources, java.lang.String namePattern) throws java.lang.IllegalArgumentException, java.io.IOExceptionCreate a newRuntimeProjectwith the provided manifests and resources.If a project by projectNamealready exists thenamePatternis applied to the name viaString.format(String, Object...), with a monotonically increasing integer value supplied, until a suitable name is found.- Parameters:
- projectName- the name of the project to create.
- manifest- the- ProjectManifest.
- resources- the resources, if any, to assign to the project.
- namePattern- the name pattern to apply if- projectNamealready exists.
- Returns:
- the name of the new project.
- Throws:
- java.lang.IllegalArgumentException- if any of the resources indicate they belong to a project other than- projectName.
- java.io.IOException- if the project files could not be created.
 
 - 
createOrReplaceProjectvoid createOrReplaceProject(java.lang.String projectName, ProjectManifest manifest, java.util.List<ProjectResource> resources) throws java.lang.IllegalArgumentException, java.io.IOExceptionCreate a newRuntimeProjectwith the provided manifests and resources, or replace an existing project byprojectNameif it already exists.Replacing an existing project is modeled as a push of create, modify, and delete ChangeOperations, as opposed to deleting the existing project and creating a new one.- Parameters:
- projectName- the name of the project to create or replace.
- manifest- the- ProjectManifest.
- resources- the resources, if any, to assign to the project.
- Throws:
- java.lang.IllegalArgumentException- if any of the resources indicate they belong to a project other than- projectName.
- java.io.IOException- if the project files could not be created.
 
 - 
copyProjectdefault java.lang.String copyProject(java.lang.String projectName, java.lang.String newProjectName) throws java.io.IOException, ProjectNotFoundException, ProjectInvalidExceptionCreate a copy of theRuntimeProjectnamedprojectName, usingnewProjectNameas the new project name, if possible.If newProjectNamealready exists a suitable name will be chosen automatically viacreateProjectSafe(String, ProjectManifest, List).- Parameters:
- projectName- the name of the existing project to copy.
- newProjectName- the name for the new project.
- Returns:
- the actual name used for the new project.
- Throws:
- java.io.IOException- if the project files could not be created.
- ProjectNotFoundException- if a project by- projectNamedoes not exist.
- ProjectInvalidException- if the project by- projectNameexists but its configuration is not valid.
 
 - 
deleteProjectvoid deleteProject(java.lang.String projectName) throws java.io.IOException, ProjectNotFoundExceptionDelete the project namedprojectName, if it exists.- Parameters:
- projectName- the name of the project to delete
- Throws:
- java.io.IOException- if the project files could not be deleted.
- ProjectNotFoundException- if a project by- projectNamedoes not exist.
 
 - 
getProjectdefault java.util.Optional<RuntimeProject> getProject(java.lang.String projectName) Get a theRuntimeProjectfor the given name with all project resources in all scopes, if it exists.The project returned will not have been validated. See RuntimeProject.validateOrThrow().- Parameters:
- projectName- the name of the project to get.
- Returns:
- the RuntimeProjectfor the given name with all project resources in all scopes.
 
 - 
getProjectdefault java.util.Optional<RuntimeProject> getProject(@Nonnull java.lang.String projectName, int applicationScope) Returns aRuntimeProjectfor the given name loaded with all project resources that meet the given application scope, if it exists.The project returned will not have been validated. See RuntimeProject.validateOrThrow().- Parameters:
- projectName- the name of the project to get.
- applicationScope- the- ApplicationScoperesources must belong to.
- Returns:
- a RuntimeProjectfor the given name loaded with all project resources that meet the given application scope.
 
 - 
getProjectjava.util.Optional<RuntimeProject> getProject(@Nonnull java.lang.String projectName, ResourceFilter resourceFilter) Get aRuntimeProjectby the givenprojectNamecontaining only resources that pass the providedResourceFilter, if it exists.The project returned will not have been validated. See RuntimeProject.validateOrThrow().- Parameters:
- projectName- the name of the project to get.
- resourceFilter- the- ResourceFilter.
- Returns:
- a RuntimeProjectby the givenprojectNamecontaining only resources that pass the providedResourceFilter.
 
 - 
exportProjectvoid exportProject(java.lang.String projectName, java.io.OutputStream destination) throws java.io.IOException, ProjectNotFoundExceptionExport a copy of projectprojectNameby writing the contents to thedestinationOutputStream.The bytes written are composed of a zip formatted project folder that could be uncompressed and placed directly in the projects directory resulting in a functional project. - Parameters:
- projectName- the name of the project to export.
- destination- an- OutputStreamto write the export to.
- Throws:
- java.io.IOException
- ProjectNotFoundException
 
 - 
getProjectManifestsjava.util.Map<java.lang.String,ProjectManifest> getProjectManifests() Get aMapofProjectManifests for all current Projects.- Returns:
- a MapofProjectManifests, keyed by project name.
 
 - 
getProjectNamesjava.util.List<java.lang.String> getProjectNames() Get aListof all current project names.- Returns:
- a Listof all current project names.
 
 - 
pushvoid push(java.util.List<ChangeOperation> changeOperations) throws ProjectPushException Attempt to push a list ofChangeOperations.If any changes conflict with the current state a ProjectPushExceptionwill be thrown.It is expected that consumers of this API will then pull and resolve any conflicts before attempting to push again. - Parameters:
- changeOperations- a list of- ChangeOperations to apply.
- Throws:
- ProjectPushException- if any changes conflict with the current state.
 
 - 
pulljava.util.List<ProjectDiff.AbsoluteDiff> pull(java.util.List<ProjectSnapshot> snapshots) throws ProjectPullException Pull any changes for the givensnapshots.- Parameters:
- snapshots- the- ProjectSnapshots to pull changes for.
- Returns:
- ProjectDiffs for each- ProjectSnapshotcontaining any resource diffs.
- Throws:
- ProjectPullException
 
 - 
pulljava.util.List<ProjectDiff.AbsoluteDiff> pull(java.util.List<ProjectSnapshot> snapshots, ResourceFilter filter) throws ProjectPullException Pull any changes for the givensnapshots, but only changes for resources that match thefilter.- Parameters:
- snapshots- the- ProjectSnapshots to pull changes for.
- filter- the- ResourceFilter.
- Returns:
- ProjectDiff.AbsoluteDiffs for each- ProjectSnapshotcontaining any resource diffs.
- Throws:
- ProjectPullException
 
 
- 
 
-