Commit edca9f75 authored by Steven Murray's avatar Steven Murray Committed by Cedric Caffy
Browse files

Added first draft of TextFormatter method for MediaTypeLsItem

parent da79f71b
...@@ -105,6 +105,7 @@ void IStreamBuffer<cta::xrd::Data>::DataCallback(cta::xrd::Data record) const ...@@ -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::kDslsItem: std::cout << Log::DumpProtobuf(&record.dsls_item()); break;
case Data::kVolsItem: std::cout << Log::DumpProtobuf(&record.vols_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::kVersionItem: std::cout << Log::DumpProtobuf(&record.version_item()); break;
case Data::kMtlsItem: std::cout << Log::DumpProtobuf(&record.mtls_item()); break;
default: default:
throw std::runtime_error("Received invalid stream data from CTA Frontend."); 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 ...@@ -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::kDslsItem: formattedText.print(record.dsls_item()); break;
case Data::kVolsItem: formattedText.print(record.vols_item()); break; case Data::kVolsItem: formattedText.print(record.vols_item()); break;
case Data::kVersionItem: formattedText.print(record.version_item()); break; case Data::kVersionItem: formattedText.print(record.version_item()); break;
case Data::kMtlsItem: formattedText.print(record.mtls_item()); break;
default: default:
throw std::runtime_error("Received invalid stream data from CTA Frontend."); throw std::runtime_error("Received invalid stream data from CTA Frontend.");
} }
......
...@@ -576,6 +576,47 @@ void TextFormatter::print(const LogicalLibraryLsItem &llls_item) { ...@@ -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() { void TextFormatter::printMountPolicyLsHeader() {
push_back("HEADER"); push_back("HEADER");
push_back( push_back(
......
...@@ -68,6 +68,7 @@ public: ...@@ -68,6 +68,7 @@ public:
void printDiskSystemLsHeader(); void printDiskSystemLsHeader();
void printVirtualOrganizationLsHeader(); void printVirtualOrganizationLsHeader();
void printVersionHeader(); void printVersionHeader();
void printMediaTypeLsHeader();
// Output records // Output records
void print(const AdminLsItem &adls_item); void print(const AdminLsItem &adls_item);
...@@ -94,6 +95,7 @@ public: ...@@ -94,6 +95,7 @@ public:
void print(const DiskSystemLsItem &dsls_item); void print(const DiskSystemLsItem &dsls_item);
void print(const VirtualOrganizationLsItem &vols_item); void print(const VirtualOrganizationLsItem &vols_item);
void print(const VersionItem & version_item); void print(const VersionItem & version_item);
void print(const MediaTypeLsItem &mtls_item);
private: private:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment