org.drools.guvnor.server
Class RepositoryPackageService

java.lang.Object
  extended by org.drools.guvnor.server.RepositoryPackageService
All Implemented Interfaces:
com.google.gwt.user.client.rpc.RemoteService, PackageService

@Name(value="org.drools.guvnor.client.rpc.PackageService")
@AutoCreate
public class RepositoryPackageService
extends Object
implements PackageService


Constructor Summary
RepositoryPackageService()
           
 
Method Summary
 BuilderResult buildPackage(String packageUUID, boolean force)
           
 BuilderResult buildPackage(String packageUUID, boolean force, String buildMode, String statusOperator, String statusDescriptionValue, boolean enableStatusSelector, String categoryOperator, String category, boolean enableCategorySelector, String customSelectorName)
          Build the package (may be a snapshot) and return the result.
 String buildPackageSource(String packageUUID)
          This will return the effective DRL for a package.
 SnapshotComparisonPageResponse compareSnapshots(SnapshotComparisonPageRequest request)
           
 SnapshotDiffs compareSnapshots(String packageName, String firstSnapshotName, String secondSnapshotName)
          Deprecated. in favour of compareSnapshots(SnapshotComparisonPageRequest)
 void copyOrRemoveSnapshot(String packageName, String snapshotName, boolean delete, String newSnapshotName)
          This alters an existing snapshot, it can be used to copy or delete it.
 String copyPackage(String sourcePackageName, String destPackageName)
          Copy the package (everything).
 void create()
           
 String createPackage(String name, String description, String format)
          This creates a package of the given name, and checks it in.
 String createPackage(String name, String description, String format, String[] workspace)
           
 void createPackageSnapshot(String packageName, String snapshotName, boolean replaceExisting, String comment)
          Create a package snapshot for deployment.
 String createSubPackage(String name, String description, String parentNode)
          This creates a package of the given name, and checks it in.
 byte[] exportPackages(String packageName)
           
 String[] getDependencies(String uuid)
           
 RulesRepository getRulesRepository()
           
 void importPackages(byte[] byteArray, boolean importAsNew)
           
 void installSampleRepository()
          Installs the sample repository, wiping out what was already there.
 PackageConfigData[] listArchivedPackages()
          This returns a list of archived packages.
 PackageConfigData[] listArchivedPackages(String workspace)
           
 String[] listImagesInPackage(String packageName)
          This will list the images available in a package.
 PackageConfigData[] listPackages()
          Role-based Authorization check: This method only returns packages that the user has permission to access.
 PackageConfigData[] listPackages(String workspace)
          This returns a list of packages where rules may be added.
 String[] listRulesInPackage(String packageName)
          This will list the rules available in a package.
 SnapshotInfo[] listSnapshots(String packageName)
          This will load a list of snapshots for the given package.
 String[] listTypesInPackage(String packageUUID)
          List the fact types (class names) in the scope of a given package.
 PackageConfigData loadGlobalPackage()
          This returns the global packages.
 PackageConfigData loadPackageConfig(String uuid)
          Loads a package by its uuid.
 SnapshotInfo loadSnapshotInfo(String packageName, String snapshotName)
           
 void rebuildPackages()
          This will force a rebuild of all packages binary data.
 void rebuildSnapshots()
          This will force a rebuild of all snapshots binary data.
 void removePackage(String uuid)
          Permanently remove a package (delete it).
 String renamePackage(String uuid, String newName)
          Rename a package.
 SingleScenarioResult runScenario(String packageName, Scenario scenario)
           
 BulkTestRunResult runScenariosInPackage(PackageItem packageItem)
           
 BulkTestRunResult runScenariosInPackage(String packageUUID)
          This should be pretty obvious what it does !
 void savePackage(PackageConfigData data)
          Saves the package config data in place (does not create a new version of anything).
 void setRulesRepository(RulesRepository repository)
           
 void updateDependency(String uuid, String dependencyPath)
           
 ValidatedResponse validatePackageConfiguration(PackageConfigData data)
          Validate package configuration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryPackageService

public RepositoryPackageService()
Method Detail

create

@Create
public void create()

setRulesRepository

public void setRulesRepository(RulesRepository repository)

getRulesRepository

public RulesRepository getRulesRepository()

listPackages

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public PackageConfigData[] listPackages()
Role-based Authorization check: This method only returns packages that the user has permission to access. User has permission to access the particular package when: The user has a package.readonly role or higher (i.e., package.admin, package.developer) to this package.

Specified by:
listPackages in interface PackageService

listPackages

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public PackageConfigData[] listPackages(String workspace)
Description copied from interface: PackageService
This returns a list of packages where rules may be added. Only the UUID and the name need to be populated.

Specified by:
listPackages in interface PackageService

listArchivedPackages

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public PackageConfigData[] listArchivedPackages()
Description copied from interface: PackageService
This returns a list of archived packages.

Specified by:
listArchivedPackages in interface PackageService

