982 |
982 |
private void updateSystemMetadataFields(long dateUploaded, String rightsHolder,
|
983 |
983 |
String checksum, String checksumAlgorithm, String originMemberNode,
|
984 |
984 |
String authoritativeMemberNode, long modifiedDate, String submitter,
|
985 |
|
String guid, String objectFormat, BigInteger size, boolean replicationAllowed,
|
|
985 |
String guid, String objectFormat, BigInteger size, boolean archived, boolean replicationAllowed,
|
986 |
986 |
int numberReplicas, String obsoletes, String obsoletedBy, BigInteger serialVersion)
|
987 |
987 |
{
|
988 |
988 |
DBConnection dbConn = null;
|
... | ... | |
998 |
998 |
String query = "update " + TYPE_SYSTEM_METADATA +
|
999 |
999 |
" set (date_uploaded, rights_holder, checksum, checksum_algorithm, " +
|
1000 |
1000 |
"origin_member_node, authoritive_member_node, date_modified, " +
|
1001 |
|
"submitter, object_format, size, replication_allowed, number_replicas, " +
|
|
1001 |
"submitter, object_format, size, archived, replication_allowed, number_replicas, " +
|
1002 |
1002 |
"obsoletes, obsoleted_by, serial_version) " +
|
1003 |
|
"= (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) where guid = ?";
|
|
1003 |
"= (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) where guid = ?";
|
1004 |
1004 |
PreparedStatement stmt = dbConn.prepareStatement(query);
|
1005 |
1005 |
|
1006 |
1006 |
//data values
|
... | ... | |
1014 |
1014 |
stmt.setString(8, submitter);
|
1015 |
1015 |
stmt.setString(9, objectFormat);
|
1016 |
1016 |
stmt.setString(10, size.toString());
|
1017 |
|
stmt.setBoolean(11, replicationAllowed);
|
1018 |
|
stmt.setInt(12, numberReplicas);
|
1019 |
|
stmt.setString(13, obsoletes);
|
1020 |
|
stmt.setString(14, obsoletedBy);
|
1021 |
|
stmt.setString(15, serialVersion.toString());
|
|
1017 |
stmt.setBoolean(11, archived);
|
|
1018 |
stmt.setBoolean(12, replicationAllowed);
|
|
1019 |
stmt.setInt(13, numberReplicas);
|
|
1020 |
stmt.setString(14, obsoletes);
|
|
1021 |
stmt.setString(15, obsoletedBy);
|
|
1022 |
stmt.setString(16, serialVersion.toString());
|
1022 |
1023 |
|
1023 |
1024 |
//where clause
|
1024 |
|
stmt.setString(16, guid);
|
|
1025 |
stmt.setString(17, guid);
|
1025 |
1026 |
logMetacat.debug("stmt: " + stmt.toString());
|
1026 |
1027 |
//execute
|
1027 |
1028 |
int rows = stmt.executeUpdate();
|
... | ... | |
1029 |
1030 |
stmt.close();
|
1030 |
1031 |
} catch (SQLException e) {
|
1031 |
1032 |
e.printStackTrace();
|
1032 |
|
logMetacat.error("insertAdditionalSystemMetadataFields: SQL error while creating a mapping to the system metadata identifier: "
|
|
1033 |
logMetacat.error("updateSystemMetadataFields: SQL error while updating system metadata: "
|
1033 |
1034 |
+ e.getMessage());
|
1034 |
1035 |
} catch (NumberFormatException e) {
|
1035 |
1036 |
e.printStackTrace();
|
1036 |
|
logMetacat.error("insertAdditionalSystemMetadataFields: NumberFormat error while creating a mapping to the system metadata identifier: "
|
|
1037 |
logMetacat.error("updateSystemMetadataFields: NumberFormat error while updating system metadata: "
|
1037 |
1038 |
+ e.getMessage());
|
1038 |
1039 |
} finally {
|
1039 |
1040 |
// Return database connection to the pool
|
... | ... | |
1162 |
1163 |
sm.getAuthoritativeMemberNode() == null ? null: sm.getAuthoritativeMemberNode().getValue(),
|
1163 |
1164 |
sm.getDateSysMetadataModified() == null ? null: sm.getDateSysMetadataModified().getTime(),
|
1164 |
1165 |
sm.getSubmitter() == null ? null: sm.getSubmitter().getValue(),
|
1165 |
|
sm.getIdentifier().getValue(),
|
1166 |
|
sm.getFormatId() == null ? null: sm.getFormatId().getValue(),
|
1167 |
|
sm.getSize(),
|
1168 |
|
replicationAllowed,
|
1169 |
|
numberReplicas,
|
1170 |
|
sm.getObsoletes() == null ? null:sm.getObsoletes().getValue(),
|
1171 |
|
sm.getObsoletedBy() == null ? null: sm.getObsoletedBy().getValue(),
|
1172 |
|
sm.getSerialVersion()
|
|
1166 |
sm.getIdentifier().getValue(),
|
|
1167 |
sm.getFormatId() == null ? null: sm.getFormatId().getValue(),
|
|
1168 |
sm.getSize(),
|
|
1169 |
sm.getArchived() == null ? false: sm.getArchived(),
|
|
1170 |
replicationAllowed,
|
|
1171 |
numberReplicas,
|
|
1172 |
sm.getObsoletes() == null ? null:sm.getObsoletes().getValue(),
|
|
1173 |
sm.getObsoletedBy() == null ? null: sm.getObsoletedBy().getValue(),
|
|
1174 |
sm.getSerialVersion()
|
1173 |
1175 |
);
|
1174 |
1176 |
|
1175 |
1177 |
String guid = sm.getIdentifier().getValue();
|
include 'archived' system metadata element in backing DB store