io.fabric8.kubernetes.client.dsl.base.OperationContext Java Examples

The following examples show how to use io.fabric8.kubernetes.client.dsl.base.OperationContext. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Controller.java    From kubernetes-client with Apache License 2.0 6 votes vote down vote up
public Controller(Class<T> apiTypeClass, DeltaFIFO<T> queue, ListerWatcher<T, L> listerWatcher, Consumer<Deque<AbstractMap.SimpleEntry<DeltaFIFO.DeltaType, Object>>> processFunc, Supplier<Boolean> resyncFunc, long fullResyncPeriod, OperationContext context, ConcurrentLinkedQueue<SharedInformerEventListener> eventListeners) {
  this.queue = queue;
  this.listerWatcher = listerWatcher;
  this.apiTypeClass = apiTypeClass;
  this.processFunc = processFunc;
  this.resyncFunc = resyncFunc;
  this.fullResyncPeriod = fullResyncPeriod;
  this.operationContext = context;
  this.eventListeners = eventListeners;

  // Starts one daemon thread for reflector
  this.reflectExecutor = Executors.newSingleThreadScheduledExecutor();

  // Starts one daemon thread for resync
  this.resyncExecutor = Executors.newSingleThreadScheduledExecutor();
}
 
Example #2
Source File: OAuthAuthorizeTokenOperationsImpl.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public OAuthAuthorizeTokenOperationsImpl(OperationContext context) {
  super(context.withApiGroupName(OAUTH)
    .withPlural("oauthauthorizetokens"));
  this.type = OAuthAuthorizeToken.class;
  this.listType = OAuthAuthorizeTokenList.class;
  this.doneableType = DoneableOAuthAuthorizeToken.class;
}
 
Example #3
Source File: DefaultSharedIndexInformer.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public DefaultSharedIndexInformer(Class<T> apiTypeClass, ListerWatcher<T, L> listerWatcher, long resyncPeriod, OperationContext context, ConcurrentLinkedQueue<SharedInformerEventListener> eventListeners) {
  this.resyncCheckPeriodMillis = resyncPeriod;
  this.defaultEventHandlerResyncPeriod = resyncPeriod;

  this.processor = new SharedProcessor<>();
  this.indexer = new Cache();

  DeltaFIFO<T> fifo = new DeltaFIFO<>(Cache::metaNamespaceKeyFunc, this.indexer);

  this.controller = new Controller<>(apiTypeClass, fifo, listerWatcher, this::handleDeltas, processor::shouldResync, resyncCheckPeriodMillis, context, eventListeners);
  controllerThread = new Thread(controller::run, "informer-controller-" + apiTypeClass.getSimpleName());
}
 
Example #4
Source File: GroupOperationsImpl.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public GroupOperationsImpl(OperationContext context) {
  super(context.withApiGroupName(USER)
    .withPlural("groups"));
  this.type = Group.class;
  this.listType = GroupList.class;
  this.doneableType = DoneableGroup.class;
}
 
Example #5
Source File: ClusterRoleBindingOperationsImpl.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public ClusterRoleBindingOperationsImpl(OperationContext context) {
  super(context.withApiGroupName(AUTHORIZATION)
    .withPlural("clusterrolebindings"));
  this.type = ClusterRoleBinding.class;
  this.listType = ClusterRoleBindingList.class;
  this.doneableType = DoneableClusterRoleBinding.class;
}
 
Example #6
Source File: ServiceMonitorOperationsImpl.java    From dekorate with Apache License 2.0 5 votes vote down vote up
public ServiceMonitorOperationsImpl(OperationContext context) {
  super(context.withApiGroupName("monitoring.coreos.om")
  .withApiGroupVersion("v1")
  .withPlural("servicemonitors"));
  this.type = ServiceMonitor.class;
  this.listType = ServiceMonitorList.class;
  this.doneableType = DoneableServiceMonitor.class;
}
 