listArchivedPackages

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public PackageConfigData[] listArchivedPackages(String workspace)

loadGlobalPackage

public PackageConfigData loadGlobalPackage()
Description copied from interface: PackageService
This returns the global packages.

Specified by:
loadGlobalPackage in interface PackageService

rebuildPackages

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public void rebuildPackages()
                     throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: PackageService
This will force a rebuild of all packages binary data. No errors are expected, as there will be no change. If there are errors, an expert will need to look at them.

Specified by:
rebuildPackages in interface PackageService
Throws:
com.google.gwt.user.client.rpc.SerializationException

buildPackageSource

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public String buildPackageSource(String packageUUID)
                          throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: PackageService
This will return the effective DRL for a package. This would be the equivalent if all the rules were written by hand in the one file. It may not actually be compiled this way in the implementation, so this is for display and debugging assistance only.

It should still generate

Specified by:
buildPackageSource in interface PackageService
Throws:
com.google.gwt.user.client.rpc.SerializationException

copyPackage

@WebRemote
public String copyPackage(String sourcePackageName,
                                    String destPackageName)
                   throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: PackageService
Copy the package (everything).

Specified by:
copyPackage in interface PackageService
Throws:
com.google.gwt.user.client.rpc.SerializationException

removePackage

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public void removePackage(String uuid)
Description copied from interface: PackageService
Permanently remove a package (delete it).

Specified by:
removePackage in interface PackageService
Parameters:
uuid - of the package.

renamePackage

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public String renamePackage(String uuid,
                                               String newName)
Description copied from interface: PackageService
Rename a package.

Specified by:
renamePackage in interface PackageService

exportPackages

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public byte[] exportPackages(String packageName)

importPackages

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public void importPackages(byte[] byteArray,
                                              boolean importAsNew)

createPackage

@WebRemote
public String createPackage(String name,
                                      String description,
                                      String format)
                     throws RulesRepositoryException
Description copied from interface: PackageService
This creates a package of the given name, and checks it in.

Specified by:
createPackage in interface PackageService
Returns:
UUID of the created item.
Throws:
RulesRepositoryException

createPackage

@WebRemote
public String createPackage(String name,
                                      String description,
                                      String format,
                                      String[] workspace)
                     throws RulesRepositoryException
Throws:
RulesRepositoryException

createSubPackage

@WebRemote
public String createSubPackage(String name,
                                         String description,
                                         String parentNode)
                        throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: PackageService
This creates a package of the given name, and checks it in.

Specified by:
createSubPackage in interface PackageService
Returns:
UUID of the created item.
Throws:
com.google.gwt.user.client.rpc.SerializationException

loadPackageConfig

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public PackageConfigData loadPackageConfig(String uuid)
Description copied from interface: PackageService
Loads a package by its uuid.

Specified by:
loadPackageConfig in interface PackageService
Returns:
Well, its pretty obvious if you think about it for a minute. Really.

validatePackageConfiguration

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public ValidatedResponse validatePackageConfiguration(PackageConfigData data)
                                               throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: PackageService
Validate package configuration

Specified by:
validatePackageConfiguration in interface PackageService
Returns:
A ValidatedReponse, with any errors to be reported. No payload is in the response. If there are any errors, the user should be given the option to review them, and correct them if needed (but a save will not be prevented this way - as its not an exception).
Throws:
com.google.gwt.user.client.rpc.SerializationException

savePackage

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public void savePackage(PackageConfigData data)
                 throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: PackageService
Saves the package config data in place (does not create a new version of anything).

Specified by:
savePackage in interface PackageService
Throws:
com.google.gwt.user.client.rpc.SerializationException

buildPackage

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public BuilderResult buildPackage(String packageUUID,
                                                     boolean force)
                           throws com.google.gwt.user.client.rpc.SerializationException
Throws:
com.google.gwt.user.client.rpc.SerializationException

buildPackage

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public BuilderResult buildPackage(String packageUUID,
                                                     boolean force,
                                                     String buildMode,
                                                     String statusOperator,
                                                     String statusDescriptionValue,
                                                     boolean enableStatusSelector,
                                                     String categoryOperator,
                                                     String category,
                                                     boolean enableCategorySelector,
                                                     String customSelectorName)
                           throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: PackageService
Build the package (may be a snapshot) and return the result.

This will then store the result in the package as an attachment.

if a non null selectorName is passed in it will lookup a selector as configured in the systems selectors.properties file. This will then apply the filter to the package being built.

Specified by:
buildPackage in interface PackageService
Throws:
com.google.gwt.user.client.rpc.SerializationException

createPackageSnapshot

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public void createPackageSnapshot(String packageName,
                                                     String snapshotName,
                                                     boolean replaceExisting,
                                                     String comment)
Description copied from interface: PackageService
Create a package snapshot for deployment.

Specified by:
createPackageSnapshot in interface PackageService
Parameters:
packageName - THe name of the package to copy.
snapshotName - The name of the snapshot. Has to be unique unless existing one is to be replaced.
replaceExisting - Replace the existing one (must be true to replace an existing snapshot of the same name).
comment - A comment to be added to the copied one.

copyOrRemoveSnapshot

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public void copyOrRemoveSnapshot(String packageName,
                                                    String snapshotName,
                                                    boolean delete,
                                                    String newSnapshotName)
                          throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: PackageService
This alters an existing snapshot, it can be used to copy or delete it.

Specified by:
copyOrRemoveSnapshot in interface PackageService
Parameters:
packageName - The package name that we are dealing with.
snapshotName - The snapshot name (this must exist)
delete - true if the snapshotName is to be removed.
newSnapshotName - The name of the target snapshot that the contents will be copied to.
Throws:
com.google.gwt.user.client.rpc.SerializationException

listRulesInPackage

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public String[] listRulesInPackage(String packageName)
                            throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: PackageService
This will list the rules available in a package. This has an upper limit of what it will return (it just doesn't make sense to show a list of 20K items !).

Specified by:
listRulesInPackage in interface PackageService
Throws:
com.google.gwt.user.client.rpc.SerializationException

listImagesInPackage

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public String[] listImagesInPackage(String packageName)
                             throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: PackageService
This will list the images available in a package. This has an upper limit of what it will return (it just doesn't make sense to show a list of 20K items !).

Specified by:
listImagesInPackage in interface PackageService
Throws:
com.google.gwt.user.client.rpc.SerializationException

rebuildSnapshots

@WebRemote
public void rebuildSnapshots()
                      throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: PackageService
This will force a rebuild of all snapshots binary data. No errors are expected, as there will be no change. If there are errors, an expert will need to look at them.

Specified by:
rebuildSnapshots in interface PackageService
Throws:
com.google.gwt.user.client.rpc.SerializationException

listSnapshots

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public SnapshotInfo[] listSnapshots(String packageName)
Description copied from interface: PackageService
This will load a list of snapshots for the given package. Snapshots are created by taking a labelled copy of a package, at a point in time, for instance for deployment.

Specified by:
listSnapshots in interface PackageService

loadSnapshotInfo

@Restrict(value="#{identity.loggedIn}")
public SnapshotInfo loadSnapshotInfo(String packageName,
                                              String snapshotName)
Specified by:
loadSnapshotInfo in interface PackageService

listTypesInPackage

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public String[] listTypesInPackage(String packageUUID)
                            throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: PackageService
List the fact types (class names) in the scope of a given package. This may not include things on the "system" classpath, but only things specifically scoped to the package (eg in jars that have been uploaded to it as an asset).

Specified by:
listTypesInPackage in interface PackageService
Throws:
com.google.gwt.user.client.rpc.SerializationException

updateDependency

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public void updateDependency(String uuid,
                                                String dependencyPath)
Specified by:
updateDependency in interface PackageService

getDependencies

public String[] getDependencies(String uuid)
Specified by:
getDependencies in interface PackageService

installSampleRepository

@Restrict(value="#{identity.loggedIn}")
public void installSampleRepository()
                             throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: PackageService
Installs the sample repository, wiping out what was already there. Generally shouldn't call this unless it is new !

Specified by:
installSampleRepository in interface PackageService
Throws:
com.google.gwt.user.client.rpc.SerializationException

compareSnapshots

public SnapshotDiffs compareSnapshots(String packageName,
                                      String firstSnapshotName,
                                      String secondSnapshotName)
Deprecated. in favour of compareSnapshots(SnapshotComparisonPageRequest)

Description copied from interface: PackageService
Compare two snapshots.

Specified by:
compareSnapshots in interface PackageService

compareSnapshots

public SnapshotComparisonPageResponse compareSnapshots(SnapshotComparisonPageRequest request)
Specified by:
compareSnapshots in interface PackageService

runScenario

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public SingleScenarioResult runScenario(String packageName,
                                                           Scenario scenario)
                                 throws com.google.gwt.user.client.rpc.SerializationException
Specified by:
runScenario in interface PackageService
Parameters:
packageName - The package name the scenario is to be run in.
scenario - The scenario to run.
Returns:
The scenario, with the results fields populated.
Throws:
com.google.gwt.user.client.rpc.SerializationException

runScenariosInPackage

@WebRemote
@Restrict(value="#{identity.loggedIn}")
public BulkTestRunResult runScenariosInPackage(String packageUUID)
                                        throws com.google.gwt.user.client.rpc.SerializationException
Description copied from interface: PackageService
This should be pretty obvious what it does !

Specified by:
runScenariosInPackage in interface PackageService
Throws:
com.google.gwt.user.client.rpc.SerializationException

runScenariosInPackage

public BulkTestRunResult runScenariosInPackage(PackageItem packageItem)
                                        throws DetailedSerializationException,
                                               com.google.gwt.user.client.rpc.SerializationException
Throws:
DetailedSerializationException
com.google.gwt.user.client.rpc.SerializationException


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.