Clean up redundant code.
parent
611045528f
commit
f4335f43ad
|
@ -67,16 +67,8 @@ class DataStore(object):
|
||||||
def __init__(self, name="DataStore"):
|
def __init__(self, name="DataStore"):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.id = make_id()
|
self.id = make_id()
|
||||||
self.source = DataSource()
|
self.source = None
|
||||||
self.sink = DataSink()
|
self.sink = None
|
||||||
|
|
||||||
@property
|
|
||||||
def source(self):
|
|
||||||
return self.source
|
|
||||||
|
|
||||||
@property
|
|
||||||
def sink(self):
|
|
||||||
return self.sink
|
|
||||||
|
|
||||||
def get(self, stix_id):
|
def get(self, stix_id):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -26,14 +26,6 @@ class FileSystemStore(DataStore):
|
||||||
self.source = FileSystemSource(stix_dir=stix_dir)
|
self.source = FileSystemSource(stix_dir=stix_dir)
|
||||||
self.sink = FileSystemSink(stix_dir=stix_dir)
|
self.sink = FileSystemSink(stix_dir=stix_dir)
|
||||||
|
|
||||||
@property
|
|
||||||
def source(self):
|
|
||||||
return self.source
|
|
||||||
|
|
||||||
@property
|
|
||||||
def sink(self):
|
|
||||||
return self.sink
|
|
||||||
|
|
||||||
# file system sink API calls
|
# file system sink API calls
|
||||||
|
|
||||||
def add(self, stix_objs):
|
def add(self, stix_objs):
|
||||||
|
|
|
@ -64,14 +64,6 @@ class MemoryStore(DataStore):
|
||||||
self.source = MemorySource(stix_data=self.data, _store=True)
|
self.source = MemorySource(stix_data=self.data, _store=True)
|
||||||
self.sink = MemorySink(stix_data=self.data, _store=True)
|
self.sink = MemorySink(stix_data=self.data, _store=True)
|
||||||
|
|
||||||
@property
|
|
||||||
def source(self):
|
|
||||||
return self.source
|
|
||||||
|
|
||||||
@property
|
|
||||||
def sink(self):
|
|
||||||
return self.sink
|
|
||||||
|
|
||||||
# memory sink API calls
|
# memory sink API calls
|
||||||
|
|
||||||
def add(self, stix_data):
|
def add(self, stix_data):
|
||||||
|
|
|
@ -32,15 +32,7 @@ class TAXIICollectionStore(DataStore):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.id = make_id()
|
self.id = make_id()
|
||||||
self.source = TAXIICollectionSource(taxii_client, api_root_name, collection_id, user, password)
|
self.source = TAXIICollectionSource(taxii_client, api_root_name, collection_id, user, password)
|
||||||
self.sink = self.TAXIICollectionSink(taxii_client, api_root_name, collection_id, user, password)
|
self.sink = TAXIICollectionSink(taxii_client, api_root_name, collection_id, user, password)
|
||||||
|
|
||||||
@property
|
|
||||||
def source(self):
|
|
||||||
return self.source
|
|
||||||
|
|
||||||
@property
|
|
||||||
def sink(self):
|
|
||||||
return self.sink
|
|
||||||
|
|
||||||
# file system sink API calls
|
# file system sink API calls
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue