flux.repository
Interface RepositoryAdministrator


public interface RepositoryAdministrator

Manages a storage depot of template flow charts, engine configurations, agent configurations, PGP keys, and business intervals. These items are stored in the database and shared across all engines in the cluster.

Author:
Copyright 2014 Flux Corporation. All rights reserved.

Method Summary
 long copy(java.lang.String sourceNamespace, java.lang.String destinationNamespace)
          Duplicates a repository element by copying the source element to the destination element.
 java.util.List<java.lang.String> findBusinessIntervalUsages(java.lang.String businessIntervalNamespace)
          Finds repository flow charts that reference the specified business interval.
 RepositoryIterator get(java.lang.String namespace)
          Returns elements from the repository.
 RepositoryIterator get(java.lang.String namespace, java.util.Set<RepositoryElementType> elementTypes)
          Returns elements from the repository.
 RepositoryIterator get(java.lang.String namespace, java.util.Set<RepositoryElementType> elementTypes, SortOrder sortOrder)
          Returns elements from the repository.
 RepositoryIterator get(java.lang.String namespace, SortOrder sortOrder)
          Returns elements from the repository.
 RepositoryElement getElement(java.lang.String namespace)
          Returns the repository element at the specified namespace from the repository.
 void promote(java.lang.String namespace, java.lang.String host, int port, boolean ssl, java.lang.String username, java.lang.String password)
          Copies one element from the local (source) repository to the (target) repository of a different cluster.
 void put(FlowChart flowChart, boolean overwrite)
          Inserts or modifies a flow chart in the repository.
 void put(FlowChart flowChart, java.lang.String description, boolean overwrite)
          Inserts or modifies a flow chart in the repository with a description.
 java.lang.String put(java.lang.String namespace, AgentConfiguration agentConfiguration, boolean overwrite)
          Inserts or modifies an agent configuration in the repository.
 java.lang.String put(java.lang.String namespace, AllowableBusinessInterval businessInterval, boolean overwrite)
          Inserts or modifies a business interval in the repository.
 java.lang.String put(java.lang.String namespace, Configuration configuration, boolean overwrite)
          Inserts or modifies an engine configuration in the repository.
 java.lang.String put(java.lang.String namespace, java.lang.String description, PgpKeyPair keyPair, boolean overwrite)
          Inserts or modifies a PGP private or public key in the repository.
 long remove(java.lang.String namespace)
          Removes all elements in the repository in the specified namespace.
 long rename(java.lang.String existingNamespace, java.lang.String newNamespace)
          Renames a repository element by changing the elements' namespace in the repository.
 long size(java.lang.String namespace)
          Returns the number of repository elements in the specified namespace.
 

Method Detail

copy

long copy(java.lang.String sourceNamespace,
          java.lang.String destinationNamespace)
          throws java.lang.IllegalArgumentException,
                 EngineException
Duplicates a repository element by copying the source element to the destination element.

Parameters:
sourceNamespace - The namespace of the repository elements to be copied.
destinationNamespace - The destination namespace of the repository elements to be copied.
Returns:
The number of repository elements successfully copied.
Throws:
java.lang.IllegalArgumentException - If either the source or destination element names are null or empty.
EngineException - If a system error occurs.
EngineCommunicationException - If a networking error occurs.

findBusinessIntervalUsages

java.util.List<java.lang.String> findBusinessIntervalUsages(java.lang.String businessIntervalNamespace)
                                                            throws EngineException
Finds repository flow charts that reference the specified business interval.

Parameters:
businessIntervalNamespace - Namespace to a business interval located in the repository.
Returns:
Names of repository flow charts, sorted alphabetically, that reference the specified business interval.
Throws:
EngineException - If a system error occurs.
EngineCommunicationException - If a networking error occurs.

get

RepositoryIterator get(java.lang.String namespace)
                       throws EngineException
Returns elements from the repository. All elements that match the specified namespace are returned.

