Class: UU::BinaryStore::BinaryStoreRepository

Inherits:
Object
  • Object
show all
Defined in:
lib/uu_binarystore/binary_store_repository.rb,
lib/uu_binarystore/binary_store_repository/binary_store_repository_create.rb,
lib/uu_binarystore/binary_store_repository/binary_store_repository_attributes.rb,
lib/uu_binarystore/binary_store_repository/binary_store_repository_set_attributes.rb,
lib/uu_binarystore/binary_store_repository/binary_store_repository_get_repository_list.rb

Overview

Binary store repository service

Defined Under Namespace

Classes: BinaryStoreGetRepositoryList, BinaryStoreRepositoryAttributes, BinaryStoreRepositoryCreate, BinaryStoreRepositorySetAttributes

Class Method Summary collapse

Class Method Details

.create(location_uri, binary_store_repository) ⇒ UU::OS::UESURI

Creates new binary store repository.

Examples:

repository_uri = UU::BinaryStore::BinaryStoreRepository.create('ues:TERR:LOCATION',
:name => 'New Repository',
:connection_uri => 'mongodb://user:password@address:port',
:description => 'New Repository',
:max_size => 10240)

Parameters:

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

    URI of folder or org. unit where repository will be created

  • binary_store_repository (BinaryStoreRepositoryCreate)

    Specific options

Options Hash (binary_store_repository):

  • :name (String)

    Name of the new binary store repository. Attribute is mandatory.

  • :code (String)

    Code of the new binary store repository. Code must be unique in the scope of territory. The attribute is optional, defaults to a system-generated value.

  • :description (String)

    Description of the new binary store repository. Attribute is optional, defaults to nil.

  • :connection_uri (String)

    Connection URI for the repository storage database. This attribute is mandatory.

  • :max_size (Fixnum)

    Maximum size of the new binary store repository (in megabytes). This number should correspond to physical capacity of storage database defined in connection_uri attribute. The attribute is not mandatory (it defaults to a value defined by server); however, it should be set explicitly because server default value does not reflect physical capacity of storage.

Returns:

  • (UU::OS::UESURI)

    URI of created binary store repository



42
43
44
45
# File 'lib/uu_binarystore/binary_store_repository.rb', line 42

def self.create(location_uri, binary_store_repository)
  session = UU::OS::Security::Session.current_session
  self.new(session).create(UU::OS::UESURI.new(location_uri), binary_store_repository)
end

.delete(binary_store_repository_uri) ⇒ Object

Deletes the binary store repository. The repository cannot be deleted if it contains any binary stores.

Examples:

UU::BinaryStore::BinaryStoreRepository.delete('ues:TERR:REPOSITORY')

Parameters:

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

    URI of binary store repository



58
59
60
61
# File 'lib/uu_binarystore/binary_store_repository.rb', line 58

def self.delete(binary_store_repository_uri)
  session = UU::OS::Security::Session.current_session
  self.new(session).delete(UU::OS::UESURI.new(binary_store_repository_uri))
end

.get_attributes(binary_store_repository_uri) ⇒ BinaryStoreRepositoryAttributes

Returns attributes of the binary store repository.

Examples:

# get repository attributes
UU::BinaryStore::BinaryStoreRepository.get_attributes('ues:TERR:REPOSITORY')

Parameters:

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

    URI of binary store repository

Returns:



73
74
75
76
# File 'lib/uu_binarystore/binary_store_repository.rb', line 73

def self.get_attributes(binary_store_repository_uri)
  session = UU::OS::Security::Session.current_session
  self.new(session).get_attributes(UU::OS::UESURI.new(binary_store_repository_uri))
end

.get_repository_list(location_uri, criteria = nil) ⇒ UU::OS::REST::ResultList<BinaryStoreRepositoryGetRepositoryList, BinaryStoreRepositoryAttributes>

Returns a list of binary store repositories within a given location (territory).

Examples:

# get repositories in location
list = UU::BinaryStore::BinaryStoreRepository.get_repository_list('ues:TERR:LOCATION')

Parameters:

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

    URI of location (territory) from which to list binary store repositories

  • criteria (BinaryStoreRepositoryGetRepositoryList) (defaults to: nil)

    Criteria to limit the result set

Options Hash (criteria):

  • :query (String)

    Query for filtering and ordering of the result list (more information in uuQuery - Guideline). It is possible to filter the result list by name, code, currentSize, binaryStoreCount and description.

  • :page_size (Fixnum)

    Result list page size. This attribute is optional, defaults to the value defined by the server.

  • :page_index (Fixnum)

    Result list page index. Attribute is optional, defaults to 0.

Returns:



130
131
132
133
# File 'lib/uu_binarystore/binary_store_repository.rb', line 130

def self.get_repository_list(location_uri, criteria = nil)
  session = UU::OS::Security::Session.current_session
  self.new(session).get_repository_list(UU::OS::UESURI.new(location_uri), criteria)
end

.set_attributes(binary_store_repository_uri, binary_store_repository) ⇒ UU::OS::UESURI

Updates attributes of the binary store repository.

Examples:

# set repository attributes
UU::BinaryStore::BinaryStoreRepository.set_attributes('ues:TERR:REPOSITORY',
:name => 'new Name')

Parameters:

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

    URI of binary store repository

  • binary_store_repository (BinaryStoreRepositorySetAttributes)

    DTO containing attributes for updating the binary store repository

Options Hash (binary_store_repository):

  • :name (String)

    New name of the binary store repository. Attribute is optional. If not set, name is not changed.

  • :code (String)

    New code of the binary store repository. Code must be unique in scope of territory. Attribute is optional. If not set, code is not changed.

  • :description (String)

    New description of the binary store repository. This attribute is optional. If not set, the description is not changed

  • :connection_uri (String)

    New connection URI for the repository storage database. This attribute is optional. If not set, the connection URI is not changed. It is important to note that changing the connection URI (unless the new URI was provided by system administrators as the result of a physical data migration) causes all binary stores created in this repository before the update to be inaccessible!

  • :max_size (Fixnum)

    New maximum size of the binary store repository (in megabytes). This number should correspond to the physical capacity of the storage database defined in the connection_uri attribute. If the requested maximum size is smaller than the total size allocated to the existing binary stores within this repository, the update of the repository fails. This attribute is optional. If not set, the maximum size is not changed.

Returns:

  • (UU::OS::UESURI)

    URI of updated binary store repository



106
107
108
109
# File 'lib/uu_binarystore/binary_store_repository.rb', line 106

def self.set_attributes(binary_store_repository_uri, binary_store_repository)
  session = UU::OS::Security::Session.current_session
  self.new(session).set_attributes(UU::OS::UESURI.new(binary_store_repository_uri), binary_store_repository)
end