站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss RULES 4.0.0.11754MR2 API 英文版文档

ServiceImplementation (Drools 4.0.0.11754MR2 API) - JBoss RULES 4.0.0.11754MR2 API 英文版文档


org.drools.brms.server
Class ServiceImplementation

java.lang.Object
  extended by org.drools.brms.server.ServiceImplementation
All Implemented Interfaces:
com.google.gwt.user.client.rpc.RemoteService, RepositoryService

@Name(value="org.drools.brms.client.rpc.RepositoryService")
@AutoCreate
public class ServiceImplementation
extends Object
implements RepositoryService

This is the implementation of the repository service to drive the GWT based front end.

Author:
Michael Neale

Field Summary
 RulesRepository repository
           
 
Constructor Summary
ServiceImplementation()
           
 
Method Summary
 BuilderResult[] buildAsset(RuleAsset asset)
          This will build the asset and return any build results (errors).
 String buildAssetSource(RuleAsset asset)
          This will return the effective source for an asset (in DRL).
 BuilderResult[] buildPackage(String packageUUID)
          Build the package (may be a snapshot) and return the result.
 String buildPackageSource(String packageUUID)
          This will return the effective DRL for a package.
 void changeAssetPackage(String uuid, String newPackage, String comment)
          This moves an asset to the given target package.
 void changeState(String uuid, String newState, boolean wholePackage)
          This will change the state of an asset or package.
 String checkinVersion(RuleAsset asset)
          This checks in a new version of an asset.
 void clearRulesRepository()
          Clear the rules repositoty, Use at your own risk.
 String copyAsset(String assetUUID, String newPackage, String newName)
          Copies an asset into a new destination package.
 void copyOrRemoveSnapshot(String packageName, String snapshotName, boolean delete, String newSnapshotName)
          This alters an existing snapshot, it can be used to copy or delete it.
 Boolean createCategory(String path, String name, String description)
          This will create a new category at the specified path.
 String createNewRule(String ruleName, String description, String initialCategory, String initialPackage, String format)
          This will create a new asset.
 String createPackage(String name, String description)
          This creates a package of the given name, and checks it in.
 void createPackageSnapshot(String packageName, String snapshotName, boolean replaceExisting, String comment)
          Create a package snapshot for deployment.
 String createState(String name)
          Create a state (status).
 void deleteUncheckedRule(String uuid, String initialPackage)
          Delete un checked in Asset
 byte[] exportRepository()
          Export rules repository to a compressed array of bytes
 TableDataResult listAssets(String uuid, String[] formats, int numRows, int startRow)
          Given a format, this will return assets that match.
 PackageConfigData[] listPackages()
          This returns a list of packages where rules may be added.
 SnapshotInfo[] listSnapshots(String packageName)
          This will load a list of snapshots for the given package.
 String[] listStates()
          Returns a list of valid states.
 TableDataResult loadAssetHistory(String uuid)
          This will load the history of the given asset, in a summary format suitable for display in a table.
 String[] loadChildCategories(String categoryPath)
           
 PackageConfigData loadPackageConfig(String uuid)
          Loads a package by its uuid.
 RuleAsset loadRuleAsset(String uuid)
          This actually does the hard work of loading up an asset based on its format.
 TableDataResult loadRuleListForCategories(String categoryPath)
          Return a a 2d array/grid of results for rules.
 SuggestionCompletionEngine loadSuggestionCompletionEngine(String packageName)
          Loads up the SuggestionCompletionEngine for the given package.
 TableConfig loadTableConfig(String listName)
          This will return a TableConfig of header names.
 TableDataResult quickFindAsset(String searchText, int max, boolean searchArchived)
          This will quickly return a list of asset names/descriptions.
 void removeCategory(String categoryPath)
          This will remove a category.
 void restoreVersion(String versionUUID, String assetUUID, String comment)
          This will restore the specified version in the repository, saving, and creating a new version (with all the restored content).
 ValidatedResponse savePackage(PackageConfigData data)
          Saves the package config data in place (does not create a new version of anything).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

repository

@In
public RulesRepository repository
Constructor Detail

ServiceImplementation

public ServiceImplementation()
Method Detail

loadChildCategories

@WebRemote
public String[] loadChildCategories(String categoryPath)
Specified by:
loadChildCategories in interface RepositoryService
Parameters:
categoryPath - A "/" delimited path to a category.

createCategory

@WebRemote
public Boolean createCategory(String path,
                                        String name,
                                        String description)
Description copied from interface: RepositoryService
This will create a new category at the specified path.

Specified by:
createCategory in interface RepositoryService

createNewRule

@WebRemote
public String createNewRule(String ruleName,
                                      String description,
                                      String initialCategory,
                                      String initialPackage,
                                      String format)
                     throws com.google.gwt.user.client.rpc.SerializableException
This will create a new asset. It will be saved, but not checked in. The initial state will be the draft state.

Specified by:
createNewRule in interface RepositoryService
Throws:
com.google.gwt.user.client.rpc.SerializableException