Parameters:
namespace - A namespace of repository elements.
Returns:
A repository iterator. Null if no elements in the repository match the provided namespace.
Throws:
EngineException - If a system error occurs.
EngineCommunicationException - If a networking error occurs.

get

RepositoryIterator get(java.lang.String namespace,
                       SortOrder sortOrder)
                       throws EngineException
Returns elements from the repository. All elements that match the specified namespace are returned.

Parameters:
namespace - A namespace of repository elements.
sortOrder - The sorting algorithm used to order the repository elements.
Returns:
A repository iterator. Null if no elements in the repository match the provided namespace.
Throws:
EngineException - If a system error occurs.
EngineCommunicationException - If a networking error occurs.

get

RepositoryIterator get(java.lang.String namespace,
                       java.util.Set<RepositoryElementType> elementTypes)
                       throws EngineException
Returns elements from the repository. All elements that match the specified namespace and any of the supplied repository element types are returned.

Parameters:
namespace - A namespace of repository elements.
elementTypes - A set of repository element types.
Returns:
A repository iterator. Null if no elements in the repository match the provided namespace and any of the supplied element types.
Throws:
EngineException - If a system error occurs.
EngineCommunicationException - If a networking error occurs.
See Also:
RepositoryElementType

get

RepositoryIterator get(java.lang.String namespace,
                       java.util.Set<RepositoryElementType> elementTypes,
                       SortOrder sortOrder)
                       throws EngineException
Returns elements from the repository. All elements that match the specified namespace and any of the supplied repository element types are returned.

Parameters:
namespace - A namespace of repository elements.
elementTypes - A set of repository element types.
sortOrder - The sorting algorithm used to order the repository elements.
Returns:
A repository iterator. Null if no elements in the repository match the provided namespace and any of the supplied element types.
Throws:
EngineException - If a system error occurs.
EngineCommunicationException - If a networking error occurs.
See Also:
RepositoryElementType

getElement

RepositoryElement getElement(java.lang.String namespace)
                             throws EngineException
Returns the repository element at the specified namespace from the repository.

If the specified namespace resolves to multiple repository elements, an arbitrary repository element is returned.

Parameters:
namespace - A namespace of repository elements.
Returns:
A repository element. Null if no elements in the repository match the provided namespace.
Throws:
EngineException - If a system error occurs.
EngineCommunicationException - If a networking error occurs.
java.lang.IllegalArgumentException - If namespace is null, or empty.

promote

void promote(java.lang.String namespace,
             java.lang.String host,
             int port,
             boolean ssl,
             java.lang.String username,
             java.lang.String password)
             throws EngineException
Copies one element from the local (source) repository to the (target) repository of a different cluster. If an element with the same name already exists on the target repository, it is overwritten.

Parameters:
namespace - The element to copy to the repository of a different cluster. It is an error if the namespace contains more than one element.
host - The host where a target engine in the different cluster resides.
port - The port on the target host.
ssl - Indicates whether SSL is enabled on the remote server.
username - If the target engine is secured, a username with sufficient privileges to accept a promoted flow chart. If the target engine is not secured, this argument is ignored and may be null.
password - The password for the specified user, if any.
Throws:
EngineException - If the namespace contains more than one element or if the target repository does not accept the new element.
EngineCommunicationException - If a networking error occurs.

put

java.lang.String put(java.lang.String namespace,
                     AgentConfiguration agentConfiguration,
                     boolean overwrite)
                     throws EngineException
Inserts or modifies an agent configuration in the repository. Verifies that the configuration is valid.

Parameters:
namespace - The location in the repository where this agent configuration will be placed.
agentConfiguration - Agent configuration to insert into the repository.
overwrite - Whether to replace the agent configuration if it already exists in the repository.
Returns:
The fully qualified agent configuration namespace in repository.
Throws:
EngineException - If the configuration is not valid, something already exists at the specified location in the repository and the overwrite flag is enabled, or a system error occurs.
EngineCommunicationException - If a networking error occurs.

put

java.lang.String put(java.lang.String namespace,
                     Configuration configuration,
                     boolean overwrite)
                     throws EngineException
