Skip to content
GitLab
Menu
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
f295a546
Commit
f295a546
authored
Feb 27, 2015
by
Daniele Kruse
Browse files
WIP SQLite backend
parent
dea2d33c
Changes
33
Hide whitespace changes
Inline
Side-by-side
libs/middletier/AdminHost.cpp
View file @
f295a546
...
...
@@ -13,9 +13,10 @@ cta::AdminHost::AdminHost():
cta
::
AdminHost
::
AdminHost
(
const
std
::
string
&
name
,
const
UserIdentity
&
creator
,
const
time_t
creationTime
,
const
std
::
string
&
comment
)
:
m_name
(
name
),
m_creationTime
(
time
(
NULL
)
),
m_creationTime
(
creationTime
),
m_creator
(
creator
),
m_comment
(
comment
)
{
}
...
...
libs/middletier/AdminHost.hpp
View file @
f295a546
...
...
@@ -27,6 +27,7 @@ public:
AdminHost
(
const
std
::
string
&
name
,
const
UserIdentity
&
creator
,
const
time_t
creationTime
,
const
std
::
string
&
comment
);
/**
...
...
libs/middletier/AdminUser.cpp
View file @
f295a546
...
...
@@ -13,9 +13,10 @@ cta::AdminUser::AdminUser():
cta
::
AdminUser
::
AdminUser
(
const
UserIdentity
&
user
,
const
UserIdentity
&
creator
,
const
time_t
creationTime
,
const
std
::
string
&
comment
)
:
m_user
(
user
),
m_creationTime
(
time
(
NULL
)
),
m_creationTime
(
creationTime
),
m_creator
(
creator
),
m_comment
(
comment
)
{
}
...
...
libs/middletier/AdminUser.hpp
View file @
f295a546
...
...
@@ -27,6 +27,7 @@ public:
AdminUser
(
const
UserIdentity
&
user
,
const
UserIdentity
&
creator
,
const
time_t
creationTime
,
const
std
::
string
&
comment
);
/**
...
...
libs/middletier/ArchivalJob.cpp
View file @
f295a546
...
...
@@ -15,11 +15,12 @@ cta::ArchivalJob::ArchivalJob(
const
ArchivalJobState
::
Enum
state
,
const
std
::
string
&
srcUrl
,
const
std
::
string
&
dstPath
,
const
UserIdentity
&
creator
)
:
const
UserIdentity
&
creator
,
const
time_t
creationTime
)
:
m_state
(
state
),
m_srcUrl
(
srcUrl
),
m_dstPath
(
dstPath
),
m_creationTime
(
time
(
NULL
)
),
m_creationTime
(
creationTime
),
m_creator
(
creator
)
{
}
...
...
libs/middletier/ArchivalJob.hpp
View file @
f295a546
...
...
@@ -31,7 +31,8 @@ public:
const
ArchivalJobState
::
Enum
state
,
const
std
::
string
&
srcUrl
,
const
std
::
string
&
dstPath
,
const
UserIdentity
&
creator
);
const
UserIdentity
&
creator
,
const
time_t
creationTime
);
/**
* Sets the state of the archival job.
...
...
libs/middletier/CMakeLists.txt
View file @
f295a546
...
...
@@ -38,6 +38,7 @@ set (MIDDLE_TIER_LIB_SRC_FILES
SecurityIdentity.cpp
SqliteDatabase.cpp
SqliteMiddleTierAdmin.cpp
SqliteMiddleTierUser.cpp
StorageClass.cpp
Tape.cpp
TapePool.cpp
...
...
@@ -58,6 +59,8 @@ set (MIDDLE_TIER_UNIT_TESTS_LIB_SRC_FILES
MockMiddleTierUserTest.cpp
MockTapeTableTest.cpp
MockTapePoolTableTest.cpp
SqliteMiddleTierAdminTest.cpp
SqliteMiddleTierUserTest.cpp
UtilsTest.cpp
)
add_library
(
ctamiddletierunittests SHARED
...
...
libs/middletier/FileSystemStorageClasses.cpp
View file @
f295a546
...
...
@@ -13,7 +13,7 @@ void cta::FileSystemStorageClasses::createStorageClass(
const
std
::
string
&
comment
)
{
try
{
checkStorageClassDoesNotAlreadyExist
(
name
);
StorageClass
storageClass
(
name
,
nbCopies
,
creator
,
comment
);
StorageClass
storageClass
(
name
,
nbCopies
,
creator
,
time
(
NULL
),
comment
);
m_storageClasses
[
name
]
=
storageClass
;
}
catch
(
std
::
exception
&
ex
)
{
throw
Exception
(
std
::
string
(
"Failed to create storage class: "
)
+
...
...
libs/middletier/LogicalLibrary.cpp
View file @
f295a546
...
...
@@ -13,9 +13,10 @@ cta::LogicalLibrary::LogicalLibrary():
cta
::
LogicalLibrary
::
LogicalLibrary
(
const
std
::
string
&
name
,
const
UserIdentity
&
creator
,
const
time_t
creationTime
,
const
std
::
string
&
comment
)
:
m_name
(
name
),
m_creationTime
(
time
(
NULL
)
),
m_creationTime
(
creationTime
),
m_creator
(
creator
),
m_comment
(
comment
)
{
}
...
...
libs/middletier/LogicalLibrary.hpp
View file @
f295a546
...
...
@@ -27,6 +27,7 @@ public:
LogicalLibrary
(
const
std
::
string
&
name
,
const
UserIdentity
&
creator
,
const
time_t
creationTime
,
const
std
::
string
&
comment
);
/**
...
...
libs/middletier/MigrationRoute.cpp
View file @
f295a546
...
...
@@ -16,11 +16,12 @@ cta::MigrationRoute::MigrationRoute(
const
uint8_t
copyNb
,
const
std
::
string
&
tapePoolName
,
const
UserIdentity
&
creator
,
const
time_t
creationTime
,
const
std
::
string
&
comment
)
:
m_storageClassName
(
storageClassName
),
m_copyNb
(
copyNb
),
m_tapePoolName
(
tapePoolName
),
m_creationTime
(
time
(
NULL
)
),
m_creationTime
(
creationTime
),
m_creator
(
creator
),
m_comment
(
comment
)
{
}
...
...
libs/middletier/MigrationRoute.hpp
View file @
f295a546
...
...
@@ -34,6 +34,7 @@ public:
const
uint8_t
copyNb
,
const
std
::
string
&
tapePoolName
,
const
UserIdentity
&
creator
,
const
time_t
creationTime
,
const
std
::
string
&
comment
);
/**
...
...
libs/middletier/MockAdminHostTable.cpp
View file @
f295a546
...
...
@@ -11,7 +11,7 @@ void cta::MockAdminHostTable::createAdminHost(
const
std
::
string
&
hostName
,
const
std
::
string
&
comment
)
{
checkAdminHostDoesNotAlreadyExist
(
hostName
);
AdminHost
adminHost
(
hostName
,
requester
.
user
,
comment
);
AdminHost
adminHost
(
hostName
,
requester
.
user
,
time
(
NULL
),
comment
);
m_adminHosts
[
hostName
]
=
adminHost
;
}
...
...
libs/middletier/MockAdminUserTable.cpp
View file @
f295a546
...
...
@@ -13,7 +13,7 @@ void cta::MockAdminUserTable::createAdminUser(
const
UserIdentity
&
user
,
const
std
::
string
&
comment
)
{
checkAdminUserDoesNotAlreadyExist
(
user
);
AdminUser
adminUser
(
user
,
requester
.
user
,
comment
);
AdminUser
adminUser
(
user
,
requester
.
user
,
time
(
NULL
),
comment
);
m_adminUsers
[
user
.
getUid
()]
=
adminUser
;
}
...
...
libs/middletier/MockArchivalJobTable.cpp
View file @
f295a546
...
...
@@ -13,7 +13,7 @@ void cta::MockArchivalJobTable::createArchivalJob(
const
std
::
string
&
dstPath
)
{
checkArchivalJobDoesNotAlreadyExist
(
dstPath
);
ArchivalJob
job
(
ArchivalJobState
::
NONE
,
srcUrl
,
dstPath
,
requester
.
user
);
ArchivalJob
job
(
ArchivalJobState
::
NONE
,
srcUrl
,
dstPath
,
requester
.
user
,
time
(
NULL
)
);
std
::
map
<
std
::
string
,
std
::
map
<
time_t
,
ArchivalJob
>
>::
iterator
poolItor
=
m_jobsTree
.
find
(
tapePoolName
);
...
...
libs/middletier/MockLogicalLibraryTable.cpp
View file @
f295a546
...
...
@@ -13,7 +13,7 @@ void cta::MockLogicalLibraryTable::createLogicalLibrary(
const
std
::
string
&
name
,
const
std
::
string
&
comment
)
{
checkLogicalLibraryDoesNotAlreadyExist
(
name
);
LogicalLibrary
logicalLibrary
(
name
,
requester
.
user
,
comment
);
LogicalLibrary
logicalLibrary
(
name
,
requester
.
user
,
time
(
NULL
),
comment
);
m_libraries
[
name
]
=
logicalLibrary
;
}
...
...
libs/middletier/MockMigrationRouteTable.cpp
View file @
f295a546
...
...
@@ -18,7 +18,8 @@ void cta::MockMigrationRouteTable::createMigrationRoute(
storageClassName
,
copyNb
,
tapePoolName
,
creator
,
creator
,
time
(
NULL
),
comment
);
m_migrationRoutes
[
routeId
]
=
route
;
}
...
...
libs/middletier/MockTapePoolTable.cpp
View file @
f295a546
...
...
@@ -13,7 +13,7 @@ void cta::MockTapePoolTable::createTapePool(
const
uint32_t
nbPartialTapes
,
const
std
::
string
&
comment
)
{
checkTapePoolDoesNotAlreadyExist
(
name
);
TapePool
tapePool
(
name
,
nbDrives
,
nbPartialTapes
,
requester
.
user
,
comment
);
TapePool
tapePool
(
name
,
nbDrives
,
nbPartialTapes
,
requester
.
user
,
time
(
NULL
),
comment
);
m_tapePools
[
name
]
=
tapePool
;
}
...
...
libs/middletier/MockTapeTable.cpp
View file @
f295a546
...
...
@@ -19,7 +19,9 @@ void cta::MockTapeTable::createTape(
logicalLibraryName
,
tapePoolName
,
capacityInBytes
,
0
,
requester
.
user
,
time
(
NULL
),
comment
);
m_tapes
[
vid
]
=
tape
;
}
...
...
libs/middletier/RetrievalJob.cpp
View file @
f295a546
...
...
@@ -15,10 +15,11 @@ cta::RetrievalJob::RetrievalJob(
const
RetrievalJobState
::
Enum
state
,
const
std
::
string
&
srcPath
,
const
std
::
string
&
dstUrl
,
const
UserIdentity
&
creator
)
:
const
UserIdentity
&
creator
,
const
time_t
creationTime
)
:
m_srcPath
(
srcPath
),
m_dstUrl
(
dstUrl
),
m_creationTime
(
time
(
NULL
)
),
m_creationTime
(
creationTime
),
m_creator
(
creator
)
{
}
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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