Installing Upgrading Designing Configuring Deploying Monitoring Administering Troubleshooting Reference JBI Components
Close Print View
Designing: Using Name Patterns With the Batch Adapter
 

Classic Java CAPS

Developing Java CAPS Projects

Using SOAP Message Handlers

Creating a Runtime Environment

Designing Business Processes in the Sun Business Process Manager

Working with TCP/IP HL7 Collaborations

Developing Sun Master Indexes (Repository)

Developing Sun Master Patient Indexes

Developing OTDs for Application Adapters

Developing OTDs for Communication Adapters

Understanding the HTTPS OTD

HTTPS Client OTD

HTTPS Server OTD

Using the Batch Adapter OTDs

Overview of the Batch OTDs

BatchFTP OTD

BatchFTP OTD Node Functions

Using the BatchFTP OTD

BatchFTPOverSSL OTD

BatchSFTP OTD

BatchSCP OTD

BatchLocalFile OTD

BatchRecord OTD

BatchInbound OTD

Using Regular Expressions With the Batch Adapter

Using Name Patterns With the Batch Adapter

Creating a New COM and DCOM OTD

To Create a COM OTD

Relaunching OTDs

To Relaunch an Existing OTD

File Adapter Components

File OTD Operations

HL7 OTD Libraries

HL7 Version 2.6 OTD Library

HL7 Version 2.5.1 OTD Library

HL7 Version 2.5 OTD Library

HL7 Version 2.4 OTD Library

HL7 Version 2.3.1 OTD Library

HL7 Version 2.3 OTD Library

HL7 Version 2.2 OTD Library

HL7 Version 2.1 OTD Library

Working With HL7 OTDs

Viewing an OTD Using the OTD Editor

Modifying an OTD Using the OTD Editor

SNA Object Type Definitions (OTDs)

To associate the standard SNA eWay OTD to a new Java Collaboration:

Developing OTDs for Database Adapters

Developing OTDs for Web Server Adapters

Designing with Application Adapters

Designing with Communication Adapters

Designing with Web Server Adapters

SWIFT Integration Projects

Java EE Based Components

Designing with Sun JCA Adapters

About the TCP/IP JCA Adapter

Defining Constants and Variables

Using Database Operations

Developing Sun Master Indexes

Using the JMS JCA Wizard

Using the JAXB Wizard and Code-Seeder Pallete

Using Name Patterns With the Batch Adapter

The Batch adapter allows you to use a Name Pattern, that is, special characters that symbolize often-used information as short-hand. You can use these character combinations to specify place holders for this specific information. Using these characters, you can quickly convey date/time, number, and file-name information.

The BatchFTP, Batch FTPOverSSL, BatchSFTP, BatchLocalFile, and BatchInbound OTDs allow you to use special characters or specify a name pattern. A name pattern allows you to specify patterns for file names and directory names. Name patterns are used for “put” operations (sending or destination) , as opposed to regular expressions which are used for “get” operations (receiving or source).

Special characters are utilities the adapters use for file-name pattern. The general rules for their use are:

For example, for a put operation, a pattern such as file%#.dat can be used. This pattern uses the sequence number setting in the configuration, and each put creates successive files named file1.dat, file2.dat, and so on.

For information on regular expressions, see Using Regular Expressions With the Batch Adapter.

Types of Name Patterns

The adapter provides the following types of name patterns:

The sequence of expansion operates in the reverse order of the previous list, that is, first the file name is expanded, then the sequence number, and finally the time stamp.

Some additional examples of name pattern:

Resolving Names

Typically, the pre/post names with name patterns or regular expressions are resolved during get() and put() method calls. But sometimes, in using Collaboration Rules, the adapter has to get the resolved names before the actual get() or put() call.

In such cases, you can get the resolved names in this way through the ResolvedNamesForGet and ResolvedNamesForPut nodes in the BatchFTP OTD, for example:

getResolvedNamesForPut().getTargetFileName()

The previous code yields file1 based on the pattern file%#. In this usage, the OTD nodes can be used to make the desired method call.

Date and Time Format Syntax

The adapter uses the Java simple default date and time format syntax (U.S. locale). To specify these formats for name pattern, you must use a time pattern string.

Note - The adapter uses the Java standard for date/time stamps from the Java class java.text.SimpleDateFormat. Some of these formats can differ from the list given here, depending on the Java SDK version you are using.

In these patterns, all ASCII letters are reserved as pattern letters. See Table 2 for a complete list.

Time Pattern Strings and Meanings

Symbol
Meaning
Presentation
Example
%G
Era designator
Text
AD
%y
Year
Number
1996
%M
Month in year
Text and number
July & 07
%d
Day in month
Number
10
%h
Hour in a.m./p.m. (1 through 12)
Number
12
%H
Hour in day (0 through 23)
Number
0
%m
Minute in hour
Number
30
%s
Second in minute
Number
55
%S
Millisecond
Number
978
%E
Day in week
Text
Tuesday
%D
Day in year
Number
189
%F
Day of week in month
Number
2 (second Wednesday in July)
%w
Week in year
Number
27
%W
Week in month
Number
2
%a
Marker for a.m./p.m.
Text
PM
%k
Hour in day (1 through 24)
Number
24
%K
Hour in a.m./p.m. (0 through 1)
Number
0
%z
Time zone
Text
Pacific Standard Time

The general rules for date/time formats are:

U.S. Locale Date and Time Patterns

Format Pattern
Result
yyyy.MM.dd, G, ’at’ hh:mm:ss, z
1996.07.10 AD at 15:08:56 PDT
E, M, dd, ’’yy
Wednesday, July 10, ’96
h:mm, a
12:08 PM
h, ’o’’clock’ a, z
12 o’clock PM., Pacific Daylight Time
K:mm a, z
0:00 p.m., PST
yyyyy.M.dd, G, hh:mm, a
1996.July.10 AD 12:08 PM