deleteUncheckedRule

@WebRemote
public void deleteUncheckedRule(String uuid,
                                          String initialPackage)
Description copied from interface: RepositoryService
Delete un checked in Asset

Specified by:
deleteUncheckedRule in interface RepositoryService

listPackages

@WebRemote
public PackageConfigData[] listPackages()
Description copied from interface: RepositoryService
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 RepositoryService

loadRuleListForCategories

@WebRemote
public TableDataResult loadRuleListForCategories(String categoryPath)
                                          throws com.google.gwt.user.client.rpc.SerializableException
Description copied from interface: RepositoryService
Return a a 2d array/grid of results for rules.

Specified by:
loadRuleListForCategories in interface RepositoryService
Throws:
com.google.gwt.user.client.rpc.SerializableException

loadTableConfig

@WebRemote
public TableConfig loadTableConfig(String listName)
Description copied from interface: RepositoryService
This will return a TableConfig of header names.

Specified by:
loadTableConfig in interface RepositoryService
Parameters:
listName - The name of the list that we are going to render.

loadRuleAsset

@WebRemote
public RuleAsset loadRuleAsset(String uuid)
                        throws com.google.gwt.user.client.rpc.SerializableException
This actually does the hard work of loading up an asset based on its format.

Specified by:
loadRuleAsset in interface RepositoryService
Throws:
com.google.gwt.user.client.rpc.SerializableException

checkinVersion

@WebRemote
public String checkinVersion(RuleAsset asset)
                      throws com.google.gwt.user.client.rpc.SerializableException
Description copied from interface: RepositoryService
This checks in a new version of an asset.

Specified by:
checkinVersion in interface RepositoryService
Returns:
the UUID of the asset you are checking in, null if there was some problem (and an exception was not thrown).
Throws:
com.google.gwt.user.client.rpc.SerializableException

loadAssetHistory

@WebRemote
public TableDataResult loadAssetHistory(String uuid)
                                 throws com.google.gwt.user.client.rpc.SerializableException
Description copied from interface: RepositoryService
This will load the history of the given asset, in a summary format suitable for display in a table.

Specified by:
loadAssetHistory in interface RepositoryService
Throws:
com.google.gwt.user.client.rpc.SerializableException

restoreVersion

@WebRemote
public void restoreVersion(String versionUUID,
                                     String assetUUID,
                                     String comment)
Description copied from interface: RepositoryService
This will restore the specified version in the repository, saving, and creating a new version (with all the restored content).

Specified by:
restoreVersion in interface RepositoryService

exportRepository

@WebRemote
public byte[] exportRepository()
                        throws com.google.gwt.user.client.rpc.SerializableException
Description copied from interface: RepositoryService
Export rules repository to a compressed array of bytes

Specified by:
exportRepository in interface RepositoryService
Throws:
com.google.gwt.user.client.rpc.SerializableException

createPackage

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

Specified by:
createPackage in interface RepositoryService
Returns:
UUID of the created item.
Throws:
com.google.gwt.user.client.rpc.SerializableException

loadPackageConfig

@WebRemote
public PackageConfigData loadPackageConfig(String uuid)
Description copied from interface: RepositoryService
Loads a package by its uuid.

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

savePackage

@WebRemote
public ValidatedResponse savePackage(PackageConfigData data)
                              throws com.google.gwt.user.client.rpc.SerializableException
Description copied from interface: RepositoryService
Saves the package config data in place (does not create a new version of anything).

Specified by:
savePackage in interface RepositoryService
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.SerializableException

listAssets

@WebRemote
public TableDataResult listAssets(String uuid,
                                            String[] formats,
                                            int numRows,
                                            int startRow)
                           throws com.google.gwt.user.client.rpc.SerializableException
Description copied from interface: RepositoryService
Given a format, this will return assets that match. It can also be used for "pagination" by passing in start and finish row numbers.

Specified by:
listAssets in interface RepositoryService
Parameters:
uuid - The package uuid to search inside.
numRows - The number of rows to return. -1 means all.
startRow - The starting row number if paging - if numRows is -1 then this is ignored.
Throws:
com.google.gwt.user.client.rpc.SerializableException

createState

@WebRemote
public String createState(String name)
                   throws com.google.gwt.user.client.rpc.SerializableException
Description copied from interface: RepositoryService
Create a state (status).

Specified by:
createState in interface RepositoryService
Returns:
the UUID of the created StateItem.
Throws:
com.google.gwt.user.client.rpc.SerializableException

listStates

@WebRemote
public String[] listStates()
                    throws com.google.gwt.user.client.rpc.SerializableException
Description copied from interface: RepositoryService
Returns a list of valid states.

Specified by:
listStates in interface RepositoryService
Throws:
com.google.gwt.user.client.rpc.SerializableException

changeState

@WebRemote
public void changeState(String uuid,
                                  String newState,
                                  boolean wholePackage)
Description copied from interface: RepositoryService
This will change the state of an asset or package.

Specified by:
changeState in interface RepositoryService
Parameters:
uuid - The UUID of the asset we are tweaking.
newState - The new state to set. It must be valid in the repo.
wholePackage - true if it is a package we are setting the state of. If this is true, UUID must be the status of a package, if false, it must be an asset.

changeAssetPackage

@WebRemote
public void changeAssetPackage(String uuid,
                                         String newPackage,
                                         String comment)
Description copied from interface: RepositoryService
This moves an asset to the given target package.

Specified by:
changeAssetPackage in interface RepositoryService

copyAsset

@WebRemote
public String copyAsset(String assetUUID,
                                  String newPackage,
                                  String newName)
Description copied from interface: RepositoryService
Copies an asset into a new destination package.

Specified by:
copyAsset in interface RepositoryService
Parameters:
assetUUID - The source assetID.
newPackage - The destination package (may be the same as the current source package, but in that case the asset has to have a different name).
newName - The new name of the asset.

listSnapshots

@WebRemote
public SnapshotInfo[] listSnapshots(String packageName)
Description copied from interface: RepositoryService
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 RepositoryService

createPackageSnapshot

@WebRemote
public void createPackageSnapshot(String packageName,
                                            String snapshotName,
                                            boolean replaceExisting,
                                            String comment)
Description copied from interface: RepositoryService
Create a package snapshot for deployment.

Specified by:
createPackageSnapshot in interface RepositoryService
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
public void copyOrRemoveSnapshot(String packageName,
                                           String snapshotName,
                                           boolean delete,
                                           String newSnapshotName)
                          throws com.google.gwt.user.client.rpc.SerializableException
Description copied from interface: RepositoryService
This alters an existing snapshot, it can be used to copy or delete it.

Specified by:
copyOrRemoveSnapshot in interface RepositoryService
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.SerializableException

quickFindAsset

@WebRemote
public TableDataResult quickFindAsset(String searchText,
                                                int max,
                                                boolean searchArchived)
Description copied from interface: RepositoryService
This will quickly return a list of asset names/descriptions. This list will be limited, and it will be flagged if more are found then can be shown. Returning an extra empty row means there are more to come... The id of a row is the UUID, the first value is the name, the next the description. Finally, if there is "more" rows, a row will be returned which has "MORE" as its ID.

Specified by:
quickFindAsset in interface RepositoryService

removeCategory

@WebRemote
public void removeCategory(String categoryPath)
                    throws com.google.gwt.user.client.rpc.SerializableException
Description copied from interface: RepositoryService
This will remove a category. A category must have no current assets linked to it, or else it will not be able to be removed.

Specified by:
removeCategory in interface RepositoryService
Parameters:
categoryPath - The full path to the category. Any sub categories will also be removed.
Throws:
com.google.gwt.user.client.rpc.SerializableException - For when it all goes horribly wrong.

clearRulesRepository

@WebRemote
public void clearRulesRepository()
Description copied from interface: RepositoryService
Clear the rules repositoty, Use at your own risk.

Specified by:
clearRulesRepository in interface RepositoryService

loadSuggestionCompletionEngine

@WebRemote
public SuggestionCompletionEngine loadSuggestionCompletionEngine(String packageName)
                                                          throws com.google.gwt.user.client.rpc.SerializableException
Description copied from interface: RepositoryService
Loads up the SuggestionCompletionEngine for the given package. As this doesn't change that often, its safe to cache. However, if a change is made to a package, should blow away the cache.

Specified by:
loadSuggestionCompletionEngine in interface RepositoryService
Throws:
com.google.gwt.user.client.rpc.SerializableException

buildPackage

@WebRemote
public BuilderResult[] buildPackage(String packageUUID)
                             throws com.google.gwt.user.client.rpc.SerializableException
Description copied from interface: RepositoryService
Build the package (may be a snapshot) and return the result. This will then store the result in the package as an attachment.

Specified by:
buildPackage in interface RepositoryService
Throws:
com.google.gwt.user.client.rpc.SerializableException

buildPackageSource

@WebRemote
public String buildPackageSource(String packageUUID)
                          throws com.google.gwt.user.client.rpc.SerializableException
Description copied from interface: RepositoryService
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 RepositoryService
Throws:
com.google.gwt.user.client.rpc.SerializableException

buildAssetSource

@WebRemote
public String buildAssetSource(RuleAsset asset)
                        throws com.google.gwt.user.client.rpc.SerializableException
Description copied from interface: RepositoryService
This will return the effective source for an asset (in DRL). Used as an aid for debugging.

Specified by:
buildAssetSource in interface RepositoryService
Throws:
com.google.gwt.user.client.rpc.SerializableException

buildAsset

@WebRemote
public BuilderResult[] buildAsset(RuleAsset asset)
                           throws com.google.gwt.user.client.rpc.SerializableException
Description copied from interface: RepositoryService
This will build the asset and return any build results (errors).

Specified by:
buildAsset in interface RepositoryService
Throws:
com.google.gwt.user.client.rpc.SerializableException


Copyright © 2001-2007 JBoss Inc.. All Rights Reserved.