trait Org extends AnyRef
A virtual Org used to present the analysis functionality in a familiar way.
All analysis works within the context of a virtual Org. You can manage multiple of these at the same time but most use cases just need one creating, see Org.newOrg(). The Org functions as a container of multiple Package objects and maintains a set of discovered issues from the analysis of the package metadata. All orgs have at least one 'unmanaged' package identifiable by having no namespace.
In the simple case after creating an Org, you should add one or more packages detailing where package metadata is stored. Adding large packages can take considerable CPU and memory resources. Once the packages are loaded the metadata within them can be mutated using the Package methods. At any point you can list of current issues with the packages from getIssues.
When metadata changes are requested (see Package.refresh they are queued for later processing either via calling Org.flush or via automatic flushing (the default). Flushing also updates a disk cache that helps significantly reduce initial loading times. The flushing model used by an Org is set on construction, see ServerOps.setAutoFlush to change to manual flushing.
Orgs and Packages are not thread safe, serialise all calls to them.
- Alphabetic
- By Inheritance
- Org
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
flush(): Boolean
Force syncing of org metadata to the cache when not using automatic flushing (see ServerOps).
Force syncing of org metadata to the cache when not using automatic flushing (see ServerOps).
When using manual flushing this should be called periodically to ensure the cache is kept upto date after metadata changes. If it returns true then getIssues should be called to retrieved the latest set of issues.
-
abstract
def
getDependencies: Map[String, Array[String]]
Get Apex type dependency map for all types in the Org.
Get Apex type dependency map for all types in the Org.
This is intended to be used to support exporting of the map for secondary analysis.
-
abstract
def
getIdentifierLocation(identifier: String): PathLocation
Find the location of some form of identifier.
Find the location of some form of identifier.
Currently this supports locating Outer & Inner classes and Triggers by name. These must include a namespace using the usual conventions to find a location for the identifier. Returns the file & position within that file if the identifier is found, otherwise returns null.
-
abstract
def
getIssues(options: IssueOptions): String
Get current issue log.
Get current issue log.
See IssueOptions for control over what is returned.
-
abstract
def
getPackages: Array[Package]
Get array of current packages.
-
abstract
def
isFlushed(): Boolean
Test if all metadata changes have been processed.
Test if all metadata changes have been processed.
The Package refresh function queues changes so that they may be processed in batches either when you call flush() or via the automatic flushing mechanism. You can use this function to determine if the queue of changes to be processed is empty.
-
abstract
def
newMDAPIPackage(namespace: String, directories: Array[String], basePackages: Array[Package]): Package
Create a new package in the org from MDAPI format metadata.
Create a new package in the org from MDAPI format metadata.
To use this package to replace the 'unmanaged' package modeled in all Orgs pass a null or empty namespace. The directories are scanned in the order provided which influences how duplicate metadata is reported. The basePackages array should contain any packages that this package depends on. References to metadata not included in basePackage is not possible.
-
abstract
def
newSFDXPackage(directory: String): Package
Create a new package in the org from SFDX format metadata.
Create a new package in the org from SFDX format metadata.
The metadata directory must contain a well formed sfdx-project.json file. The package namespace & package directories to use are read from that sfdx-project.json file. If a .forceignore file is present in the metadata directory it will be honoured. Any dependent packages that are also required can be specified in the "plugins" section of sfdx-project.json under in a "dependencies" array.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )