org.gcube.messaging.common.consumerlibrary.query
Class PortalAccountingQuery

java.lang.Object
  extended by org.gcube.messaging.common.consumerlibrary.query.Query<ConsumerCL>
      extended by org.gcube.messaging.common.consumerlibrary.query.AccountingQuery
          extended by org.gcube.messaging.common.consumerlibrary.query.PortalAccountingQuery
All Implemented Interfaces:
Serializable

public class PortalAccountingQuery
extends AccountingQuery

Author:
Andrea Manzi(CERN)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.gcube.messaging.common.consumerlibrary.query.Query
call, dateFormat, groupClause, limitClause, orderClause, query, results
 
Constructor Summary
PortalAccountingQuery()
           
 
Method Summary
<TYPE extends org.gcube.messaging.common.messages.records.BaseRecord>
Long
countByType(Class<TYPE> type, String... scope)
          countByType
 Long countByType(String type, String... scope)
          countByType
 String countByTypeAndUserWithGrouping(String type, String groupBy, String[] dates, String... user)
          countByTypeAndUserWithScopeGrouping
<TYPE extends org.gcube.messaging.common.messages.records.BaseRecord>
Long
countByUser(Class<TYPE> type, String user, String... scope)
          countByUser
 Long countByUser(String type, String user, String... scope)
          countByUser
 HashMap<String,String> getAddresseesGCUBEUsers(String id)
          getAddressesGCUBEUsers
 HashMap<String,String> getCollections(String id)
          getCollections
 String[] getContent(String id)
          getContent
 HashMap<String,String> getGHNDetails(String id)
          getGHNDetails
<TYPE extends org.gcube.messaging.common.messages.records.BaseRecord>
ArrayList<org.gcube.messaging.common.messages.PortalAccountingMessage<TYPE>>
getResultsAsMessage(Class<TYPE> type)
          get the results as ArrayList>
 HashMap<String,String> getTerms(String id)
          getTerms
 HashMap<String,String> getWebAppDetails(String id)
          getWebAppDetails
<TYPE extends org.gcube.messaging.common.messages.records.BaseRecord>
String
queryByType(Class<TYPE> type)
          queryByType
 String queryByType(String type, String[] date)
          queryByType
<TYPE extends org.gcube.messaging.common.messages.records.BaseRecord>
String
queryByUser(Class<TYPE> type, String user, String... scope)
          queryByUser
 String queryByUser(String type, String user, String[] date, String... scope)
          queryByUser
 
Methods inherited from class org.gcube.messaging.common.consumerlibrary.query.AccountingQuery
performQuery
 
Methods inherited from class org.gcube.messaging.common.consumerlibrary.query.Query
getCall, getDimensions, getGroupClause, getLimitClause, getOrderClause, getQuery, getResults, getResultsAsArray, printQueryResults, query, setCall, setGroupClause, setLimitClause, setLimitClause, setOrderClause, setQuery, setResults, toJSON
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortalAccountingQuery

public PortalAccountingQuery()
Method Detail

queryByType

public <TYPE extends org.gcube.messaging.common.messages.records.BaseRecord> String queryByType(Class<TYPE> type)
                   throws Exception
queryByType

Type Parameters:
TYPE - the TYPE of Record to retrieve
Parameters:
type - the class of results
Returns:
a String representing the result in Json;
Throws:
Exception - Exception

queryByType

public String queryByType(String type,
                          String[] date)
                   throws Exception
queryByType

Parameters:
type - the class of results
date -
Returns:
a String representing the result in Json;
Throws:
Exception - Exception

queryByUser

public <TYPE extends org.gcube.messaging.common.messages.records.BaseRecord> String queryByUser(Class<TYPE> type,
                                                                                                String user,
                                                                                                String... scope)
                   throws Exception
queryByUser

Type Parameters:
TYPE - the TYPE of Record to retrieve
Parameters:
type - the class of results
user - the user
Returns:
a String representing the result in Json;
Throws:
Exception - Exception

queryByUser

public String queryByUser(String type,
                          String user,
                          String[] date,
                          String... scope)
                   throws Exception
queryByUser

Parameters:
type - the TYPE of Record to retrieve
type - the class of results
user - the user
date -
Returns:
a String representing the result in Json;
Throws:
Exception - Exception

countByType

public <TYPE extends org.gcube.messaging.common.messages.records.BaseRecord> Long countByType(Class<TYPE> type,
                                                                                              String... scope)
                 throws Exception
countByType

Type Parameters:
TYPE - the TYPE of Record to retrieve
Parameters:
type - the class of results
scope - the optional scope
Returns:
the number of records for the given type ( and scope)
Throws:
Exception - Exception

countByUser

public <TYPE extends org.gcube.messaging.common.messages.records.BaseRecord> Long countByUser(Class<TYPE> type,
                                                                                              String user,
                                                                                              String... scope)
                 throws Exception,
                        EmptyResultException
countByUser

Type Parameters:
TYPE - the TYPE of Record to retrieve
Parameters:
type - the class of results
user - the user
scope - the optional scope
Returns:
the number of records for the given type ( and scope)
Throws:
EmptyResultException - Exception
Exception - Exception

countByType

public Long countByType(String type,
                        String... scope)
                 throws Exception
countByType

Parameters:
type - the class of results
scope - the optional scope
Returns:
the number of records for the given type ( and scope)
Throws:
Exception - Exception

countByUser

public Long countByUser(String type,
                        String user,
                        String... scope)
                 throws Exception,
                        EmptyResultException
countByUser

Parameters:
type - the class of results
user - the user
scope - the optional scope
Returns:
the number of records for the given type ( and scope)
Throws:
EmptyResultException - Exception
Exception - Exception

countByTypeAndUserWithGrouping

public String countByTypeAndUserWithGrouping(String type,
                                             String groupBy,
                                             String[] dates,
                                             String... user)
                                      throws Exception,
                                             EmptyResultException
countByTypeAndUserWithScopeGrouping

Parameters:
type - the class of results
groupBy - groupBy
user - the user
scope - the optional scope
dates - the optional scope
Returns:
the number of records for the given type ( and scope)
Throws:
EmptyResultException - Exception
Exception - Exception

getCollections

public HashMap<String,String> getCollections(String id)
                                      throws EmptyResultException,
                                             Exception
getCollections

Parameters:
id - the message id
Returns:
HashMap collection map (id, name)
Throws:
EmptyResultException - exception
Exception - exception

getTerms

public HashMap<String,String> getTerms(String id)
                                throws EmptyResultException,
                                       Exception
getTerms

Parameters:
id - the message id
Returns:
HashMap term map (name, value)
Throws:
EmptyResultException - exception
Exception - exception

getWebAppDetails

public HashMap<String,String> getWebAppDetails(String id)
                                        throws EmptyResultException,
                                               Exception
getWebAppDetails

Parameters:
id - the message id
Returns:
HashMap ghn map (id, name)
Throws:
EmptyResultException - exception
Exception - exception

getGHNDetails

public HashMap<String,String> getGHNDetails(String id)
                                     throws EmptyResultException,
                                            Exception
getGHNDetails

Parameters:
id - the message id
Returns:
HashMap ghn map (id, name)
Throws:
EmptyResultException - exception
Exception - exception

getAddresseesGCUBEUsers

public HashMap<String,String> getAddresseesGCUBEUsers(String id)
                                               throws EmptyResultException,
                                                      Exception
getAddressesGCUBEUsers

Parameters:
id - the message id
Returns:
results user, vre
Throws:
EmptyResultException - exception
Exception - exception

getContent

public String[] getContent(String id)
                    throws EmptyResultException,
                           Exception
getContent

Parameters:
id - the message id
Returns:
results contentid, contentName
Throws:
EmptyResultException - exception
Exception - exception

getResultsAsMessage

public <TYPE extends org.gcube.messaging.common.messages.records.BaseRecord> ArrayList<org.gcube.messaging.common.messages.PortalAccountingMessage<TYPE>> getResultsAsMessage(Class<TYPE> type)
                                                                                                                                                                throws Exception,
                                                                                                                                                                       EmptyResultException
get the results as ArrayList>

Type Parameters:
TYPE -
Parameters:
type - the type
Returns:
ArrayList>
Throws:
Exception - exception
EmptyResultException - exception


Copyright © 2013. All Rights Reserved.