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

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

public class PortalAccountingQuery
extends AccountingQuery

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

Constructor Summary
PortalAccountingQuery()
           
 
Method Summary
<TYPE extends org.gcube.messaging.common.messages.records.BaseRecord>
java.lang.Long
countByType(java.lang.Class<TYPE> type, GCUBEScope... scope)
          countByType
 java.lang.Long countByType(java.lang.String type, GCUBEScope... scope)
          countByType
 java.lang.String countByTypeAndUserWithGrouping(java.lang.String type, java.lang.String groupBy, java.lang.String[] dates, java.lang.String... user)
          countByTypeAndUserWithScopeGrouping
<TYPE extends org.gcube.messaging.common.messages.records.BaseRecord>
java.lang.Long
countByUser(java.lang.Class<TYPE> type, java.lang.String user, GCUBEScope... scope)
          countByUser
 java.lang.Long countByUser(java.lang.String type, java.lang.String user, GCUBEScope... scope)
          countByUser
 java.util.HashMap<java.lang.String,java.lang.String> getAddresseesGCUBEUsers(java.lang.String id)
          getAddressesGCUBEUsers
 java.util.HashMap<java.lang.String,java.lang.String> getCollections(java.lang.String id)
          getCollections
 java.lang.String[] getContent(java.lang.String id)
          getContent
 java.util.HashMap<java.lang.String,java.lang.String> getGHNDetails(java.lang.String id)
          getGHNDetails
<TYPE extends org.gcube.messaging.common.messages.records.BaseRecord>
java.util.ArrayList<org.gcube.messaging.common.messages.PortalAccountingMessage<TYPE>>
getResultsAsMessage(java.lang.Class<TYPE> type)
          get the results as ArrayList>
 java.util.HashMap<java.lang.String,java.lang.String> getTerms(java.lang.String id)
          getTerms
 java.util.HashMap<java.lang.String,java.lang.String> getWebAppDetails(java.lang.String id)
          getWebAppDetails
<TYPE extends org.gcube.messaging.common.messages.records.BaseRecord>
java.lang.String
queryByType(java.lang.Class<TYPE> type)
          queryByType
 java.lang.String queryByType(java.lang.String type, java.lang.String[] date)
          queryByType
<TYPE extends org.gcube.messaging.common.messages.records.BaseRecord>
java.lang.String
queryByUser(java.lang.Class<TYPE> type, java.lang.String user, GCUBEScope... scope)
          queryByUser
 java.lang.String queryByUser(java.lang.String type, java.lang.String user, java.lang.String[] date, GCUBEScope... 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
equals, 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> java.lang.String queryByType(java.lang.Class<TYPE> type)
                             throws java.lang.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:
java.lang.Exception - Exception

queryByType

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

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

queryByUser

public <TYPE extends org.gcube.messaging.common.messages.records.BaseRecord> java.lang.String queryByUser(java.lang.Class<TYPE> type,
                                                                                                          java.lang.String user,
                                                                                                          GCUBEScope... scope)
                             throws java.lang.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:
java.lang.Exception - Exception

queryByUser

public java.lang.String queryByUser(java.lang.String type,
                                    java.lang.String user,
                                    java.lang.String[] date,
                                    GCUBEScope... scope)
                             throws java.lang.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:
java.lang.Exception - Exception

countByType

public <TYPE extends org.gcube.messaging.common.messages.records.BaseRecord> java.lang.Long countByType(java.lang.Class<TYPE> type,
                                                                                                        GCUBEScope... scope)
                           throws java.lang.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:
java.lang.Exception - Exception

countByUser

public <TYPE extends org.gcube.messaging.common.messages.records.BaseRecord> java.lang.Long countByUser(java.lang.Class<TYPE> type,
                                                                                                        java.lang.String user,
                                                                                                        GCUBEScope... scope)
                           throws java.lang.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
java.lang.Exception - Exception

countByType

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

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

countByUser

public java.lang.Long countByUser(java.lang.String type,
                                  java.lang.String user,
                                  GCUBEScope... scope)
                           throws java.lang.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
java.lang.Exception - Exception

countByTypeAndUserWithGrouping

public java.lang.String countByTypeAndUserWithGrouping(java.lang.String type,
                                                       java.lang.String groupBy,
                                                       java.lang.String[] dates,
                                                       java.lang.String... user)
                                                throws java.lang.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
java.lang.Exception - Exception

getCollections

public java.util.HashMap<java.lang.String,java.lang.String> getCollections(java.lang.String id)
                                                                    throws EmptyResultException,
                                                                           java.lang.Exception
getCollections

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

getTerms

public java.util.HashMap<java.lang.String,java.lang.String> getTerms(java.lang.String id)
                                                              throws EmptyResultException,
                                                                     java.lang.Exception
getTerms

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

getWebAppDetails

public java.util.HashMap<java.lang.String,java.lang.String> getWebAppDetails(java.lang.String id)
                                                                      throws EmptyResultException,
                                                                             java.lang.Exception
getWebAppDetails

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

getGHNDetails

public java.util.HashMap<java.lang.String,java.lang.String> getGHNDetails(java.lang.String id)
                                                                   throws EmptyResultException,
                                                                          java.lang.Exception
getGHNDetails

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

getAddresseesGCUBEUsers

public java.util.HashMap<java.lang.String,java.lang.String> getAddresseesGCUBEUsers(java.lang.String id)
                                                                             throws EmptyResultException,
                                                                                    java.lang.Exception
getAddressesGCUBEUsers

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

getContent

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

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

getResultsAsMessage

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

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