org.apache.felix.ipojo.api.composite

## Class ImportedService

- java.lang.Object
- - org.apache.felix.ipojo.api.composite.ImportedService

All Implemented Interfaces:
  HandlerConfiguration

    public class ImportedService
    extends java.lang.Object
    implements HandlerConfiguration

Allows defining an imported service. A service import is the publication of service from the parent composite or global registry inside the composite.

Author:
  Felix Project Team

### Field Summary

Fields
`static java.lang.String` `COMPOSITE_AND_GLOBAL_SCOPE` Scoping policy: composite+global.
`static java.lang.String` `COMPOSITE_SCOPE` Scoping policy: composite.
`static java.lang.String` `GLOBAL_SCOPE` Scoping policy: global.

### Constructor Summary

Constructors
Constructor and Description
`ImportedService()`

### Method Summary

All Methods Instance Methods Concrete Methods
`org.apache.felix.ipojo.metadata.Element` `getElement()` Gets the dependency metadata.
`ImportedService` `setAggregate(boolean agg)` Sets the dependency cardinality.
`ImportedService` `setBindingPolicy(int policy)` Sets the dependency binding policy.
`ImportedService` `setComparator(java.lang.String cmp)` Sets the dependency comparator.
`ImportedService` `setFilter(java.lang.String filter)` Sets the dependency filter.
`ImportedService` `setId(java.lang.String id)` Sets the dependency id.
`ImportedService` `setOptional(boolean opt)` Sets the dependency optionality.
`ImportedService` `setScope(java.lang.String scope)` Sets the dependency scope.
`ImportedService` `setSpecification(java.lang.String spec)` Sets the required service specification.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### COMPOSITE_SCOPE

    public static final java.lang.String COMPOSITE_SCOPE

Scoping policy: composite.

See Also:
  Constant Field Values

#### GLOBAL_SCOPE

    public static final java.lang.String GLOBAL_SCOPE

Scoping policy: global.

See Also:
  Constant Field Values

#### COMPOSITE_AND_GLOBAL_SCOPE

    public static final java.lang.String COMPOSITE_AND_GLOBAL_SCOPE

Scoping policy: composite+global.

See Also:
  Constant Field Values

### Constructor Detail

#### ImportedService

    public ImportedService()

### Method Detail

#### getElement

    public org.apache.felix.ipojo.metadata.Element getElement()

Gets the dependency metadata.

Specified by:
  `getElement` in interface `HandlerConfiguration`
Returns:
  the 'requires' element describing the current dependency.

#### setSpecification

    public ImportedService setSpecification(java.lang.String spec)

Sets the required service specification.

Parameters:
  `spec` - the specification
Returns:
  the current imported sub-service.

#### setFilter

    public ImportedService setFilter(java.lang.String filter)

Sets the dependency filter.

Parameters:
  `filter` - the LDAP filter
Returns:
  the current imported sub-service

#### setOptional

    public ImportedService setOptional(boolean opt)

Sets the dependency optionality.

Parameters:
  `opt` - `true` to set the dependency to optional.
Returns:
  the current imported sub-service.

#### setAggregate

    public ImportedService setAggregate(boolean agg)

Sets the dependency cardinality.

Parameters:
  `agg` - `true` to set the dependency to aggregate.
Returns:
  the current imported sub-service.

#### setBindingPolicy

    public ImportedService setBindingPolicy(int policy)

Sets the dependency binding policy.

Parameters:
  `policy` - the binding policy
Returns:
  the current imported sub-service

#### setComparator

    public ImportedService setComparator(java.lang.String cmp)

Sets the dependency comparator.

Parameters:
  `cmp` - the comparator class name
Returns:
  the current imported sub-service

#### setId

    public ImportedService setId(java.lang.String id)

Sets the dependency id.

Parameters:
  `id` - the dependency id.
Returns:
  the current imported sub-service.

#### setScope

    public ImportedService setScope(java.lang.String scope)

Sets the dependency scope.

Parameters:
  `scope` - the dependency scope (global, composite or composite+global).
Returns:
  the current imported sub-service.