Inserts or modifies an engine configuration in the repository. Verifies that the configuration is valid.

Parameters:
namespace - The location in the repository where this agent configuration will be placed.
configuration - Engine configuration to insert into the repository.
overwrite - Whether to replace the engine configuration if it already exists in the repository.
Returns:
The fully qualified engine configuration namespace in repository.
Throws:
EngineException - If the configuration is not valid, something already exists at the specified location in the repository and the overwrite flag is enabled, or if a system error occurs.
EngineCommunicationException - If a networking error occurs.

put

void put(FlowChart flowChart,
         boolean overwrite)
         throws EngineException
Inserts or modifies a flow chart in the repository. Verifies that the flow chart is valid.

Parameters:
flowChart - Flow chart to insert into the repository.
overwrite - Whether to replace the flow chart if it exists in the repository.
Throws:
EngineException - If a system error occurs.
EngineCommunicationException - If a networking error occurs.

put

void put(FlowChart flowChart,
         java.lang.String description,
         boolean overwrite)
         throws EngineException
Inserts or modifies a flow chart in the repository with a description. Verifies that the flow chart is valid.

Parameters:
flowChart - Flow chart to insert into the repository.
description - Description of flow chart to add to the repository.
overwrite - Whether to replace the flow chart if it exists in the repository.
Throws:
EngineException - If a system error occurs.
EngineCommunicationException - If a networking error occurs.

put

java.lang.String put(java.lang.String namespace,
                     AllowableBusinessInterval businessInterval,
                     boolean overwrite)
                     throws EngineException
Inserts or modifies a business interval in the repository.

Parameters:
namespace - The location in the repository where this business interval will be placed.
businessInterval - Business interval to insert into the repository.
overwrite - Whether to replace the business interval if it already exists in the repository.
Returns:
The fully qualified business interval namespace in repository.
Throws:
EngineException - If the business interval is not valid, something already exists at the specified location in the repository and the overwrite flag is enabled, or if a system error occurs.
EngineCommunicationException - If a networking error occurs.

put

java.lang.String put(java.lang.String namespace,
                     java.lang.String description,
                     PgpKeyPair keyPair,
                     boolean overwrite)
                     throws EngineException
Inserts or modifies a PGP private or public key in the repository.

Parameters:
namespace - The location in the repository where this business interval will be placed.
keyPair - PGP key pair to insert into the repository.
overwrite - Whether to replace the PGP key if it already exists in the repository.
Returns:
The fully qualified PGP key namespace in the repository.
Throws:
EngineException - If the PGP key is not valid, something already exists at the specified location in the repository and the overwrite flag is enabled, or if a system error occurs.
EngineCommunicationException - If a networking error occurs.

remove

long remove(java.lang.String namespace)
            throws EngineException
Removes all elements in the repository in the specified namespace.

Parameters:
namespace - A namespace of repository elements to remove.
Returns:
The number of elements removed from the repository.
Throws:
EngineException - If a system error occurs.
EngineCommunicationException - If a networking error occurs.

rename

long rename(java.lang.String existingNamespace,
            java.lang.String newNamespace)
            throws java.lang.IllegalArgumentException,
                   EngineException
Renames a repository element by changing the elements' namespace in the repository.

Parameters:
existingNamespace - The existing namespace.
newNamespace - The new namespace.
Returns:
The number of repository elements which were successfully renamed.
Throws:
java.lang.IllegalArgumentException - If either the source or destination element names are null or empty.
EngineException - If a system error occurs.
EngineCommunicationException - If a networking error occurs.

size

long size(java.lang.String namespace)
          throws EngineException
Returns the number of repository elements in the specified namespace.

Parameters:
namespace - A namespace of elements in the repository.
Returns:
The number of elements in the specified namespace.
Throws:
java.lang.IllegalArgumentException - If namespace is null or empty.
EngineException - If a system error occurs.
EngineCommunicationException - If a networking error occurs.


© 2014 Flux Corporation. All rights reserved.