# Managing Accounts and SLAs

# Managing Application Instances

This section describes how application instances are managed and provisioned:

- Summary of Tasks related to Application Instances
- States of Application Instances
- Web Services Security
- Password Encryption

See Reference: ApplicationInstances, for information finding the operations in the Administration Console and for the name of the MBean.

Prior to registering application instances, service provider and application accounts must have been created: see Managing Service Provider and Application Accounts.

## Summary of Tasks related to Application Instances

To... | Use...
--- | ---
Get information about the number of application instances. | Operation: countApplicationInstances
Add, remove and get information about an application instance. | Operation: addApplicationInstance Operation: removeApplicationInstance Operation: getApplicationInstance
List registered application instances. | Operation: listApplicationInstances
Define additional properties for an application instance. | Operation: setApplicationInstancePassword Operation: setApplicationInstanceProperties Operation: setApplicationInstanceReference Operation: setApplicationInstanceState

## States of Application Instances

Application instances have states. Two states are possible:

- ACTIVATED
- DEACTIVATED

In state ACTIVATED, the application using this application instance ID is in normal operation.

In state DEACTIVATED, the application using this application instance ID is not allowed to send traffic through Oracle Communications Services Gatekeeper. The account is still valid and the state can be transitional by the Oracle Communications Services Gatekeeper Administrator using:

Operation: setApplicationInstanceState

## Web Services Security

When Web Services Security is being used as authentication for the application instance, its credentials must be set up, as in the mapping rules in Table 3-1.

Table 3-1 Credential mapping
ApplicationInstance | UserNameToken | X.509 | SAML
--- | --- | --- | ---
ApplicationInstanceName | userName | CN | CN
Password | password | n/a | n/a

In addition, if X.509 or SAML are being used, the certificates and private keys must be provisioned in the WebLogic Server keystore. For example, `ImportPrivateKey` utility can be used to load the key and digital certificate files into the keystore. See Oracle WebLogic Server Command Reference at http://download.oracle.com/docs/cd/E12840_01/wls/docs103/admin_ref/ for a description of `ImportPrivateKey`.

## Password Encryption

Application instance passwords are encrypted using 3DES algorithm and stored in persistent storage. If no encryption key is configured, a default encryption key is used, but best practice to to use your own key. It should be 24 Bytes.

Configure the encryption key, starting in the Administration Console:

1. Select Security realms myrealm
2. Select Providers tab Authentication tab.
3. Select WLNG Application Authenticator
4. Select Configuration tab Provider specific tab.

In Encryption Key field enter your key.

In Please type again To confirm field enter your key again for verification.

## Reference: ApplicationInstances

All operations are reachable from:

- Oracle Communications Services Gatekeeper Administration Console Managed Object: Container ServicesAccountServiceApplicationInstances
- MBean: com.bea.wlcp.wlng.account.management.ApplicationInstanceMBean

Below is a list of operations for management.

- Operation: addApplicationInstance
- Operation: countApplicationInstances
- Operation: getApplicationInstance
- Operation: listApplicationInstances
- Operation: removeApplicationInstance
- Operation: setApplicationInstancePassword
- Operation: setApplicationInstanceProperties
- Operation: setApplicationInstanceReference
- Operation: setApplicationInstanceState

#### Operation: addApplicationInstance

Scope: Domain

Adds an application instance. Always connected to a service provider/application account combination.

Signature:

    addApplicationInstance(ApplicationInstanceName: String, Password: String, ApplicationIdentifier: String, ServiceProviderIdentifier: String, Reference: String)

Table 3-2 addApplicationInstance
addApplicationInstance
Parameter | Description
--- | ---
ApplicationInstanceName | ID for the new application instance. Used by an application to authenticate. Must be unique.
Password | Password for the application instance.
ApplicationIdentifier | ID of the application account the application instance shall belong to.
ServiceProviderIdentifier | ID of the service provider the application instance shall belong to.
Reference | See Account References. Must be unique.

#### Operation: countApplicationInstances

Scope: Domain

