org.ctoolkit.restapi.client.pubsub.adaptee.PubSubAdapteesModule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ctoolkit-client-pubsub Show documentation
Show all versions of ctoolkit-client-pubsub Show documentation
Google API CtoolkiT REST API Client Implementation of Google Pub/Sub
The newest version!
/*
* Copyright (c) 2017 Comvai, s.r.o. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package org.ctoolkit.restapi.client.pubsub.adaptee;
import com.google.api.services.pubsub.model.AcknowledgeRequest;
import com.google.api.services.pubsub.model.ModifyAckDeadlineRequest;
import com.google.api.services.pubsub.model.ModifyPushConfigRequest;
import com.google.api.services.pubsub.model.Policy;
import com.google.api.services.pubsub.model.PublishRequest;
import com.google.api.services.pubsub.model.PullRequest;
import com.google.api.services.pubsub.model.Subscription;
import com.google.api.services.pubsub.model.TestIamPermissionsRequest;
import com.google.api.services.pubsub.model.Topic;
import com.google.inject.AbstractModule;
import com.google.inject.TypeLiteral;
import org.ctoolkit.restapi.client.adaptee.DeleteExecutorAdaptee;
import org.ctoolkit.restapi.client.adaptee.GetExecutorAdaptee;
import org.ctoolkit.restapi.client.adaptee.InsertExecutorAdaptee;
import org.ctoolkit.restapi.client.adaptee.ListExecutorAdaptee;
import org.ctoolkit.restapi.client.adaptee.UpdateExecutorAdaptee;
import org.ctoolkit.restapi.client.pubsub.TopicMessage;
/**
* The guice module with all Pub/Sub resource model adaptees injection configuration.
*
* @author Aurel Medvegy
*/
public class PubSubAdapteesModule
extends AbstractModule
{
@Override
protected void configure()
{
// adaptee for PublishRequest
bind( new TypeLiteral>()
{
} ).to( PublishAdaptee.class );
// adaptee for TopicMessage
bind( new TypeLiteral>()
{
} ).to( TopicMessageAdaptee.class );
// policy adaptee
bind( new TypeLiteral>()
{
} ).to( PolicyAdaptee.class );
bind( new TypeLiteral>()
{
} ).to( PolicyAdaptee.class );
// TestIamPermissionsRequest adaptee
bind( new TypeLiteral>()
{
} ).to( TestIamPermissionsAdaptee.class );
// PullRequest adaptee
bind( new TypeLiteral>()
{
} ).to( PullRequestAdaptee.class );
// ModifyAckDeadlineRequest adaptee
bind( new TypeLiteral>()
{
} ).to( ModifyAckDeadlineAdaptee.class );
// ModifyPushConfigRequest adaptee
bind( new TypeLiteral>()
{
} ).to( ModifyPushConfigAdaptee.class );
// topic adaptee
bind( new TypeLiteral>()
{
} ).to( TopicAdaptee.class );
bind( new TypeLiteral>()
{
} ).to( TopicAdaptee.class );
bind( new TypeLiteral>()
{
} ).to( TopicAdaptee.class );
bind( new TypeLiteral>()
{
} ).to( TopicAdaptee.class );
// subscription adaptee
bind( new TypeLiteral>()
{
} ).to( SubscriptionAdaptee.class );
bind( new TypeLiteral>()
{
} ).to( SubscriptionAdaptee.class );
bind( new TypeLiteral>()
{
} ).to( SubscriptionAdaptee.class );
bind( new TypeLiteral>()
{
} ).to( SubscriptionAdaptee.class );
// subscription acknowledge adaptee
bind( new TypeLiteral>()
{
} ).to( SubscriptionAcknowledgeAdaptee.class );
}
}