Module: UU::ObjectStore::ObjectStoreControl

Extended by:
ObjectStoreControl
Included in:
ObjectStoreControl
Defined in:
uu_objectstore-0.6.5/lib/uu/object_store/object_store_control.rb,
uu_objectstore-0.6.5/lib/uu/object_store/object_store_control/object_store_delete.rb,
uu_objectstore-0.6.5/lib/uu/object_store/object_store_control/object_store_create.rb,
uu_objectstore-0.6.5/lib/uu/object_store/object_store_control/object_store_transfer.rb,
uu_objectstore-0.6.5/lib/uu/object_store/object_store_control/object_store_attributes.rb,
uu_objectstore-0.6.5/lib/uu/object_store/object_store_control/object_store_get_store_list.rb,
uu_objectstore-0.6.5/lib/uu/object_store/object_store_control/object_store_set_attributes.rb,
uu_objectstore-0.6.5/lib/uu/object_store/object_store_control/object_store_control_exception.rb,
uu_objectstore-0.6.5/lib/uu/object_store/object_store_control/object_store_control_fatal_exception.rb

Overview

Object store control service.

Defined Under Namespace

Classes: ObjectStoreAttributes, ObjectStoreControlException, ObjectStoreControlFatalException, ObjectStoreCreate, ObjectStoreDelete, ObjectStoreGetStoreList, ObjectStoreSetAttributes, ObjectStoreTransfer

Constant Summary

Instance Method Summary (collapse)

Instance Method Details

- (UU::OS::UESURI) create(repository_uri, object_store = nil)

Creates new object store.

Parameters:

  • repository_uri (String, UU::OS::UESURI)

    URI of object store repository where to create object store

  • object_store (ObjectStoreCreate) (defaults to: nil)

    Specific options

Returns:

Raises:



34
35
36
37
38
39
40
# File 'uu_objectstore-0.6.5/lib/uu/object_store/object_store_control.rb', line 34

def create(repository_uri, object_store = nil)
  svc = UU::OS::REST::RemoteClient.new(ObjectStoreControl)
  svc.timeout = 300
  payload = ObjectStoreControl::ObjectStoreCreate.new(object_store).to_json
  res = svc.post(:create, repository_uri, payload)
  return UU::OS::UESURI.new(res)
end

- (Object) delete(object_store_uri, options = nil)

Deletes object store.

Parameters:

  • object_store_uri (String, UU::OS::UESURI)

    URI of object store

  • options (ObjectStoreDelete) (defaults to: nil)

    Additional options for object schema delete

Raises:



114
115
116
117
118
119
# File 'uu_objectstore-0.6.5/lib/uu/object_store/object_store_control.rb', line 114

def delete(object_store_uri, options = nil)
  svc = UU::OS::REST::RemoteClient.new(ObjectStoreControl)
  svc.timeout = 300
  payload = ObjectStoreControl::ObjectStoreDelete.new(options).to_json
  svc.post(:delete, object_store_uri, payload)
end

- (ObjectStoreAttributes) get_attributes(object_store_uri)

Returns attributes of the object store.

Parameters:

Returns:

Raises:



67
68
69
70
71
# File 'uu_objectstore-0.6.5/lib/uu/object_store/object_store_control.rb', line 67

def get_attributes(object_store_uri)
  svc = UU::OS::REST::RemoteClient.new(ObjectStoreControl)
  res = svc.get(:getAttributes, object_store_uri)
  return ObjectStoreControl::ObjectStoreAttributes.new(res)
end

- (UU::OS::REST::ResultList<ObjectStoreGetStoreList, ObjectStoreAttributes>) get_store_list(repository_uri, criteria = nil)

Returns list of object stores within given object store repository.

Parameters:

  • repository_uri (String, UU::OS::UESURI)

    URI of object store repository from which to list object stores

  • criteria (ObjectStoreGetStoreList) (defaults to: nil)

    Criteria to limit the result set

Returns:

Raises:



82
83
84
85
86
87
88
89
# File 'uu_objectstore-0.6.5/lib/uu/object_store/object_store_control.rb', line 82

def get_store_list(repository_uri, criteria = nil)
  dto = ObjectStoreControl::ObjectStoreGetStoreList.new(criteria)
  svc = UU::OS::REST::RemoteClient.new(ObjectStoreControl)
  svc.add_parameter(:pageIndex, dto.page_index)
  svc.add_parameter(:pageSize, dto.page_size)
  res = svc.get(:getStoreList, repository_uri)
  return UU::OS::REST::ResultList.new(ObjectStoreControl::ObjectStoreGetStoreList, ObjectStoreControl::ObjectStoreAttributes, res)
end

- (UU::OS::UESURI) set_attributes(object_store_uri, object_store = nil)

Updates attributes of the object store.

Parameters:

Returns:

Raises:



51
52
53
54
55
56
57
# File 'uu_objectstore-0.6.5/lib/uu/object_store/object_store_control.rb', line 51

def set_attributes(object_store_uri, object_store = nil)
  svc = UU::OS::REST::RemoteClient.new(ObjectStoreControl)
  svc.timeout = 120
  payload = ObjectStoreControl::ObjectStoreSetAttributes.new(object_store).to_json
  res = svc.post(:setAttributes, object_store_uri, payload)
  return UU::OS::UESURI.new(res)
end

- (Object) transfer(object_store_uri, options = nil)

Transfers object store to another object store repository. This command represents VERY EXPENSIVE OPERATION and MUST BE USED ONLY WITH EXTREME CAUTION! See uuObjectStore Documentation

for additional details.

Parameters:

  • object_store_uri (String, UU::OS::UESURI)

    URI of object store

  • options (ObjectStoreTransfer) (defaults to: nil)

    DTO containing object store transfer options

Raises:



101
102
103
104
105
# File 'uu_objectstore-0.6.5/lib/uu/object_store/object_store_control.rb', line 101

def transfer(object_store_uri, options = nil)
  svc = UU::OS::REST::RemoteClient.new(ObjectStoreControl)
  payload = ObjectStoreControl::ObjectStoreTransfer.new(options).to_json
  svc.post(:transfer, object_store_uri, payload)
end