'Extends lock of subject.'

def ExtendSubjectLock(self, subject, transid, lease_time, token):

    request = rdf_data_store.DataStoreRequest(subject=[subject])
    specific = rdf_data_store.TimestampSpec.Type.SPECIFIC_TIME
    request.timestamp = rdf_data_store.TimestampSpec(start=lease_time, type=specific)
    if token:
        request.token = token
    blob = rdf_protodict.DataBlob(string=transid)
    value = rdf_data_store.DataStoreValue(value=blob)
    request.values.Append(value)
    typ = rdf_data_server.DataStoreCommand.Command.EXTEND_SUBJECT
    response = self._MakeSyncRequest(request, typ)
    if (not response.results):
        return None
    result = response.results[0]
    if (not result.values):
        return None
    value = result.values[0].value.string
    return (transid if (transid == value) else None)