Example #7
Source File: CustomResourceDefinitionOperationsImpl.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public CustomResourceDefinitionOperationsImpl(OperationContext context) {
  super(context.withApiGroupName("apiextensions.k8s.io")
    .withApiGroupVersion("v1beta1")
    .withPlural("customresourcedefinitions"));
  this.type = CustomResourceDefinition.class;
  this.listType = CustomResourceDefinitionList.class;
  this.doneableType = DoneableCustomResourceDefinition.class;
}
 
Example #8
Source File: JobOperationsImpl.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public JobOperationsImpl(OperationContext context) {
  super(context.withApiGroupName("batch")
    .withApiGroupVersion("v1")
    .withPlural("jobs"));

  this.type = Job.class;
  this.listType = JobList.class;
  this.doneableType = DoneableJob.class;
}
 
Example #9
Source File: CronJobOperationsImpl.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public CronJobOperationsImpl(OperationContext context) {
  super(context.withApiGroupName("batch")
    .withApiGroupVersion("v1beta1")
    .withCascading(true)
    .withPlural("cronjobs"));
  this.type = CronJob.class;
  this.listType = CronJobList.class;
  this.doneableType = DoneableCronJob.class;
}
 
Example #10
Source File: OAuthClientOperationsImpl.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public OAuthClientOperationsImpl(OperationContext context) {
  super(context.withApiGroupName(OAUTH)
    .withPlural("oauthclients"));
  this.type = OAuthClient.class;
  this.listType = OAuthClientList.class;
  this.doneableType = DoneableOAuthClient.class;
}
 
Example #11
Source File: BindingOperationsImpl.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public BindingOperationsImpl(OperationContext context) {
  super(context
    .withApiGroupVersion("v1")
    .withPlural("bindings"));
  this.type = Binding.class;
  this.listType = (Class<KubernetesResourceList<Binding>>)new TypeReference<KubernetesResourceList<Binding>>(){}.getType();
  this.doneableType = DoneableBinding.class;
}
 
Example #12
Source File: ClusterServiceClassOperationsImpl.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public ClusterServiceClassOperationsImpl(OperationContext ctx) {
    super(ctx.withApiGroupName("servicecatalog.k8s.io").withApiGroupVersion("v1beta1").withPlural("clusterserviceclasses"));
    this.type=ClusterServiceClass.class;
    this.listType=ClusterServiceClassList.class;
    this.doneableType= DoneableClusterServiceClass.class;

}
 
Example #13
Source File: RoleBindingOperationsImpl.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public RoleBindingOperationsImpl(OperationContext context) {
  super(context.withApiGroupName(AUTHORIZATION)
    .withPlural("rolebindings"));
  this.type = RoleBinding.class;
  this.listType = RoleBindingList.class;
  this.doneableType = DoneableRoleBinding.class;
}
 
Example #14
Source File: OAuthAccessTokenOperationsImpl.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public OAuthAccessTokenOperationsImpl(OperationContext context) {
  super(context.withApiGroupName(OAUTH)
    .withPlural("oauthaccesstokens"));
  this.type = OAuthAccessToken.class;
  this.listType = OAuthAccessTokenList.class;
  this.doneableType = DoneableOAuthAccessToken.class;
}
 
Example #15
Source File: UserOperationsImpl.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public UserOperationsImpl(OperationContext context) {
  super(context.withApiGroupName(USER)
    .withPlural("users"));
  this.type = User.class;
  this.listType = UserList.class;
  this.doneableType = DoneableUser.class;
}
 
Example #16
Source File: ProjectOperationsImpl.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public ProjectOperationsImpl(OperationContext context) {
  super(context.withApiGroupName(PROJECT)
    .withPlural("projects"));
  this.type = Project.class;
  this.listType = ProjectList.class;
  this.doneableType = DoneableProject.class;
}
 
Example #17
Source File: SecurityContextConstraintsOperationsImpl.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public SecurityContextConstraintsOperationsImpl(OperationContext context) {
  super(context.withApiGroupName(SECURITY)
    .withPlural("securitycontextconstraints"));
  this.type = SecurityContextConstraints.class;
  this.listType = SecurityContextConstraintsList.class;
  this.doneableType = DoneableSecurityContextConstraints.class;
}
 
Example #18
Source File: ClusterServicePlanOperationsImpl.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
public ClusterServicePlanOperationsImpl(OperationContext ctx) {
    super(ctx.withApiGroupName("servicecatalog.k8s.io").withApiGroupVersion("v1beta1").withPlural("clusterserviceplans"));
    this.type=ClusterServicePlan.class;
    this.listType=ClusterServicePlanList.class;
    this.doneableType= DoneableClusterServicePlan.class;
}
 
Example #19
Source File: ClusterServiceClassOperationsImpl.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
public ClusterServiceClassOperationsImpl(OkHttpClient client, Config config) {
    this(new OperationContext().withOkhttpClient(client).withConfig(config));
}
 
Example #20
Source File: ServiceInstanceOperationsImpl.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
@Override
public BaseOperation<ServiceInstance, ServiceInstanceList, DoneableServiceInstance, ServiceInstanceResource> newInstance(OperationContext context) {
    return new ServiceInstanceOperationsImpl(context);
}
 
Example #21
Source File: CustomResourceDefinitionOperationsImpl.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
public CustomResourceDefinitionOperationsImpl(OkHttpClient client, Config config, String namespace) {
  this(new OperationContext().withOkhttpClient(client).withConfig(config).withNamespace(namespace).withPropagationPolicy(DEFAULT_PROPAGATION_POLICY));
}
 
Example #22
Source File: ProjectOperationsImpl.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
public ProjectOperationsImpl(OkHttpClient client, OpenShiftConfig config) {
  this(new OperationContext().withOkhttpClient(client).withConfig(config));
}
 
Example #23
Source File: ClusterServiceClassOperationsImpl.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
@Override
public BaseOperation<ClusterServiceClass, ClusterServiceClassList, DoneableClusterServiceClass, ClusterServiceClassResource> newInstance(OperationContext context) {
    return new ClusterServiceClassOperationsImpl(context);
}
 
Example #24
Source File: ClusterServiceBrokerOperationsImpl.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
public ClusterServiceBrokerOperationsImpl(OperationContext context) {
    super(context.withApiGroupName("servicecatalog.k8s.io").withApiGroupVersion("v1beta1").withPlural("clusterservicebrokers"));
      this.type=ClusterServiceBroker.class;
      this.listType= ClusterServiceBrokerList.class;
      this.doneableType= DoneableClusterServiceBroker.class;
}
 
Example #25
Source File: GroupOperationsImpl.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
public GroupOperationsImpl(OkHttpClient client, OpenShiftConfig config) {
  this(new OperationContext().withOkhttpClient(client).withConfig(config));
}
 
Example #26
Source File: OAuthAccessTokenOperationsImpl.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
public OAuthAccessTokenOperationsImpl(OkHttpClient client, OpenShiftConfig config) {
  this(new OperationContext().withOkhttpClient(client).withConfig(config));
}
 
Example #27
Source File: OAuthAccessTokenOperationsImpl.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
@Override
public OAuthAccessTokenOperationsImpl newInstance(OperationContext context) {
  return new OAuthAccessTokenOperationsImpl(context);
}
 
Example #28
Source File: BuildConfigOperationsImpl.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
@Override
public BuildConfigOperationsImpl newInstance(OperationContext context) {
  return new BuildConfigOperationsImpl((BuildConfigOperationContext) context);
}
 
Example #29
Source File: UserOperationsImpl.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
public UserOperationsImpl(OkHttpClient client, OpenShiftConfig config) {
  this(new OperationContext().withOkhttpClient(client).withConfig(config));
}
 
Example #30
Source File: ClusterServicePlanOperationsImpl.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
@Override
public BaseOperation<ClusterServicePlan, ClusterServicePlanList, DoneableClusterServicePlan, ClusterServicePlanResource> newInstance(OperationContext context) {
    return new ClusterServicePlanOperationsImpl(context);
}