HAPPY BOOKSGIVING
Use code BOOKSGIVING during checkout to save 40%-55% on books and eBooks. Shop now.
Register your product to gain access to bonus material or receive a coupon.
This eBook includes the following formats, accessible from your Account page after purchase:
EPUB The open industry format known for its reflowable content and usability on supported mobile devices.
PDF The popular standard, used most often with the free Acrobat® Reader® software.
This eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.
Save Time and Money: Streamline WebSphere Application Server Management with Jython Scripting!
Utilizing Jython scripting, you can dramatically reduce the effort, resources, and expense associated with managing WebSphere Application Server. WebSphere Application Server Administration Using Jython will show you how. The first start-to-finish guide to Jython scripting for WebSphere administration, this book’s practical techniques and downloadable scripts can help you improve efficiency, repeatability, and automation in any WebSphere environment.
This book’s expert authors begin with practical introductions to both WebSphere Application Server administration and Jython, today’s powerful, Java implementation of Python. Next, they cover a broad spectrum of WebSphere management tasks and techniques, presenting real, easy-to-adapt solutions for everything from server configuration and security to database management. These are powerful solutions you can begin using immediately–whether you’re running WebSphere in production, development, or test environments.
Coverage includes
Introduction to WebSphere Application Server Administration Using Jython
Download the sample pages (includes Chapter 1 and Index)
Acknowledgments . . . xxi
About the Authors . . . xxiii
Chapter 1 Introduction . . . 1
Why Is This Book Necessary? . . . 1
About the Websphere Application Server Product . . . 2
This Book and Its Organization . . . 2
Chapter 2 Jython Fundamentals . . . 5
Introduction . . . 6
Data Types . . . 6
Numbers . . . 7
Strings . . . 8
Tuples . . . 11
Lists . . . 12
Accessing Sequence Elements . . . 12
Dictionaries . . . 14
Additional Information Types . . . 15
Literals (Constants) . . . 15
Variables Names (Identifiers) . . . 15
Variables . . . 16
Expressions . . . 18
String Operators . . . 19
Statement Separator . . . 25
Comments . . . 26
Coding Conventions . . . 26
Summary . . . 26
Chapter 3 Jython Statements . . . 27
Expression Statements . . . 27
The print Statement . . . 27
Assignment Statements . . . 28
Packing and Unpacking . . . 30
Augmented Assignment . . . 32
Slices . . . 32
Simple Statements . . . 35
The assert Statement . . . 35
The break Statement . . . 36
The continue Statement . . . 36
The del Statement . . . 36
The exec Statement . . . 38
The import Statement . . . 39
The pass Statement . . . 39
The raise Statement . . . 39
Control Flow . . . 39
Compound Statements . . . 42
The if Statement . . . 42
loop Statements . . . 42
The while Statement . . . 43
The for Statement . . . 44
The try Statement . . . 47
Functions . . . 49
Function Definitions . . . 50
Namespaces . . . 51
The global Statement . . . 51
Function Parameters . . . 53
The return Statement . . . 58
Default Parameter Evaluation . . . 60
Summary . . . 62
Chapter 4 Jython Classes . . . 63
Class Statement . . . 63
Example class Definition . . . 64
Object Instantiation . . . 66
Built-in Constants . . . 66
Built-in Data Types . . . 67
List Methods . . . 67
Dictionary Methods . . . 69
String Methods . . . 71
String Formatting . . . 74
Built-in Functions . . . 77
Summary . . . 86
Chapter 5 Jython Modules . . . 87
Jython Module Basics . . . 87
The import Statement . . . 88
nested_scopes . . . 90
Packages . . . 92
Errors and Exceptions . . . 92
Built-in Exceptions . . . 93
Functional Programming . . . 94
Using Java Objects and Libraries . . . 95
Jython Standard Library . . . 97
getopt() Module . . . 100
Regular Expressions (RegExp) . . . 107
Summary . . . 112
Chapter 6 wsadmin . . . 113
wsadmin Options . . . 115
Usage Information . . . 116
The Java Virtual Machine Initialization Phase . . . 116
The wsadmin Environment Initialization Phase . . . 116
The Connection Phase . . . 120
Defining the Scripting Language . . . 122
Trace-Related Options . . . 122
wsadmin Profile Script Files . . . 123
Commands and Script Files . . . 126
Interactive/Interpretive wsadmin Session . . . 128
Summary . . . 128
Chapter 7 Introduction to Admin Objects . . . 129
The Administrative Scripting Objects . . . 129
Help for the Help Object . . . 134
Help for MBeans . . . 136
Help for MBean Attributes . . . 138
Help for MBean Operations . . . 140
Help for Additional MBean Information . . . 142
Help for Other Administrative Objects . . . 144
Help for WebSphere Messages . . . 145
Useful Information . . . 145
Summary . . . 147
Chapter 8 The AdminConfig Object . . . 149
AdminConfig Overview . . . 149
Configuration Identifier (config ID) . . . 150
Containment Path . . . 151
Configuration Types . . . 152
Using a config ID . . . 153
Show and Tell Methods . . . 155
Create and Modify Methods . . . 160
Configuration Verification/Validation . . . 162
Document Manipulation Methods . . . 164
Miscellaneous Methods . . . 164
Summary . . . 165
Chapter 9 The AdminControl Object . . . 167
Environment Information and Manipulation . . . 167
MBean Support Methods . . . 172
Objects, Names, and Instances . . . 173
Attribute-Related Methods . . . 174
Miscellaneous Methods . . . 181
*_jmx Methods . . . 183
Summary . . . 184
Chapter 10 The AdminApp Object . . . 185
Application Informational Methods . . . 185
Application Installation Methods . . . 190
Edit, Update, and Uninstall . . . 194
Miscellaneous AdminApp Methods . . . 196
Summary . . . 198
Chapter 11 The AdminTask Object–Server Management . . . 199
Introduction 199
Simple One-Line Examples . . . 201
ServerType-Related Methods . . . 202
Creating Servers and Clusters . . . 205
Server-Related Commands . . . 209
create*Server Optional and Required Steps . . . 212
Server Template-Related Commands . . . 214
JVM-Related Methods . . . 216
JVM System Properties . . . 217
JVM Properties . . . 218
z/OS-Specific Methods . . . 220
Miscellaneous ServerManagement Methods . . . 220
Reference Section . . . 223
Node Group Command Group and Core Group Command Group . . . 224
AdminReports Command Group . . . 226
ClusterConfigCommands Command Group . . . 226
ConfigArchiveOperations Command Group . . . 231
GenerateSecurityConfigCommand Command Group . . . 232
PortManagement Command Group . . . 232
ServerManagement Command Group . . . 233
Server Management Methods that Do Not Belong to Any Command Group . . . 238
Summary . . . 239
Chapter 12 Scripting and Security . . . 241
WebSphere Security Basics . . . 241
JAAS (J2C) Aliases . . . 242
Create a J2C (JAAS) Alias . . . 242
Viewing JAAS Aliases . . . 244
Modify a JAAS Alias . . . 245
Delete a JAAS Alias . . . 246
Configuring Application Security . . . 249
Enabling/Disabling Administrative and Application Security . . . 249
Mapping Java EE Roles . . . 250
Review the Current and Available Mappings . . . 251
Mapping Roles to Users and/or Groups . . . 251
Enable/Disable Java 2 Security . . . 253
LDAP Failover . . . 255
Viewing the Hosts . . . 257
Adding Additional LDAP Hosts . . . 258
Setting the Host List . . . 258
Removing LDAP Hosts . . . 259
Federated Registries (and Other Essentially Undocumented Scripting Areas) . . . 260
Multiple Security Domains (WebSphere V7) . . . 261
Additional Security Topics . . . 263
Bus Security . . . 263
Datasources . . . 263
Web Services . . . 264
AdminTask Security Reference . . . 264
SecurityConfigurationCommands Group . . . 264
SecurityDomainCommands Group . . . 270
SecurityRealmInfoCommands . . . 272
WIMManagementCommands . . . 273
WizardCommands . . . 274
JACCUtilityCommands . . . 275
IdMgrRepositoryConfig . . . 275
Chapter 13 Databases and Authorization . . . 277
Database Basics . . . 277
Terminology . . . 278
A Simple Example . . . 278
Troubleshooting Configuration Problems . . . 280
Advanced Settings . . . 284
Databases Reference Section . . . 291
JDBCProviderManagement Group . . . 291
VariableConfiguration Group . . . 294
Useful MBeans . . . 296
Summary . . . 300
Chapter 14 Messaging . . . 301
An Introduction to Messaging . . . 301
Messaging Basics . . . 302
Terminology . . . 303
Example: Creating a Bus . . . 303
Example: Deleting a Bus . . . 308
Security . . . 310
Enabling Bus Security . . . 311
Example: Enabling Bus Access Security . . . 312
Example: Enabling Transport Security . . . 314
Reference Section . . . 317
Creating Message Buses . . . 317
Deleting a Bus and Bus Components . . . 326
Modifying a Bus and Bus Components . . . 329
Displaying Buses and Bus Components . . . 334
Bus Security . . . 337
Summary . . . 344
Chapter 15 Administering Web Services . . . 345
Web Services Basics . . . 346
WS-I Profiles . . . 346
WSDL and SOAP . . . 347
A Web Service Example . . . 348
Web Services Runtimes . . . 351
Managing Web Services . . . 352
Exploring Web Services . . . 353
Listing Web Services . . . 353
Listing Web Services Information . . . 354
Exporting the WSDL for a Web Service . . . 355
Web Service Policy Sets . . . 355
Policy Set Bindings . . . 362
Policy Set Attachment . . . 368
Policy Topics Summary . . . 371
Additional Topics . . . 371
Enable/Disable Endpoints . . . 371
WS-Notification . . . 371
Web Services and the Service Integration Bus . . . 372
Mediations . . . 372
Web Services Gateway . . . 372
Online References . . . 372
AdminTask Web Services Reference . . . 373
SIBWebServices Group . . . 374
KeyManagerCommands . . . 377
KeyStoreCommands . . . 378
KeySetCommands . . . 381
PolicySetManagement Group . . . 382
WebServicesAdmin Group . . . 390
Chapter 16 Version 7.0 Scripting Libraries . . . 393
Library Organization . . . 393
Scripting Library Help . . . 397
Default Failure Action . . . 398
AdminApplication Script Library Module . . . 399
AdminApplication Group 1–Install and Uninstall Applications . . . 400
AdminApplication Group 2–Query Application Configurations . . . 403
AdminApplication Group 3–Update Applications . . . 404
AdminApplication Group 4–Export Applications . . . 406
AdminApplication Group 5–Configure Application Deployment . . . 407
AdminApplication Group 6–Start/Stop Applications . . . 408
Business-Level Applications (AdminBLA) . . . 409
Java 2 Connector (AdminJ2C) Library Module . . . 412
AdminJDBC Library Module . . . 414
AdminJMS Library Module . . . 416
AdminResources Library Module . . . 423
AdminAuthorizations Library Module . . . 428
AdminClusterManagement Library Module . . . 430
AdminServerManagement Library Module . . . 432
AdminServerManagement: Group 1–Server Configuration . . . 433
AdminServerManagement: Group 2–ServerTracingAndLogging Configuration . . . 437
AdminServerManagement: Group 3–OtherServicesConfiguration . . . 439
AdminNodeGroupManagement Library Module . . . 445
AdminNodeManagement Library Module . . . 446
AdminLibHelp and AdminUtilities Library Modules . . . 447
Summary . . . 447
Index . . . 449