package org.openspaces.pu.service;

import java.io.Serializable;
import java.util.Map;

/**
 * A generic service that exists within a processing unit.
 *
 * @author kimchy
 * @see org.openspaces.pu.service.PlainServiceDetails
 */
public interface ServiceDetails extends Serializable {

    /**
     * Returns the id of the processing unit (usually the bean id).
     */
    String getId();

    /**
     * Returns the service type. For example, space, dotnet, jee.
     */
    String getServiceType();

    /**
     * Returns the type of the serive details. For example, in case of
     * space, it can be localcache, proxy, ... .
     */
    String getServiceSubType();

    /**
     * Returns a short description of the service.
     */
    String getDescription();

    /**
     * Returns the long description
     */
    String getLongDescription();

    /**
     * Returns extra atrributes the service details wishes to expose.
     */
    Map<String, Object> getAttributes();

    /**
     * Aggregates an array of service details into an aggregated view of it. All service details are of the same
     * service type. Can return <code>null</code> if no aggregation can be performed.
     */
    AggregatedServiceDetails aggregateByServiceType(ServiceDetails[] servicesDetails);

    /**
     * Aggregates an array of service details into an aggregated view of it. All service details are of the same
     * service type and service sub type. Can return <code>null</code> if no aggregation can be performed.
     */
    AggregatedServiceDetails aggregateByServiceSubType(ServiceDetails[] servicesDetails);

    /**
     * Aggregates an array of service details into an aggregated view of it. All service details are of the same
     * id (and service type and service sub type). Can return <code>null</code> if no aggregation can be performed.
     */
    AggregatedServiceDetails aggregateById(ServiceDetails[] servicesDetails);
}

@@ -972,32 +972,34 @@
 ributes();%0A%0A
+//
     /**%0A
      * Aggre
@@ -978,32 +978,34 @@
 s();%0A%0A//    /**%0A
+//
      * Aggregate
@@ -1093,32 +1093,34 @@
 are of the same%0A
+//
      * service t
@@ -1185,32 +1185,34 @@
  performed.%0A
+//
      */%0A
     Aggregat
@@ -1191,32 +1191,34 @@
 rmed.%0A//     */%0A
+//
     AggregatedSe
@@ -1284,33 +1284,37 @@
 esDetails);%0A
-%0A
+//%0A//
     /**%0A
      * Aggre
@@ -1293,32 +1293,34 @@
 );%0A//%0A//    /**%0A
+//
      * Aggregate
@@ -1412,24 +1412,26 @@
 of the same%0A
+//
      * servi
@@ -1521,32 +1521,34 @@
  performed.%0A
+//
      */%0A
     Aggregat
@@ -1527,32 +1527,34 @@
 rmed.%0A//     */%0A
+//
     AggregatedSe
@@ -1627,25 +1627,29 @@
 tails);%0A
-%0A
+//%0A//
     /**%0A
      * A
@@ -1636,24 +1636,26 @@
 /%0A//    /**%0A
+//
      * Aggre
@@ -1755,16 +1755,18 @@
 he same%0A
+//
      * i
@@ -1873,24 +1873,26 @@
 formed.%0A
+//
      */%0A
     Aggr
@@ -1879,24 +1879,26 @@
 .%0A//     */%0A
+//
     Aggregat

remove the aggregate methods for now from ServiceDetails