|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.services.publish.tools.PackageCleanup
public class PackageCleanup
A Java class that provides a simple, command line interface for deleting or listing packages from a publish channel.
With SAS9 Release, the Publish Framework supports channels defined in a SAS Metadata Repository. Channels can be defined with archive or WebDAV persistent stores. When a package is published to a channel that is defined with a persistent store, the package is first persisted to that location and then it is published to all subscribers of that channel. Channels must be managed to delete old persisted packages. The Package Cleanup utility allows you to review basic information about the persisted package associated with the channel and delete both the metadata and the actual persisted package. Deletions are based on the expiration date of the package. This utility supports the deletion of packages from either type of persistent store (archive or WebDAV). The utility also supports the deletion of packages that are not to defined to any channel.
The Publishing Framework also supports the publishing of packages to an arbitrary WebDAV server (not associated to a channel). The Package Cleanup utility has been updated to support the deletion of these WebDAV packages. Given the WebDAV URL and credentials, the Package Cleanup utility searches for packages at that the specified URL location and returns the basic package information for review and deletion.
The Package Cleanup utility also supports a listing feature. The utility can be used to display package information without deleting. It can display information about packages published to a particular channel, packages that are orphaned and are no longer defined to any channel, and packages that exist on an arbitrary WebDAV server.
The package cleanup utility has the following requirements:
Many sites will use this application with an operating system scheduler software. For Windows, this will be the AT scheduler (see Windows help), and for Unix, this will be cron (see cron -help).
java -Djava.security.auth.login.config= <your-path>/login.config -Djava.security.policy= <your-path>/policy com.sas.services.publish.tools.PackageCleanup -d <expiration date for deletions> -ch <Channel Name> -metauser <username when binding to the Metadata Server> -metapass <password to use when binding to the Metadata Server> -domain <authentication domain for the Metadata Server> |
java -Djava.security.auth.login.config= <your-path>/login.config -Djava.security.policy= <your-path>/policy com.sas.services.publish.tools.PackageCleanup -d <expiration date for deletions> -metauser <username when binding to the Metadata Server> -metapass <password to use when binding to the Metadata Server> -domain <authentication domain for the Metadata Server> |
java -Djava.security.auth.login.config= <your-path>/login.config -Djava.security.policy= <your-path>/policy com.sas.services.publish.tools.PackageCleanup -url <WebDAV URL> -username <username when binding to WebDAV server> -password <password when binding to WebDAV server> -d <expiration date for deletions> -metauser <username when binding to the Metadata Server> -metapass <password to use when binding to the Metadata Server> -domain <authentication domain for the Metadata Server> |
java -Djava.security.auth.login.config= <your-path>/login.config -Djava.security.policy= <your-path>/policy com.sas.services.publish.tools.PackageCleanup -list -ch <Channel Name> -metauser <username when binding to the Metadata Server> -metapass <password to use when binding to the Metadata Server> -domain <authentication domain for the Metadata Server> |
java -Djava.security.auth.login.config= <your-path>/login.config -Djava.security.policy= <your-path>/policy com.sas.services.publish.tools.PackageCleanup -metauser <username when binding to the Metadata Server> -metapass <password to use when binding to the Metadata Server> -domain <authentication domain for the Metadata Server> -list |
java -Djava.security.auth.login.config= <your-path>/login.config -Djava.security.policy= <your-path>/policy com.sas.services.publish.tools.PackageCleanup -list -url <WebDAV URL> -username <username when binding to WebDAV server> -password <password when binding to WebDAV server> -metauser <username when binding to the Metadata Server> -metapass <password to use when binding to the Metadata Server> -domain <authentication domain for the Metadata Server> |
Prompting for Deletions
User is prompted to proceed after reviewing impending deletions. By default, the user is presented with a list of all packages that meet the deletion criteria. The user is then prompted to see if they want to proceed with the deletion of all the packages. To override the default, specify "-prompteach". The user will be prompted to delete each package that meets the deletion criteria. After each package is processed, a final list of all packages that were selected is provided to the user. The user can choose to delete all of those packages that were selected or exit without actual package deletions.
The prompting feature is completely turned off by "-noprompt". Execution with a scheduler service must use the "-noprompt" option, unless shell programming is provided to respond to the prompts. It is best to run with prompting when learning how to use the application. In this way, the user can review proper date formatting and correct package deletion candidates, with the option to exit without actual package deletions.
Logging
Application activity is reported to the Java standard out console. If a log file is desired, use the "-logfile | -log" option, like "-log c:\\mylog.file". If the log file already exists, the log lines are appended to the current file.
Deleting Packages with no expiration date specified
If a package does not have an expiration date assigned, it is ignored. If you wish to delete packages with missing expiration dates, use the "-deletenodate" option.
Deleting Specific Packages
When deleting packages, specify "-package" or "-pkg" along with the "-d" option (expiration date), to further subset which packages are deleted. The "-package" option allows you to specify the name of the package to delete.
Deleting Packages defined in WebDAV
To delete packages from a specific WebDAV server, specify the "-url" option along with the "-username" and "-password" options. The cleanup utility will use these options to bind to the WebDAV server and search for packages to delete. This option cannot be specified when the "-channel" option.
Debug Information
Specify "-debug" to turn on debug level information. This will provide debug information for all of the Foundation Services as well as the utility program. This option should only be used when trying to determine why the utility is not running properly.
Usage: java com.sas.services.publish.tools.PackageCleanup args
where args include: -channel | -ch <channel name> channel to process -deletionDate | -d <expiration date for deletion or listing of packages> Format: yyyyy.MM.dd 'at' hh:mm a reference Javadoc for java.text.SimpleDateFormat -list display a list of packages only (no deletion will occur) -metauser <username> username to use when binding to the Metdata Server -metapass <password> password to use when binding to the Metdata Server -domain <domain> authentication domain for the Metadata Server -package | -pkg <package name> name of package to delete -url <WebDAV URL> WebDAV URL to use when searching for packages to delete -username <username> username to use when binding to WebDAV server identified by 'url' property -password <password> password to use when binding to WebDAV server identified by 'url' property -logfile | -log <file name> name of log file -noprompt no user confirmation of deletes. -deletenodate delete/list packages that have no expiration date defined. -prompteach confirm each package for deletion. -debug print debug information for all the Foundation Services. -help print this help message. |
java -Djava.security.auth.login.config=C:/myconfig/login.config -Djava.security.policy=c:/myconfig/policy com.sas.services.publish.tools.PackageCleanup -ch myChannel -d "10000.10.07 at 12:59 PM" -metauser userA -metapass pass1 -domain DefaultAuth |
This second example uses the "-prompteach" option. This will require that the user confirm each package for deletion.
java -Djava.security.auth.login.config=C:/myconfig/login.config -Djava.security.policy=c:/myconfig/policy com.sas.services.publish.tools.PackageCleanup -ch myWebDAVChannel -d "2004.10.07 at 12:00 PM" -metauser userX -metapass mypass -domain DefaultAuth -prompteach |
This example deletes all packages defined to the channel "myChannel" that have an expiration date prior to 10/07/10000 at 12:59PM.
java -Djava.security.auth.login.config=C:/myconfig/login.config -Djava.security.policy=c:/myconfig/policy com.sas.services.publish.tools.PackageCleanup -ch myChannel -d "10000.10.07 at 12:59 PM" -metauser userX -metapass mypass -domain DefaultAuth |
This example deletes all packages defined to the channel "myChannel" that have an expiration date prior to 10/07/10000 at 12:59PM.
java -Djava.security.auth.login.config=C:/myconfig/login.config -Djava.security.policy=c:/myconfig/policy com.sas.services.publish.tools.PackageCleanup -ch myChannel -d "10000.10.07 at 12:59 PM" -metauser userX -metapass mypass -domain DefaultAuth |
This example deletes a specific package defined to the channel, "myChannel". The "-pkg" option is specified to identify the exact package to delete. This will delete the package named, s109513698.spk, that has an expiration date prior to 10/07/10000 at 12:59PM.
java -Djava.security.auth.login.config=C:/myconfig/login.config -Djava.security.policy=c:/myconfig/policy com.sas.services.publish.tools.PackageCleanup -ch myChannel -d "10000.10.07 at 12:59 PM" -pkg s109513698.spk -metauser userX -metapass mypass -domain DefaultAuth |
This example deletes all packages that are not defined to any channel. Only packages that are not defined to a channel and have an expiration date prior to 10/07/10000 at 12:59PM, will be deleted.
java -Djava.security.auth.login.config=C:/myconfig/login.config -Djava.security.policy=c:/myconfig/policy com.sas.services.publish.tools.PackageCleanup -d "10000.10.07 at 12:59 PM" -metauser userX -metapass mypass -domain DefaultAuth |
This example deletes packages that have been published to a WebDAV server. The utility binds to the server using the specified URL, and deletes all packages published to that location with an expiration date prior to 10/07/10000 at 12:59PM.
java -Djava.security.auth.login.config=C:/myconfig/login.config -Djava.security.policy=c:/myconfig/policy com.sas.services.publish.tools.PackageCleanup -d "10000.10.07 at 12:59 PM" -url http://myhost.com/Sales/Packages -username davUser -password davPassword -metauser userX -metapass mypass -domain DefaultAuth |
This example deletes a specific package from the specified WebDAV server. The "-pkg" option is used to provide the name of the package to delete. The utility binds to the server using the specified URL, and deletes the package named "s3964865240".
java -Djava.security.auth.login.config=C:/myconfig/login.config -Djava.security.policy=c:/myconfig/policy com.sas.services.publish.tools.PackageCleanup -d "10000.10.07 at 12:59 PM" -metauser userX -metapass mypass -domain DefaultAuth -url http://myhost.com/Sales/Packages -username davUser -password davPassword -pkg s3964865240 |
Constructor Summary | |
---|---|
PackageCleanup()
|
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
The main routine. |
Constructor Detail |
---|
public PackageCleanup()
Method Detail |
---|
public static void main(java.lang.String[] args)
args
- User-specified command-line arguments.
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |