Module: UU::ObjectStore::ObjectSchema

Extended by:
ObjectSchema
Included in:
ObjectSchema
Defined in:
uu_objectstore-0.0.6/lib/uu/object_store/object_schema.rb,
uu_objectstore-0.0.6/lib/uu/object_store/object_schema/object_schema_create.rb,
uu_objectstore-0.0.6/lib/uu/object_store/object_schema/object_schema_delete.rb,
uu_objectstore-0.0.6/lib/uu/object_store/object_schema/object_schema_exception.rb,
uu_objectstore-0.0.6/lib/uu/object_store/object_schema/object_schema_attributes.rb,
uu_objectstore-0.0.6/lib/uu/object_store/object_schema/object_schema_set_attributes.rb,
uu_objectstore-0.0.6/lib/uu/object_store/object_schema/object_schema_fatal_exception.rb,
uu_objectstore-0.0.6/lib/uu/object_store/object_schema/object_schema_get_schema_list.rb

Overview

Object schema service. Schemas are used to divide object store into smaller blocks with particular purpose. In future versions, schemas will provide validation of uuObject structure, and also allow creation of custom indexes providing faster uuObject queries.

Defined Under Namespace

Classes: ObjectSchemaAttributes, ObjectSchemaCreate, ObjectSchemaDelete, ObjectSchemaException, ObjectSchemaFatalException, ObjectSchemaGetSchemaList, ObjectSchemaSetAttributes

Constant Summary

Instance Method Summary (collapse)

Instance Method Details

- (UU::OS::UESURI) create(object_store_uri, object_schema = nil)

Creates new object schema.

Parameters:

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

    URI of object store for which to create object schema

  • object_schema (ObjectSchemaCreate) (defaults to: nil)

    Specific options

Returns:

Raises:

  • (ObjectSchemaException)

    Exception caused by wrong input or wrong usage of API. Specific cause can be determined based on error code.

  • (ObjectSchemaFatalException)

    Internal uuObjectStore exception. Specific cause can be determined based on error code.



34
35
36
37
38
39
# File 'uu_objectstore-0.0.6/lib/uu/object_store/object_schema.rb', line 34

def create(object_store_uri, object_schema = nil)
  svc = UU::OS::REST::RemoteClient.new(ObjectSchema)
  payload = ObjectSchema::ObjectSchemaCreate.new(object_schema).to_json
  res = svc.post(:create, object_store_uri, payload)
  return UU::OS::UESURI.new(res)
end

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

Deletes object schema.

Parameters:

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

    URI of object schema

  • options (ObjectSchemaDelete) (defaults to: nil)

    Additional options for object schema delete

Raises:

  • (ObjectSchemaException)

    Exception caused by wrong input or wrong usage of API. Specific cause can be determined based on error code.

  • (ObjectSchemaFatalException)

    Internal uuObjectStore exception. Specific cause can be determined based on error code.



96
97
98
99
100
# File 'uu_objectstore-0.0.6/lib/uu/object_store/object_schema.rb', line 96

def delete(object_schema_uri, options = nil)
  svc = UU::OS::REST::RemoteClient.new(ObjectSchema)
  payload = ObjectSchema::ObjectSchemaDelete.new(options).to_json
  svc.post(:delete, object_schema_uri, payload)
end

- (ObjectSchemaAttributes) get_attributes(object_schema_uri)

Returns attributes of the object schema.

Parameters:

Returns:

Raises:

  • (ObjectSchemaException)

    Exception caused by wrong input or wrong usage of API. Specific cause can be determined based on error code.

  • (ObjectSchemaFatalException)

    Internal uuObjectStore exception. Specific cause can be determined based on error code.



65
66
67
68
69
# File 'uu_objectstore-0.0.6/lib/uu/object_store/object_schema.rb', line 65

def get_attributes(object_schema_uri)
  svc = UU::OS::REST::RemoteClient.new(ObjectSchema)
  res = svc.get(:getAttributes, object_schema_uri)
  return ObjectSchema::ObjectSchemaAttributes.new(res)
end

- (UU::OS::REST::ResultList<ObjectSchemaGetSchemaList, ObjectSchemaAttributes>) get_schema_list(object_store_uri, criteria = nil)

Returns list of object schemas within given object store.

Parameters:

Returns:

Raises:

  • (ObjectSchemaException)

    Exception caused by wrong input or wrong usage of API. Specific cause can be determined based on error code.

  • (ObjectSchemaFatalException)

    Internal uuObjectStore exception. Specific cause can be determined based on error code.



80
81
82
83
84
85
86
87
# File 'uu_objectstore-0.0.6/lib/uu/object_store/object_schema.rb', line 80

def get_schema_list(object_store_uri, criteria = nil)
  dto = ObjectSchema::ObjectSchemaGetSchemaList.new(criteria)
  svc = UU::OS::REST::RemoteClient.new(ObjectSchema)
  svc.add_parameter(:pageIndex, dto.page_index)
  svc.add_parameter(:pageSize, dto.page_size)
  res = svc.get(:getSchemaList, object_store_uri)
  return UU::OS::REST::ResultList.new(ObjectSchema::ObjectSchemaGetSchemaList, ObjectSchema::ObjectSchemaAttributes, res)
end

- (UU::OS::UESURI) set_attributes(object_schema_uri, object_schema = nil)

Updates attributes of the object schema.

Parameters:

Returns:

Raises:

  • (ObjectSchemaException)

    Exception caused by wrong input or wrong usage of API. Specific cause can be determined based on error code.

  • (ObjectSchemaFatalException)

    Internal uuObjectStore exception. Specific cause can be determined based on error code.



50
51
52
53
54
55
# File 'uu_objectstore-0.0.6/lib/uu/object_store/object_schema.rb', line 50

def set_attributes(object_schema_uri, object_schema = nil)
  svc = UU::OS::REST::RemoteClient.new(ObjectSchema)
  payload = ObjectSchema::ObjectSchemaSetAttributes.new(object_schema).to_json
  res = svc.post(:setAttributes, object_schema_uri, payload)
  return UU::OS::UESURI.new(res)
end