Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
edca9f75
Commit
edca9f75
authored
Jun 05, 2020
by
Steven Murray
Committed by
Cedric Caffy
Jun 10, 2020
Browse files
Added first draft of TextFormatter method for MediaTypeLsItem
parent
da79f71b
Changes
3
Hide whitespace changes
Inline
Side-by-side
cmdline/CtaAdminCmd.cpp
View file @
edca9f75
...
...
@@ -105,6 +105,7 @@ void IStreamBuffer<cta::xrd::Data>::DataCallback(cta::xrd::Data record) const
case
Data
::
kDslsItem
:
std
::
cout
<<
Log
::
DumpProtobuf
(
&
record
.
dsls_item
());
break
;
case
Data
::
kVolsItem
:
std
::
cout
<<
Log
::
DumpProtobuf
(
&
record
.
vols_item
());
break
;
case
Data
::
kVersionItem
:
std
::
cout
<<
Log
::
DumpProtobuf
(
&
record
.
version_item
());
break
;
case
Data
::
kMtlsItem
:
std
::
cout
<<
Log
::
DumpProtobuf
(
&
record
.
mtls_item
());
break
;
default:
throw
std
::
runtime_error
(
"Received invalid stream data from CTA Frontend."
);
}
...
...
@@ -135,6 +136,7 @@ void IStreamBuffer<cta::xrd::Data>::DataCallback(cta::xrd::Data record) const
case
Data
::
kDslsItem
:
formattedText
.
print
(
record
.
dsls_item
());
break
;
case
Data
::
kVolsItem
:
formattedText
.
print
(
record
.
vols_item
());
break
;
case
Data
::
kVersionItem
:
formattedText
.
print
(
record
.
version_item
());
break
;
case
Data
::
kMtlsItem
:
formattedText
.
print
(
record
.
mtls_item
());
break
;
default:
throw
std
::
runtime_error
(
"Received invalid stream data from CTA Frontend."
);
}
...
...
cmdline/CtaAdminTextFormatter.cpp
View file @
edca9f75
...
...
@@ -576,6 +576,47 @@ void TextFormatter::print(const LogicalLibraryLsItem &llls_item) {
);
}
void
TextFormatter
::
printMediaTypeLsHeader
()
{
push_back
(
"HEADER"
);
push_back
(
"media type"
,
"cartridge"
,
"capacity"
,
"primary density code"
,
"secondary density code"
,
"number of wraps"
,
"min LPos"
,
"max LPos"
,
"c.user"
,
"c.host"
,
"c.time"
,
"m.user"
,
"m.host"
,
"m.time"
,
"comment"
);
}
void
TextFormatter
::
print
(
const
MediaTypeLsItem
&
mtls_item
)
{
push_back
(
mtls_item
.
name
(),
mtls_item
.
cartridge
(),
mtls_item
.
capacity
(),
mtls_item
.
primary_density_code
(),
mtls_item
.
secondary_density_code
(),
mtls_item
.
number_of_wraps
(),
mtls_item
.
min_lpos
(),
mtls_item
.
max_lpos
(),
mtls_item
.
creation_log
().
username
(),
mtls_item
.
creation_log
().
host
(),
timeToStr
(
mtls_item
.
creation_log
().
time
()),
mtls_item
.
last_modification_log
().
username
(),
mtls_item
.
last_modification_log
().
host
(),
timeToStr
(
mtls_item
.
last_modification_log
().
time
()),
mtls_item
.
comment
()
);
}
void
TextFormatter
::
printMountPolicyLsHeader
()
{
push_back
(
"HEADER"
);
push_back
(
...
...
cmdline/CtaAdminTextFormatter.hpp
View file @
edca9f75
...
...
@@ -68,6 +68,7 @@ public:
void
printDiskSystemLsHeader
();
void
printVirtualOrganizationLsHeader
();
void
printVersionHeader
();
void
printMediaTypeLsHeader
();
// Output records
void
print
(
const
AdminLsItem
&
adls_item
);
...
...
@@ -94,6 +95,7 @@ public:
void
print
(
const
DiskSystemLsItem
&
dsls_item
);
void
print
(
const
VirtualOrganizationLsItem
&
vols_item
);
void
print
(
const
VersionItem
&
version_item
);
void
print
(
const
MediaTypeLsItem
&
mtls_item
);
private:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment