100% found this document useful (1 vote)
9 views

Pro RESTful APIs with Micronaut: Build Java-Based Microservices with REST, JSON, and XML 2 / converted Edition Sanjay Patni instant download

The document discusses the book 'Pro RESTful APIs with Micronaut' by Sanjay Patni, which focuses on building Java-based microservices using REST, JSON, and XML. It covers key concepts such as data exchange mechanisms, API design, and best practices for RESTful APIs, specifically using the Micronaut framework. The book is intended for software developers and data professionals with Java programming experience who are interested in API development.

Uploaded by

minevaharby
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
9 views

Pro RESTful APIs with Micronaut: Build Java-Based Microservices with REST, JSON, and XML 2 / converted Edition Sanjay Patni instant download

The document discusses the book 'Pro RESTful APIs with Micronaut' by Sanjay Patni, which focuses on building Java-based microservices using REST, JSON, and XML. It covers key concepts such as data exchange mechanisms, API design, and best practices for RESTful APIs, specifically using the Micronaut framework. The book is intended for software developers and data professionals with Java programming experience who are interested in API development.

Uploaded by

minevaharby
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

Pro RESTful APIs with Micronaut: Build Java-

Based Microservices with REST, JSON, and XML 2 /


converted Edition Sanjay Patni download

https://ebookmeta.com/product/pro-restful-apis-with-micronaut-
build-java-based-microservices-with-rest-json-and-
xml-2-converted-edition-sanjay-patni/

Download more ebook from https://ebookmeta.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookmeta.com
to discover even more!

Pro RESTful APIs with Micronaut: Build Java-Based


Microservices with REST, JSON, and XML, 2nd Edition
Sanjay Patni

https://ebookmeta.com/product/pro-restful-apis-with-micronaut-
build-java-based-microservices-with-rest-json-and-xml-2nd-
edition-sanjay-patni/

Java XML and JSON 1st Edition Jeff Friesen

https://ebookmeta.com/product/java-xml-and-json-1st-edition-jeff-
friesen-2/

Java XML and JSON 1st Edition Jeff Friesen

https://ebookmeta.com/product/java-xml-and-json-1st-edition-jeff-
friesen/

Schooling the Nation: Education and Everyday Politics


in Egypt (The Global Middle East) Hania Sobhy

https://ebookmeta.com/product/schooling-the-nation-education-and-
everyday-politics-in-egypt-the-global-middle-east-hania-sobhy/
Writing Back in Modern Fiction A Postcolonial Study
First Edition Dr Ashraf Ibrahim Zidan

https://ebookmeta.com/product/writing-back-in-modern-fiction-a-
postcolonial-study-first-edition-dr-ashraf-ibrahim-zidan/

Charming Billy 1st Edition Alice Mcdermott

https://ebookmeta.com/product/charming-billy-1st-edition-alice-
mcdermott/

More than Sometimes 1st Edition Sj Mccoy

https://ebookmeta.com/product/more-than-sometimes-1st-edition-sj-
mccoy/

Sustainable Fishery Systems 2nd Edition Anthony Charles

https://ebookmeta.com/product/sustainable-fishery-systems-2nd-
edition-anthony-charles/

Progress in Pure and Applied Discrete Mathematics Vol 1


Probabilistic Methods in Discrete Mathematics 2nd
Edition V.F. Kolchin

https://ebookmeta.com/product/progress-in-pure-and-applied-
discrete-mathematics-vol-1-probabilistic-methods-in-discrete-
mathematics-2nd-edition-v-f-kolchin/
85 Years IFLA A History and Chronology of Sessions 1927
2012 1st Edition Jeffrey M Wilhite

https://ebookmeta.com/product/85-years-ifla-a-history-and-
chronology-of-sessions-1927-2012-1st-edition-jeffrey-m-wilhite/
Sanjay Patni

Pro RESTful APIs with Micronaut


Build Java-Based Microservices with REST,
JSON, and XML
2nd ed.
Sanjay Patni
Santa Clara, CA, USA

ISBN 978-1-4842-9199-3 e-ISBN 978-1-4842-9200-6


https://doi.org/10.1007/978-1-4842-9200-6

© Sanjay Patni 2017, 2023

This work is subject to copyright. All rights are solely and exclusively
licensed by the Publisher, whether the whole or part of the material is
concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in
any other physical way, and transmission or information storage and
retrieval, electronic adaptation, computer software, or by similar or
dissimilar methodology now known or hereafter developed.

The use of general descriptive names, registered names, trademarks,


service marks, etc. in this publication does not imply, even in the
absence of a specific statement, that such names are exempt from the
relevant protective laws and regulations and therefore free for general
use.

The publisher, the authors, and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, expressed or implied, with respect to the
material contained herein or for any errors or omissions that may have
been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.

This Apress imprint is published by the registered company APress


Media, LLC, part of Springer Nature.
The registered company address is: 1 New York Plaza, New York, NY
10004, U.S.A.
I would like to thank everyone at Apress who I’ve worked closely with.
Thanks to the reviewers; their in-depth reviews helped the quality of the
book. A heartfelt thanks goes to my wife, Veena, for her tireless and
unconditional support that helped me work on this book. A huge thanks
goes to my father, Ajit Kumar Patni, and my mother, Late Basantidevi, for
their selfless support that helped me reach where I am today.
Introduction
Databases, websites, and business applications need to exchange data.
This is accomplished by defining standard data formats such as
Extensible Markup Language (XML) or JavaScript Object Notation
(JSON), as well as transfer protocols or web services such as the Simple
Object Access Protocol (SOAP) or the more popular Representational
State Transfer (REST). Developers often have to design their own
Application Programming Interfaces (APIs) to make applications work
while integrating specific business logic around operating systems or
servers. This book introduces these concepts with a focus on the
RESTful APIs.
This book introduces the data exchange mechanism and common
data formats. For web exchange, you will learn the HTTP protocol,
including how to use XML. This book compares SOAP and REST and
then covers the concepts of stateless transfer. It introduces software
API design and best design practices. The second half of the book
focuses on RESTful APIs design and implementations that follow the
Micronaut and Java API for RESTful Web Services. You will learn how to
build and consume Micronaut services using JSON and XML and
integrate RESTful APIs with different data sources like relational
databases and NoSQL databases through hands-on exercises. You will
apply these best practices to complete a design review of publicly
available APIs with a small-scale software system in order to design
and implement RESTful APIs.
This book is intended for software developers who use data in
projects. It is also useful for data professionals who need to understand
the methods of data exchange and how to interact with business
applications. Java programming experience is required for the
exercises.
Topics include
Data exchange and web services
SOAP vs. REST, state vs. stateless
XML vs. JSON
Introduction to API design: REST and Micronaut
API design practices
Designing RESTful APIs
Building RESTful APIs
Interacting with RDBMS (MySQL)
Consuming RESTful APIs (i.e., JSON, XML)
Any source code or other supplementary material referenced by the
author in this book is available to readers on the Github repository:
https://github.com/Apress/Pro-RESTful-APIs-with-Micronaut. For
more detailed information, please visit
http://www.apress.com/source-code.
Table of Contents
Chapter 1:​Fundamentals of RESTful APIs
Abstract
SOAP vs.​REST
Web Architectural Style
Client-Server
Uniform Resource Interface
Layered System
Caching
Stateless
Code on Demand
HATEOAS
What Is REST?​
REST Basics
REST Fundamentals
Summary
Chapter 2:​Micronaut
Abstract
Comparison of Micronaut with Spring Boot
Ease of Installation
Natively Cloud Enabled
Serverless Functions
Application Configuration
Messaging System Support
Security
Caching
Management and Monitoring
API Portfolio
Online Flight
Message
Software
Micronaut
JDK 11
POSTMAN
CURL
IDE
Maven
Setting Up an IDE
Configuring Visual Studio Code
Summary
Chapter 3:​Introduction:​XML and JSON
Abstract
What Is XML?​
XML Comments
Why Is XML Important?​
How Can You Use XML?​
Pros and Cons of XML
What Is JSON?​
JSON Syntax
Why Is JSON Important?​
How Can You Use JSON?​
Pros and Cons of JSON
XML and JSON Comparison
Implementing APIs to Return XML and JSON Messages
Summary
Chapter 4:​API Design and Modeling
Abstract
API Design Strategies
API Creation Process and Methodology
Process
API Methodology
Domain Analysis or API Description
Architecture Design
Prototyping
Implementation
Publish
API Modeling
Comparison of API Modeling
In summary
Best Practices
Keep Your Base URL Simple and Intuitive
Error Handling
Error Code
Versioning
Partial Response
Pagination
Multiple Formats
API Façade
API Solution Architecture
Mobile Solutions
Cloud Solutions
Web Solutions
Integration Solutions
Multichannel Solutions
Smart TV Solutions
Internet of Things
Stakeholders in API Solutions
API Providers
API Consumers
End Users
API Modeling
Summary
Chapter 5:​API Portfolio and Framework
Abstract
API Portfolio Architecture
Requirements
Consistency
Reuse
Customization
Discoverability
Longevity
How Do We Enforce These Requirements—Governance?​
Consistency
Reuse
Customization
Discoverability
Change Management
API Framework
Process APIs:​Services Layer
System APIs:​Data Access Object
Experience APIs:​API Façade
Services Layer Implementation
Summary
Chapter 6:​API Platform and Data Handler
Abstract
API Platform Architecture
Why Do We Need an API Platform?​
So What Is an API Platform?​
So Which Capabilities Does the API Platform Have?​
API Development Platform
API Runtime Platform
API Engagement Platform
How Is an API Platform Organized?​What Is the Architecture of
the API Platform?​
How Does the API Architecture Fit in the Surrounding Technical
Architecture of an Enterprise?​
Data Handler
Data Access Object
Command Query Responsibility Segregation (CQRS)
SQL Development Process
NoSQL Process
Do I Have to Choose Between SQL and NoSQL?​
Why a Single REST API?​
Summary
Chapter 7:​API Management and CORS
Abstract
Façade
Façade Pattern
API Façade
API Management
API Life Cycle
API Retirement
API Monetization
Cross-Origin Resource Sharing (CORS)
Summary
Index
About the Author
Sanjay Patni
is a results-focused technologist with
extensive experience in aligning
innovative technology solutions with
business needs to optimize manual steps
in the business processes and improving
operational efficiency.
At Oracle, he has worked with the
Fusion Apps Product development team,
where he has identified opportunities for
automation of programs related to
Fusion Apps codeline management. This
involved delivery of GA releases for
patching, as well as codelines for
ongoing demo, development, and testing. He conceptualized and
developed self-service UX for codeline requests and auditing, reducing
manual steps by 80%. He also rolled out 12 sprints of codeline creation,
automating about 100+ manual steps involving integration with other
subsystems using technologies like automation workflow and RESTful
APIs.
Prior to joining Oracle, he spent 15+ years in the software industry,
defining and delivering key initiatives across different industry sectors.
His responsibilities included innovation, requirement, analysis,
technical architecture, design, and agile software development of web-
based enterprise products and solutions. He pioneered innovative
usage of Java in building business applications and received an award
from Sun Microsystems. This helped improve feedback for Java APIs for
Enterprise in building business application software using Java. He has
diverse experience in Application Architecture to include UX,
Distributed Systems, Cloud and DevOps.
He has worked as a visiting technical instructor or mentor and
conducted classes or training on RESTful APIs design and integration.
He has a strong educational background in computer science with a
master’s from IIT, Roorkee, India.
Exploring the Variety of Random
Documents with Different Content
unwittingly placed themselves in the power of Pecos Dalhart. The
summary punishment of the first three—the ones who had occupied
the jag-cell with Angevine Thorne—had been heralded far and wide
as an example of poetic justice, but the grim humor of this last
arraignment set the town in an uproar. Within two days these same
booze-fighting cowboys would appear against him in the upper
court, but of that event Pecos Dalhart took no thought and he
kangarooed them to a finish. It was good business, as the actors
say, and won him many a friend, for Arizona loves a sport—but after
they had been spread-eagled over a chair and received twenty blows
for contempt of court, the cowboys were ready to take their oath to
anything. That was it—Pecos might win the hearts of the people and
still go down before the law and the evidence. Only two things
cheered him on—Angy and Bill Todhunter had gone up the river for
Old Funny-face, and Joe Garcia was in town. After Crit had sworn
himself into perdition over the calf they would spring Funny-face on
him—Mexican brands and all—and show that he was a liar. Then
José Garcia would testify to the sale of Funny-face and her calf and
the rest would go off in a canter. It was a pleasing dream, and Pecos
indulged it to the full, for it was the only hope he had. But the next
morning he was nervous.
It was the day before his trial and even his six months in jail had not
taught him to be patient. As soon as the cells were unlocked he
began to pace up and down the corridor like a caged lion, scowling
and muttering to himself. To the stray visitors who dropped in he
was distant but civil, as befits a man who must act his part, but all
the time a growing uneasiness was gnawing at his heart and he
looked past them to the outer door. Hours dragged by and his
uneasiness changed into despair; he hurled himself upon his bunk
and was lying with his haggard face to the bars when the jail deputy
entered and gazed in upon him curiously.
"They's a lady out here to see you," he whispered, laying his finger
along his nose with an air of roguish secrecy, "shall I bring her in?
She's got something she wants to give you!"
A vision of the unbalanced females who had been bringing flowers
to a murderer came over Pecos and he debated swiftly with himself
whether to accept this last humiliation or plead a sudden
indisposition.
"She's been waiting around all the morning," continued the deputy.
"Kinder shy, I reckon—shall I bring 'er in? She's a Mex!"
A Mex! The word shocked Pecos like a blow; it made him glad, and
then it made him angry.
"Well, what's the matter with a Mex?" he demanded sharply. "Ain't a
Mexican got no rights in this dam' jail? I guess she's as good as any
white woman—show her in!"
He waited in palpitating silence, and when the soft rustle of skirts
sounded down the corridor his heart stopped beating entirely. Then
Marcelina pressed her face against the screened bars and gazed
wistfully into the darkened cell. She had grown taller since he last
saw her and her dark eyes had taken on a look of infinite
melancholy; the rare promise of her youth had flowered suddenly in
his absence and she stood before him a woman. Often in his dreams
he had thought of her, but always as the black-eyed girl, saucy and
fugitive as a bird, who had bewitched him with her childish graces;
now she peered in at him through the prison bars with the eyes of a
woman who has suffered and found her soul. For a moment she
gazed into the darkness, and then she drew back involuntarily. The
Pecos she had known was a grown-up boy, grim and quick in speech
but full of the reckless fire of youth; a dashing cowboy, guiding his
horse by a touch of the hand and riding, riding, always. Here was a
hard-faced man, pale and bowed by confinement, and his eyes were
like a starved animal's. She started and bit her lip.
"Are you Paycos?" she asked timidly.
The bitterness of his fate swept over Pecos at the words—he looked
down at his crumpled clothes, his outworn boots, and faded shirt
and rumbled in his throat.
"No, Marcelina," he said, "I'm only a caged wolf—a coyote that the
vaqueros have roped and tied and fastened to a tree. I'm a hard-
looker, all right—how'd you come to find me?"

She laid a brown hand against the bars as if in protest and motioned him nearer
the screen

She laid a brown hand against the bars as if in protest and motioned
him nearer the screen.
"I have only been in town four days," she said hurriedly. "All summer
I was shut up at Verde, and Ol' Creet—ah, that bad, ba-ad man! My
mother took me to school the day he come to Geronimo. I am 'fraid,
Paycos—but this morning I run away to see you. The seesters will be
hunt for me now. Look Paycos"—she thrust her hand into the bosom
of her dress and drew forth a small bundle, wrapped in a blue silk
handkerchief—"Cuidado, be careful," she whispered; "when I keess
you good-bye at the door I weel put thees een your hand—ssst!"
She turned and looked up the corridor where the deputy was doing
the Sherlock. He was a new man—the jail deputy—just helping out
during the session of the court and correspondingly impressed with
his own importance. Nothing larger than a darning-needle could be
passed through the heavy iron screen, but all the same he kept his
eye on them, and when he saw the quick thrust of her hand all the
suspicions of the amateur sleuth rushed over him at once.
"Hey! What's that?" he demanded, striding down the run-around.
"What you got hid there, eh?" He ogled Marcelina threateningly as
he stood over her and she shrank before his glance like a school-girl.
"Come, now," he blustered, "show me what that is or I'll take it
away from you. We don't allow anything to be passed in to the
prisoners!"
"She can't pass nothin' through here!" interposed Pecos, tapping on
the screen. "You haven't got nothin', have you, Marcelina?"
"Well, I saw her hide something blue in her dress just now,"
persisted the jailer, "and I want to see it, that's all!"
"It was—it was only a handkerchief!" sobbed Marcelina, clutching at
her breast. "No, no! Eet is mine—he—he geev it to me! You can not
—" she choked, and backed swiftly toward the door. Like a panther
Pecos whipped out of his cell and sprang against the corridor
grating, but she was gone. The deputy made a futile grab as she
darted away from him and sprang after her, but she swung the great
door in his face and sped like a deer down the hall. The next
moment she was gone, leaving Pecos and the deputy to have it out
together.
"Aha!" cried the deputy vengefully, "you will try to smuggle things in,
will you? I'll report this matter to Mr. Morgan at once!"
"Well, report it, then, you low-flung hound!" wailed Pecos, "report it,
and be damned to you! But if I was outside these bars I'd beat you
to death for this!" They raged up and down the grating, snarling at
each other like dogs that fight through a lattice, and even when
Boone Morgan came and called them down Pecos would not be
appeased.
"He scairt my girl away!" he cried, scowling menacingly at the raw
deputy. "She come to give me a handkerchief and he jumped at her.
I'll fix him, the dastard, if ever I git a chance!" And so he raged and
stormed until they went away and left him, mystified. To Boone
Morgan it seemed as if his alcalde was raising a row out of all
proportion to his grievance, but that was because Pecos could not
explain his woes. Marcelina had promised to kiss him good-bye, and
the damned deputy had intervened!
CHAPTER XX
THE LAW AND THE EVIDENCE

A S the rising sun poured its flood of glorious light into the court-
house square and the janitor, according to his custom, threw
open the court-room doors to sweep, there was a scuffling of
eager feet from without and the swift-moving pageantry of the
Dalhart trial began. A trio of bums who had passed the night al
fresco on the park benches hustled past the astounded caretaker
and bestowed themselves luxuriously on the front seats. As the
saloons opened up and discharged their over-night guests others of
the brotherhood drifted in and occupied the seats behind, and by
the time the solid citizens of Geronimo had taken care of their stock,
snatched their breakfasts, and hurried to the scene there was
standing room only in the teeming chamber of justice. Only the
special venire of jurymen took their time in the matter and the
sweating bailiff had to pass them in through the side door in order to
get them seated inside the railing. At nine-thirty Boone Morgan
brought in the defendant, freshly shaven and with his hair plastered
down across his forehead, and sat with him near the jail door. It was
all in the line of duty, but there were those who remarked that it was
right clever of old Boone to throw in that way with his jail alcalde.
Some people would have put the nippers on him for the cow-thief
that he was, and chained him to a deputy. Behind them, the
cynosure of all eyes, sat the counsel for the defendant, Angevine
Thorne, his round baby face illuminated with the light of a great
resolve. On that day he was going to save his friend from prison or
climb spider-webs in the attempt. A hush fell over the assembly as
the hour of trial drew near and only the gaunt figure of Shepherd
Kilkenny, pacing up and down before the empty jury-box, suggested
the battle that was to come. The rest was as pathetic as the
Angelus.
The soft morning breeze breathed in through the windows and as
Pecos glimpsed the row of horses tied to the hitching rack he filled
his lungs deep with the sweet air, and sighed. The invalid who has
been confined to his room longs vaguely for the open air, but to the
strong man of action, shut up for months in a close cell, the outer
world seems like a dream of paradise and he sees a new heaven in
the skies. In the tense silence of waiting the tragedy in his face
afflicted the morbid crowd and made them uneasy; they shifted their
eyes to the stern, fighting visage of the district attorney and listened
hopefully for the clock. It struck, slowly and with measured pauses,
and as the last stroke sounded through the hall the black curtain
behind the bench parted and the judge stepped into court. Then
instantly the sheriff's gavel came down upon the table; the People
rose before the person of the Law, and in sonorous tones Boone
Morgan repeated the ancient formula for the calling of the court.
"Oyez! Oyez! Oyez! The District Court of Geronimo County is now in
session!"
The judge threw off his robes and sat down and as the audience
sank back into their crowded seats he cast one swift, judicial glance
at the defendant, the clerk, and the district attorney and called the
case of Pecos Dalhart, charged with the crime of grand larceny. With
the smoothness of well-worn machinery the ponderous wheels of
justice began to turn, never halting, never faltering, until the forms
prescribed by law had been observed. One after the other, the clerk
called the names of the forty talesmen, writing each name on a slip
of paper as the owner answered "Here"; then at a word from the
judge he placed the slips in a box and shook out twelve names upon
the table. As his name was called and spelled each talesman rose
from his seat and shambled over to the jury-box, turning his solemn
face from the crowd. They held up their right hands and swore to
answer truthfully all questions relative to their qualifications as
jurors, and sat down to listen to the charges; then, after reading the
information upon which the accusations were based, the district
attorney glanced shrewdly at the counsel for defendant and called
the first juryman. The battle had begun.
The first talesman was a tall, raw-boned individual with cowman
written all over him, and the district attorney was careful not to ask
his occupation. He wanted a jury of twelve cowmen, no less; and,
knowing every man in the venire either by sight or reputation, he
laid himself out to get it.
"Mr. Rambo," he began, "do you know the defendant in this case?"
He indicated Pecos Dalhart with a contemptuous wave of the hand,
and Mr. Rambo said he did not. "Know anything about this case?"
"Only what I read in the papers," responded the cowman dryly.
"You don't believe everything you read, do you, Mr. Rambo? If you
were passed for a juror you wouldn't let anything you have read
influence your mind, if it was proven that the defendant was guilty,
would you?"
"No, sir!"
"If I should prove to your satisfaction that the defendant here"—
another contemptuous wave of the hand—"had wilfully and
feloniously stolen and branded the animal in question, what would
your verdict be—'Guilty' or 'Not guilty'?"
"W'y—er—'Guilty'!"
"Pass the juror!" snapped the district attorney, and then he looked at
the counsel for the defendant as if imploring him not to waste any of
the court's valuable time.
"Mr. Rambo," began Angy, singing the words in a child-like,
embarrassed manner, "you are engaged in the business of raising
cattle, are you not?"
The district attorney winced at this, but Angevine Thorne did not
take advantage of his discovery. He also wanted a jury of twelve
cowmen, though he did not show his hand.
"Very good," he observed, "and I suppose, Mr. Rambo, that you are
acquainted with the law in this case which makes it a felony for any
man to mark or brand the stock of another man? Very good. Have
you any prejudice against that law, Mr. Rambo? You believe that it
should be enforced impartially, do you not—against the rich as well
as the poor? Very good. Pass the juror!"
For a moment Shepherd Kilkenny could hardly believe his ears. The
drift of every one of the questions had led naturally up to a
challenge and yet at the end Angy had passed the juror. He glanced
quickly at the innocent face of his opponent, opened his mouth to
speak, and then hurried on with his examination. The second man
was interested in the cattle business, too; and when Angy passed
him the judge felt called upon to speak.
"You know, do you not, Mr. Thorne," he said, "that it is your privilege
to excuse any juror whose occupation or condition of mind might
indicate a prejudice against your client?"
"Yes, indeed, Your Honor," replied Mr. Thorne, suavely, "but I have
perfect confidence in the integrity of the two gentlemen just passed.
I feel sure that they will do full justice to Mr. Dalhart."
"Very well, then," said His Honor, "let the examination proceed!"
With all the address of a good tactician who sees that his opponent
has mistaken a two-spot for an ace, Shepherd Kilkenny flew at his
task, but each time that Angy passed one of his cowmen he paused
just the fraction of a second, glanced apprehensively about the
room, and rubbed his chin thoughtfully. The defence was playing
right into his hand, but he didn't know whether he liked it or not.
When it came to the peremptory challenges he excused two health-
seekers and a mining man, but Thorne did not challenge a man.
Once more the clerk shook the names out of his box and within half
an hour the district attorney had the very jury he wanted—every
man of them interested in the cattle business and ready to cinch a
rustler as they would kill a rattlesnake. It seemed almost too good to
be true. Even the staid judge was concerned, for he had a sober
sense of justice and Angy's appointment had been slightly irregular;
but after a long look at that individual he motioned for the trial to
proceed. The evidence was all against the defendant anyway, and he
could cut off a year or two on the sentence to make amends.
"Swear the jurors!" he said, and holding up their rope-scarred hands
and looking coldly across the room at the alleged rustler, the twelve
cowmen swore to abide by the law and the evidence and a true
verdict find. Then the district attorney pulled his notes from his hip-
pocket as a man might draw a deadly weapon and began his
opening statement to the jury.
"Your Honor and gentlemen of the jury," he said, "in the case of the
People of the Territory of Arizona versus Pecos Dalhart, we shall
show that on or about the eighth day of May the said Pecos Dalhart
did wilfully, feloniously, and unlawfully pursue, rope, and brand a
calf, said calf being the property of Isaac Crittenden of Verde
Crossing, Territory of Arizona; that the said Pecos Dalhart was
arrested and, upon being taken before a magistrate, he did plead
'Not guilty' and was held for the grand jury, which handed down an
indictment against him; that upon being arraigned before the judge
he did plead 'Not guilty' and was remanded for trial upon the crime
charged in the indictment, to wit:—that he did feloniously and
unlawfully mark, brand, or alter the brand on a neat animal, to wit,
one red-and-white spotted calf, said calf being the property of Isaac
Crittenden, of Verde Crossing, Territory of Arizona, contrary to the
form, force, and effect of the statute in such case made and
provided and against the peace and dignity of the People of the
Territory of Arizona. Mr. Crittenden, will you please take the stand!"
All the other witnesses had been relegated to the jury-room, where
they would be beyond the sound of the court, but being the
complaining witness Isaac Crittenden was entitled to remain and he
sat just behind the district attorney, fumbling with the high collar
that galled his scrawny neck and rolling his evil eye upon the
assemblage. As he rose up from his place and mounted the witness
stand a rumble of comment passed through the hall and the sheriff
struck his gavel sharply for order.
"Swear the witness, Mr. Clerk," directed the judge, and raising his
right hand in the air Isaac Crittenden rose and faced the court,
looking a trifle anxious and apprehensive, as befits one who is about
to swear to a lie. Also, not being used to actions in court, he
entertained certain illusions as to the sanctity of an oath, illusions
which were, however, speedily banished by the professional
disrespect of the clerk. Reaching down under the table for a
penholder which he had dropped and holding one hand weakly
above his head he recited with parrot-like rapidity the wearisome
formula of the oath:—"Do you solemnly swear that the evidence you
are about to give in the case of the People versus Pecos Dalhart
shall be the truth, the whole truth, and nothing but the truth,
s'elpyougod?"
Crittenden blinked his good eye and sat down. There was nothing
very impressive about the proceeding, but all the same he was liable
for perjury.
"Calling your attention to the eighth day of May, of the present year,
where were you on that day, Mr. Crittenden?" It was the first gun in
the real engagement and the surging crowd about the doors quit
scrouging for a view and poised their heads to listen. The voice of
the district attorney was very quiet and reassuring, and Isaac
Crittenden, taking his cue, answered with the glib readiness of a
previous understanding.
"I was gathering cattle with my cowboys near my ranch at Verde
Crossing."
"And upon returning to your home did you encounter any one in the
deep arroyo which lies above your ranch?"
"Yes, sir," responded Crittenden, "I come across Pecos Dalhart."
"Is this the gentleman to whom you refer?" inquired Kilkenny,
pointing an accusing thumb toward Pecos. "Very good, then—you
identify the defendant. Now, Mr. Crittenden, what was the defendant
doing at that time?"
"He had a spotted calf of mine strung out by a little fire and was
alterin' the brand with a runnin' iron." Old Crit's eye wandered
instinctively to Pecos Dalhart as he spoke and gleamed with a hidden
fire, but his face was as expressionless as a death mask.
"I offer the following animal in evidence," said the district attorney,
beckoning toward the side door. "Bring in the exhibit!" And as Bill
Todhunter appeared, sheepishly leading the spotted calf, which had
been boarded all summer in town, he threw out his hand
dramatically and hissed:
"Do you identify this animal? Is that the calf?"
"I do!" responded Crit. "It is the same animal!"
"That's all!" announced Kilkenny, and with a grin of triumph he
summoned the hawk-eyed jurymen to inspect the brand. There it
was, written on the spotted side of the calf, in ineffaceable lines—the
plain record of Pecos Dalhart's crime, burned with his own hands.
Across the older scar of Isaac Crittenden's brand there ran a fresh-
burnt bar, and below the barred Spectacle was a Monkey-wrench,
seared in the tender hide. To a health-seeker or a mining man the
significance of those marks might be hidden, but the twelve cowmen
on the jury read it like a book. Only one thing gave them a passing
uneasiness—Crit's Spectacle brand was very evidently devised to
burn over Pecos Dalhart's Monkey-wrench, but that was beside the
point. They were there to decide whether Pecos Dalhart had stolen
that particular spotted calf, and the markings said that he did. By
that broad bar which ran through the pair of Spectacles he deprived
Isaac Crittenden of its ownership, and by the Monkey-wrench burned
below he took it for his own. All right then,—they retired to their
seats and Angevine Thorne took the witness.
They faced each other for a minute—the man who had committed a
crime and covered it, and the man who had sworn to expose his
guilt—and began their fencing warily.
"Mr. Crittenden," purred Angy, "you are in the cattle business, are
you not? Yes, indeed; and about how many cattle have you running
on your range?"
"I don't know!" answered Crittenden gruffly.
"At the last time you paid your taxes you were assessed for about
ten thousand, were you not? Quite correct; I have the statement of
the assessor here to verify it. Now, Mr. Crittenden, kindly tell the jury
what per cent of those cattle are calves?"
"I don't know," replied Crit.
"No?" said Angy, with assumed surprise. "Well then, I hope the court
will excuse me for presuming to tell a cowman about cows but the
percentage of calves on an ordinary range is between fifty and sixty
per cent. So, according to that you have on your range between five
and six thousand calves, have you not? Very good. And now, Mr.
Crittenden, speaking roughly, about how many of your cattle are
solid color?"
"I don't know!" scowled Crit.
"You don't know," repeated Angy gravely. "Very good. I wish the
court to note that Mr. Crittenden is a very poor observer. Now, Mr.
Crittenden, you have stated that you do not know how many cattle
you have; nor how many of said cattle are calves; nor how many of
said calves are solid color or spotted. Will you kindly inform the
court, then, how you know that the calf which has been produced in
evidence is yours?"
"Well—" said Crittenden, and then he stopped. The one thing which
he was afraid of in this trial was about to happen—Angy was going
to corner him on the maternity of the calf, and that would make him
out a cow-thief. The district attorney scowled at him to go ahead
and then, in order to cover up the failure, he leapt to his feet and
cried:
"Your Honor, I object to the line of questioning on the ground that it
is irrelevant, incompetent, and immaterial!"
"If the court please," spoke up Angevine Thorne, "the witness has
positively identified the calf in question as his own, although it is a
matter of record that he possesses four or five thousand calves, all
of which have been born within the past year and over half of which
are spotted. It is the purpose of the defence to prove that this calf
does not belong to the witness; that it was the property of Pecos
Dalhart at the time the alleged crime was committed, and that it had
been previously stolen by Isaac Crittenden!"
As he shouted these words Angy pointed an accusing finger at Old
Crit, who started back like a man who had been struck, and while
the clamor of deputies and bailiffs filled the court-room they stood
there like the figures in a tableau, glaring at each other with
inextinguishable hatred.
"Order in the court! Order in the court!" cried the bailiffs, beating
back the crowd, and when the assembly had been quieted the judge
motioned to Angy to proceed.
"Objection is overruled," he said, and bent his dark brows upon
Isaac Crittenden. "Let the witness answer the question."
"Well, the calf had my brand on it," responded Crittenden defiantly,
and then, egged on by Angy's sarcastic smile, he went a step too far.
"Yes, and I know him, too!" he blurted out. "I'd know that calf
among a thousand, by them spots across his face."
"Oh, you would, would you?" spoke up Angy quickly. "You have a
distinct recollection of the animal on account of its peculiar markings
then; is that right? Very good. When did you put your brand on that
calf, Mr. Crittenden?"
"Last Spring," replied Crittenden grudgingly.
"You know the law regarding the branding of calves," prompted
Angy. "Was the calf with its mother at the time?"
"It was!"
"And did she bear the same brand that you burned upon her calf?"
"She did!"
"Any other brands?"
"Nope!"
"Raised her yourself, did you?"
"Yes!" shouted Crittenden angrily.
"That's all!" said Angy briefly, and Isaac Crittenden sank back into
his chair, dazed at the very unexpectedness of his escape. It was a
perilous line of questioning that his former roustabout had taken up,
leading close to the stealing of Upton's cattle and the seizing of
Pecos Dalhart's herd, but at the very moment when he might have
sprung the mine Angy had withheld his hand. The gaunt cowman
tottered to his seat in a smother of perspiration, and Shepherd
Kilkenny, after a moment's consideration, decided to make his hand
good by calling a host of witnesses.
They came into court, one after the other, the hard-faced gun-men
that Crittenden kept about his place, and with the unblinking
assurance of men who gamble even with life itself they swore to the
stereotyped facts, while Angy said never a word.
"The People rest!" announced the district attorney at last, and lay
back smiling in his chair to see what his opponent would spring.
"Your Honor and gentlemen of the jury," began Angevine Thorne,
speaking with the easy confidence of a barrister, "the prosecution
has gone to great lengths to prove that Pecos Dalhart branded this
calf. The defence freely admits that act, but denies all felonious
intent. We will show you, gentlemen of the jury, that at the time he
branded the animal it was by law and right his own, and that during
his absence it had been feloniously and unlawfully branded into the
Spectacle brand by the complaining witness, Isaac Crittenden. Mr.
Dalhart, will you please take the stand!"
Awkward and shamefaced in the presence of the multitude and
painfully conscious of his jail clothes, Pecos mounted to the stand
and turned to face his inquisitor. They had rehearsed the scene
before—for Babe Thorne was not altogether ignorant of a lawyer's
wiles—and his examination went off as smoothly as Kilkenny's
examination of Crit, down to the point where Pecos was rudely
pounced upon and roped while he was branding his spotted calf.
Then it was that Angevine Thorne's voice began to ring like a
trumpet, and as he came to the crucial question the audience stood
motionless to listen.
"Now, Mr. Dalhart," he clarioned, "you say that you purposely barred
the Spectacle brand upon this calf and burned your own brand,
which was a Monkey-wrench, below it? What was your reason for
that act?"
"My reason was that the calf was mine!" cried Pecos, rising angrily to
his feet. "When I first come to Verde Crossing I bought an old
spotted cow and her calf from José Garcia and branded them with a
Monkey-wrench on the ribs—I kept her around my camp for a milk
cow. That first calf growed up and she was jest comin' in with
another one when I went to New Mexico last Fall. Well, when I came
back last Spring I hadn't got into town yet when I come across my
old milk cow with her ears all chopped up and her brand burned
over and this little calf, lookin' jest like her, with a Spectacle brand
burned on his ribs. That made me mad and I was jest ventin' the
calf back to a Monkey-wrench when Crittenden and his cowboys
jumped in and roped me!"
"You say that you bought the mother of this calf from José Garcia?"
"Yes, sir! I paid him twenty-five dollars for the cow and five dollars
for the first calf."
"What were the brand and markings of this cow at the time you
bought her?"
"She had a Mexican brand, like an Injun arrer struck by lightning, on
her left hip, a big window or ventano in the left ear, and a slash and
underbit in the right. Garcia vented his brand on her shoulder and I
run a Monkey-wrench—that's my regular, registered brand—on her
ribs, but I never changed her ear marks because I kept her for a
milk cow anyway."
"Your Honor," interposed Kilkenny, rising with a bored air to his feet,
"I object to this testimony on the ground that it is irrelevant,
incompetent, and immaterial. I fail to see the relation of this
hypothetical milk cow to the question before the court."
"The cow in question was the mother of the calf which my client is
accused of stealing!" cried Angy, panting with excitement as he saw
the moment of his triumph approaching. "She was sold to the
defendant and he had a legal right to her offspring. Can a man steal
his own property, Your Honor? Most assuredly not! I wish to produce
that cow in evidence and I will bring competent witnesses to prove
that she belongs by rights to Pecos Dalhart. Bring in the exhibit, Mr.
Todhunter!"
He waved his hand toward the side door and as Kilkenny saw the
coup which had been sprung on him he burst into a storm of
protest. "I object, Your Honor!" he shouted, "I object!"
"Objection overruled!" pronounced the judge. "Let the cow be
brought in as quickly as possible and after the examination of the
exhibit we will proceed at once to the argument."
He paused, and as the crowd that blocked the side door gave way
before the bailiffs, Old Funny-face was dragged unwillingly into court
and led to the sand boat to join her calf. At the first sight of her dun-
colored face and spotted neck every man in the jury-box looked at
his neighbor knowingly. They were cowmen, every one of them used
to picking out mothers by hair-marks in the corral cut, and Old
Funny-face was a dead ringer for her calf. Even to the red blotch
across his dun face the calf was the same, and when Funny-face
indignantly repulsed its advances they were not deceived, for a cow
soon forgets her offspring, once it is taken away. But most of all
their trained eyes dwelt upon the mangled ears, the deep swallow
fork in the left and the short crop in the right, and the record of the
brands on her side. There was the broken arrow, just as Pecos had
described it, and the vent mark on the shoulder. It would take some
pretty stiff swearing to make them believe that that Spectacle brand
on her ribs had not been burnt over a Monkey-wrench. It was Angy's
inning now, and with a flourish he called Pecos to the stand and had
him identify his cow; but when he called José Garcia, and José,
gazing trustfully into Angy's eyes, testified that she was his old milk
cow and he had, sin duda, sold her to Pecos Dalhart for twenty-five
dollars, the self-composed Kilkenny began to rave with questions,
while Crittenden broke into a cold sweat. Not only was the case
going against him, but it threatened to leave him in the toils. It was
too late to stop Garcia now—he had said his say and gone into a
sullen silence—there was nothing for it but to swear, and swear
hard. Kilkenny was on his toes, swinging his clenched fist into the
hollow of his hand and raging at the witness, when Crittenden
suddenly dragged him down by the coat-tails and began to whisper
into his ear. Instantly the district attorney was all attention; he asked
a question, and then another; nodded, and addressed the court.
"Your Honor," he said, "I will excuse the witness and ask to call
others in rebuttal. Will you take the chair, Mr. Crittenden!"
Old Crit advanced to the stand and faced the court-room, a savage
gleam in his eye.
"Do you recognize this cow, Mr. Crittenden?" inquired Kilkenny
mildly.
"Yes, sir, I know her well. She's an old gentle cow that's been
hangin' around my corral for years. I took her from Joe Garcia, last
Spring, for some money he was owin' me."
"What?" yelled Angy, springing up from his chair, "do you mean to
say—"
"I object, Your Honor!" clamored Kilkenny desperately. "I object! The
witness is mine!"
"The People's witness," ruled the judge; "let the examination
proceed."
"Is this cow the mother of the calf in question—do you identify her
as the mother of this calf?"
"I do!" repeated Crittenden solemnly. "And you can summon any of
my cowboys—they'll swear to her."
"Take the witness!" said Kilkenny, leering at Angevine Thorne, and in
spite of all Angy could do Crit stuck to his story, word for word. One
after the other his cowboys took the chair, glanced at their boss, and
identified the cow and calf. Kilkenny had won, and before Babe
Thorne could collect his wits he plunged into his closing argument.
"Gentlemen of the jury," he cried, "the people of Geronimo County
are looking to you to-day to vindicate justice in the courts. It is the
shame of Geronimo County—spoken against her by all the world—
that not a single cattle-thief has ever been convicted in her courts.
Men have been tried; their guilt has been demonstrated to a moral
certainty; but the evidence has been insufficient, and they have
escaped. Gentlemen of the jury, a year and a half ago the defendant
in this case came to Geronimo County without a cent; he went to
work for Mr. Crittenden, who kindly took him in; but within a few
months, gentlemen of the jury, Pecos Dalhart left the service of his
benefactor and moved to Lost Dog Cañon. Six months later,
gentlemen, when the sheriff at the risk of his life rode into his guilty
hiding-place, Mr. Dalhart had two hundred head of cattle shut up in
a secret pasture! Two—hundred—head, gentlemen; and he defied
the sheriff of this county to even collect the taxes upon those cattle!
Gentlemen of the jury, I ask you, Where did this man get those two
hundred head of cattle? Did he bring them with him? No, for the
evidence shows that he rode in alone. Did he buy them? No, for he
had no money. Gentlemen of the jury, that man who sits before you
stole those cattle, and he does not dare to deny it!"
He paused and looked about the court-room, and a great hush came
upon the entire assembly. Every man in the crowded standing room
stood silent and the surge of those without the doorway died down
in a tremor of craning heads. Kilkenny had won—but he had not
finished. Point by point he went over the chain of his evidence,
testing every link to prove that it was true, and then in a final
outburst of frenzy he drove the last point home.
"Gentlemen of the jury," he said, in closing, "the defendant stands
before you, convicted by his own words. He acknowledges that he
branded the calf; he acknowledges that he set at defiance all law
and justice and robbed the man who had befriended him—and what
is his defence? That Isaac Crittenden had robbed him of his cow!
Isaac Crittenden, who has cattle on a thousand hills! A man known,
and favorably known, in this community for twenty years!
Gentlemen, I ask of you, whose word will you take in this matter?
The word of this self-confessed cattle-rustler and his Mexican
consort or the word of Isaac Crittenden of Verde Crossing?
Gentlemen of the jury, it has been the shame of Geronimo County
for many years that this practice of rustling cattle has never received
its fitting rebuke. It has been the shame of Arizona that the rights of
the cattle men, the men who dared the Indians and braved the
desert and made this country what it is, have never been protected.
You have seen what this negligence has brought to our near
neighbor, Tonto County—a cattle war in which over fifty men have
given up their lives; a beautiful cattle country, devastated of all its
flocks and herds. It has brought death, gentlemen, and destruction
of property, and—bankruptcy! Gentlemen, I ask you for a verdict of
'Guilty'!"
He sat down, and Angevine Thorne rose to his feet, bewildered. The
speech which he had prepared to save his friend was forgotten; the
appeals which he could have made were dead. He gazed about the
court and read in every eye the word that was still ringing in his
ears: "Guilty!" And yet he knew that Pecos was not guilty. Cattle he
had stolen, yes—but not the cattle in court. They, of all the animals
he had owned, had been honestly acquired; but Old Crit had sworn
him into prison. It was right, perhaps, but it was not Law—and it
was the law that held him. As he looked at the forbidding faces
before him, each one hard and set by the false words of Crit and
Shepherd Kilkenny, the monstrous injustice of the thing rushed over
him and he opened his lips to speak. It was a conspiracy—a hellish
combination of lawyers and the men they served, to beat the poor
man down. The old rage for the revolution, the rage which he had
put so resolutely from his heart, rushed back and choked him; he
scowled at the sneering district attorney and Old Crit, humped over
in his chair; and turned to the glowering audience, searching with
the orator's instinct for a single friendly face. But there was none;
every man was against him—every one! He raised his hand to
heaven—and stopped. There was a struggle in the doorway—a
bailiff, tall and burly, was thrusting back a young girl who struggled
to get free—and then like a flash of light Babe Thorne saw her face,
the wild-eyed, piteous face of Marcelina!
"Here!" he commanded, leaping upon a chair and pointing with an
imperious hand. "Let that girl in! Your Honor, I demand that that girl
be let in! This trial is her trial, Your Honor—she is Marcelina Garcia,
my friend's affianced bride!" In that single moment he saw it—the
last desperate chance to save his friend—a sentimental appeal to the
jury! How many men have been saved from prison and gallows and
the just punishment of their crimes by such a ruse! Given the aged
mother, the despairing wife, the sweetheart, clinging to his hand,
and all the thunderings of Jove will fail of conviction. The law and
the evidence are nothing; Reason is dethroned and Justice tips her
scales to send the prisoner free. With a surly frown the bailiff let go
his hold and like a hunted creature that flees from the memory of
her pursuers Marcelina ran panting down the aisle and threw herself
at the feet of the just judge.
"Oh, Meester," she cried, holding up her hands, "do not send Paycos
to preeson! Look, here are the ears of Old Funny-face, his cow, what
Ol' Creet stole while he was gone! Paycos did not steal the cow—no,
no! He buy heem from my papa, and this is mi padre's mark!" She
unwound the blue silk handkerchief that encased them and thrust
into the hands of the astounded judge—two ears! With eager
glances she held them up—the keys which Old Crit had cut from
Funny-face's ears on the day that he stole Pecos's herd—and thrust
her brown finger through the Mexican ventano. Then, impatient of
her English, she snatched them back and, scampering back to where
Old Funny-face still stood on the sand boat, she fitted the crop and
swallow-fork back into the mangled ears.
"Look! Look!" she cried, "these are the dried-up ears what Ol' Creet
cut from my Paycos's cow, that day when he stole his cattle. My
leetle brothers bring them from the corral to play with and I hide
them, to show to Paycos. Meester, he is bad man, that Creet! He—
he—"
She faltered and started back. There before her, humped over in his
chair, sat Isaac Crittenden, and his one eye covered her like the evil
glare of a rattlesnake.
"Santa Maria!" she gasped. "Madre de Dios! Creet!" And with a
scared sob she turned and ran to Babe. It was an affecting scene,
but Babe did not overdo it.
"Your Honor," he said, speaking over her bowed head with
portentous calm, "I wish to offer these two ears in evidence as an
exhibit in this case. One of them, you will notice, is cut in a swallow-
fork and exhibits, above, the ventano which defendant testified
belonged to the mother of this calf; the other is cropped short and
exhibits the slash and Mexican anzuelo; both of them show the
peculiar red and white spots which gave to the cow in question the
name of Funny-face. After the jury has inspected the exhibit I will
ask that Marcelina Garcia be sworn."
It was not a long speech and had nothing of dramatic appeal; and
yet as it came out, this was Angevine Thorne's closing speech. When
he saw how the pendulum had swung, Shepherd Kilkenny, the
fighting district attorney, went into a black, frowning silence and
refused to speak to Old Crit; but as the judge began his instructions
to the jury he suddenly roused up and beckoned to Boone Morgan.
They whispered together while the law was being read and then the
sheriff went over and spoke a few words to Pecos Dalhart.
"Sure!" nodded Pecos, and at the signal Shepherd Kilkenny rose
quickly to his feet.
"Your Honor," he said, bowing apologetically to the judge, "in
consideration of the evidence which has just been introduced I wish
to withdraw my former request to the jury, and I now ask for a
verdict of 'Not guilty.'" He sat down, and a hum went up from the
crowded court-room like the zooning of swarming bees. There was
something coming—something tremendous—that they all knew; and
when the verdict was given not a man moved from his place. Then
Boone Morgan rose up from beside the district attorney and touched
Isaac Crittenden on the shoulder. There was nothing rough about it,
and Crittenden followed without a word, but the significance was
plain. The man who had sworn others into prison had done as much
for himself, and it would take a Philadelphia lawyer to turn him
loose. He had sworn that the cow was his, and the ear keys showed
that he lied. Swallow-fork and crop, and Mexican marks above, and
Old Funny-face, wagging her mangled ears in court! There had
never been a cow-thief convicted in the Geronimo courts, and Old
Crit would spend every cent he had to keep out of jail, but if
Shepherd Kilkenny could not get him on evidence like that, then
tyranny is dead and the devil has lost his claws.

You might also like