Package com.powsybl.afs.ext.base
Class VirtualCase
- java.lang.Object
-
- com.powsybl.afs.AbstractNodeBase<ProjectFolder>
-
- com.powsybl.afs.ProjectNode
-
- com.powsybl.afs.ProjectFile
-
- com.powsybl.afs.ext.base.VirtualCase
-
- All Implemented Interfaces:
ProjectCase
public class VirtualCase extends ProjectFile implements ProjectCase
- Author:
- Geoffroy Jamgotchian
-
-
Field Summary
Fields Modifier and Type Field Description static String
PSEUDO_CLASS
static int
VERSION
-
Fields inherited from class com.powsybl.afs.ProjectNode
folder, project
-
Fields inherited from class com.powsybl.afs.AbstractNodeBase
codeVersion, info, storage
-
-
Constructor Summary
Constructors Constructor Description VirtualCase(ProjectFileCreationContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(ProjectCaseListener l)
Optional<ProjectFile>
getCase()
com.powsybl.iidm.network.Network
getNetwork()
com.powsybl.iidm.network.Network
getNetwork(List<com.powsybl.iidm.network.NetworkListener> listeners)
Get the network and add a listeners on it in order to listen changes due to virtual case script application.String
getOutput()
Optional<ModificationScript>
getScript()
protected void
invalidate()
void
invalidateNetworkCache()
boolean
mandatoryDependenciesAreMissing()
String
queryNetwork(ScriptType scriptType, String scriptContent)
void
removeListener(ProjectCaseListener l)
void
setCase(ProjectFile aCase)
void
setScript(ModificationScript aScript)
-
Methods inherited from class com.powsybl.afs.ProjectFile
addListener, createLogger, getDependencies, getDependencies, getDependencies, hasDeepDependency, hasDeepDependency, isFolder, removeDependencies, removeListener, replaceDependency, setDependencies, startTask, stopTask
-
Methods inherited from class com.powsybl.afs.ProjectNode
delete, findService, getBackwardDependencies, getFileSystem, getParent, getPath, getProject
-
Methods inherited from class com.powsybl.afs.AbstractNodeBase
archive, archive, archive, archive, archive, getChildInfo, getCodeVersion, getCreationDate, getDescription, getId, getModificationDate, getName, getParentInfo, getVersion, isAheadOfVersion, isAncestorOf, moveTo, rename, setDescription, toString, unarchive, unarchive
-
-
-
-
Field Detail
-
PSEUDO_CLASS
public static final String PSEUDO_CLASS
- See Also:
- Constant Field Values
-
VERSION
public static final int VERSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VirtualCase
public VirtualCase(ProjectFileCreationContext context)
-
-
Method Detail
-
getCase
public Optional<ProjectFile> getCase()
-
setCase
public void setCase(ProjectFile aCase)
-
getScript
public Optional<ModificationScript> getScript()
-
setScript
public void setScript(ModificationScript aScript)
-
getOutput
public String getOutput()
-
queryNetwork
public String queryNetwork(ScriptType scriptType, String scriptContent)
- Specified by:
queryNetwork
in interfaceProjectCase
-
getNetwork
public com.powsybl.iidm.network.Network getNetwork()
- Specified by:
getNetwork
in interfaceProjectCase
-
getNetwork
public com.powsybl.iidm.network.Network getNetwork(List<com.powsybl.iidm.network.NetworkListener> listeners)
Description copied from interface:ProjectCase
Get the network and add a listeners on it in order to listen changes due to virtual case script application. The listeners will not be removed from the network at the end of the network loading, so the user of this method must make sure to handle it on its own. The contract of being notified may not be honored by all implementations (see remote service cache : listeners will not be added to the network). The user must check with the cache implementation he will use.- Specified by:
getNetwork
in interfaceProjectCase
-
invalidateNetworkCache
public void invalidateNetworkCache()
- Specified by:
invalidateNetworkCache
in interfaceProjectCase
-
addListener
public void addListener(ProjectCaseListener l)
- Specified by:
addListener
in interfaceProjectCase
-
removeListener
public void removeListener(ProjectCaseListener l)
- Specified by:
removeListener
in interfaceProjectCase
-
invalidate
protected void invalidate()
- Overrides:
invalidate
in classProjectNode
-
mandatoryDependenciesAreMissing
public boolean mandatoryDependenciesAreMissing()
- Overrides:
mandatoryDependenciesAreMissing
in classProjectFile
-
-