Displays the number of registered application instances for a service provider/application account/application instance combinations. Can be filtered by state.

Signature:

    countApplicationInstances(ApplicationIdentifier: String, ServiceProviderIdentifier: String, State: String)

Table 3-3 countApplicationInstances
countApplicationInstances
Parameter | Description
--- | ---
ApplicationIdentifier | ID of the application account. Optional. Leave empty to match all.
ServiceProviderIdentifier | ID of the service provider account. Optional. Leave empty to match all.
State | State of application instance. Valid values: ACTIVATED DEACTIVATED Optional. Leave empty to match all.

#### Operation: getApplicationInstance

Scope: Domain

Gets information about a registered application instance.

The information includes:

- ID of the application account to which the application instance belongs.
- ID of the service provider account to which the application instance belongs.
- State: see States of Application Instances.
- Reference: see Account References.
- Properties: see Account Properties.

Signature:

    getApplicationInstance(ApplicationInstanceName: String)

Table 3-4 getApplicationInstance
getApplicationInstance
Parameter | Description
--- | ---
ApplicationInstanceName | ID of the application instance to get information about.

#### Operation: listApplicationInstances

Scope: Domain

Displays a list of registered application instances for a specific service provider/application account/application instance state combination.

The list contains application instance IDs.

Signature:

    listApplicationInstances(ApplicationIdentifier: String, ServiceProviderIdentifier: String, State: String, Offset: int, Size: int)

Table 3-5 listApplicationInstances
listApplicationInstances
Parameter | Description
--- | ---
ApplicationIdentifier | ID of the application account to list application instances for. Optional. Leave empty to match all.
ServiceProviderIdentifier | ID of the service provider account to list application instances for. Optional. Leave empty to match all.
State | State of application instance. Valid values: ACTIVATED DEACTIVATED Optional. Leave empty to match all.
Offset | Offset in the list. Starts with 0 (zero)
Size | Size of the list. For no restrictions on the size of the list, use 0 (zero).

#### Operation: removeApplicationInstance

Scope: Domain

Removes a registered application instance.

The account must be in state DEACTIVATED.

Signature:

    removeApplicationInstance(ApplicationInstanceName: String)

Table 3-6 removeApplicationInstance
removeApplicationInstance
Parameter | Description
--- | ---
ApplicationInstanceName | ID of the application instance to remove.

#### Operation: setApplicationInstancePassword

Scope: Domain

Defines a new password for an application instance.

Signature:

    setApplicationInstancePassword( ApplicationInstanceName: String, Password: String)

Table 3-7 setApplicationInstancePassword
setApplicationInstancePassword
Parameter | Description
--- | ---
ApplicationInstanceName | ID of the application instance.
Password | New password.

#### Operation: setApplicationInstanceProperties

Scope: Domain

Specifies properties for an application instance: see Account Properties.

Note: | Only applicable when accessing the MBean directly.

Signature:

    setApplicationInstanceProperties(ApplicationInstanceName: String, Properties: Set<Map.Entry<String, String>>)

Table 3-8 setApplicationInstanceProperties
setApplicationInstanceProperties
Parameter | Description
--- | ---
ApplicationInstanceName | ID of the application instance to set properties for.
Properties | See Account Properties.

#### Operation: setApplicationInstanceReference

Scope: Domain

Specifies a reference for an application instance: see Account References.

Signature:

    setApplicationInstanceReference(ApplicationInstanceName: String, Reference: String)

Table 3-9 setApplicationInstanceReference
setApplicationInstanceReference
Parameter | Description
--- | ---
ApplicationInstanceName | ID of the application instance to set the reference for.
Reference | See Account References.

#### Operation: setApplicationInstanceState

Scope: Domain

Performs a state transition for an application instance: see States of Application Instances.

Signature:

    setApplicationInstanceState(ApplicationInstanceName: String, State: String)

Table 3-10 setApplicationInstanceState
setApplicationInstanceState
Parameter | Description
--- | ---
ApplicationInstanceName | ID of the application instance to change state for.
State | See States of Application Instances. One of: ACTIVATED DEACTIVATED