repo_name
stringlengths
4
116
path
stringlengths
3
942
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Poales/Cyperaceae/Carex/Carex winkelmannii/ Syn. Carex sabauda/README.md
179
# Carex sabauda Beauverd SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
apache-2.0
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Brassicales/Brassicaceae/Lepidium/Lepidium tayloriae/README.md
187
# Lepidium tayloriae Al-Shehbaz SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
apache-2.0
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Plantaginaceae/Penstemon/Penstemon rhizomatosus/README.md
194
# Penstemon rhizomatosus N.H. Holmgren SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
apache-2.0
adihubba/javafx-3d-surface-chart
src/main/java/de/adihubba/ObjectUtils.java
3433
package de.adihubba; import java.util.Arrays; import java.util.Collections; import java.util.List; public class ObjectUtils { private static final int DEFAULT_DOUBLE_PRECISION = 8; private static final double[] POWER_OF_TEN = new double[15]; static { for (int i = 0; i < POWER_OF_TEN.length; i++) { POWER_OF_TEN[i] = Math.pow(10, i); } } public static boolean smallerOrEqualsDoublePrecision(double double1, double double2) { return smallerOrEqualsDoublePrecision(double1, double2, DEFAULT_DOUBLE_PRECISION); } public static boolean smallerOrEqualsDoublePrecision(double double1, double double2, int precision) { // try to save the POWER operation double factor = (precision >= 0 && precision < POWER_OF_TEN.length) ? POWER_OF_TEN[precision] : Math.pow(10, precision); long result = Math.round((double1 - double2) * factor); if (result <= 0) { return true; } return false; } public static boolean equalsDoublePrecision(double double1, double double2) { return equalsDoublePrecision(double1, double2, DEFAULT_DOUBLE_PRECISION); } public static boolean equalsDoublePrecision(double double1, double double2, int precision) { double absDifference = Math.abs(double1 - double2); if (absDifference == 0.0) { // don't calculate, if result is already zero return true; } if (absDifference >= 1) { return false; } // try to save the POWER operation double factor = (precision >= 0 && precision < POWER_OF_TEN.length) ? POWER_OF_TEN[precision] : Math.pow(10, precision); return (absDifference * factor < 1); } public static boolean smallerDoublePrecision(double double1, double double2) { return smallerDoublePrecision(double1, double2, DEFAULT_DOUBLE_PRECISION); } public static boolean smallerDoublePrecision(double double1, double double2, int precision) { // try to save the POWER operation double factor = (precision >= 0 && precision < POWER_OF_TEN.length) ? POWER_OF_TEN[precision] : Math.pow(10, precision); long result = Math.round((double1 - double2) * factor); if (result < 0) { return true; } return false; } public static <O> List<O> asReadonlyList(O... objects) { return objects == null ? Collections.EMPTY_LIST : Arrays.asList(objects); } public static boolean equalsObject(Object obj1, Object obj2) { if (obj1 == obj2) { // both objects are identical or null return true; } if (obj1 == null || obj2 == null) { // only one side is null return false; } // from here both of them are not null // don't compare the classes as it is done in the equals routine and should be up // to objects we are comparing return obj1.equals(obj2); } public static boolean arrayHasElements(Object[] obj) { if (obj != null && obj.length != 0) { for (Object object : obj) { if (object != null) { return true; } } } return false; } }
apache-2.0
jimmidyson/kubernetes-client
kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/DeploymentTest.java
10860
/** * Copyright (C) 2015 Red Hat, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.fabric8.kubernetes.client.mock; import io.fabric8.kubernetes.api.model.extensions.Deployment; import io.fabric8.kubernetes.api.model.extensions.DeploymentBuilder; import io.fabric8.kubernetes.api.model.extensions.DeploymentList; import io.fabric8.kubernetes.api.model.extensions.DeploymentListBuilder; import io.fabric8.kubernetes.api.model.extensions.ReplicaSet; import io.fabric8.kubernetes.api.model.extensions.ReplicaSetBuilder; import io.fabric8.kubernetes.api.model.extensions.ReplicaSetListBuilder; import io.fabric8.kubernetes.client.KubernetesClient; import io.fabric8.kubernetes.client.KubernetesClientException; import io.fabric8.kubernetes.client.server.mock.KubernetesServer; import org.junit.Rule; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; public class DeploymentTest { @Rule public KubernetesServer server = new KubernetesServer(); @Test public void testList() { server.expect().withPath("/apis/extensions/v1beta1/namespaces/test/deployments").andReturn(200, new DeploymentListBuilder().build()).once(); server.expect().withPath("/apis/extensions/v1beta1/namespaces/ns1/deployments").andReturn(200, new DeploymentListBuilder() .addNewItem().and() .addNewItem().and().build()).once(); server.expect().withPath("/apis/extensions/v1beta1/deployments").andReturn(200, new DeploymentListBuilder() .addNewItem().and() .addNewItem().and() .addNewItem() .and().build()).once(); KubernetesClient client = server.getClient(); DeploymentList deploymentList = client.extensions().deployments().list(); assertNotNull(deploymentList); assertEquals(0, deploymentList.getItems().size()); deploymentList = client.extensions().deployments().inNamespace("ns1").list(); assertNotNull(deploymentList); assertEquals(2, deploymentList.getItems().size()); deploymentList = client.extensions().deployments().inAnyNamespace().list(); assertNotNull(deploymentList); assertEquals(3, deploymentList.getItems().size()); } @Test public void testListWithLabels() { server.expect().withPath("/apis/extensions/v1beta1/namespaces/test/deployments?labelSelector=" + toUrlEncoded("key1=value1,key2=value2,key3=value3")).andReturn(200, new DeploymentListBuilder().build()).always(); server.expect().withPath("/apis/extensions/v1beta1/namespaces/test/deployments?labelSelector=" + toUrlEncoded("key1=value1,key2=value2")).andReturn(200, new DeploymentListBuilder() .addNewItem().and() .addNewItem().and() .addNewItem().and() .build()).once(); KubernetesClient client = server.getClient(); DeploymentList deploymentList = client.extensions().deployments() .withLabel("key1", "value1") .withLabel("key2", "value2") .withLabel("key3", "value3") .list(); assertNotNull(deploymentList); assertEquals(0, deploymentList.getItems().size()); deploymentList = client.extensions().deployments() .withLabel("key1", "value1") .withLabel("key2", "value2") .list(); assertNotNull(deploymentList); assertEquals(3, deploymentList.getItems().size()); } @Test public void testGet() { server.expect().withPath("/apis/extensions/v1beta1/namespaces/test/deployments/deployment1").andReturn(200, new DeploymentBuilder().build()).once(); server.expect().withPath("/apis/extensions/v1beta1/namespaces/ns1/deployments/deployment2").andReturn(200, new DeploymentBuilder().build()).once(); KubernetesClient client = server.getClient(); Deployment deployment = client.extensions().deployments().withName("deployment1").get(); assertNotNull(deployment); deployment = client.extensions().deployments().withName("deployment2").get(); assertNull(deployment); deployment = client.extensions().deployments().inNamespace("ns1").withName("deployment2").get(); assertNotNull(deployment); } @Test public void testDelete() { Deployment deployment1 = new DeploymentBuilder().withNewMetadata() .withName("deployment1") .addToLabels("key1", "value1") .withResourceVersion("1") .withGeneration(1L) .endMetadata() .withNewSpec() .withNewSelector() .addToMatchLabels("key1", "value1") .endSelector() .withReplicas(0) .endSpec() .withNewStatus() .withReplicas(1) .withObservedGeneration(1l) .endStatus() .build(); ReplicaSet replicaSet1 = new ReplicaSetBuilder().withNewMetadata() .withName("rs1") .addToLabels("key1", "value1") .withResourceVersion("1") .withGeneration(1L) .endMetadata() .withNewSpec() .withNewSelector() .addToMatchLabels("key1", "value1") .endSelector() .withReplicas(0) .endSpec() .withNewStatus() .withReplicas(1) .withObservedGeneration(1l) .endStatus() .build(); Deployment deployment2 = new DeploymentBuilder().withNewMetadata() .withName("deployment2") .addToLabels("key2", "value2") .withResourceVersion("1") .withGeneration(1L) .endMetadata() .withNewSpec() .withNewSelector() .addToMatchLabels("key2", "value2") .endSelector() .withReplicas(0) .endSpec() .withNewStatus() .withReplicas(1) .withObservedGeneration(1l) .endStatus() .build(); server.expect().withPath("/apis/extensions/v1beta1/namespaces/test/deployments/deployment1").andReturn(200, deployment1).once(); server.expect().withPath("/apis/extensions/v1beta1/namespaces/test/deployments/deployment1").andReturn(200, new DeploymentBuilder(deployment1).editSpec().withReplicas(0).endSpec().build()).times(5); server.expect().withPath("/apis/extensions/v1beta1/namespaces/test/replicasets?labelSelector=key1%3Dvalue1").andReturn(200, new ReplicaSetListBuilder().addToItems(replicaSet1).build()).once(); server.expect().withPath("/apis/extensions/v1beta1/namespaces/test/replicasets/rs1").andReturn(200, replicaSet1).once(); server.expect().withPath("/apis/extensions/v1beta1/namespaces/ns1/deployments/deployment2").andReturn(200, deployment2).once(); server.expect().withPath("/apis/extensions/v1beta1/namespaces/ns1/deployments/deployment2").andReturn(200, new DeploymentBuilder(deployment2).editSpec().withReplicas(0).endSpec().build()).times(5); KubernetesClient client = server.getClient(); Boolean deleted = client.extensions().deployments().withName("deployment1").delete(); assertNotNull(deleted); deleted = client.extensions().deployments().withName("deployment2").delete(); assertFalse(deleted); deleted = client.extensions().deployments().inNamespace("ns1").withName("deployment2").delete(); assertTrue(deleted); } @Test public void testDeleteMulti() { Deployment deployment1 = new DeploymentBuilder().withNewMetadata() .withNamespace("test") .withName("deployment1") .withResourceVersion("1") .withGeneration(2L) .endMetadata() .withNewSpec() .withReplicas(0) .endSpec() .withNewStatus() .withReplicas(1) .withObservedGeneration(1l) .endStatus() .build(); Deployment deployment2 = new DeploymentBuilder().withNewMetadata() .withNamespace("ns1") .withName("deployment2") .withResourceVersion("1") .withGeneration(2L) .endMetadata() .withNewSpec() .withReplicas(0) .endSpec() .withNewStatus() .withReplicas(1) .withObservedGeneration(1l) .endStatus() .build(); Deployment deployment3 = new DeploymentBuilder().withNewMetadata().withName("deployment3").withNamespace("any").and().build(); server.expect().withPath("/apis/extensions/v1beta1/namespaces/test/deployments/deployment1").andReturn(200, deployment1).once(); server.expect().withPath("/apis/extensions/v1beta1/namespaces/test/deployments/deployment1").andReturn(200, new DeploymentBuilder(deployment1) .editStatus() .withReplicas(0) .withObservedGeneration(2l) .endStatus() .build()).times(5); server.expect().withPath("/apis/extensions/v1beta1/namespaces/ns1/deployments/deployment2").andReturn(200, deployment2).once(); server.expect().withPath("/apis/extensions/v1beta1/namespaces/ns1/deployments/deployment2").andReturn(200, new DeploymentBuilder(deployment2) .editStatus() .withReplicas(0) .withObservedGeneration(2l) .endStatus() .build()).times(5); KubernetesClient client = server.getClient(); Boolean deleted = client.extensions().deployments().inAnyNamespace().delete(deployment1, deployment2); assertTrue(deleted); deleted = client.extensions().deployments().inAnyNamespace().delete(deployment3); assertFalse(deleted); } @Test(expected = KubernetesClientException.class) public void testDeleteWithNamespaceMismatch() { Deployment deployment1 = new DeploymentBuilder().withNewMetadata().withName("deployment1").withNamespace("test").and().build(); KubernetesClient client = server.getClient(); Boolean deleted = client.extensions().deployments().inNamespace("test1").delete(deployment1); assertNotNull(deleted); } @Test(expected = KubernetesClientException.class) public void testCreateWithNameMismatch() { Deployment deployment1 = new DeploymentBuilder().withNewMetadata().withName("deployment1").withNamespace("test").and().build(); Deployment deployment2 = new DeploymentBuilder().withNewMetadata().withName("deployment2").withNamespace("ns1").and().build(); KubernetesClient client = server.getClient(); client.extensions().deployments().inNamespace("test1").withName("mydeployment1").create(deployment1); } /** * Converts string to URL encoded string. * It's not a fullblown converter, it serves just the purpose of this test. * @param str * @return */ private static final String toUrlEncoded(String str) { return str.replaceAll("=", "%3D"); } }
apache-2.0
knative/build
vendor/github.com/knative/pkg/client/injection/informers/authentication/v1alpha1/policy/fake/fake.go
1229
/* Copyright 2019 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by injection-gen. DO NOT EDIT. package fake import ( "context" fake "github.com/knative/pkg/client/injection/informers/authentication/factory/fake" policy "github.com/knative/pkg/client/injection/informers/authentication/v1alpha1/policy" controller "github.com/knative/pkg/controller" injection "github.com/knative/pkg/injection" ) var Get = policy.Get func init() { injection.Fake.RegisterInformer(withInformer) } func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := fake.Get(ctx) inf := f.Authentication().V1alpha1().Policies() return context.WithValue(ctx, policy.Key{}, inf), inf.Informer() }
apache-2.0
wayshall/onetwo
core/modules/common/src/main/java/org/onetwo/common/data/ValueWrapper.java
602
package org.onetwo.common.data; import java.io.Serializable; /***** * @author wayshall * */ @SuppressWarnings("serial") public class ValueWrapper<T> implements Serializable{ public static <E> ValueWrapper<E> wrap(E value){ return new ValueWrapper<E>(value); } public static <E> ValueWrapper<E> create(){ return new ValueWrapper<E>(null); } private T value; private ValueWrapper(T value) { this.value = value; } public T getValue() { return value; } public boolean isPresent() { return this.value!=null; } public void setValue(T value) { this.value = value; } }
apache-2.0
glycerine/vj
src/veracity/src/libraries/ut/sg_rbtree.c
37138
/* Copyright 2010-2013 SourceGear, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Originally based on code written by Julienne Walker, obtained from the following location, and identified there as "public domain": http://www.eternallyconfuzzled.com/tuts/datastructures/jsw_tut_rbtree.aspx */ #include <sg.h> typedef struct _sg_rbtree_node { int red; const char* pszKey; void* assocData; struct _sg_rbtree_node *link[2]; } sg_rbtree_node; typedef struct _sg_nodesubpool { SG_uint32 count; SG_uint32 space; sg_rbtree_node* pNodes; struct _sg_nodesubpool* pNext; } sg_nodesubpool; typedef struct _sg_rbnodepool { SG_uint32 subpool_space; SG_uint32 count_subpools; SG_uint32 count_items; sg_nodesubpool *pHead; } sg_rbnodepool; void sg_nodesubpool__alloc(SG_context * pCtx, SG_uint32 space, sg_nodesubpool* pNext, sg_nodesubpool ** ppNew) { sg_nodesubpool* pThis = NULL; sg_rbtree_node * pNodes = NULL; SG_ERR_CHECK_RETURN( SG_alloc1(pCtx, pThis) ); SG_ERR_CHECK( SG_allocN(pCtx, space, pNodes) ); pThis->space = space; pThis->pNodes = pNodes; pThis->pNext = pNext; pThis->count = 0; *ppNew = pThis; return; fail: SG_NULLFREE(pCtx, pNodes); SG_NULLFREE(pCtx, pThis); } void sg_nodesubpool__free(SG_context * pCtx, sg_nodesubpool *psp) { // free this node and everything in the next-chain. // i converted this to a loop rather than recursive // so that we don't blow a stack (either procedure or // error-level). while (psp) { sg_nodesubpool * pspNext = psp->pNext; SG_NULLFREE(pCtx, psp->pNodes); SG_NULLFREE(pCtx, psp); psp = pspNext; } } void sg_rbnodepool__alloc(SG_context* pCtx, sg_rbnodepool** ppResult, SG_uint32 subpool_space) { sg_rbnodepool* pThis = NULL; SG_ERR_CHECK_RETURN( SG_alloc1(pCtx, pThis) ); pThis->subpool_space = subpool_space; SG_ERR_CHECK( sg_nodesubpool__alloc(pCtx, pThis->subpool_space, NULL, &pThis->pHead) ); pThis->count_subpools = 1; *ppResult = pThis; return; fail: SG_NULLFREE(pCtx, pThis); } void sg_rbnodepool__free(SG_context * pCtx, sg_rbnodepool* pPool) { if (!pPool) { return; } SG_ERR_IGNORE( sg_nodesubpool__free(pCtx, pPool->pHead) ); SG_NULLFREE(pCtx, pPool); } void sg_rbnodepool__add(SG_context* pCtx, sg_rbnodepool* pPool, sg_rbtree_node** ppResult) { if ((pPool->pHead->count + 1) > pPool->pHead->space) { sg_nodesubpool* psp = NULL; SG_ERR_CHECK_RETURN( sg_nodesubpool__alloc(pCtx, pPool->subpool_space, pPool->pHead, &psp) ); pPool->pHead = psp; pPool->count_subpools++; } *ppResult = &(pPool->pHead->pNodes[pPool->pHead->count++]); pPool->count_items++; return; } struct _sg_rbtree { sg_rbtree_node *root; sg_rbnodepool* pNodePool; SG_strpool *pStrPool; SG_rbtree_compare_function_callback * pfnCompare; SG_uint32 count; SG_bool strpool_is_mine; }; ////////////////////////////////////////////////////////////////// // Some debug routines to test consistency and dump the tree. // These are for the code in SG_rbtree__remove__with_assoc(). #if defined(DEBUG) static SG_rbtree_foreach_callback sg_rbtree__verify_count_cb; static void sg_rbtree__verify_count_cb(SG_context * pCtx, const char * pszKey, void * pVoidAssoc, void * pVoidInst) { SG_uint32 * pCount = (SG_uint32 *)pVoidInst; SG_UNUSED(pCtx); SG_UNUSED(pszKey); SG_UNUSED(pVoidAssoc); *pCount = (*pCount) + 1; } void sg_rbtree__verify_count(SG_context * pCtx, const SG_rbtree * prb, SG_uint32 * pSumObserved) { SG_uint32 sum = 0; SG_uint32 official_count = prb->count; SG_NULLARGCHECK_RETURN(prb); SG_ERR_CHECK_RETURN( SG_rbtree__foreach(pCtx, prb, sg_rbtree__verify_count_cb, &sum) ); if (sum != official_count) { // print the message immediately and then throw the message. // i'm doing this because if we get called inside an SG_ERR_IGNORE // (like a _NULLFREE) the message is lost. SG_ERR_IGNORE( SG_console(pCtx, SG_CS_STDERR, "RBTREE: Count is inconsistent with list. [official_count %d] [observed %d]\n", official_count, sum) ); SG_ERR_THROW2_RETURN( SG_ERR_ASSERT, (pCtx, "RBTREE: Count is inconsistent with list. [official_count %d] [observed %d]", official_count, sum) ); } if (pSumObserved) *pSumObserved = sum; } void sg_rbtree_node__recursive_dump_to_console(SG_context * pCtx, const sg_rbtree_node * pNode, SG_uint32 indent) { if (pNode == NULL) { SG_ERR_IGNORE( SG_console(pCtx, SG_CS_STDERR, "%*c(null node)\n", indent, ' ') ); } else { SG_ERR_IGNORE( SG_console(pCtx, SG_CS_STDERR, "%*c%s [%p] [red %c]\n", indent, ' ', pNode->pszKey, pNode->assocData, ((pNode->red) ? 'Y' : 'N')) ); SG_ERR_IGNORE( sg_rbtree_node__recursive_dump_to_console(pCtx, pNode->link[0], indent+1) ); SG_ERR_IGNORE( sg_rbtree_node__recursive_dump_to_console(pCtx, pNode->link[1], indent+1) ); } } void sg_rbtree__dump_nodes_to_console(SG_context * pCtx, const SG_rbtree * prb, const char * pszMessage) { SG_ERR_IGNORE( SG_console(pCtx, SG_CS_STDERR, "RBTREE: Node Dump: [%s]\n", ((pszMessage) ? pszMessage : "")) ); SG_ERR_IGNORE( sg_rbtree_node__recursive_dump_to_console(pCtx, prb->root, 1) ); } #endif ////////////////////////////////////////////////////////////////// void SG_rbtree__get_strpool( SG_context* pCtx, SG_rbtree* prb, SG_strpool** ppp ) { SG_NULLARGCHECK_RETURN(prb); SG_NULLARGCHECK_RETURN(ppp); *ppp = prb->pStrPool; } void SG_rbtree__alloc__params2( SG_context* pCtx, SG_rbtree** ppNew, SG_uint32 guess, SG_strpool* pStrPool, SG_rbtree_compare_function_callback * pfnCompare ) { SG_rbtree* ptree = NULL; SG_ERR_CHECK_RETURN( SG_alloc1(pCtx, ptree) ); if (guess == 0) { guess = 10; } if (pfnCompare) ptree->pfnCompare = pfnCompare; else ptree->pfnCompare = SG_RBTREE__DEFAULT__COMPARE_FUNCTION; ptree->root = NULL; if (pStrPool) { ptree->strpool_is_mine = SG_FALSE; ptree->pStrPool = pStrPool; } else { ptree->strpool_is_mine = SG_TRUE; // TODO this guess should probably not be passed down like this. // guess*64 is the total number of bytes, but it is not the // desired size of the subpool, which is what strpool__alloc wants. SG_ERR_CHECK( SG_STRPOOL__ALLOC(pCtx, &ptree->pStrPool, guess * 64) ); } SG_ERR_CHECK( sg_rbnodepool__alloc(pCtx, &ptree->pNodePool, guess) ); ptree->count = 0; *ppNew = ptree; return; fail: SG_RBTREE_NULLFREE(pCtx, ptree); } void SG_rbtree__alloc__params(SG_context* pCtx, SG_rbtree** ppNew, SG_uint32 guess, SG_strpool* pStrPool) { SG_ERR_CHECK_RETURN( SG_rbtree__alloc__params2(pCtx, ppNew, guess, pStrPool, NULL) ); // do not use SG_RBTREE__ALLOC__PARAMS2 macro here. } void SG_rbtree__alloc( SG_context* pCtx, SG_rbtree** ppNew ) { SG_ERR_CHECK_RETURN( SG_rbtree__alloc__params2(pCtx, ppNew, 128, NULL, NULL) ); // do not use SG_RBTREE__ALLOC__PARAMS macro here. } #if 0 static int sg_rbtree__is_red ( sg_rbtree_node *root ) { return root != NULL && root->red == 1; } #endif #define sg_rbtree__is_red(root) ( (root) && (1 == (root)->red) ) static sg_rbtree_node *sg_rbtree_single ( sg_rbtree_node *root, int dir ) { sg_rbtree_node *save = root->link[!dir]; root->link[!dir] = save->link[dir]; save->link[dir] = root; root->red = 1; save->red = 0; return save; } static sg_rbtree_node *sg_rbtree_double ( sg_rbtree_node *root, int dir ) { root->link[!dir] = sg_rbtree_single ( root->link[!dir], !dir ); return sg_rbtree_single ( root, dir ); } #if 0 static int sg_rbtree_rb_assert ( sg_rbtree_node *root, SG_rbtree_compare_function_callback * pfnCompare ) { int lh, rh; if ( root == NULL ) return 1; else { sg_rbtree_node *ln = root->link[0]; sg_rbtree_node *rn = root->link[1]; /* Consecutive red links */ if ( sg_rbtree__is_red ( root ) ) { if ( sg_rbtree__is_red ( ln ) || sg_rbtree__is_red ( rn ) ) { puts ( "Red violation" ); return 0; } } lh = sg_rbtree_rb_assert ( ln, pfnCompare ); rh = sg_rbtree_rb_assert ( rn, pfnCompare ); /* Invalid binary search tree */ if ( ( ln != NULL && (*pfnCompare)(ln->pszKey, root->pszKey) >= 0 ) || ( rn != NULL && (*pfnCompare)(rn->pszKey, root->pszKey) <= 0 ) ) { puts ( "Binary tree violation" ); return 0; } /* Black height mismatch */ if ( lh != 0 && rh != 0 && lh != rh ) { puts ( "Black violation" ); return 0; } /* Only count black links */ if ( lh != 0 && rh != 0 ) return sg_rbtree__is_red ( root ) ? lh : lh + 1; else return 0; } } void SG_rbtree__verify( SG_UNUSED_PARM( SG_context* pCtx ), const SG_rbtree* prb ) { SG_UNUSED( pCtx ); sg_rbtree_rb_assert(prb->root, prb->pfnCompare); return SG_ERR_OK; } #endif static void sg_rbtree__alloc_node (SG_context* pCtx, SG_rbtree *tree, sg_rbtree_node** ppnode, const char* pszKey, void* assocData ) { sg_rbtree_node* rn = NULL; SG_ERR_CHECK( sg_rbnodepool__add(pCtx, tree->pNodePool, &rn) ); SG_ERR_CHECK( SG_strpool__add__sz(pCtx, tree->pStrPool, pszKey, &(rn->pszKey)) ); rn->assocData = assocData; rn->red = 1; /* 1 is red, 0 is black */ rn->link[0] = NULL; rn->link[1] = NULL; *ppnode = rn; tree->count++; fail: return; } void SG_rbtree__free(SG_context * pCtx, SG_rbtree* ptree) { if (!ptree) { return; } if (ptree->strpool_is_mine && ptree->pStrPool) { SG_STRPOOL_NULLFREE(pCtx, ptree->pStrPool); } SG_ERR_IGNORE( sg_rbnodepool__free(pCtx, ptree->pNodePool) ); SG_NULLFREE(pCtx, ptree); } static void sg_rbtreenode__find( SG_context* pCtx, const sg_rbtree_node* pnode, SG_rbtree_compare_function_callback * pfnCompare, // i'm passing this down to avoid having a backlink in node to rbtree const char* pszKey, const sg_rbtree_node** pp_result ) { int cmp; if (!pnode) return; cmp = (*pfnCompare)(pnode->pszKey, pszKey); if (0 == cmp) { *pp_result = pnode; } else { int dir = cmp < 0; SG_ERR_CHECK_RETURN( sg_rbtreenode__find(pCtx, pnode->link[dir], pfnCompare, pszKey, pp_result) ); } } void SG_rbtree__key( SG_context* pCtx, const SG_rbtree* prb, const char* psz, const char** ppsz_key ) { const sg_rbtree_node* pnode = NULL; SG_ERR_CHECK_RETURN( sg_rbtreenode__find(pCtx, prb->root, prb->pfnCompare, psz, &pnode) ); if (pnode) { *ppsz_key = pnode->pszKey; } else { *ppsz_key = NULL; } } void SG_rbtree__find( SG_context* pCtx, const SG_rbtree* prb, const char* pszKey, SG_bool* pbFound, void** pAssocData ) { const sg_rbtree_node* pnode = NULL; SG_ERR_CHECK_RETURN( sg_rbtreenode__find(pCtx, prb->root, prb->pfnCompare, pszKey, &pnode) ); if (pnode) { if (pbFound) { *pbFound = SG_TRUE; } if (pAssocData) { *pAssocData = pnode->assocData; } } else { if (pbFound) { *pbFound = SG_FALSE; } else { SG_ERR_THROW_RETURN( SG_ERR_NOT_FOUND ); } } } static void sg_rbtree__add_or_update( SG_context* pCtx, SG_rbtree *tree, const char* pszKey, SG_bool bUpdate, void* assocData, void** pOldAssoc, const char** ppKeyPooled ) { SG_bool bCreated = SG_FALSE; SG_NULLARGCHECK_RETURN(pszKey); if ( tree->root == NULL ) { /* Empty tree case */ SG_ERR_CHECK( sg_rbtree__alloc_node (pCtx, tree, &tree->root, pszKey, assocData ) ); bCreated = SG_TRUE; if (ppKeyPooled) { *ppKeyPooled = tree->root->pszKey; } } else { sg_rbtree_node head = {0,0,0,{0,0}}; /* False tree root */ sg_rbtree_node *g, *t; /* Grandparent & parent */ sg_rbtree_node *p, *q; /* Iterator & parent */ int dir = 0; int last = 0; /* Set up helpers */ t = &head; g = p = NULL; q = t->link[1] = tree->root; /* Search down the tree */ for ( ; ; ) { int cmp; if (!q) { /* Insert new node at the bottom */ SG_ERR_CHECK( sg_rbtree__alloc_node (pCtx, tree, &q, pszKey, assocData ) ); if (ppKeyPooled) { *ppKeyPooled = q->pszKey; } p->link[dir] = q; bCreated = SG_TRUE; } else if ( sg_rbtree__is_red ( q->link[0] ) && sg_rbtree__is_red ( q->link[1] ) ) { /* Color flip */ q->red = 1; q->link[0]->red = 0; q->link[1]->red = 0; } /* Fix red violation */ if ( sg_rbtree__is_red ( q ) && sg_rbtree__is_red ( p ) ) { int dir2 = t->link[1] == g; if ( q == p->link[last] ) { t->link[dir2] = sg_rbtree_single ( g, !last ); } else { t->link[dir2] = sg_rbtree_double ( g, !last ); } } /* Stop if found */ if (bCreated) { break; } cmp = (*tree->pfnCompare)(q->pszKey, pszKey); if (0 == cmp) { if (bUpdate) { if (pOldAssoc) { *pOldAssoc = q->assocData; } q->assocData = assocData; } break; } last = dir; dir = cmp < 0; /* Update helpers */ if ( g != NULL ) { t = g; } g = p, p = q; q = q->link[dir]; } /* Update root */ tree->root = head.link[1]; } /* Make root black */ tree->root->red = 0; if (bCreated) { if (pOldAssoc) { *pOldAssoc = NULL; } return; } if (bUpdate) { return; } SG_ERR_THROW2_RETURN( SG_ERR_RBTREE_DUPLICATEKEY, (pCtx, "Key [%s]", pszKey) ); fail: return; } void SG_memoryblob__pack( SG_context* pCtx, const SG_byte* p, SG_uint32 len, SG_byte* pDest ) { SG_NULLARGCHECK_RETURN(pDest); SG_NULLARGCHECK_RETURN(len); pDest[0] = (SG_byte) ((len >> 24) & 0xff); pDest[1] = (SG_byte) ((len >> 16) & 0xff); pDest[2] = (SG_byte) ((len >> 8) & 0xff); pDest[3] = (SG_byte) ((len >> 0) & 0xff); if (p) { memcpy(pDest + 4, p, len); } return; } void SG_memoryblob__unpack( SG_context* pCtx, const SG_byte* pPacked, const SG_byte** pp, SG_uint32* piLen ) { SG_NULLARGCHECK_RETURN(pPacked); SG_NULLARGCHECK_RETURN(pp); SG_NULLARGCHECK_RETURN(piLen); *piLen = ( (pPacked[0] << 24) | (pPacked[1] << 16) | (pPacked[2] << 8) | pPacked[3] ); *pp = pPacked + 4; return; } void SG_rbtree__memoryblob__alloc( SG_context* pCtx, SG_rbtree* prb, const char* pszKey, SG_uint32 len, SG_byte** pp ) { SG_byte* pPacked = NULL; SG_ERR_CHECK( SG_strpool__add__len(pCtx, prb->pStrPool, len + 4, (const char**) &pPacked) ); SG_ERR_CHECK( SG_memoryblob__pack(pCtx, NULL, len, pPacked) ); SG_ERR_CHECK( sg_rbtree__add_or_update(pCtx, prb, pszKey, SG_FALSE, pPacked, NULL, NULL) ); *pp = (pPacked + 4); fail: return; } void SG_rbtree__memoryblob__add__name( SG_context* pCtx, SG_rbtree* prb, const char* pszKey, const SG_byte* p, SG_uint32 len ) { SG_byte* pPacked = NULL; SG_ERR_CHECK( SG_strpool__add__len(pCtx, prb->pStrPool, len + 4, (const char**) &pPacked) ); SG_ERR_CHECK( SG_memoryblob__pack(pCtx, p, len, pPacked) ); SG_ERR_CHECK( sg_rbtree__add_or_update(pCtx, prb, pszKey, SG_FALSE, pPacked, NULL, NULL) ); fail: return; } void SG_rbtree__memoryblob__add__hid( SG_context* pCtx, SG_rbtree* prb, SG_repo * pRepo, const SG_byte* p, SG_uint32 len, const char** ppszhid ) { SG_byte* pPacked = NULL; char* pszhid = NULL; const char* pszKeyPooled; SG_ERR_CHECK( SG_repo__alloc_compute_hash__from_bytes(pCtx, pRepo, len, p, &pszhid) ); SG_ERR_CHECK( SG_strpool__add__len(pCtx, prb->pStrPool, len + 4, (const char**) &pPacked) ); SG_ERR_CHECK( SG_memoryblob__pack(pCtx, p, len, pPacked) ); SG_ERR_CHECK( sg_rbtree__add_or_update(pCtx, prb, pszhid, SG_FALSE, pPacked, NULL, &pszKeyPooled) ); SG_NULLFREE(pCtx, pszhid); *ppszhid = pszKeyPooled; return; fail: SG_NULLFREE(pCtx, pszhid); } void SG_rbtree__memoryblob__get( SG_context* pCtx, SG_rbtree* prb, const char* pszhid, const SG_byte** pp, SG_uint32* piLen ) { SG_byte* pPacked = NULL; SG_ERR_CHECK( SG_rbtree__find(pCtx, prb, pszhid, NULL, (void**) &pPacked) ); SG_ERR_CHECK( SG_memoryblob__unpack(pCtx, pPacked, pp, piLen) ); fail: return; } void SG_rbtree__add__return_pooled_key( SG_context* pCtx, SG_rbtree* prb, const char* psz, const char** pp ) { SG_ERR_CHECK_RETURN( sg_rbtree__add_or_update(pCtx, prb, psz, SG_FALSE, NULL, NULL, pp) ); } void SG_rbtree__add( SG_context* pCtx, SG_rbtree *tree, const char* pszKey ) { SG_ERR_CHECK_RETURN( sg_rbtree__add_or_update(pCtx, tree, pszKey, SG_FALSE, NULL, NULL, NULL) ); } void SG_rbtree__add__with_assoc( SG_context* pCtx, SG_rbtree* prb, const char* pszKey, void* assoc ) { SG_ERR_CHECK_RETURN( sg_rbtree__add_or_update(pCtx, prb, pszKey, SG_FALSE, assoc, NULL, NULL) ); } void SG_rbtree__add__with_assoc2( SG_context* pCtx, SG_rbtree* prb, const char* pszKey, void* assoc, const char** pp ) { SG_ERR_CHECK_RETURN( sg_rbtree__add_or_update(pCtx, prb, pszKey, SG_FALSE, assoc, NULL, pp) ); } void SG_rbtree__add__with_pooled_sz( SG_context* pCtx, SG_rbtree* prb, const char* pszKey, const char* pszAssoc ) { const char* pszPooledAssoc = NULL; SG_ERR_CHECK( SG_strpool__add__sz(pCtx, prb->pStrPool, pszAssoc, &(pszPooledAssoc)) ); SG_ERR_CHECK_RETURN( sg_rbtree__add_or_update(pCtx, prb, pszKey, SG_FALSE, (void*) pszPooledAssoc, NULL, NULL) ); fail: return; } void SG_rbtree__update( SG_context* pCtx, SG_rbtree *tree, const char* pszKey ) { SG_ERR_CHECK_RETURN( sg_rbtree__add_or_update(pCtx, tree, pszKey, SG_TRUE, NULL, NULL, NULL) ); } void SG_rbtree__update__with_assoc( SG_context* pCtx, SG_rbtree* prb, const char* pszKey, void* assoc, void** pOldAssoc ) { SG_ERR_CHECK_RETURN( sg_rbtree__add_or_update(pCtx, prb, pszKey, SG_TRUE, assoc, pOldAssoc, NULL) ); } void SG_rbtree__update__with_pooled_sz( SG_context* pCtx, SG_rbtree* prb, const char* pszKey, const char* pszAssoc ) { const char* pszPooledAssoc = NULL; SG_ERR_CHECK( SG_strpool__add__sz(pCtx, prb->pStrPool, pszAssoc, &(pszPooledAssoc)) ); SG_ERR_CHECK_RETURN( sg_rbtree__add_or_update(pCtx, prb, pszKey, SG_TRUE, (void*) pszPooledAssoc, NULL, NULL) ); fail: return; } static void _sg_rbtree__remove__with_assoc__actual( SG_context* pCtx, SG_rbtree *tree, const char* pszKey, void** ppAssocData ) { if (!tree->root) { SG_ERR_THROW_RETURN( SG_ERR_NOT_FOUND ); } else { sg_rbtree_node head = {0,0,0,{0,0}}; /* False tree root */ sg_rbtree_node *q, *p, *g; /* Helpers */ sg_rbtree_node *f = NULL; /* Found item */ int dir = 1; /* Set up helpers */ q = &head; g = p = NULL; q->link[1] = tree->root; /* Search and push a red down */ while ( q->link[dir] != NULL ) { int cmp; int last = dir; /* Update helpers */ g = p, p = q; q = q->link[dir]; cmp = (*tree->pfnCompare)(q->pszKey, pszKey); dir = cmp < 0; /* Save found node */ if ( 0 == cmp ) { f = q; } /* Push the red node down */ if ( !sg_rbtree__is_red ( q ) && !sg_rbtree__is_red ( q->link[dir] ) ) { if ( sg_rbtree__is_red ( q->link[!dir] ) ) { p = p->link[last] = sg_rbtree_single ( q, dir ); } else if ( !sg_rbtree__is_red ( q->link[!dir] ) ) { sg_rbtree_node *s = p->link[!last]; if ( s != NULL ) { if ( !sg_rbtree__is_red ( s->link[!last] ) && !sg_rbtree__is_red ( s->link[last] ) ) { /* Color flip */ p->red = 0; s->red = 1; q->red = 1; } else { int dir2 = g->link[1] == p; if ( sg_rbtree__is_red ( s->link[last] ) ) { g->link[dir2] = sg_rbtree_double ( p, last ); } else if ( sg_rbtree__is_red ( s->link[!last] ) ) { g->link[dir2] = sg_rbtree_single ( p, last ); } /* Ensure correct coloring */ q->red = g->link[dir2]->red = 1; g->link[dir2]->link[0]->red = 0; g->link[dir2]->link[1]->red = 0; } } } } } /* Replace and remove if found */ if ( f != NULL ) { if (ppAssocData) { *ppAssocData = f->assocData; } f->pszKey = q->pszKey; f->assocData = q->assocData; p->link[p->link[1] == q] = q->link[q->link[0] == NULL]; tree->count--; } else { SG_ERR_THROW( SG_ERR_NOT_FOUND ); } /* Update root and make it black */ tree->root = head.link[1]; if ( tree->root != NULL ) { tree->root->red = 0; } } fail: return; } void SG_rbtree__remove__with_assoc( SG_context* pCtx, SG_rbtree *tree, const char* pszKey, void** ppAssocData ) { // TODO 2010/08/13 BUGBUG sprawl-786 // TODO // TODO There is a bug in the actual remove code when trying // TODO to remove an key that isn't in the tree. It starts // TODO diving and rotating nodes and when finished it has // TODO lost a bunch of nodes. // TODO // TODO It doesn't always happen. It depends on where the // TODO key is in relation to the other keys in the tree. // TODO // TODO If we fix that, we can remove this interlude which // TODO causes us to do a double-lookup. SG_bool bFound; SG_ERR_CHECK_RETURN( SG_rbtree__find(pCtx, tree, pszKey, &bFound, NULL) ); if (bFound) { SG_ERR_CHECK_RETURN( _sg_rbtree__remove__with_assoc__actual(pCtx, tree, pszKey, ppAssocData) ); return; } else { // The item is not present in the rbtree. We have nothing to do. // But to test the bug, use the following: #if 0 && defined(DEBUG) SG_uint32 official_count_before; SG_uint32 official_count_after; SG_uint32 observed_count_before; SG_uint32 observed_count_after; SG_ERR_IGNORE( SG_console(pCtx, SG_CS_STDERR, "[%p] Preparing to remove non-existant key [%s]\n", tree, pszKey) ); SG_ERR_IGNORE( sg_rbtree__dump_nodes_to_console(pCtx, tree, "Before Attempted Remove") ); SG_ERR_IGNORE( sg_rbtree__verify_count(pCtx, tree, &observed_count_before) ); official_count_before = tree->count; _sg_rbtree__remove__with_assoc__actual(pCtx, tree, pszKey, ppAssocData); SG_ERR_IGNORE( sg_rbtree__dump_nodes_to_console(pCtx, tree, "After Attempted Remove") ); SG_ERR_IGNORE( sg_rbtree__verify_count(pCtx, tree, &observed_count_after) ); official_count_after = tree->count; SG_ERR_IGNORE( SG_console(pCtx, SG_CS_STDERR, ("Counts: before [observed %5d][official %5d]\n" " after [observed %5d][official %5d]\n"), observed_count_before, official_count_before, observed_count_after, official_count_after) ); // let the SG_ERR_NOT_FOUND from the actual-remove continue up. SG_ERR_RETHROW_RETURN; #else SG_ERR_THROW_RETURN( SG_ERR_NOT_FOUND ); #endif } } void SG_rbtree__remove ( SG_context* pCtx, SG_rbtree *tree, const char* pszKey ) { SG_ERR_CHECK_RETURN( SG_rbtree__remove__with_assoc(pCtx, tree, pszKey, NULL) ); } void sg_rbtreenode__calc_depth( SG_context* pCtx, const sg_rbtree_node* pnode, SG_uint16* piDepth, SG_uint16 curDepth ) { if (curDepth > *piDepth) { *piDepth = curDepth; } if (pnode->link[0]) { SG_ERR_CHECK( sg_rbtreenode__calc_depth(pCtx, pnode->link[0], piDepth, 1 + curDepth) ); } if (pnode->link[1]) { SG_ERR_CHECK( sg_rbtreenode__calc_depth(pCtx, pnode->link[1], piDepth, 1 + curDepth) ); } fail: return; } struct _sg_rbtree_trav { sg_rbtree_node *up[128]; /* Stack */ sg_rbtree_node *it; /* Current node */ int top; /* Top of stack */ }; static void _sg_rbtree__iterator__first( SG_context* pCtx, SG_rbtree_iterator *pit, const SG_rbtree *tree, SG_bool* pbOK, const char** ppszKey, void** pAssocData ) { SG_NULLARGCHECK_RETURN(pit); pit->it = tree->root; pit->top = 0; if ( pit->it != NULL ) { while ( pit->it->link[0] != NULL ) { pit->up[pit->top++] = pit->it; pit->it = pit->it->link[0]; } } if ( pit->it != NULL ) { if (ppszKey) { *ppszKey = pit->it->pszKey; } if (pAssocData) { *pAssocData = pit->it->assocData; } if (pbOK) *pbOK = SG_TRUE; } else { if (pbOK) *pbOK = SG_FALSE; } } void SG_rbtree__get_only_entry( SG_context* pCtx, const SG_rbtree *tree, const char** ppszKey, void** pAssocData ) { SG_ARGCHECK_RETURN( (tree->count == 1), tree->count); if (ppszKey) { *ppszKey = tree->root->pszKey; } if (pAssocData) { *pAssocData = tree->root->assocData; } } void SG_rbtree__iterator__first( SG_context* pCtx, SG_rbtree_iterator **ppIterator, const SG_rbtree *tree, SG_bool* pbOK, const char** ppszKey, void** pAssocData ) { SG_rbtree_iterator* pit = NULL; SG_NULLARGCHECK_RETURN(tree); SG_ERR_CHECK_RETURN( SG_alloc1(pCtx, pit) ); SG_ERR_CHECK( _sg_rbtree__iterator__first(pCtx, pit, tree, pbOK, ppszKey, pAssocData) ); if (ppIterator) { *ppIterator = pit; } else { SG_NULLFREE(pCtx, pit); } return; fail: SG_NULLFREE(pCtx, pit); } void SG_rbtree__iterator__next( SG_context* pCtx, SG_rbtree_iterator *trav, SG_bool* pbOK, const char** ppszKey, void** pAssocData ) { SG_NULLARGCHECK_RETURN(trav); SG_NULLARGCHECK_RETURN(pbOK); if ( trav->it->link[1] != NULL ) { trav->up[trav->top++] = trav->it; trav->it = trav->it->link[1]; while ( trav->it->link[0] != NULL ) { trav->up[trav->top++] = trav->it; trav->it = trav->it->link[0]; } } else { sg_rbtree_node *last; do { if ( trav->top == 0 ) { trav->it = NULL; break; } last = trav->it; trav->it = trav->up[--trav->top]; } while ( last == trav->it->link[1] ); } if ( trav->it != NULL ) { if (ppszKey) { *ppszKey = trav->it->pszKey; } if (pAssocData) { *pAssocData = trav->it->assocData; } *pbOK = SG_TRUE; } else { *pbOK = SG_FALSE; } } void SG_rbtree__iterator__free(SG_context * pCtx, SG_rbtree_iterator* pit) { if (!pit) { return; } SG_NULLFREE(pCtx, pit); } void SG_rbtree__foreach( SG_context* pCtx, const SG_rbtree* prb, SG_rbtree_foreach_callback* cb, void* ctx ) { SG_rbtree_iterator trav; const char* pszKey = NULL; void* assocData = NULL; SG_bool b; SG_NULLARGCHECK_RETURN( prb ); SG_NULLARGCHECK_RETURN( cb ); /* Note that foreach is not allowed to alloc memory from the heap. * We instantiate the iterator on the stack instead. * * REVIEW: Jeff says: Is the above comment still valid? We're probably * breaking that rule all over the place.... */ SG_ERR_CHECK( _sg_rbtree__iterator__first(pCtx, &trav, prb, &b, &pszKey, &assocData) ); while (b) { SG_ERR_CHECK( cb(pCtx, pszKey, assocData, ctx) ); SG_ERR_CHECK( SG_rbtree__iterator__next(pCtx, &trav, &b, &pszKey, &assocData) ); } fail: return; } void SG_rbtree__compare__keys_only(SG_context* pCtx, const SG_rbtree* prb1, const SG_rbtree* prb2, SG_bool* pbIdentical, SG_rbtree* prbOnly1, SG_rbtree* prbOnly2, SG_rbtree* prbBoth) { SG_bool bIdentical; SG_rbtree_iterator* ptrav1 = NULL; const char* pszKey1; SG_bool b1; SG_rbtree_iterator* ptrav2 = NULL; const char* pszKey2; SG_bool b2; SG_bool bNoOutputLists = ( !prbOnly1 && !prbOnly2 && !prbBoth ); // for now, we require that both rbtrees have the same ordering function // because we are just iterating on them in tandom. SG_ARGCHECK_RETURN( (prb1->pfnCompare == prb2->pfnCompare), prb1->pfnCompare ); bIdentical = SG_TRUE; SG_ERR_CHECK( SG_rbtree__iterator__first(pCtx, &ptrav1, prb1, &b1, &pszKey1, NULL) ); SG_ERR_CHECK( SG_rbtree__iterator__first(pCtx, &ptrav2, prb2, &b2, &pszKey2, NULL) ); while (b1 || b2) { if (b1 && b2) { int cmp = (*prb1->pfnCompare)(pszKey1, pszKey2); if (0 == cmp) { if (prbBoth) { SG_ERR_CHECK( SG_rbtree__add(pCtx, prbBoth, pszKey1) ); } SG_ERR_CHECK( SG_rbtree__iterator__next(pCtx, ptrav1, &b1, &pszKey1, NULL) ); SG_ERR_CHECK( SG_rbtree__iterator__next(pCtx, ptrav2, &b2, &pszKey2, NULL) ); } else { bIdentical = SG_FALSE; if (bNoOutputLists) { if (pbIdentical) { *pbIdentical = SG_FALSE; } break; } if (cmp > 0) { // 1 is ahead. if (prbOnly2) { SG_ERR_CHECK( SG_rbtree__add(pCtx, prbOnly2, pszKey2) ); } SG_ERR_CHECK( SG_rbtree__iterator__next(pCtx, ptrav2, &b2, &pszKey2, NULL) ); } else { bIdentical = SG_FALSE; // 2 is ahead. if (prbOnly1) { SG_ERR_CHECK( SG_rbtree__add(pCtx, prbOnly1, pszKey1) ); } SG_ERR_CHECK( SG_rbtree__iterator__next(pCtx, ptrav1, &b1, &pszKey1, NULL) ); } } } else if (b1) { if (prbOnly1) { SG_ERR_CHECK( SG_rbtree__add(pCtx, prbOnly1, pszKey1) ); } SG_ERR_CHECK( SG_rbtree__iterator__next(pCtx, ptrav1, &b1, &pszKey1, NULL) ); } else { if (prbOnly2) { SG_ERR_CHECK( SG_rbtree__add(pCtx, prbOnly2, pszKey2) ); } SG_ERR_CHECK( SG_rbtree__iterator__next(pCtx, ptrav2, &b2, &pszKey2, NULL) ); } } SG_RBTREE_ITERATOR_NULLFREE(pCtx, ptrav1); SG_RBTREE_ITERATOR_NULLFREE(pCtx, ptrav2); if (pbIdentical) { *pbIdentical = bIdentical; } return; fail: SG_RBTREE_ITERATOR_NULLFREE(pCtx, ptrav1); SG_RBTREE_ITERATOR_NULLFREE(pCtx, ptrav2); } void SG_rbtree__copy_keys_into_varray(SG_context* pCtx, const SG_rbtree* prb, SG_varray* pva) { SG_rbtree_iterator* ptrav = NULL; const char* pszKey; SG_bool b; SG_NULLARGCHECK( prb ); SG_NULLARGCHECK( pva ); SG_ERR_CHECK( SG_rbtree__iterator__first(pCtx, &ptrav, prb, &b, &pszKey, NULL) ); while (b) { SG_ERR_CHECK( SG_varray__append__string__sz(pCtx, pva, pszKey) ); SG_ERR_CHECK( SG_rbtree__iterator__next(pCtx, ptrav, &b, &pszKey, NULL) ); } fail: SG_RBTREE_ITERATOR_NULLFREE(pCtx, ptrav); } void SG_rbtree__to_varray__keys_only(SG_context* pCtx, const SG_rbtree* prb, SG_varray** ppva) { SG_varray* pva = NULL; SG_uint32 count = 0; SG_NULLARGCHECK( prb ); SG_NULLARGCHECK( ppva ); SG_ERR_CHECK( SG_rbtree__count(pCtx, prb, &count) ); if (count) SG_ERR_CHECK( SG_VARRAY__ALLOC__PARAMS(pCtx, &pva, count, NULL, NULL) ); else SG_ERR_CHECK( SG_VARRAY__ALLOC(pCtx, &pva) ); SG_ERR_CHECK( SG_rbtree__copy_keys_into_varray(pCtx, prb, pva) ); *ppva = pva; pva = NULL; fail: SG_VARRAY_NULLFREE(pCtx, pva); } void SG_rbtree__copy_keys_into_stringarray(SG_context* pCtx, const SG_rbtree* prb, SG_stringarray* psa) { SG_rbtree_iterator* ptrav = NULL; const char* pszKey; SG_bool b; SG_NULLARGCHECK( prb ); SG_NULLARGCHECK( psa ); SG_ERR_CHECK( SG_rbtree__iterator__first(pCtx, &ptrav, prb, &b, &pszKey, NULL) ); while (b) { SG_ERR_CHECK( SG_stringarray__add(pCtx, psa, pszKey) ); SG_ERR_CHECK( SG_rbtree__iterator__next(pCtx, ptrav, &b, &pszKey, NULL) ); } fail: SG_RBTREE_ITERATOR_NULLFREE(pCtx, ptrav); } void SG_rbtree__to_stringarray__keys_only(SG_context* pCtx, const SG_rbtree* prb, SG_stringarray** ppsa) { SG_stringarray* psa = NULL; SG_uint32 count = 0; SG_NULLARGCHECK( prb ); SG_NULLARGCHECK( ppsa ); SG_ERR_CHECK( SG_rbtree__count(pCtx, prb, &count) ); SG_ERR_CHECK( SG_STRINGARRAY__ALLOC(pCtx, &psa, count) ); SG_ERR_CHECK( SG_rbtree__copy_keys_into_stringarray(pCtx, prb, psa) ); *ppsa = psa; psa = NULL; fail: SG_STRINGARRAY_NULLFREE(pCtx, psa); } void SG_rbtree__copy_keys_into_vhash(SG_context* pCtx, const SG_rbtree* prb, SG_vhash* pvh) { SG_rbtree_iterator* ptrav = NULL; const char* pszKey; SG_bool b; SG_NULLARGCHECK( prb ); SG_NULLARGCHECK( pvh ); SG_ERR_CHECK( SG_rbtree__iterator__first(pCtx, &ptrav, prb, &b, &pszKey, NULL) ); while (b) { SG_ERR_CHECK( SG_vhash__add__null(pCtx, pvh, pszKey) ); SG_ERR_CHECK( SG_rbtree__iterator__next(pCtx, ptrav, &b, &pszKey, NULL) ); } fail: SG_RBTREE_ITERATOR_NULLFREE(pCtx, ptrav); } void SG_rbtree__to_vhash__keys_only(SG_context* pCtx, const SG_rbtree* prb, SG_vhash** ppvh) { SG_vhash* pvh = NULL; SG_uint32 count = 0; SG_NULLARGCHECK( prb ); SG_NULLARGCHECK( ppvh ); SG_ERR_CHECK( SG_rbtree__count(pCtx, prb, &count) ); SG_ERR_CHECK( SG_VHASH__ALLOC__PARAMS(pCtx, &pvh, count, NULL, NULL) ); SG_ERR_CHECK( SG_rbtree__copy_keys_into_vhash(pCtx, prb, pvh) ); *ppvh = pvh; pvh = NULL; fail: SG_VHASH_NULLFREE(pCtx, pvh); } void SG_rbtree__count( SG_context* pCtx, const SG_rbtree* prb, SG_uint32* piCount ) { SG_NULLARGCHECK_RETURN(prb); *piCount = prb->count; } void SG_rbtree__depth( SG_context* pCtx, const SG_rbtree* prb, SG_uint16* piDepth ) { SG_uint16 depth = 0; SG_NULLARGCHECK_RETURN(prb); SG_ERR_CHECK( sg_rbtreenode__calc_depth(pCtx, prb->root, &depth, 0) ); *piDepth = depth; fail: return; } void SG_rbtree__add__from_other_rbtree( SG_context* pCtx, SG_rbtree* prb, const SG_rbtree* prbOther ) { SG_rbtree_iterator* ptrav = NULL; const char* pszKey; void* assocData; SG_bool b; SG_NULLARGCHECK_RETURN( prb ); SG_NULLARGCHECK_RETURN( prbOther ); SG_ERR_CHECK( SG_rbtree__iterator__first(pCtx, &ptrav, prbOther, &b, &pszKey, &assocData) ); while (b) { SG_ERR_CHECK( SG_rbtree__add__with_assoc(pCtx, prb, pszKey, assocData) ); SG_ERR_CHECK( SG_rbtree__iterator__next(pCtx, ptrav, &b, &pszKey, &assocData) ); } SG_RBTREE_ITERATOR_NULLFREE(pCtx, ptrav); return; fail: SG_RBTREE_ITERATOR_NULLFREE(pCtx, ptrav); } void SG_rbtree__update__from_other_rbtree__keys_only( SG_context* pCtx, SG_rbtree* prb, const SG_rbtree* prbOther ) { SG_rbtree_iterator* ptrav = NULL; const char* pszKey; SG_bool b; SG_NULLARGCHECK_RETURN( prb ); SG_NULLARGCHECK_RETURN( prbOther ); SG_ERR_CHECK( SG_rbtree__iterator__first(pCtx, &ptrav, prbOther, &b, &pszKey, NULL) ); while (b) { SG_ERR_CHECK( SG_rbtree__update(pCtx, prb, pszKey) ); SG_ERR_CHECK( SG_rbtree__iterator__next(pCtx, ptrav, &b, &pszKey, NULL) ); } SG_RBTREE_ITERATOR_NULLFREE(pCtx, ptrav); return; fail: SG_RBTREE_ITERATOR_NULLFREE(pCtx, ptrav); } void SG_rbtree__free__with_assoc(SG_context * pCtx, SG_rbtree * prb, SG_free_callback* cb) { SG_rbtree_iterator* ptrav = NULL; const char* pszKey; void* assocData; SG_bool b; if (!prb) return; if (cb) { SG_ERR_CHECK( SG_rbtree__iterator__first(pCtx, &ptrav, prb, &b, &pszKey, &assocData) ); while (b) { SG_ERR_IGNORE( cb(pCtx, assocData) ); SG_ERR_CHECK( SG_rbtree__iterator__next(pCtx, ptrav, &b, &pszKey, &assocData) ); } } // fall thru to common cleanup fail: SG_RBTREE_ITERATOR_NULLFREE(pCtx, ptrav); SG_RBTREE_NULLFREE(pCtx, prb); } void SG_rbtree__write_json_array__keys_only(SG_context* pCtx, const SG_rbtree* prb, SG_jsonwriter* pjson) { SG_rbtree_iterator trav; const char* pszKey = NULL; SG_bool b; SG_ERR_CHECK( SG_jsonwriter__write_start_array(pCtx, pjson) ); SG_ERR_CHECK( _sg_rbtree__iterator__first(pCtx, &trav, prb, &b, &pszKey, NULL) ); while (b) { SG_ERR_CHECK( SG_jsonwriter__write_element__string__sz(pCtx, pjson, pszKey) ); SG_ERR_CHECK( SG_rbtree__iterator__next(pCtx, &trav, &b, &pszKey, NULL) ); } SG_ERR_CHECK( SG_jsonwriter__write_end_array(pCtx, pjson) ); fail: return; } ////////////////////////////////////////////////////////////////// #if defined(DEBUG) void SG_rbtree_debug__dump_keys(SG_context* pCtx, const SG_rbtree * prb, SG_string * pStrOut) { SG_rbtree_iterator * pIter = NULL; const char * szKey; SG_bool b; SG_uint32 k; SG_string * pStrLine = NULL; SG_NULLARGCHECK_RETURN( prb ); SG_NULLARGCHECK_RETURN( pStrOut ); SG_ERR_CHECK( SG_STRING__ALLOC(pCtx, &pStrLine) ); k = 0; SG_ERR_CHECK( SG_rbtree__iterator__first(pCtx, &pIter,prb,&b,&szKey,NULL) ); while (b) { SG_ERR_IGNORE( SG_string__sprintf(pCtx, pStrLine,"\t[%d]: %s\n",k,szKey) ); SG_ERR_CHECK( SG_string__append__string(pCtx, pStrOut,pStrLine) ); k++; SG_ERR_CHECK( SG_rbtree__iterator__next(pCtx, pIter,&b,&szKey,NULL) ); } // fall thru to common cleanup fail: SG_RBTREE_ITERATOR_NULLFREE(pCtx, pIter); SG_STRING_NULLFREE(pCtx, pStrLine); } void SG_rbtree_debug__dump_keys_to_console(SG_context* pCtx, const SG_rbtree * prb) { SG_string * pStrOut = NULL; SG_NULLARGCHECK_RETURN(prb); SG_ERR_CHECK( SG_STRING__ALLOC(pCtx, &pStrOut) ); SG_ERR_CHECK( SG_rbtree_debug__dump_keys(pCtx, prb,pStrOut) ); SG_ERR_CHECK( SG_console(pCtx, SG_CS_STDERR,"RBTree:\n%s\n",SG_string__sz(pStrOut)) ); // fall thru to common cleanup fail: SG_STRING_NULLFREE(pCtx, pStrOut); } #endif ////////////////////////////////////////////////////////////////// SG_rbtree_compare_function_callback SG_rbtree__compare_function__reverse_strcmp; int SG_rbtree__compare_function__reverse_strcmp(const char * psz1, const char * psz2) { return strcmp(psz2,psz1); }
apache-2.0
NationalSecurityAgency/ghidra
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/SpacerFieldFactory.java
5415
/* ### * IP: GHIDRA * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ghidra.app.util.viewer.field; import java.math.BigInteger; import docking.widgets.OptionDialog; import docking.widgets.fieldpanel.field.*; import docking.widgets.fieldpanel.support.FieldLocation; import ghidra.app.util.HighlightProvider; import ghidra.app.util.viewer.format.FieldFormatModel; import ghidra.app.util.viewer.proxy.ProxyObj; import ghidra.framework.options.Options; import ghidra.framework.options.ToolOptions; import ghidra.program.model.listing.CodeUnit; import ghidra.program.model.listing.Data; import ghidra.program.util.ProgramLocation; import ghidra.program.util.SpacerFieldLocation; import ghidra.util.StringUtilities; import ghidra.util.classfinder.ClassSearcher; /** * Generates Spacer Fields. * <P> * This field is not meant to be loaded by the {@link ClassSearcher}, hence the X in the name. */ public class SpacerFieldFactory extends FieldFactory { public static final String FIELD_NAME = "Spacer"; private String text = null; /** * Constructor */ public SpacerFieldFactory() { super(FIELD_NAME); } /** * Constructor * @param model the model that the field belongs to. * @param hsProvider the HightLightStringProvider. * @param displayOptions the Options for display properties. * @param fieldOptions the Options for field specific properties. */ private SpacerFieldFactory(FieldFormatModel model, HighlightProvider hsProvider, Options displayOptions, Options fieldOptions) { super(FIELD_NAME, model, hsProvider, displayOptions, fieldOptions); } /** * Constructor * @param text The text to display in the field. * @param model The Field model that will use this Address factory. * @param hsProvider the HightLightProvider. * @param displayOptions the Options for display properties. * @param fieldOptions the Options for field specific properties. */ public SpacerFieldFactory(String text, FieldFormatModel model, HighlightProvider hsProvider, Options displayOptions, Options fieldOptions) { super(FIELD_NAME, model, hsProvider, displayOptions, fieldOptions); this.text = text; } /** * Sets the text for the spacer field * @param text the text to display in the listing */ public void setText(String text) { if (text != null && text.length() == 0) { text = null; } this.text = text; } /** * Sets the literal text to display in this field. */ public void setText() { String newText = OptionDialog.showInputSingleLineDialog(null, "Input Spacer Text", "Text", text); if (newText != null) { newText = newText.trim(); if (newText.equals("")) { text = null; } else { text = newText; } } model.update(); } /** * Returns the spacer field's text */ public String getText() { return text; } @Override public ListingField getField(ProxyObj<?> proxy, int varWidth) { if (enabled && (text != null)) { AttributedString as = new AttributedString(text, color, getMetrics()); FieldElement field = new TextFieldElement(as, 0, 0); return ListingTextField.createSingleLineTextField(this, proxy, field, startX + varWidth, width, hlProvider); } return null; } @Override public String getFieldText() { if (text == null) { return ""; } return text; } @Override public FieldLocation getFieldLocation(ListingField bf, BigInteger index, int fieldNum, ProgramLocation programLoc) { if (!(programLoc instanceof SpacerFieldLocation)) { return null; } SpacerFieldLocation loc = (SpacerFieldLocation) programLoc; if (loc.getText().equals(text)) { return new FieldLocation(index, fieldNum, 0, loc.getCharOffset()); } return null; } @Override public ProgramLocation getProgramLocation(int row, int col, ListingField bf) { Object obj = bf.getProxy().getObject(); if (!(obj instanceof CodeUnit)) { return null; } CodeUnit cu = (CodeUnit) obj; int[] cpath = null; if (obj instanceof Data) { cpath = ((Data) obj).getComponentPath(); } return new SpacerFieldLocation(cu.getProgram(), cu.getMinAddress(), cpath, col, text); } /** * Returns the string to highlight * @param bf the ListingTextField * @param row the row in the field * @param col the column in the field * @param loc the programLocation. */ public String getStringToHighlight(ListingTextField bf, int row, int col, ProgramLocation loc) { if (loc == null) { return null; } String s = ((SpacerFieldLocation) loc).getText(); return StringUtilities.findWord(s, col); } @Override public boolean acceptsType(int category, Class<?> proxyObjectClass) { return true; } @Override public FieldFactory newInstance(FieldFormatModel formatModel, HighlightProvider provider, ToolOptions options, ToolOptions fieldOptions) { return new SpacerFieldFactory(formatModel, provider, options, fieldOptions); } }
apache-2.0
mdoering/backbone
life/Fungi/Ascomycota/Dothideomycetes/Botryosphaeriales/Botryosphaeriaceae/Diplodia/Holcomyces exiguus/README.md
227
# Holcomyces exiguus J. Lindau SPECIES #### Status ACCEPTED #### According to Index Fungorum #### Published in Verh. bot. Ver. Prov. Brandenb. 45: 155 (1904) #### Original name Holcomyces exiguus J. Lindau ### Remarks null
apache-2.0
googleapis/java-pubsublite
samples/snippets/src/test/java/pubsublite/QuickStartIT.java
15069
/* * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package pubsublite; import static com.google.common.truth.Truth.assertThat; import static junit.framework.TestCase.assertNotNull; import com.google.cloud.pubsublite.BacklogLocation; import com.google.cloud.pubsublite.CloudRegion; import com.google.cloud.pubsublite.ProjectNumber; import com.google.cloud.pubsublite.ReservationName; import com.google.cloud.pubsublite.ReservationPath; import com.google.cloud.pubsublite.SeekTarget; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.util.Random; import java.util.UUID; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; import org.junit.rules.Timeout; public class QuickStartIT { private ByteArrayOutputStream bout; private PrintStream out; Random rand = new Random(); private static final Long projectNumber = Long.parseLong(System.getenv("GOOGLE_CLOUD_PROJECT_NUMBER")); private String cloudRegion = "us-central1"; private final char zoneId = (char) (rand.nextInt(3) + 'a'); private static final String suffix = UUID.randomUUID().toString(); private static final String reservationId = "lite-reservation-" + suffix; private static final String topicId = "lite-topic-" + suffix; private static final String subscriptionId = "lite-subscription-" + suffix; private static final int partitions = 2; private static final int messageCount = 10; ReservationPath reservationPath = ReservationPath.newBuilder() .setProject(ProjectNumber.of(projectNumber)) .setLocation(CloudRegion.of(cloudRegion)) .setName(ReservationName.of(reservationId)) .build(); private static void requireEnvVar(String varName) { assertNotNull( "Environment variable " + varName + " is required to perform these tests.", System.getenv(varName)); } @Rule public Timeout globalTimeout = Timeout.seconds(300); // 5 minute timeout @BeforeClass public static void checkRequirements() { requireEnvVar("GOOGLE_CLOUD_PROJECT_NUMBER"); } @Before public void setUp() throws Exception { bout = new ByteArrayOutputStream(); out = new PrintStream(bout); System.setOut(out); } @After public void tearDown() throws Exception { System.setOut(null); } @Test public void testQuickstart() throws Exception { // Create a reservation. CreateReservationExample.createReservationExample( projectNumber, cloudRegion, reservationId, /*throughputCapacity=*/ 4); assertThat(bout.toString()).contains(reservationId); assertThat(bout.toString()).contains("created successfully"); bout.reset(); // Create a regional topic. CreateTopicExample.createTopicExample( cloudRegion, zoneId, projectNumber, topicId, reservationId, partitions, /*regional=*/ true); assertThat(bout.toString()).contains(" (regional topic) created successfully"); bout.reset(); // Create a zonal topic. CreateTopicExample.createTopicExample( cloudRegion, zoneId, projectNumber, topicId, reservationId, partitions, /*regional=*/ false); assertThat(bout.toString()).contains(" (zonal topic) created successfully"); bout.reset(); // Get a reservation. GetReservationExample.getReservationExample(projectNumber, cloudRegion, reservationId); assertThat(bout.toString()).contains(reservationId); assertThat(bout.toString()).contains("4 units of throughput capacity."); bout.reset(); // List reservations. ListReservationsExample.listReservationsExample(projectNumber, cloudRegion); assertThat(bout.toString()).contains("reservation(s) listed"); bout.reset(); // Update reservation to have a throughput capacity of 8 units. UpdateReservationExample.updateReservationExample(projectNumber, cloudRegion, reservationId, 8); assertThat(bout.toString()).contains("throughput_capacity=8"); bout.reset(); // Get a regional topic. GetTopicExample.getTopicExample( cloudRegion, zoneId, projectNumber, topicId, /*regional=*/ true); assertThat(bout.toString()).contains(cloudRegion + "/topics/" + topicId); assertThat(bout.toString()).contains(String.format("%s partition(s).", partitions)); bout.reset(); // Get a zonal topic GetTopicExample.getTopicExample( cloudRegion, zoneId, projectNumber, topicId, /*regional=*/ false); assertThat(bout.toString().contains(cloudRegion + "-" + zoneId + "/topics/" + topicId)); assertThat(bout.toString()).contains(String.format("%s partition(s).", partitions)); bout.reset(); // List regional topics. ListTopicsExample.listTopicsExample(cloudRegion, zoneId, projectNumber, /*regional=*/ true); assertThat(bout.toString().contains(cloudRegion + "/topics/" + topicId)); assertThat(bout.toString()).contains("topic(s) listed"); bout.reset(); // List zonal topics. ListTopicsExample.listTopicsExample(cloudRegion, zoneId, projectNumber, /*regional=*/ false); assertThat(bout.toString().contains(cloudRegion + "-" + zoneId + "/topics/" + topicId)); assertThat(bout.toString()).contains("topic(s) listed"); bout.reset(); // Update a regional topic. UpdateTopicExample.updateTopicExample( cloudRegion, zoneId, projectNumber, topicId, reservationId, /*regional=*/ true); assertThat(bout.toString()).contains("seconds: 604800"); assertThat(bout.toString()).contains("per_partition_bytes: 34359738368"); assertThat(bout.toString()).contains("throughput_reservation: \"" + reservationPath.toString()); bout.reset(); // Update a zonal topic. UpdateTopicExample.updateTopicExample( cloudRegion, zoneId, projectNumber, topicId, reservationId, /*regional=*/ false); assertThat(bout.toString()).contains("seconds: 604800"); assertThat(bout.toString()).contains("per_partition_bytes: 34359738368"); assertThat(bout.toString()).contains("throughput_reservation: \"" + reservationPath.toString()); bout.reset(); // Create a regional subscription. CreateSubscriptionExample.createSubscriptionExample( cloudRegion, zoneId, projectNumber, topicId, subscriptionId, /*regional=*/ true); assertThat(bout.toString().contains(cloudRegion + "/subscriptions/" + subscriptionId)); assertThat(bout.toString()).contains("created successfully"); bout.reset(); // Create a zonal subscription. CreateSubscriptionExample.createSubscriptionExample( cloudRegion, zoneId, projectNumber, topicId, subscriptionId, /*regional=*/ false); assertThat( bout.toString().contains(cloudRegion + "-" + zoneId + "/subscriptions/" + subscriptionId)); assertThat(bout.toString()).contains("created successfully"); bout.reset(); // Get a regional subscription. GetSubscriptionExample.getSubscriptionExample( cloudRegion, zoneId, projectNumber, subscriptionId, /*regional=*/ true); assertThat(bout.toString().contains(cloudRegion + "/subscriptions/" + subscriptionId)); bout.reset(); // Get a zonal subscription. GetSubscriptionExample.getSubscriptionExample( cloudRegion, zoneId, projectNumber, subscriptionId, /*regional=*/ false); assertThat( bout.toString().contains(cloudRegion + "-" + zoneId + "/subscriptions/" + subscriptionId)); bout.reset(); // List subscriptions in a regional topic. ListSubscriptionsInTopicExample.listSubscriptionsInTopicExample( cloudRegion, zoneId, projectNumber, topicId, /*regional=*/ true); assertThat(bout.toString()).contains("subscription(s) listed in the regional topic"); // List subscriptions in a zonal topic. ListSubscriptionsInTopicExample.listSubscriptionsInTopicExample( cloudRegion, zoneId, projectNumber, topicId, /*regional=*/ false); assertThat(bout.toString()).contains("subscription(s) listed in the zonal topic"); bout.reset(); // List regional subscriptions in a project. ListSubscriptionsInProjectExample.listSubscriptionsInProjectExample( cloudRegion, zoneId, projectNumber, /*regional=*/ true); assertThat(bout.toString()).contains("subscription(s) listed in the project"); bout.reset(); // List zonal subscriptions in a project. ListSubscriptionsInProjectExample.listSubscriptionsInProjectExample( cloudRegion, zoneId, projectNumber, /*regional=*/ false); assertThat(bout.toString()).contains("subscription(s) listed in the project"); bout.reset(); // Update a regional subscription. UpdateSubscriptionExample.updateSubscriptionExample( cloudRegion, zoneId, projectNumber, subscriptionId, /*regional=*/ true); assertThat(bout.toString()).contains("delivery_requirement: DELIVER_AFTER_STORED"); bout.reset(); // Update a zonal subscription. UpdateSubscriptionExample.updateSubscriptionExample( cloudRegion, zoneId, projectNumber, subscriptionId, /*regional=*/ false); assertThat(bout.toString()).contains("delivery_requirement: DELIVER_AFTER_STORED"); bout.reset(); // Publish to a regional topic. PublisherExample.publisherExample( cloudRegion, zoneId, projectNumber, topicId, messageCount, /*regional=*/ true); assertThat(bout.toString()).contains("Published " + messageCount + " messages."); bout.reset(); // Publish to a zonal topic. PublisherExample.publisherExample( cloudRegion, zoneId, projectNumber, topicId, messageCount, /*regional=*/ false); assertThat(bout.toString()).contains("Published " + messageCount + " messages."); bout.reset(); // Publish with ordering key to a regional topic. PublishWithOrderingKeyExample.publishWithOrderingKeyExample( cloudRegion, zoneId, projectNumber, topicId, /*regional=*/ true); assertThat(bout.toString()).contains("Published a message with ordering key:"); bout.reset(); // Publish with ordering key to a zonal topic. PublishWithOrderingKeyExample.publishWithOrderingKeyExample( cloudRegion, zoneId, projectNumber, topicId, /*regional=*/ false); assertThat(bout.toString()).contains("Published a message with ordering key:"); bout.reset(); // Publish messages with custom attributes to a regional topic. PublishWithCustomAttributesExample.publishWithCustomAttributesExample( cloudRegion, zoneId, projectNumber, topicId, /*regional=*/ true); assertThat(bout.toString()).contains("Published a message with custom attributes:"); bout.reset(); // Publish messages with custom attributes to a zonal topic. PublishWithCustomAttributesExample.publishWithCustomAttributesExample( cloudRegion, zoneId, projectNumber, topicId, /*regional=*/ false); assertThat(bout.toString()).contains("Published a message with custom attributes:"); bout.reset(); // Publish with batch settings to a regional topic. PublishWithBatchSettingsExample.publishWithBatchSettingsExample( cloudRegion, zoneId, projectNumber, topicId, messageCount, /*regional=*/ true); assertThat(bout.toString()) .contains("Published " + messageCount + " messages with batch settings."); bout.reset(); // Publish with batch settings to a zonal topic. PublishWithBatchSettingsExample.publishWithBatchSettingsExample( cloudRegion, zoneId, projectNumber, topicId, messageCount, /*regional=*/ false); assertThat(bout.toString()) .contains("Published " + messageCount + " messages with batch settings."); bout.reset(); // Subscribe to a regional subscription. SubscriberExample.subscriberExample( cloudRegion, zoneId, projectNumber, subscriptionId, /*regional=*/ true); assertThat(bout.toString()).contains("Listening"); for (int i = 0; i < messageCount; ++i) { assertThat(bout.toString()).contains(String.format("Data : message-%s", i)); } assertThat(bout.toString()).contains("Subscriber is shut down: TERMINATED"); bout.reset(); // Subscribe to a zonal subscription. SubscriberExample.subscriberExample( cloudRegion, zoneId, projectNumber, subscriptionId, /*regional=*/ false); assertThat(bout.toString()).contains("Listening"); for (int i = 0; i < messageCount; ++i) { assertThat(bout.toString()).contains(String.format("Data : message-%s", i)); } assertThat(bout.toString()).contains("Subscriber is shut down: TERMINATED"); bout.reset(); // Seek in a regional subscription. SeekSubscriptionExample.seekSubscriptionExample( cloudRegion, zoneId, projectNumber, subscriptionId, SeekTarget.of(BacklogLocation.BEGINNING), /*waitForOperation=*/ false, /*regional=*/ true); assertThat(bout.toString()).contains("initiated successfully"); bout.reset(); // Seek in a zonal subscription. SeekSubscriptionExample.seekSubscriptionExample( cloudRegion, zoneId, projectNumber, subscriptionId, SeekTarget.of(BacklogLocation.BEGINNING), /*waitForOperation=*/ false, /*regional=*/ false); assertThat(bout.toString()).contains("initiated successfully"); bout.reset(); // Delete a regional subscription. DeleteSubscriptionExample.deleteSubscriptionExample( cloudRegion, zoneId, projectNumber, subscriptionId, /*regional=*/ true); assertThat(bout.toString()).contains(" deleted successfully"); bout.reset(); // Delete a zonal subscription. DeleteSubscriptionExample.deleteSubscriptionExample( cloudRegion, zoneId, projectNumber, subscriptionId, /*regional=*/ false); assertThat(bout.toString()).contains(" deleted successfully"); bout.reset(); // Delete a regional topic. DeleteTopicExample.deleteTopicExample( cloudRegion, zoneId, projectNumber, topicId, /*regional=*/ true); assertThat(bout.toString()).contains(" (regional topic) deleted successfully"); bout.reset(); // Delete a zonal topic. DeleteTopicExample.deleteTopicExample( cloudRegion, zoneId, projectNumber, topicId, /*regional=*/ false); assertThat(bout.toString()).contains(" (zonal topic) deleted successfully"); bout.reset(); // Delete a reservation. DeleteReservationExample.deleteReservationExample(projectNumber, cloudRegion, reservationId); assertThat(bout.toString()).contains("deleted successfully"); } }
apache-2.0
gosu-lang/gosu-lang
gosu-core/src/main/java/gw/internal/gosu/ir/nodes/IRMethodFactory.java
4548
/* * Copyright 2014 Guidewire Software, Inc. */ package gw.internal.gosu.ir.nodes; import gw.lang.reflect.IMethodInfo; import gw.lang.reflect.IType; import gw.lang.reflect.IRelativeTypeInfo; import gw.lang.reflect.IFunctionType; import gw.lang.reflect.IConstructorInfo; import gw.lang.ir.IRType; import gw.lang.ir.IRTypeConstants; import gw.internal.gosu.parser.DynamicFunctionSymbol; import gw.internal.gosu.ir.transform.AbstractElementTransformer; import gw.internal.gosu.ir.transform.util.IRTypeResolver; import gw.lang.reflect.java.IJavaClassInfo; import gw.lang.reflect.java.IJavaClassMethod; import java.lang.reflect.Method; import java.util.List; import java.util.ArrayList; import java.util.Arrays; public class IRMethodFactory { public static IRMethodFromMethodInfo createIRMethod(IMethodInfo originalMethodInfo, IFunctionType functionType) { if (originalMethodInfo == null) { return null; } return new IRMethodFromMethodInfo(originalMethodInfo, functionType); } public static IRMethod createIRMethod( IConstructorInfo constructor ) { return new IRMethodFromConstructorInfo( constructor ); } public static IRMethod createIRMethod(Class cls, String name, Class... paramTypes) { return createIRMethod(AbstractElementTransformer.getDeclaredMethod(cls, name, paramTypes)); } public static IRMethod createIRMethod(IJavaClassInfo cls, String name, Class... paramTypes) { return createIRMethod(AbstractElementTransformer.getDeclaredMethod(cls, name, paramTypes)); } public static IRMethod createIRMethod(Method method) { return new IRMethodFromMethod(method); } public static IRMethod createIRMethod(IJavaClassMethod method) { return new IRMethodFromJavaMethodInfo(method); } public static IRMethod createConstructorIRMethod(IType gosuClass, DynamicFunctionSymbol dfs, int numberOfTypeParameters) { return new IRMethodForConstructorSymbol(gosuClass, dfs, numberOfTypeParameters); } public static IRMethod createIRMethod(IType owner, String name, IType returnType, IType[] parameterTypes, IRelativeTypeInfo.Accessibility accessibility, boolean bStatic) { return new SyntheticIRMethod( owner, name, IRTypeResolver.getDescriptor(returnType), convertToIRTypes(parameterTypes), accessibility, bStatic ); } public static IRMethod createIRMethod(IType owner, String name, IRType returnType, List<IRType> parameterTypes, IRelativeTypeInfo.Accessibility accessibility, boolean bStatic) { return new SyntheticIRMethod( owner, name, returnType, parameterTypes, accessibility, bStatic ); } public static IRMethod createConstructorIRMethod(IType owner, IRType[] parameterTypes ) { return new SyntheticIRMethod( owner, "<init>", IRTypeConstants.pVOID(), Arrays.asList(parameterTypes), IRelativeTypeInfo.Accessibility.PUBLIC, false ); } private static List<IRType> convertToIRTypes(IType[] types) { List<IRType> result = new ArrayList<IRType>(); for (IType type : types) { result.add(IRTypeResolver.getDescriptor(type)); } return result; } // private static IType getTrueOwningType( IMethodInfo mi ) { // if( mi instanceof IJavaMethodInfo) // { // // We have to get the owner type from the method because it may be different from the owning type e.g., entity aspects see ContactGosuAspect.AllAdresses // Method m = ((IJavaMethodInfo)mi).getMethod(); // if( m != null ) // { // return TypeSystem.get( m.getDeclaringClass() ); // } // } // return mi.getOwnersType(); // } // // private static IType[] getParameterTypes( IMethodInfo mi ) { // if ( mi instanceof IGosuMethodInfo ) { // IDynamicFunctionSymbol dfs = ((IGosuMethodInfo)mi).getDfs(); // while( dfs instanceof ParameterizedDynamicFunctionSymbol) // { // ParameterizedDynamicFunctionSymbol pdfs = (ParameterizedDynamicFunctionSymbol)dfs; // dfs = pdfs.getBackingDfs(); // } // IType[] boundedTypes = new IType[dfs.getArgTypes().length]; // for( int i = 0; i < dfs.getArgTypes().length; i++ ) // { // boundedTypes[i] = TypeLord.getDefaultParameterizedTypeWithTypeVars( dfs.getArgTypes()[i] ); // } // return boundedTypes; // } else { // IParameterInfo[] parameterInfos = mi.getParameters(); // IType[] parameterTypes = new IType[parameterInfos.length]; // for (int i = 0; i < parameterInfos.length; i++) { // parameterTypes[i] = parameterInfos[i].getFeatureType(); // } // return parameterTypes; // } // } }
apache-2.0
plutext/ae-xmlgraphics-commons
src/java/org/apache/xmlgraphics/xmp/XMPSerializer.java
4720
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* $Id: XMPSerializer.java 746951 2009-02-23 10:40:14Z jeremias $ */ package org.apache.xmlgraphics.xmp; import java.io.OutputStream; import javax.xml.transform.OutputKeys; import javax.xml.transform.Result; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.sax.SAXTransformerFactory; import javax.xml.transform.sax.TransformerHandler; import javax.xml.transform.stream.StreamResult; import org.xml.sax.SAXException; /** * Serializes an XMP tree to XML or to an XMP packet. */ public class XMPSerializer { private static final String DEFAULT_ENCODING = "UTF-8"; /** * Writes the in-memory representation of the XMP metadata to a JAXP Result. * @param meta the metadata * @param res the JAXP Result to write to * @throws TransformerConfigurationException if an error occurs setting up the XML * infrastructure. * @throws SAXException if a SAX-related problem occurs while writing the XML */ public static void writeXML(Metadata meta, Result res) throws TransformerConfigurationException, SAXException { writeXML(meta, res, false, false); } /** * Writes the in-memory representation of the XMP metadata to an OutputStream as an XMP packet. * @param meta the metadata * @param out the stream to write to * @param readOnlyXMP true if the generated XMP packet should be read-only * @throws TransformerConfigurationException if an error occurs setting up the XML * infrastructure. * @throws SAXException if a SAX-related problem occurs while writing the XML */ public static void writeXMPPacket(Metadata meta, OutputStream out, boolean readOnlyXMP) throws TransformerConfigurationException, SAXException { StreamResult res = new StreamResult(out); writeXML(meta, res, true, readOnlyXMP); } private static void writeXML(Metadata meta, Result res, boolean asXMPPacket, boolean readOnlyXMP) throws TransformerConfigurationException, SAXException { SAXTransformerFactory tFactory = (SAXTransformerFactory)SAXTransformerFactory.newInstance(); TransformerHandler handler = tFactory.newTransformerHandler(); Transformer transformer = handler.getTransformer(); if (asXMPPacket) { transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); } transformer.setOutputProperty(OutputKeys.ENCODING, DEFAULT_ENCODING); try { transformer.setOutputProperty(OutputKeys.INDENT, "yes"); } catch (IllegalArgumentException iae) { //INDENT key is not supported by implementation. That's not tragic, so just ignore. } handler.setResult(res); handler.startDocument(); if (asXMPPacket) { handler.processingInstruction("xpacket", "begin=\"\uFEFF\" id=\"W5M0MpCehiHzreSzNTczkc9d\""); } meta.toSAX(handler); if (asXMPPacket) { if (readOnlyXMP) { handler.processingInstruction("xpacket", "end=\"r\""); } else { //Create padding string (40 * 101 characters is more or less the recommended 4KB) StringBuffer sb = new StringBuffer(101); sb.append('\n'); for (int i = 0; i < 100; i++) { sb.append(" "); } char[] padding = sb.toString().toCharArray(); for (int i = 0; i < 40; i++) { handler.characters(padding, 0, padding.length); } handler.characters(new char[] {'\n'}, 0, 1); handler.processingInstruction("xpacket", "end=\"w\""); } } handler.endDocument(); } }
apache-2.0
Ramzi-Alqrainy/SELK
apache-nutch-1.9.0/docs/api/org/apache/nutch/util/class-use/TrieStringMatcher.TrieNode.html
12193
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_55) on Tue Aug 12 22:12:20 PDT 2014 --> <title>Uses of Class org.apache.nutch.util.TrieStringMatcher.TrieNode (apache-nutch 1.9 API)</title> <meta name="date" content="2014-08-12"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.nutch.util.TrieStringMatcher.TrieNode (apache-nutch 1.9 API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html" title="class in org.apache.nutch.util">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/nutch/util/class-use/TrieStringMatcher.TrieNode.html" target="_top">Frames</a></li> <li><a href="TrieStringMatcher.TrieNode.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.apache.nutch.util.TrieStringMatcher.TrieNode" class="title">Uses of Class<br>org.apache.nutch.util.TrieStringMatcher.TrieNode</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html" title="class in org.apache.nutch.util">TrieStringMatcher.TrieNode</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.apache.nutch.util">org.apache.nutch.util</a></td> <td class="colLast"> <div class="block">Miscellaneous utility classes.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.apache.nutch.util"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html" title="class in org.apache.nutch.util">TrieStringMatcher.TrieNode</a> in <a href="../../../../../org/apache/nutch/util/package-summary.html">org.apache.nutch.util</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation"> <caption><span>Fields in <a href="../../../../../org/apache/nutch/util/package-summary.html">org.apache.nutch.util</a> declared as <a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html" title="class in org.apache.nutch.util">TrieStringMatcher.TrieNode</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>protected <a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html" title="class in org.apache.nutch.util">TrieStringMatcher.TrieNode</a>[]</code></td> <td class="colLast"><span class="strong">TrieStringMatcher.TrieNode.</span><code><strong><a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html#children">children</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected <a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html" title="class in org.apache.nutch.util">TrieStringMatcher.TrieNode</a></code></td> <td class="colLast"><span class="strong">TrieStringMatcher.</span><code><strong><a href="../../../../../org/apache/nutch/util/TrieStringMatcher.html#root">root</a></strong></code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation"> <caption><span>Fields in <a href="../../../../../org/apache/nutch/util/package-summary.html">org.apache.nutch.util</a> with type parameters of type <a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html" title="class in org.apache.nutch.util">TrieStringMatcher.TrieNode</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>protected <a href="http://java.sun.com/javase/6/docs/api/java/util/LinkedList.html?is-external=true" title="class or interface in java.util">LinkedList</a>&lt;<a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html" title="class in org.apache.nutch.util">TrieStringMatcher.TrieNode</a>&gt;</code></td> <td class="colLast"><span class="strong">TrieStringMatcher.TrieNode.</span><code><strong><a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html#childrenList">childrenList</a></strong></code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/apache/nutch/util/package-summary.html">org.apache.nutch.util</a> that return <a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html" title="class in org.apache.nutch.util">TrieStringMatcher.TrieNode</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>protected <a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html" title="class in org.apache.nutch.util">TrieStringMatcher.TrieNode</a></code></td> <td class="colLast"><span class="strong">TrieStringMatcher.</span><code><strong><a href="../../../../../org/apache/nutch/util/TrieStringMatcher.html#matchChar(org.apache.nutch.util.TrieStringMatcher.TrieNode, java.lang.String, int)">matchChar</a></strong>(<a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html" title="class in org.apache.nutch.util">TrieStringMatcher.TrieNode</a>&nbsp;node, <a href="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;s, int&nbsp;idx)</code> <div class="block">Returns the next <a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html" title="class in org.apache.nutch.util"><code>TrieStringMatcher.TrieNode</code></a> visited, given that you are at <code>node</code>, and the the next character in the input is the <code>idx</code>'th character of <code>s</code>.</div> </td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/apache/nutch/util/package-summary.html">org.apache.nutch.util</a> with parameters of type <a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html" title="class in org.apache.nutch.util">TrieStringMatcher.TrieNode</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><span class="strong">TrieStringMatcher.TrieNode.</span><code><strong><a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html#compareTo(org.apache.nutch.util.TrieStringMatcher.TrieNode)">compareTo</a></strong>(<a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html" title="class in org.apache.nutch.util">TrieStringMatcher.TrieNode</a>&nbsp;other)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected <a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html" title="class in org.apache.nutch.util">TrieStringMatcher.TrieNode</a></code></td> <td class="colLast"><span class="strong">TrieStringMatcher.</span><code><strong><a href="../../../../../org/apache/nutch/util/TrieStringMatcher.html#matchChar(org.apache.nutch.util.TrieStringMatcher.TrieNode, java.lang.String, int)">matchChar</a></strong>(<a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html" title="class in org.apache.nutch.util">TrieStringMatcher.TrieNode</a>&nbsp;node, <a href="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;s, int&nbsp;idx)</code> <div class="block">Returns the next <a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html" title="class in org.apache.nutch.util"><code>TrieStringMatcher.TrieNode</code></a> visited, given that you are at <code>node</code>, and the the next character in the input is the <code>idx</code>'th character of <code>s</code>.</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/apache/nutch/util/TrieStringMatcher.TrieNode.html" title="class in org.apache.nutch.util">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/nutch/util/class-use/TrieStringMatcher.TrieNode.html" target="_top">Frames</a></li> <li><a href="TrieStringMatcher.TrieNode.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &copy; 2014 The Apache Software Foundation</small></p> </body> </html>
apache-2.0
kaneg/JFlask
src/main/java/gz/jflask/template/TemplateEngines.java
1391
package gz.jflask.template; import gz.jflask.FlaskException; import gz.jflask.InternalServerException; import gz.jflask.config.Config; import gz.jflask.config.ConfigHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.Map; /** * Created by IntelliJ IDEA. * User: kaneg * Date: 6/22/15 * Time: 6:20 PM */ public class TemplateEngines { static TemplateEngine templateEngine; public static final Logger LOGGER = LoggerFactory.getLogger(TemplateEngines.class); public static void init() throws FlaskException { Config configs = ConfigHelper.getAppConfigs(); String engineName = configs.get("template.engine", "default"); if (engineName.equals("default")) { templateEngine = new DefaultTemplateEngine(); } else { try { templateEngine = (TemplateEngine) Class.forName(engineName).newInstance(); } catch (Exception e) { throw new InternalServerException(e); } } LOGGER.info("Begin init template engine:" + templateEngine.getName()); templateEngine.init(); LOGGER.info("End init template engine:" + templateEngine.getName()); } public static String render(String name, String source, Map<String, ?> context) throws Exception { return templateEngine.render(name, source, context); } }
apache-2.0
IMCG/nativetask
src/main/native/src/handler/MMapperHandler.cc
6215
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "commons.h" #include "util/StringUtil.h" #include "MMapperHandler.h" #include "NativeObjectFactory.h" #include "MapOutputCollector.h" namespace NativeTask { MMapperHandler::MMapperHandler() : _config(NULL), _moc(NULL), _mapper(NULL), _partitioner(NULL), _combinerCreator(NULL), _numPartition(1), _dest(NULL), _remain(0) { } MMapperHandler::~MMapperHandler() { reset(); } void MMapperHandler::reset() { _dest = NULL; _remain = 0; delete _mapper; _mapper = NULL; delete _moc; _moc = NULL; delete _partitioner; _partitioner = NULL; _combinerCreator = NULL; } void MMapperHandler::configure(Config & config) { _config = &config; // collector _numPartition = config.getInt("mapred.reduce.tasks", 1); if (_numPartition > 0) { // combiner const char * combinerClass = config.get("native.combiner.class"); if (NULL != combinerClass) { _combinerCreator = NativeObjectFactory::GetObjectCreator(combinerClass); if (NULL == _combinerCreator) { THROW_EXCEPTION_EX(UnsupportException, "Combiner not found: %s", combinerClass); } } // partitioner const char * partitionerClass = config.get("native.partitioner.class"); if (NULL != partitionerClass) { _partitioner = (Partitioner *) NativeObjectFactory::CreateObject(partitionerClass); } else { _partitioner = (Partitioner *) NativeObjectFactory::CreateDefaultObject(PartitionerType); } if (NULL == _partitioner) { THROW_EXCEPTION_EX(UnsupportException, "Partitioner not found: %s", partitionerClass); } _partitioner->configure(config); LOG("Native Mapper with MapOutputCollector"); _moc = new MapOutputCollector(_numPartition); _moc->configure(config); } else { LOG("Native Mapper with java direct output collector"); } // mapper const char * mapperClass = config.get("native.mapper.class"); if (NULL != mapperClass) { _mapper = (Mapper *) NativeObjectFactory::CreateObject(mapperClass); } else { _mapper = (Mapper *) NativeObjectFactory::CreateDefaultObject(MapperType); } if (NULL == _mapper) { THROW_EXCEPTION_EX(UnsupportException, "Mapper not found: %s", mapperClass); } _mapper->configure(config); _mapper->setCollector(this); } void MMapperHandler::finish() { close(); BatchHandler::finish(); reset(); } void MMapperHandler::handleInput(char * buff, uint32_t length) { if (unlikely(_remain > 0)) { uint32_t cp = _remain < length ? _remain : length; memcpy(_dest + _kvlength - _remain, buff, cp); buff += cp; length -= cp; _remain -= cp; if (0 == _remain) { _mapper->map(_dest, _klength, _dest + _klength, _vlength); delete _dest; _dest = NULL; } } while (length > 0) { if (unlikely(length<2*sizeof(uint32_t))) { THROW_EXCEPTION(IOException, "k/v length information incomplete"); } uint32_t klength = ((uint32_t*) buff)[0]; uint32_t vlength = ((uint32_t*) buff)[1]; buff += 2 * sizeof(uint32_t); length -= 2 * sizeof(uint32_t); uint32_t kvlength = klength + vlength; // TODO: optimize length==0 if (kvlength <= length) { _mapper->map(buff, klength, buff + klength, vlength); buff += kvlength; length -= kvlength; } else { _dest = new char[kvlength + 8]; _klength = klength; _vlength = vlength; _kvlength = kvlength; simple_memcpy(_dest, buff, length); _remain = kvlength - length; return; } } } void MMapperHandler::collect(const void * key, uint32_t keyLen, const void * value, uint32_t valueLen, int partition) { if (NULL == _moc) { THROW_EXCEPTION(UnsupportException, "Collect with partition not support"); } int result =_moc->put(key, keyLen, value, valueLen, partition); if (result==0) { return; } string spillpath = this->sendCommand("GetSpillPath"); if (spillpath.length() == 0) { THROW_EXCEPTION(IOException, "Illegal(empty) spill files path"); } vector<string> pathes; StringUtil::Split(spillpath, ";", pathes); _moc->mid_spill(pathes,"", _moc->getMapOutputSpec(), _combinerCreator); result =_moc->put(key, keyLen, value, valueLen, partition); if (0 != result) { // should not get here, cause _moc will throw Exceptions THROW_EXCEPTION(OutOfMemoryException, "key/value pair larger than io.sort.mb"); } } void MMapperHandler::collect(const void * key, uint32_t keyLen, const void * value, uint32_t valueLen) { if (NULL == _moc) { putInt(keyLen); put((char *)key, keyLen); putInt(valueLen); put((char *)value, valueLen); return; } uint32_t partition = _partitioner->getPartition((const char *) key, keyLen, _numPartition); collect(key, keyLen, value, valueLen, partition); } void MMapperHandler::close() { _mapper->close(); if (NULL == _moc) { return; } string outputpath = this->sendCommand("GetOutputPath"); string indexpath = this->sendCommand("GetOutputIndexPath"); if ((outputpath.length() == 0) || (indexpath.length() == 0)) { THROW_EXCEPTION(IOException, "Illegal(empty) map output file/index path"); } vector<string> pathes; StringUtil::Split(outputpath, ";", pathes); _moc->final_merge_and_spill(pathes, indexpath, _moc->getMapOutputSpec(), _combinerCreator); } } // namespace NativeTask
apache-2.0
McSherry/AppsAgainstHumanity
Server/UI/expansionPackForm.Designer.cs
4820
namespace AppsAgainstHumanity.Server.UI { partial class expansionPackForm { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.saveSelectionBtn = new System.Windows.Forms.Button(); this.reloadDecksBtn = new System.Windows.Forms.Button(); this.cancelBtn = new System.Windows.Forms.Button(); this.expansionPackListBox = new System.Windows.Forms.CheckedListBox(); this.SuspendLayout(); // // saveSelectionBtn // this.saveSelectionBtn.Location = new System.Drawing.Point(329, 12); this.saveSelectionBtn.Name = "saveSelectionBtn"; this.saveSelectionBtn.Size = new System.Drawing.Size(122, 23); this.saveSelectionBtn.TabIndex = 0; this.saveSelectionBtn.Text = "Save Selections"; this.saveSelectionBtn.UseVisualStyleBackColor = true; this.saveSelectionBtn.Click += new System.EventHandler(this.saveSelectionBtn_Click); // // reloadDecksBtn // this.reloadDecksBtn.Location = new System.Drawing.Point(329, 41); this.reloadDecksBtn.Name = "reloadDecksBtn"; this.reloadDecksBtn.Size = new System.Drawing.Size(122, 23); this.reloadDecksBtn.TabIndex = 1; this.reloadDecksBtn.Text = "Reload Packs"; this.reloadDecksBtn.UseVisualStyleBackColor = true; this.reloadDecksBtn.Click += new System.EventHandler(this.reloadDecksBtn_Click); // // cancelBtn // this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.cancelBtn.Location = new System.Drawing.Point(329, 244); this.cancelBtn.Name = "cancelBtn"; this.cancelBtn.Size = new System.Drawing.Size(122, 23); this.cancelBtn.TabIndex = 3; this.cancelBtn.Text = "Cancel"; this.cancelBtn.UseVisualStyleBackColor = true; // // expansionPackListBox // this.expansionPackListBox.BorderStyle = System.Windows.Forms.BorderStyle.None; this.expansionPackListBox.CheckOnClick = true; this.expansionPackListBox.FormattingEnabled = true; this.expansionPackListBox.Location = new System.Drawing.Point(12, 12); this.expansionPackListBox.Name = "expansionPackListBox"; this.expansionPackListBox.ScrollAlwaysVisible = true; this.expansionPackListBox.Size = new System.Drawing.Size(303, 255); this.expansionPackListBox.TabIndex = 4; // // expansionPackForm // this.AcceptButton = this.saveSelectionBtn; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.Window; this.CancelButton = this.cancelBtn; this.ClientSize = new System.Drawing.Size(459, 275); this.ControlBox = false; this.Controls.Add(this.expansionPackListBox); this.Controls.Add(this.cancelBtn); this.Controls.Add(this.reloadDecksBtn); this.Controls.Add(this.saveSelectionBtn); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Name = "expansionPackForm"; this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Select Expansion Packs"; this.ResumeLayout(false); } #endregion private System.Windows.Forms.Button saveSelectionBtn; private System.Windows.Forms.Button reloadDecksBtn; private System.Windows.Forms.Button cancelBtn; private System.Windows.Forms.CheckedListBox expansionPackListBox; } }
apache-2.0
anuragkapur/cassandra-2.1.2-ak-skynet
apache-cassandra-2.0.16/javadoc/org/apache/cassandra/config/class-use/TriggerDefinition.html
12525
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_80) on Thu Jun 18 14:08:47 EDT 2015 --> <title>Uses of Class org.apache.cassandra.config.TriggerDefinition (apache-cassandra API)</title> <meta name="date" content="2015-06-18"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.cassandra.config.TriggerDefinition (apache-cassandra API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html" title="class in org.apache.cassandra.config">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/cassandra/config/class-use/TriggerDefinition.html" target="_top">Frames</a></li> <li><a href="TriggerDefinition.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.apache.cassandra.config.TriggerDefinition" class="title">Uses of Class<br>org.apache.cassandra.config.TriggerDefinition</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html" title="class in org.apache.cassandra.config">TriggerDefinition</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.apache.cassandra.config">org.apache.cassandra.config</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.apache.cassandra.config"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html" title="class in org.apache.cassandra.config">TriggerDefinition</a> in <a href="../../../../../org/apache/cassandra/config/package-summary.html">org.apache.cassandra.config</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/apache/cassandra/config/package-summary.html">org.apache.cassandra.config</a> that return <a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html" title="class in org.apache.cassandra.config">TriggerDefinition</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html" title="class in org.apache.cassandra.config">TriggerDefinition</a></code></td> <td class="colLast"><span class="strong">TriggerDefinition.</span><code><strong><a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html#create(java.lang.String,%20java.lang.String)">create</a></strong>(java.lang.String&nbsp;name, java.lang.String&nbsp;classOption)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html" title="class in org.apache.cassandra.config">TriggerDefinition</a></code></td> <td class="colLast"><span class="strong">TriggerDefinition.</span><code><strong><a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html#fromThrift(org.apache.cassandra.thrift.TriggerDef)">fromThrift</a></strong>(<a href="../../../../../org/apache/cassandra/thrift/TriggerDef.html" title="class in org.apache.cassandra.thrift">TriggerDef</a>&nbsp;thriftDef)</code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/apache/cassandra/config/package-summary.html">org.apache.cassandra.config</a> that return types with arguments of type <a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html" title="class in org.apache.cassandra.config">TriggerDefinition</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static java.util.List&lt;<a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html" title="class in org.apache.cassandra.config">TriggerDefinition</a>&gt;</code></td> <td class="colLast"><span class="strong">TriggerDefinition.</span><code><strong><a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html#fromSchema(org.apache.cassandra.db.Row)">fromSchema</a></strong>(<a href="../../../../../org/apache/cassandra/db/Row.html" title="class in org.apache.cassandra.db">Row</a>&nbsp;serializedTriggers)</code> <div class="block">Deserialize triggers from storage-level representation.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static java.util.Map&lt;java.lang.String,<a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html" title="class in org.apache.cassandra.config">TriggerDefinition</a>&gt;</code></td> <td class="colLast"><span class="strong">TriggerDefinition.</span><code><strong><a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html#fromThrift(java.util.List)">fromThrift</a></strong>(java.util.List&lt;<a href="../../../../../org/apache/cassandra/thrift/TriggerDef.html" title="class in org.apache.cassandra.thrift">TriggerDef</a>&gt;&nbsp;thriftDefs)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>java.util.Map&lt;java.lang.String,<a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html" title="class in org.apache.cassandra.config">TriggerDefinition</a>&gt;</code></td> <td class="colLast"><span class="strong">CFMetaData.</span><code><strong><a href="../../../../../org/apache/cassandra/config/CFMetaData.html#getTriggers()">getTriggers</a></strong>()</code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/apache/cassandra/config/package-summary.html">org.apache.cassandra.config</a> with parameters of type <a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html" title="class in org.apache.cassandra.config">TriggerDefinition</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="strong">CFMetaData.</span><code><strong><a href="../../../../../org/apache/cassandra/config/CFMetaData.html#addTriggerDefinition(org.apache.cassandra.config.TriggerDefinition)">addTriggerDefinition</a></strong>(<a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html" title="class in org.apache.cassandra.config">TriggerDefinition</a>&nbsp;def)</code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Method parameters in <a href="../../../../../org/apache/cassandra/config/package-summary.html">org.apache.cassandra.config</a> with type arguments of type <a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html" title="class in org.apache.cassandra.config">TriggerDefinition</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static java.util.List&lt;<a href="../../../../../org/apache/cassandra/thrift/TriggerDef.html" title="class in org.apache.cassandra.thrift">TriggerDef</a>&gt;</code></td> <td class="colLast"><span class="strong">TriggerDefinition.</span><code><strong><a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html#toThrift(java.util.Map)">toThrift</a></strong>(java.util.Map&lt;java.lang.String,<a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html" title="class in org.apache.cassandra.config">TriggerDefinition</a>&gt;&nbsp;triggers)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../org/apache/cassandra/config/CFMetaData.html" title="class in org.apache.cassandra.config">CFMetaData</a></code></td> <td class="colLast"><span class="strong">CFMetaData.</span><code><strong><a href="../../../../../org/apache/cassandra/config/CFMetaData.html#triggers(java.util.Map)">triggers</a></strong>(java.util.Map&lt;java.lang.String,<a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html" title="class in org.apache.cassandra.config">TriggerDefinition</a>&gt;&nbsp;prop)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/apache/cassandra/config/TriggerDefinition.html" title="class in org.apache.cassandra.config">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/cassandra/config/class-use/TriggerDefinition.html" target="_top">Frames</a></li> <li><a href="TriggerDefinition.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &copy; 2015 The Apache Software Foundation</small></p> </body> </html>
apache-2.0
nhr/origin
vendor/k8s.io/kubernetes/cmd/kube-controller-manager/app/controllermanager.go
20478
/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package app implements a server that runs a set of active // components. This includes replication controllers, service endpoints and // nodes. // package app import ( "fmt" "io/ioutil" "math/rand" "net" "net/http" "net/http/pprof" "os" goruntime "runtime" "strconv" "time" "k8s.io/apimachinery/pkg/runtime/schema" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apiserver/pkg/server/healthz" "k8s.io/api/core/v1" "k8s.io/client-go/discovery" v1core "k8s.io/client-go/kubernetes/typed/core/v1" restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/record" certutil "k8s.io/client-go/util/cert" "k8s.io/client-go/informers" clientset "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/leaderelection" "k8s.io/client-go/tools/leaderelection/resourcelock" "k8s.io/kubernetes/cmd/kube-controller-manager/app/options" "k8s.io/kubernetes/pkg/api/legacyscheme" "k8s.io/kubernetes/pkg/cloudprovider" "k8s.io/kubernetes/pkg/controller" serviceaccountcontroller "k8s.io/kubernetes/pkg/controller/serviceaccount" "k8s.io/kubernetes/pkg/serviceaccount" "k8s.io/kubernetes/pkg/util/configz" "k8s.io/kubernetes/pkg/version" "k8s.io/kubernetes/pkg/version/verflag" "github.com/golang/glog" "github.com/prometheus/client_golang/prometheus" "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/util/uuid" ) const ( // Jitter used when starting controller managers ControllerStartJitter = 1.0 ) // NewControllerManagerCommand creates a *cobra.Command object with default parameters func NewControllerManagerCommand() *cobra.Command { s := options.NewCMServer() cmd := &cobra.Command{ Use: "kube-controller-manager", Long: `The Kubernetes controller manager is a daemon that embeds the core control loops shipped with Kubernetes. In applications of robotics and automation, a control loop is a non-terminating loop that regulates the state of the system. In Kubernetes, a controller is a control loop that watches the shared state of the cluster through the apiserver and makes changes attempting to move the current state towards the desired state. Examples of controllers that ship with Kubernetes today are the replication controller, endpoints controller, namespace controller, and serviceaccounts controller.`, Run: func(cmd *cobra.Command, args []string) { verflag.PrintAndExitIfRequested() Run(s) }, } s.AddFlags(cmd.Flags(), KnownControllers(), ControllersDisabledByDefault.List()) return cmd } // ResyncPeriod returns a function which generates a duration each time it is // invoked; this is so that multiple controllers don't get into lock-step and all // hammer the apiserver with list requests simultaneously. func ResyncPeriod(s *options.CMServer) func() time.Duration { return func() time.Duration { factor := rand.Float64() + 1 return time.Duration(float64(s.MinResyncPeriod.Nanoseconds()) * factor) } } // Run runs the CMServer. This should never exit. func Run(s *options.CMServer) error { // To help debugging, immediately log version glog.Infof("Version: %+v", version.Get()) if err := s.Validate(KnownControllers(), ControllersDisabledByDefault.List()); err != nil { return err } if c, err := configz.New("componentconfig"); err == nil { c.Set(s.KubeControllerManagerConfiguration) } else { glog.Errorf("unable to register configz: %s", err) } kubeClient, leaderElectionClient, kubeconfig, err := createClients(s) if err != nil { return err } cleanupFn, err := ShimForOpenShift(s, kubeconfig) if err != nil { return err } defer cleanupFn() if s.Port >= 0 { go startHTTP(s) } recorder := createRecorder(kubeClient) run := func(stop <-chan struct{}) { rootClientBuilder := controller.SimpleControllerClientBuilder{ ClientConfig: kubeconfig, } var clientBuilder controller.ControllerClientBuilder if s.UseServiceAccountCredentials { if len(s.ServiceAccountKeyFile) == 0 { // It's possible another controller process is creating the tokens for us. // If one isn't, we'll timeout and exit when our client builder is unable to create the tokens. glog.Warningf("--use-service-account-credentials was specified without providing a --service-account-private-key-file") } clientBuilder = controller.SAControllerClientBuilder{ ClientConfig: restclient.AnonymousClientConfig(kubeconfig), CoreClient: kubeClient.CoreV1(), AuthenticationClient: kubeClient.Authentication(), Namespace: "kube-system", } } else { clientBuilder = rootClientBuilder } ctx, err := CreateControllerContext(s, rootClientBuilder, clientBuilder, stop) if err != nil { glog.Fatalf("error building controller context: %v", err) } saTokenControllerInitFunc := serviceAccountTokenControllerStarter{rootClientBuilder: rootClientBuilder}.startServiceAccountTokenController if err := StartControllers(ctx, saTokenControllerInitFunc, NewControllerInitializers()); err != nil { glog.Fatalf("error starting controllers: %v", err) } ctx.InformerFactory.Start(ctx.Stop) close(ctx.InformersStarted) select {} } if !s.LeaderElection.LeaderElect { run(nil) panic("unreachable") } id, err := os.Hostname() if err != nil { return err } // add a uniquifier so that two processes on the same host don't accidentally both become active id = id + "_" + string(uuid.NewUUID()) rl, err := resourcelock.New(s.LeaderElection.ResourceLock, "kube-system", "kube-controller-manager", leaderElectionClient.CoreV1(), resourcelock.ResourceLockConfig{ Identity: id, EventRecorder: recorder, }) if err != nil { glog.Fatalf("error creating lock: %v", err) } leaderelection.RunOrDie(leaderelection.LeaderElectionConfig{ Lock: rl, LeaseDuration: s.LeaderElection.LeaseDuration.Duration, RenewDeadline: s.LeaderElection.RenewDeadline.Duration, RetryPeriod: s.LeaderElection.RetryPeriod.Duration, Callbacks: leaderelection.LeaderCallbacks{ OnStartedLeading: run, OnStoppedLeading: func() { glog.Fatalf("leaderelection lost") }, }, }) panic("unreachable") } func startHTTP(s *options.CMServer) { mux := http.NewServeMux() healthz.InstallHandler(mux) if s.EnableProfiling { mux.HandleFunc("/debug/pprof/", pprof.Index) mux.HandleFunc("/debug/pprof/profile", pprof.Profile) mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol) mux.HandleFunc("/debug/pprof/trace", pprof.Trace) if s.EnableContentionProfiling { goruntime.SetBlockProfileRate(1) } } configz.InstallHandler(mux) mux.Handle("/metrics", prometheus.Handler()) server := &http.Server{ Addr: net.JoinHostPort(s.Address, strconv.Itoa(int(s.Port))), Handler: mux, } glog.Fatal(server.ListenAndServe()) } func createRecorder(kubeClient *clientset.Clientset) record.EventRecorder { eventBroadcaster := record.NewBroadcaster() eventBroadcaster.StartLogging(glog.Infof) eventBroadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: v1core.New(kubeClient.CoreV1().RESTClient()).Events("")}) return eventBroadcaster.NewRecorder(legacyscheme.Scheme, v1.EventSource{Component: "controller-manager"}) } func createClients(s *options.CMServer) (*clientset.Clientset, *clientset.Clientset, *restclient.Config, error) { kubeconfig, err := clientcmd.BuildConfigFromFlags(s.Master, s.Kubeconfig) if err != nil { return nil, nil, nil, err } kubeconfig.ContentConfig.ContentType = s.ContentType // Override kubeconfig qps/burst settings from flags kubeconfig.QPS = s.KubeAPIQPS kubeconfig.Burst = int(s.KubeAPIBurst) kubeClient, err := clientset.NewForConfig(restclient.AddUserAgent(kubeconfig, "controller-manager")) if err != nil { glog.Fatalf("Invalid API configuration: %v", err) } leaderElectionClient := clientset.NewForConfigOrDie(restclient.AddUserAgent(kubeconfig, "leader-election")) return kubeClient, leaderElectionClient, kubeconfig, nil } type ControllerContext struct { // ClientBuilder will provide a client for this controller to use ClientBuilder controller.ControllerClientBuilder // InformerFactory gives access to informers for the controller. InformerFactory informers.SharedInformerFactory // Options provides access to init options for a given controller Options options.CMServer // AvailableResources is a map listing currently available resources AvailableResources map[schema.GroupVersionResource]bool // Cloud is the cloud provider interface for the controllers to use. // It must be initialized and ready to use. Cloud cloudprovider.Interface // Stop is the stop channel Stop <-chan struct{} // InformersStarted is closed after all of the controllers have been initialized and are running. After this point it is safe, // for an individual controller to start the shared informers. Before it is closed, they should not. InformersStarted chan struct{} } func (c ControllerContext) IsControllerEnabled(name string) bool { return IsControllerEnabled(name, ControllersDisabledByDefault, c.Options.Controllers...) } func IsControllerEnabled(name string, disabledByDefaultControllers sets.String, controllers ...string) bool { hasStar := false for _, ctrl := range controllers { if ctrl == name { return true } if ctrl == "-"+name { return false } if ctrl == "*" { hasStar = true } } // if we get here, there was no explicit choice if !hasStar { // nothing on by default return false } if disabledByDefaultControllers.Has(name) { return false } return true } // InitFunc is used to launch a particular controller. It may run additional "should I activate checks". // Any error returned will cause the controller process to `Fatal` // The bool indicates whether the controller was enabled. type InitFunc func(ctx ControllerContext) (bool, error) func KnownControllers() []string { ret := sets.StringKeySet(NewControllerInitializers()) // add "special" controllers that aren't initialized normally. These controllers cannot be initialized // using a normal function. The only known special case is the SA token controller which *must* be started // first to ensure that the SA tokens for future controllers will exist. Think very carefully before adding // to this list. ret.Insert( saTokenControllerName, ) return ret.List() } var ControllersDisabledByDefault = sets.NewString( "bootstrapsigner", "tokencleaner", ) const ( saTokenControllerName = "serviceaccount-token" ) // NewControllerInitializers is a public map of named controller groups (you can start more than one in an init func) // paired to their InitFunc. This allows for structured downstream composition and subdivision. func NewControllerInitializers() map[string]InitFunc { controllers := map[string]InitFunc{} controllers["endpoint"] = startEndpointController controllers["replicationcontroller"] = startReplicationController controllers["podgc"] = startPodGCController controllers["resourcequota"] = startResourceQuotaController controllers["namespace"] = startNamespaceController controllers["serviceaccount"] = startServiceAccountController controllers["garbagecollector"] = startGarbageCollectorController controllers["daemonset"] = startDaemonSetController controllers["job"] = startJobController controllers["deployment"] = startDeploymentController controllers["replicaset"] = startReplicaSetController controllers["horizontalpodautoscaling"] = startHPAController controllers["disruption"] = startDisruptionController controllers["statefulset"] = startStatefulSetController controllers["cronjob"] = startCronJobController controllers["csrsigning"] = startCSRSigningController controllers["csrapproving"] = startCSRApprovingController controllers["csrcleaner"] = startCSRCleanerController controllers["ttl"] = startTTLController controllers["bootstrapsigner"] = startBootstrapSignerController controllers["tokencleaner"] = startTokenCleanerController controllers["service"] = startServiceController controllers["node"] = startNodeController controllers["route"] = startRouteController controllers["persistentvolume-binder"] = startPersistentVolumeBinderController controllers["attachdetach"] = startAttachDetachController controllers["persistentvolume-expander"] = startVolumeExpandController controllers["clusterrole-aggregation"] = startClusterRoleAggregrationController controllers["pvc-protection"] = startPVCProtectionController return controllers } // TODO: In general, any controller checking this needs to be dynamic so // users don't have to restart their controller manager if they change the apiserver. // Until we get there, the structure here needs to be exposed for the construction of a proper ControllerContext. func GetAvailableResources(clientBuilder controller.ControllerClientBuilder) (map[schema.GroupVersionResource]bool, error) { var discoveryClient discovery.DiscoveryInterface var healthzContent string // If apiserver is not running we should wait for some time and fail only then. This is particularly // important when we start apiserver and controller manager at the same time. err := wait.PollImmediate(time.Second, 5*time.Minute, func() (bool, error) { client, err := clientBuilder.Client("controller-discovery") if err != nil { glog.Errorf("Failed to get api versions from server: %v", err) return false, nil } healthStatus := 0 resp := client.Discovery().RESTClient().Get().AbsPath("/healthz").Do().StatusCode(&healthStatus) if healthStatus != http.StatusOK { glog.Errorf("Server isn't healthy yet. Waiting a little while.") return false, nil } content, _ := resp.Raw() healthzContent = string(content) discoveryClient = client.Discovery() return true, nil }) if err != nil { return nil, fmt.Errorf("failed to get api versions from server: %v: %v", healthzContent, err) } resourceMap, err := discoveryClient.ServerResources() if err != nil { utilruntime.HandleError(fmt.Errorf("unable to get all supported resources from server: %v", err)) } if len(resourceMap) == 0 { return nil, fmt.Errorf("unable to get any supported resources from server") } allResources := map[schema.GroupVersionResource]bool{} for _, apiResourceList := range resourceMap { version, err := schema.ParseGroupVersion(apiResourceList.GroupVersion) if err != nil { return nil, err } for _, apiResource := range apiResourceList.APIResources { allResources[version.WithResource(apiResource.Name)] = true } } return allResources, nil } // CreateControllerContext creates a context struct containing references to resources needed by the // controllers such as the cloud provider and clientBuilder. rootClientBuilder is only used for // the shared-informers client and token controller. func CreateControllerContext(s *options.CMServer, rootClientBuilder, clientBuilder controller.ControllerClientBuilder, stop <-chan struct{}) (ControllerContext, error) { versionedClient := rootClientBuilder.ClientOrDie("shared-informers") var sharedInformers informers.SharedInformerFactory if InformerFactoryOverride == nil { sharedInformers = informers.NewSharedInformerFactory(versionedClient, ResyncPeriod(s)()) } else { sharedInformers = InformerFactoryOverride } availableResources, err := GetAvailableResources(rootClientBuilder) if err != nil { return ControllerContext{}, err } cloud, err := cloudprovider.InitCloudProvider(s.CloudProvider, s.CloudConfigFile) if err != nil { return ControllerContext{}, fmt.Errorf("cloud provider could not be initialized: %v", err) } if cloud != nil && cloud.HasClusterID() == false { if s.AllowUntaggedCloud == true { glog.Warning("detected a cluster without a ClusterID. A ClusterID will be required in the future. Please tag your cluster to avoid any future issues") } else { return ControllerContext{}, fmt.Errorf("no ClusterID Found. A ClusterID is required for the cloud provider to function properly. This check can be bypassed by setting the allow-untagged-cloud option") } } if informerUserCloud, ok := cloud.(cloudprovider.InformerUser); ok { informerUserCloud.SetInformers(sharedInformers) } ctx := ControllerContext{ ClientBuilder: clientBuilder, InformerFactory: sharedInformers, Options: *s, AvailableResources: availableResources, Cloud: cloud, Stop: stop, InformersStarted: make(chan struct{}), } return ctx, nil } func StartControllers(ctx ControllerContext, startSATokenController InitFunc, controllers map[string]InitFunc) error { // Always start the SA token controller first using a full-power client, since it needs to mint tokens for the rest // If this fails, just return here and fail since other controllers won't be able to get credentials. if _, err := startSATokenController(ctx); err != nil { return err } // Initialize the cloud provider with a reference to the clientBuilder only after token controller // has started in case the cloud provider uses the client builder. if ctx.Cloud != nil { ctx.Cloud.Initialize(ctx.ClientBuilder) } for controllerName, initFn := range controllers { if !ctx.IsControllerEnabled(controllerName) { glog.Warningf("%q is disabled", controllerName) continue } time.Sleep(wait.Jitter(ctx.Options.ControllerStartInterval.Duration, ControllerStartJitter)) glog.V(1).Infof("Starting %q", controllerName) started, err := initFn(ctx) if err != nil { glog.Errorf("Error starting %q", controllerName) return err } if !started { glog.Warningf("Skipping %q", controllerName) continue } glog.Infof("Started %q", controllerName) } return nil } // serviceAccountTokenControllerStarter is special because it must run first to set up permissions for other controllers. // It cannot use the "normal" client builder, so it tracks its own. It must also avoid being included in the "normal" // init map so that it can always run first. type serviceAccountTokenControllerStarter struct { rootClientBuilder controller.ControllerClientBuilder } func (c serviceAccountTokenControllerStarter) startServiceAccountTokenController(ctx ControllerContext) (bool, error) { if !ctx.IsControllerEnabled(saTokenControllerName) { glog.Warningf("%q is disabled", saTokenControllerName) return false, nil } if len(ctx.Options.ServiceAccountKeyFile) == 0 { glog.Warningf("%q is disabled because there is no private key", saTokenControllerName) return false, nil } privateKey, err := certutil.PrivateKeyFromFile(ctx.Options.ServiceAccountKeyFile) if err != nil { return true, fmt.Errorf("error reading key for service account token controller: %v", err) } var rootCA []byte if ctx.Options.RootCAFile != "" { rootCA, err = ioutil.ReadFile(ctx.Options.RootCAFile) if err != nil { return true, fmt.Errorf("error reading root-ca-file at %s: %v", ctx.Options.RootCAFile, err) } if _, err := certutil.ParseCertsPEM(rootCA); err != nil { return true, fmt.Errorf("error parsing root-ca-file at %s: %v", ctx.Options.RootCAFile, err) } } else { rootCA = c.rootClientBuilder.ConfigOrDie("tokens-controller").CAData } controller, err := serviceaccountcontroller.NewTokensController( ctx.InformerFactory.Core().V1().ServiceAccounts(), ctx.InformerFactory.Core().V1().Secrets(), c.rootClientBuilder.ClientOrDie("tokens-controller"), serviceaccountcontroller.TokensControllerOptions{ TokenGenerator: serviceaccount.JWTTokenGenerator(privateKey), RootCA: rootCA, }, ) if err != nil { return true, fmt.Errorf("error creating Tokens controller: %v", err) } go controller.Run(int(ctx.Options.ConcurrentSATokenSyncs), ctx.Stop) // start the first set of informers now so that other controllers can start ctx.InformerFactory.Start(ctx.Stop) return true, nil }
apache-2.0
google/web-prototyping-tool
src/app/routes/dashboard/components/projects-tab/projects-tab.component.html
4917
<ng-container *ngIf="searchString; else default"> <div class="no-results" *ngIf="showEmptySearchResultsState"> <span class="no-results-title">We couldn't find any projects for</span> <span>{{ searchString }}</span> </div> <!-- Found Users --> <ng-container *ngIf="foundUsers$ | async as foundUsers"> <div class="found-users" *ngIf="foundUsers.length"> <h3>Users</h3> <ul> <li *ngFor="let foundUser of foundUsers" (click)="onAvatarClick(foundUser?.email)" cdTooltip="Show projects" cdTooltipDirection="bottom" > <cd-avatar [profileImgUrl]="foundUser?.photoUrl"></cd-avatar> <span>{{ foundUser?.name }}</span> </li> </ul> </div> </ng-container> <!-- User Projects --> <ng-container *ngIf="userSearchResults.length"> <div class="user-projects"> <h3>Yours</h3> <ng-container *ngTemplateOutlet="projectList; context: { $implicit: userSearchResults }" ></ng-container> </div> </ng-container> <!-- Others Projects --> <ng-container *ngIf="otherSearchResults.length"> <div class="other-projects"> <h3>Others</h3> <ng-container *ngTemplateOutlet="projectList; context: { $implicit: otherSearchResults }" ></ng-container> <ng-container *ngTemplateOutlet="loader; context: { $implicit: loading || userLoading }" ></ng-container> </div> </ng-container> </ng-container> <ng-template #default> <ng-container *ngIf="canShowProjectList; else emptyState"> <div class="action-bar" *ngIf="canShowActionBar"> <ng-container> <button fabStyle cd-unelevated-button cd-shaped-button size="large" iconSize="large" iconName="add" (click)="onCreateProjectClick()" > New Project </button> <cd-toggle-button-group separatedButtons [value]="queryState" class="filter-toggles" (valueChange)="onQueryStateChange($event)" > <button cd-button cdToggleButton size="medium" [value]="QueryState.Mine" expand="true" cdTooltip="Your projects" > Mine </button> <button cd-button cdToggleButton size="medium" [value]="QueryState.Starred" expand="true" cdTooltip="Starred projects" > Starred </button> <button cd-button cdToggleButton size="medium" [value]="QueryState.All" expand="true" cdTooltip="Explore projects from all users" > All </button> </cd-toggle-button-group> </ng-container> </div> <ng-container *ngTemplateOutlet="projectList; context: { $implicit: projects }"></ng-container> <ng-container *ngTemplateOutlet="loader; context: { $implicit: loading }"></ng-container> </ng-container> </ng-template> <!-- EMPTY STATE --> <ng-template #emptyState> <app-empty-message header="Get started" headerImg="/assets/placeholder.svg" description="Quickly create realistic prototypes using real components without writing code." actionName="New project" actionIcon="add" (action)="onCreateProjectClick()" ></app-empty-message> </ng-template> <!-- Loader --> <ng-template #loader let-isLoading> <div class="loader" *ngIf="isLoading"> <cd-spinner></cd-spinner> </div> </ng-template> <!-- Project list --> <ng-template #projectList let-projectList> <div class="list project-list body" *ngIf="projectList.length > 0"> <app-project-tile *ngFor="let project of projectList; trackBy: trackFn" actionable="true" editable="true" [project]="project" [userEmail]="user?.email" [starred]="starredProjects.has(project.id)" [showAvatar]="project.owner?.id !== userId" [updatedAt]="project.updatedAt | FormatFirebaseTime" [menuConfig]="project.owner?.id === userId ? projectMenuConfig : nonOwnerProjectMenuconfig" [boardThumbnails]="project | projectThumbnailPipe: boardThumbnails" (menuSelected)="onProjectMenuSelected($event, project)" (nameChange)="onProjectNameChange($event, project)" (avatarClick)="onAvatarClick($event)" (commentsClicked)="onOpenProjectComments(project)" (starredClick)="onStarredProjectClick($event, project.id)" ></app-project-tile> </div> <app-empty-message *ngIf="canShowStarredZeroState" class="starred-zero" type="vertical" header="No starred projects" headerImg="/assets/star-placeholder.svg" description="Click the star on a project to have it show up here." ></app-empty-message> </ng-template>
apache-2.0
nttdots/go-dots
Dockerfile
1229
FROM ubuntu:trusty USER root ENV HOME /root # install packages RUN apt-get update && apt-get -y install wget curl git build-essential libtool autoconf pkgconf RUN apt-get install -q -y mysql-server libmysqld-dev # install go1.9.3 RUN wget https://dl.google.com/go/go1.9.3.linux-amd64.tar.gz RUN tar -C /usr/local -xzf go1.9.3.linux-amd64.tar.gz RUN mkdir $HOME/go ENV PATH $PATH:/usr/local/go/bin ENV GOPATH $HOME/go RUN echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc RUN echo "export GOPATH=$HOME/go" >> ~/.bashrc # intall openssl 1.1.1 RUN wget https://www.openssl.org/source/openssl-1.1.1-pre7.tar.gz RUN tar -C $HOME -xzf openssl-1.1.1-pre7.tar.gz WORKDIR $HOME/openssl-1.1.1-pre7 RUN $HOME/openssl-1.1.1-pre7/config RUN make && make install RUN echo '/usr/local/lib' >> /etc/ld.so.conf # install libcoap WORKDIR $HOME RUN git clone https://github.com/obgm/libcoap.git WORKDIR $HOME/libcoap RUN git checkout 1365dea39a6129a9b7e8c579537e12ffef1558f6 RUN ./autogen.sh RUN ./configure --disable-documentation --with-openssl RUN make && make install RUN ldconfig # install go-dots WORKDIR $HOME RUN go get -u github.com/nttdots/go-dots/... WORKDIR $GOPATH/src/github.com/nttdots/go-dots/ RUN make && make install
apache-2.0
beobal/cassandra-dtest
CONTRIBUTING.md
7214
## Style We plan to move to Python 3 in the near future. Where possible, new code should be Python 3-compatible. In particular: - favor `format` over `%` for formatting strings. - use the `/` on numbers in a Python 3-compatible way. In particular, if you want floor division (which is the behavior of `/` in Python 2), use `//` instead. If you want the result of integer division to be a `float` (e.g. `1 / 2 == 0.5`), add `from __future__ import division` to the top of the imports and use `/`. For more information, see [the official Python 3 porting docs](https://docs.python.org/3/howto/pyporting.html#division). - use `absolute_import`, `division`, and `unicode_literals` in new test files. Contributions will be evaluated by PEP8. We now strictly enforce compliance, via a linter run with Travis CI against all new pull requests. We do not enforce the default limits on line length, but have established a maximum length of 200 chars as a sanity check. You can conform to PEP8 by running `autopep8` which can be installed via `pip`. `pip install autopep8 && autopep8 --in-place -a --ignore E501` Another way to make sure that your code will pass compliance checks is to run **flake8** from a commit hook: ``` flake8 --install-hook git config flake8.strict true git config flake8.ignore E501,F811,F812,F821,F822,F823,F831,F841,N8,C9 ``` We do not enforce **import** sorting, but if you choose to organize imports by some convention, use the `isort` tool (`pip install isort`). Please use `session`, and not `cursor` when naming your connection variables, to match the style preferred by the DataStax Python Driver, which is how these tests connect to C*. All version objects being passed from CCM are now LooseVersion objects, instead of strings. Those can still be safely compared to strings, so there is no need to do `version < LooseVersion('3.10')`. ## Doxygen Docstrings We are now colocating our test plans directly with the source code. We have decided to do so in a manner compatible with Doxygen, to turn the test plans into easily navigated HTML. Please view the following list of tags, as well as an example test. While this full list of tags is available for use, there is no need to use every tag for a given test. The **description** and **since** fields should be included, but most others should only be used when **appropriate**. The test plan will live in a comment block below the test method declaration. Input | Description ------------------|------------------ Test name | Name of the test Description | Brief description of the test @param | Description of Parameter 1 (Usually used for helper methods) @return | Description of expected return value (Usually used for helper methods) @expected_errors | What exceptions this test is expected to throw on normal behavior (should be caught and expected in the test) @throws | What exceptions this test would throw upon failure (if expecting a specific regression) @since | I am unsure what we will use this for. Do not use until we have reached a decision. @jira_ticket | Associated JIRA ticket identifier, including the project name (e.g. `CASSANDRA-42`, not `42`). @expected_result | Brief summary of what the expected results of this test are @test_assumptions | Test requirements (auth, hints disabled , etc) @note | (future improvments, todo, etc) @test_category | What categories this test falls under (deprecated) ```python def test_example(self): """ Demonstrates the expected syntax for a test plan. Parsed by Doxygen. @jira_ticket CASSANDRA-0000 @since 2.0.15, 2.1.5 @note Test should not be implemented, it is an example. """ pass ``` To run doxygen to generate HTML from these test plans, you will need to do the following: * Unzip **doxygen/doxypy-0.4.2.tar.gz** and install it ``` cd doxygen/ tar xvf doxypy-0.4.2.tar.gz cd doxypy-0.4.2 sudo python setup.py install ``` * Install **doxygen**, via your system's package manager * Edit the **INPUT** and **OUTPUT_DIRECTORY** fields in **doxygen/Doxyfile_python**. They must be absolute paths. **INPUT** should point to **cassandra-dtest/**. * Run doxygen ``` doxygen doxygen/Doxyfile_python ``` Feel free to submit test plans without the implemented tests. If you are submitting a new test, we would appreciate if it were annotated in this manner. If that is not possible, we will add the markup to your pull request. ## Modules In some cases, we organize our test files by putting them in directories. If you do so, please export a module from that directory by placing an `__init__.py` file in the directory with the test files. This makes the modules visible to our test infrastructure scripts that divide tests into buckets for CI. ## Assertions - When possible, you should use the assert functions from [`tools/assertions.py`](https://github.com/apache/cassandra-dtest/blob/master/tools/assertions.py). - When none of these are applicable, use python's built in [unittest assertions](https://docs.python.org/2/library/unittest.html#assert-methods). - Naked assert statements should never be used, e.g. `assert True` ## Byteman Files Any and all byteman (.btm) files should be saved in the cassandra-dtest/byteman/ directory. ## Summary: Review Checklist - Correctness - Does the test pass? If not, is the failure expected? - If the test shells out to other processes, - does it validate the output to ensure there were no failures? - is it Windows-compatibile? - Does the test exercise a new feature? If so, is it tagged with `@since` to skip older versions? - Style and Python 3 Compatibility: - Does the code use `.format()` over `%` for format strings? - If there are new test files, do they use the requested imports for Python 3 compatibility? - Have the changes caused any style regressions? In particular, did Travis find any? - Are `cassandra.cluster.Session` objects named `session` (and not `cursor`)? - Documentation and Metadata: - Are new tests and test classes documented with docstrings? - Are changed tests' documentation updated? - Is Cassandra's desired behavior described in the documentation if it's not immediately readable in the test? - Does the documentation include all appropriate Doxygen annotations, in particular `@jira_ticket`? - Readability and Reusability - Are any data structures built by looping that could be succinctly created in a comprehension - Is there repeated logic that could be factored out and given a descriptive name? - Does that repeated logic belong somewhere other than this particular test? Possible appropriate locations include the modules in `tools/`, or `ccm`. - If there is no assertion in the test, should there be? If not, is the statement that would fail under a regression commented to indicate that? - Is it possible for an uninitiated reader to understand what Casssandra behavior is being tested for? - If not, could the code be rewritten so it is? - If not, are there comments and documentation describing the desired behavior and how it's tested?
apache-2.0
mav-im/orientdb-debian-packager
debian/postinst.tpl.sh
2625
#!/bin/sh set -e if [ "$1" = "configure" ]; then if [ ! -f "/etc/orientdb/orientdb-server-log.properties" ] then # The configuration file /etc/orientdb/orientdb-server-log.properties does not already exist cat /usr/share/doc/orientdb/examples/orientdb-server-log.properties.gz | gunzip > /etc/orientdb/orientdb-server-log.properties else echo "An old configuration file was found: /etc/orientdb/orientdb-server-log.properties" echo "We are not touching the file. You could have to modify it by yourself" fi if [ ! -f "/etc/orientdb/orientdb-client-log.properties" ] then # The configuration file /etc/orientdb/orientdb-client-log.properties does not already exist cat /usr/share/doc/orientdb/examples/orientdb-client-log.properties.gz | gunzip > /etc/orientdb/orientdb-client-log.properties else echo "An old configuration file was found: /etc/orientdb/orientdb-client-log.properties" echo "We are not touching the file. You could have to modify it by yourself" fi if [ ! -f "/etc/orientdb/orientdb-server-config.xml" ] then # The configuration file /etc/orientdb/orientdb-server-config.xml does not already exist cat /usr/share/doc/orientdb/examples/orientdb-server-config.xml.gz | gunzip > /etc/orientdb/orientdb-server-config.xml chmod 640 /etc/orientdb/orientdb-server-config.xml else echo "An old configuration file was found: /etc/orientdb/orientdb-server-config.xml" echo "We are not touching the file. You could have to modify it by yourself" fi if [ ! -f "/etc/orientdb/orientdb-dserver-config.xml" ] then # The configuration file /etc/orientdb/orientdb-dserver-config.xml does not already exist cat /usr/share/doc/orientdb/examples/orientdb-dserver-config.xml.gz | gunzip > /etc/orientdb/orientdb-dserver-config.xml chmod 640 /etc/orientdb/orientdb-dserver-config.xml else echo "An old configuration file was found: /etc/orientdb/orientdb-dserver-config.xml" echo "We are not touching the file. You could have to modify it by yourself" fi update-rc.d orientdb defaults echo echo "To start orientdb run:" echo "# service orientdb start" echo echo "To stop orientdb run:" echo "# service orientdb stop" echo echo "To get the orientdb status run:" echo "# service orientdb status" echo echo "To use the console run:" echo "# orientdb-console" echo echo "NOTE: OrientDB is free software. For more informations subscribe to the orientdb mailinglist" chown -R orientdb:orientdb /var/lib/orientdb /etc/orientdb/* /var/log/orientdb chown -R orientdb:orientdb /usr/share/orientdb/databases /usr/share/orientdb/config /usr/share/orientdb/log fi
apache-2.0
rubik951/Neat-Team-1943
Documentation/WPILib-doxygen/html/structLCDSegments__struct.html
9127
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>WPILIB: LCDSegments_struct Struct Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.8 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main&nbsp;Page</span></a></li> <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li> <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li> </ul> </div> </div> <div class="contents"> <h1>LCDSegments_struct Struct Reference</h1><!-- doxytag: class="LCDSegments_struct" --><code>#include &lt;<a class="el" href="nivision_8h-source.html">nivision.h</a>&gt;</code> <p> <p> <a href="structLCDSegments__struct-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Public Attributes</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structLCDSegments__struct.html#d0992c4d20b0deedf72a5f6da9807442">a</a>:1</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structLCDSegments__struct.html#8e56fb087d3fc7a8b2dc9b3c5e47b1c4">b</a>:1</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structLCDSegments__struct.html#4cb2e9b683f2dba54db8a9fea9284955">c</a>:1</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structLCDSegments__struct.html#cacc4a4b025fc4a2e6738ca80a283929">d</a>:1</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structLCDSegments__struct.html#8af46cabd3ee9c9242e42f79809b8e5e">e</a>:1</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structLCDSegments__struct.html#843b60988db8efa6c5fef4e986306d80">f</a>:1</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structLCDSegments__struct.html#21f91e9e7b539e470c7d4117efdd6579">g</a>:1</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structLCDSegments__struct.html#ae144e3a95d1a95d16485c4112ccbbc5">reserved</a>:25</td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> <p>Definition at line <a class="el" href="nivision_8h-source.html#l03178">3178</a> of file <a class="el" href="nivision_8h-source.html">nivision.h</a>.</p> <hr><h2>Member Data Documentation</h2> <a class="anchor" name="d0992c4d20b0deedf72a5f6da9807442"></a><!-- doxytag: member="LCDSegments_struct::a" ref="d0992c4d20b0deedf72a5f6da9807442" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">unsigned <a class="el" href="structLCDSegments__struct.html#d0992c4d20b0deedf72a5f6da9807442">LCDSegments_struct::a</a> </td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="nivision_8h-source.html#l03179">3179</a> of file <a class="el" href="nivision_8h-source.html">nivision.h</a>.</p> </div> </div><p> <a class="anchor" name="8e56fb087d3fc7a8b2dc9b3c5e47b1c4"></a><!-- doxytag: member="LCDSegments_struct::b" ref="8e56fb087d3fc7a8b2dc9b3c5e47b1c4" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">unsigned <a class="el" href="structLCDSegments__struct.html#8e56fb087d3fc7a8b2dc9b3c5e47b1c4">LCDSegments_struct::b</a> </td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="nivision_8h-source.html#l03180">3180</a> of file <a class="el" href="nivision_8h-source.html">nivision.h</a>.</p> </div> </div><p> <a class="anchor" name="4cb2e9b683f2dba54db8a9fea9284955"></a><!-- doxytag: member="LCDSegments_struct::c" ref="4cb2e9b683f2dba54db8a9fea9284955" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">unsigned <a class="el" href="structLCDSegments__struct.html#4cb2e9b683f2dba54db8a9fea9284955">LCDSegments_struct::c</a> </td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="nivision_8h-source.html#l03181">3181</a> of file <a class="el" href="nivision_8h-source.html">nivision.h</a>.</p> </div> </div><p> <a class="anchor" name="cacc4a4b025fc4a2e6738ca80a283929"></a><!-- doxytag: member="LCDSegments_struct::d" ref="cacc4a4b025fc4a2e6738ca80a283929" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">unsigned <a class="el" href="structLCDSegments__struct.html#cacc4a4b025fc4a2e6738ca80a283929">LCDSegments_struct::d</a> </td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="nivision_8h-source.html#l03182">3182</a> of file <a class="el" href="nivision_8h-source.html">nivision.h</a>.</p> </div> </div><p> <a class="anchor" name="8af46cabd3ee9c9242e42f79809b8e5e"></a><!-- doxytag: member="LCDSegments_struct::e" ref="8af46cabd3ee9c9242e42f79809b8e5e" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">unsigned <a class="el" href="structLCDSegments__struct.html#8af46cabd3ee9c9242e42f79809b8e5e">LCDSegments_struct::e</a> </td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="nivision_8h-source.html#l03183">3183</a> of file <a class="el" href="nivision_8h-source.html">nivision.h</a>.</p> </div> </div><p> <a class="anchor" name="843b60988db8efa6c5fef4e986306d80"></a><!-- doxytag: member="LCDSegments_struct::f" ref="843b60988db8efa6c5fef4e986306d80" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">unsigned <a class="el" href="structLCDSegments__struct.html#843b60988db8efa6c5fef4e986306d80">LCDSegments_struct::f</a> </td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="nivision_8h-source.html#l03184">3184</a> of file <a class="el" href="nivision_8h-source.html">nivision.h</a>.</p> </div> </div><p> <a class="anchor" name="21f91e9e7b539e470c7d4117efdd6579"></a><!-- doxytag: member="LCDSegments_struct::g" ref="21f91e9e7b539e470c7d4117efdd6579" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">unsigned <a class="el" href="structLCDSegments__struct.html#21f91e9e7b539e470c7d4117efdd6579">LCDSegments_struct::g</a> </td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="nivision_8h-source.html#l03185">3185</a> of file <a class="el" href="nivision_8h-source.html">nivision.h</a>.</p> </div> </div><p> <a class="anchor" name="ae144e3a95d1a95d16485c4112ccbbc5"></a><!-- doxytag: member="LCDSegments_struct::reserved" ref="ae144e3a95d1a95d16485c4112ccbbc5" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">unsigned <a class="el" href="structLCDSegments__struct.html#ae144e3a95d1a95d16485c4112ccbbc5">LCDSegments_struct::reserved</a> </td> </tr> </table> </div> <div class="memdoc"> <p> <p>Definition at line <a class="el" href="nivision_8h-source.html#l03186">3186</a> of file <a class="el" href="nivision_8h-source.html">nivision.h</a>.</p> </div> </div><p> <hr>The documentation for this struct was generated from the following file:<ul> <li><a class="el" href="nivision_8h-source.html">nivision.h</a></ul> </div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Feb 9 11:20:51 2011 for WPILIB by&nbsp; <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> </body> </html>
apache-2.0
qiao4/AndroidLearn
app/src/androidTest/java/android/qiao/androidlearn/ApplicationTest.java
368
package android.qiao.androidlearn; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
apache-2.0
kdgregory/pathfinder
lib-spring/src/main/java/com/kdgregory/pathfinder/spring/context/SpringConstants.java
1960
// Copyright (c) Keith D Gregory // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * Constants related to Spring implementations: classnames, locations, &c. */ package com.kdgregory.pathfinder.spring.context; public class SpringConstants { public final static String CLASS_DISPATCHER_SERVLET = "org.springframework.web.servlet.DispatcherServlet"; public final static String CLASS_CONTEXT_LISTENER = "org.springframework.web.context.ContextLoaderListener"; public final static String CLASS_SIMPLE_URL_HANDLER = "org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"; public final static String CLASS_BEAN_NAME_HANDLER = "org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"; public final static String CLASS_CLASS_NAME_HANDLER = "org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"; public final static String INTF_CONTROLLER = "org.springframework.web.servlet.mvc.Controller"; public final static String ANNO_CONTROLLER = "org.springframework.stereotype.Controller"; public final static String ANNO_COMPONENT = "org.springframework.stereotype.Component"; public final static String ANNO_REQUEST_MAPPING = "org.springframework.web.bind.annotation.RequestMapping"; public final static String ANNO_REQUEST_PARAM = "org.springframework.web.bind.annotation.RequestParam"; }
apache-2.0
play1-maven-plugin/play1-maven-plugin.github.io
external-apidocs/com/google/code/maven-play-plugin/org/playframework/play/1.4.5/play/db/jpa/class-use/JPA.JPAContext.html
6477
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="pl"> <head> <!-- Generated by javadoc (1.8.0_111) on Mon Oct 16 21:56:29 CEST 2017 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Class play.db.jpa.JPA.JPAContext (Play! API)</title> <meta name="date" content="2017-10-16"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class play.db.jpa.JPA.JPAContext (Play! API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../play/db/jpa/JPA.JPAContext.html" title="class in play.db.jpa">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?play/db/jpa/class-use/JPA.JPAContext.html" target="_top">Frames</a></li> <li><a href="JPA.JPAContext.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class play.db.jpa.JPA.JPAContext" class="title">Uses of Class<br>play.db.jpa.JPA.JPAContext</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../play/db/jpa/JPA.JPAContext.html" title="class in play.db.jpa">JPA.JPAContext</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#play.db.jpa">play.db.jpa</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="play.db.jpa"> <!-- --> </a> <h3>Uses of <a href="../../../../play/db/jpa/JPA.JPAContext.html" title="class in play.db.jpa">JPA.JPAContext</a> in <a href="../../../../play/db/jpa/package-summary.html">play.db.jpa</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation"> <caption><span>Fields in <a href="../../../../play/db/jpa/package-summary.html">play.db.jpa</a> with type parameters of type <a href="../../../../play/db/jpa/JPA.JPAContext.html" title="class in play.db.jpa">JPA.JPAContext</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static java.lang.ThreadLocal&lt;java.util.Map&lt;java.lang.String,<a href="../../../../play/db/jpa/JPA.JPAContext.html" title="class in play.db.jpa">JPA.JPAContext</a>&gt;&gt;</code></td> <td class="colLast"><span class="typeNameLabel">JPA.</span><code><span class="memberNameLink"><a href="../../../../play/db/jpa/JPA.html#currentEntityManager">currentEntityManager</a></span></code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../play/db/jpa/JPA.JPAContext.html" title="class in play.db.jpa">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?play/db/jpa/class-use/JPA.JPAContext.html" target="_top">Frames</a></li> <li><a href="JPA.JPAContext.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small><a href="http://guillaume.bort.fr">Guillaume Bort</a> &amp; <a href="http://www.zenexity.fr">zenexity</a> - Distributed under <a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache 2 licence</a>, without any warrantly</small></p> </body> </html>
apache-2.0
phac-nml/irida
src/main/java/ca/corefacility/bioinformatics/irida/ria/web/exceptions/UIConstraintViolationException.java
432
package ca.corefacility.bioinformatics.irida.ria.web.exceptions; import java.util.Map; /** * Used by UI to contain internationalized constraint violations. */ public class UIConstraintViolationException extends Exception { private final Map<String, String> errors; public UIConstraintViolationException(Map<String, String> errors) { this.errors = errors; } public Map<String, String> getErrors() { return errors; } }
apache-2.0
cping/LGame
Java/Loon-Neo/src/loon/action/sprite/effect/FadeEffect.java
3402
/** * Copyright 2008 - 2010 * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. * * @project loon * @author cping * @email:[email protected] * @version 0.1 */ package loon.action.sprite.effect; import loon.LSystem; import loon.action.sprite.Entity; import loon.canvas.LColor; import loon.opengl.GLEx; /** * 最基础的画面淡入淡出 */ public class FadeEffect extends Entity implements BaseEffect { private float time; private float currentFrame; private int type; private boolean finished; private boolean autoRemoved; public static FadeEffect create(int type, LColor c) { return create(type, c, LSystem.viewSize.getWidth(), LSystem.viewSize.getHeight()); } public static FadeEffect create(int type, int timer, LColor c) { return new FadeEffect(c, timer, type, LSystem.viewSize.getWidth(), LSystem.viewSize.getHeight()); } public static FadeEffect create(int type, LColor c, int w, int h) { return new FadeEffect(c, 120, type, w, h); } public FadeEffect(int type, LColor c) { this(c, 120, type, LSystem.viewSize.getWidth(), LSystem.viewSize .getHeight()); } public FadeEffect(LColor c, int delay, int type, int w, int h) { this.type = type; this.setDelay(delay); this.setColor(c); this.setSize(w, h); this.setRepaint(true); } public float getDelay() { return time; } public void setDelay(float delay) { this.time = delay; if (type == TYPE_FADE_IN) { this.currentFrame = this.time; } else { this.currentFrame = 0; } } public float getCurrentFrame() { return currentFrame; } public void setCurrentFrame(float currentFrame) { this.currentFrame = currentFrame; } @Override public boolean isCompleted() { return finished; } public void setStop(boolean finished) { this.finished = finished; } public int getType() { return type; } public void setType(int type) { this.type = type; } @Override public void repaint(GLEx g, float sx, float sy) { if (finished) { return; } float op = (currentFrame / time); int old = g.color(); g.setTint(_baseColor.r, _baseColor.g, _baseColor.b, op); g.fillRect(drawX(sx), drawY(sy), _width, _height); g.setTint(old); return; } @Override public void onUpdate(long timer) { if (type == TYPE_FADE_IN) { currentFrame--; if (currentFrame <= 0) { setAlpha(0); finished = true; } } else { currentFrame++; if (currentFrame >= time) { setAlpha(0); finished = true; } } if (this.finished) { if (autoRemoved && getSprites() != null) { getSprites().remove(this); } } } public int getFadeType() { return type; } public boolean isAutoRemoved() { return autoRemoved; } public FadeEffect setAutoRemoved(boolean autoRemoved) { this.autoRemoved = autoRemoved; return this; } @Override public void close() { super.close(); finished = true; } }
apache-2.0
IIC3143-Equipo1/angularJS
app/scripts/services/student.js
1586
'use strict'; //https://evaluat-e-api.herokuapp.com angular.module('evaluateApp').factory('Student',function($resource,$cookieStore,$http,url_api){ var interface_api = { resource: $resource(url_api+'api/student/:id',{id:'@id','csrf_token' :$cookieStore._csrf, page: 1 },{ update: { method:'PUT'}, delete: { method:'DELETE', headers: { 'Content-Type': 'application/json' },params: {id: '@id'}} }), http: { getStudentsByCourse: function(id_course,page) { return $http({ url: url_api+'api/student_course', method: 'GET', params: {id_course: id_course,page: page} }); }, saveStudentCourse: function(id_course,id_student) { var data = $.param({ id_course: id_course, id_student: id_student }); var config = { headers : { 'Content-Type': 'application/x-www-form-urlencoded' } } return $http.post(url_api+'api/student_course', data, config) }, deleteStudentCourse: function(id_student,id_course) { return $http({ url: url_api+'api/student_course', method: 'DELETE', params: {id_course: id_course,id_student: id_student} }); } } } return interface_api; });
apache-2.0
SeekingAlone/AndroidWheel
data/src/main/java/com/fernandocejas/android10/sample/data/cache/UserCacheImpl.java
6364
/** * Copyright (C) 2015 Fernando Cejas Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.fernandocejas.android10.sample.data.cache; import android.content.Context; import com.fernandocejas.android10.sample.data.cache.serializer.JsonSerializer; import com.fernandocejas.android10.sample.data.entity.UserEntity; import com.fernandocejas.android10.sample.data.exception.UserNotFoundException; import com.fernandocejas.android10.sample.domain.executor.ThreadExecutor; import java.io.File; import javax.inject.Inject; import javax.inject.Singleton; import rx.Observable; /** * {@link UserCache} implementation. */ @Singleton public class UserCacheImpl implements UserCache { private static final String SETTINGS_FILE_NAME = "com.fernandocejas.android10.SETTINGS"; private static final String SETTINGS_KEY_LAST_CACHE_UPDATE = "last_cache_update"; private static final String DEFAULT_FILE_NAME = "user_"; private static final long EXPIRATION_TIME = 60 * 10 * 1000; private final Context context; private final File cacheDir; private final JsonSerializer serializer; private final FileManager fileManager; private final ThreadExecutor threadExecutor; /** * Constructor of the class {@link UserCacheImpl}. * * @param context A * @param userCacheSerializer {@link JsonSerializer} for object serialization. * @param fileManager {@link FileManager} for saving serialized objects to the file system. */ @Inject public UserCacheImpl(Context context, JsonSerializer userCacheSerializer, FileManager fileManager, ThreadExecutor executor) { if (context == null || userCacheSerializer == null || fileManager == null || executor == null) { throw new IllegalArgumentException("Invalid null parameter"); } this.context = context.getApplicationContext(); this.cacheDir = this.context.getCacheDir(); this.serializer = userCacheSerializer; this.fileManager = fileManager; this.threadExecutor = executor; } @Override public Observable<UserEntity> get(final int userId) { return Observable.create(subscriber -> { File userEntityFile = UserCacheImpl.this.buildFile(userId); String fileContent = UserCacheImpl.this.fileManager.readFileContent(userEntityFile); UserEntity userEntity = UserCacheImpl.this.serializer.deserialize(fileContent,UserEntity.class); if (userEntity != null) { subscriber.onNext(userEntity); subscriber.onCompleted(); } else { subscriber.onError(new UserNotFoundException()); } }); } @Override public void put(UserEntity userEntity) { if (userEntity != null) { File userEntityFile = this.buildFile(userEntity.getUserId()); if (!isCached(userEntity.getUserId())) { String jsonString = this.serializer.serialize(userEntity); this.executeAsynchronously(new CacheWriter(this.fileManager, userEntityFile, jsonString)); setLastCacheUpdateTimeMillis(); } } } @Override public boolean isCached(int userId) { File userEntitiyFile = this.buildFile(userId); return this.fileManager.exists(userEntitiyFile); } @Override public boolean isExpired() { long currentTime = System.currentTimeMillis(); long lastUpdateTime = this.getLastCacheUpdateTimeMillis(); boolean expired = ((currentTime - lastUpdateTime) > EXPIRATION_TIME); if (expired) { this.evictAll(); } return expired; } @Override public void evictAll() { this.executeAsynchronously(new CacheEvictor(this.fileManager, this.cacheDir)); } /** * Build a file, used to be inserted in the disk cache. * * @param userId The id user to build the file. * @return A valid file. */ private File buildFile(int userId) { StringBuilder fileNameBuilder = new StringBuilder(); fileNameBuilder.append(this.cacheDir.getPath()); fileNameBuilder.append(File.separator); fileNameBuilder.append(DEFAULT_FILE_NAME); fileNameBuilder.append(userId); return new File(fileNameBuilder.toString()); } /** * Set in millis, the last time the cache was accessed. */ private void setLastCacheUpdateTimeMillis() { long currentMillis = System.currentTimeMillis(); this.fileManager.writeToPreferences(this.context, SETTINGS_FILE_NAME, SETTINGS_KEY_LAST_CACHE_UPDATE, currentMillis); } /** * Get in millis, the last time the cache was accessed. */ private long getLastCacheUpdateTimeMillis() { return this.fileManager.getFromPreferences(this.context, SETTINGS_FILE_NAME, SETTINGS_KEY_LAST_CACHE_UPDATE); } /** * Executes a {@link Runnable} in another Thread. * * @param runnable {@link Runnable} to execute */ private void executeAsynchronously(Runnable runnable) { this.threadExecutor.execute(runnable); } /** * {@link Runnable} class for writing to disk. */ private static class CacheWriter implements Runnable { private final FileManager fileManager; private final File fileToWrite; private final String fileContent; CacheWriter(FileManager fileManager, File fileToWrite, String fileContent) { this.fileManager = fileManager; this.fileToWrite = fileToWrite; this.fileContent = fileContent; } @Override public void run() { this.fileManager.writeToFile(fileToWrite, fileContent); } } /** * {@link Runnable} class for evicting all the cached files */ private static class CacheEvictor implements Runnable { private final FileManager fileManager; private final File cacheDir; CacheEvictor(FileManager fileManager, File cacheDir) { this.fileManager = fileManager; this.cacheDir = cacheDir; } @Override public void run() { this.fileManager.clearDirectory(this.cacheDir); } } }
apache-2.0
dflemstr/docker-java
src/main/java/com/github/dockerjava/client/command/TopContainerResponse.java
983
package com.github.dockerjava.client.command; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Joiner; /** * * @author marcus * */ @JsonIgnoreProperties(ignoreUnknown = true) public class TopContainerResponse { @JsonProperty("Titles") private String[] titles; @JsonProperty("Processes") private String[][] processes; public String[] getTitles() { return titles; } public String[][] getProcesses() { return processes; } @Override public String toString() { Joiner joiner = Joiner.on("; ").skipNulls(); StringBuffer buffer = new StringBuffer(); buffer.append("["); for(String[] fields: processes) { buffer.append("[" + joiner.join(fields) + "]"); } buffer.append("]"); return "TopContainerResponse{" + "titles=" + joiner.join(titles) + ", processes=" + buffer.toString() + '}'; } }
apache-2.0
arcgistask/arcgistask.github.io
src/kremenchugskiy/htmls/kremenchugskiy-tabl-1.html
6817
<table border="1" cellspacing="0" cellpadding="0" width="100%"> <tbody> <tr> <td width="100%" colspan="3" valign="top"> <p align="center"> <strong>Загальна інформація</strong> </p> </td> </tr> <tr> <td width="44%" nowrap="" valign="top"> <p> Тип енергоспоруди </p> </td> <td width="50%" nowrap="" valign="top"> <p> ГЕС </p> </td> </tr> <tr> <td width="44%" nowrap="" valign="top"> <p> Найменування енергоспоруди </p> </td> <td width="50%" nowrap="" valign="top"> <p> Кременьчуцька ГЕС </p> </td> </tr> <tr> <td width="44%" nowrap="" valign="top"> <p> Найменування водостоку </p> </td> <td width="50%" nowrap="" valign="top"> <p> р. Дніпро </p> </td> </tr> <tr> <td width="44%" nowrap="" valign="top"> <p> Найменування басейну </p> </td> <td width="50%" nowrap="" valign="top"> <p> р. Дніпро </p> </td> </tr> <tr> <td width="44%" nowrap="" valign="top"> <p> Розташування </p> </td> <td width="50%" valign="top"> <p> Кіровоградська обл., </p> <p> Полтавська обл., </p> <p> Черкаська обл. </p> </td> </tr> <tr> <td width="44%" nowrap="" valign="top"> <p> Розташування створу греблі </p> </td> <td width="50%" valign="top"> <p> м. Кременчук </p> <p> Полтавська обл. </p> </td> </tr> <tr> <td width="44%" nowrap="" valign="top"> <p> Відстань гирло-створ, км </p> </td> <td width="50%" nowrap="" valign="top"> <p> 564 </p> </td> </tr> <tr> <td width="44%" nowrap="" valign="top"> <p> Вид регулювання </p> </td> <td width="50%" nowrap="" valign="top"> <p> річне з переходом у багаторічне </p> </td> </tr> <tr> <td width="44%" nowrap="" valign="top"> <p> Тип водосховища </p> </td> <td width="50%" nowrap="" valign="top"> <p> руслове </p> </td> </tr> <tr> <td width="44%" nowrap="" valign="top"> <p> Призначення водосховища </p> </td> <td width="50%"valign="top"> <p> Гідроенергетика (основний регулятор стоку Дніпра та основний енергетичний регулятор каскаду Дніпровських ГЕС), судноплавство, зрошення, водозабезпечення (м. Кіровоград, м. Світловодськ, Черкаський хімкомбінат, Черкаський рафінадний завод, Черкаська ТЕС, Кременчуцький нафтопереробний завод та інш.), рибництво, рекреація </p> </td> </tr> <tr> <td width="44%" nowrap="" valign="top"> <p> Рік введення у експлуатацію </p> </td> <td width="50%" nowrap="" valign="top"> <p> 1959 </p> </td> </tr> <tr> <td width="44%" nowrap="" valign="top"> <p> Генеральний проектувальник </p> </td> <td width="50%" nowrap="" valign="top"> <p> Харьківське відділення ГІДЕПА </p> </td> </tr> <tr> <td width="44%" nowrap="" valign="top"> <p> Власник енергоспоруди </p> </td> <td width="50%" nowrap="" valign="top"> <p> ПАТ «Укргідроенерго» </p> <p> Адреса: 07300, м. Вишгород, Київська обл. </p> <p> Сайт: www.uge.gov.ua </p> </td> </tr> <tr> <td width="44%" nowrap="" valign="top"> <p> Перелік основних споруд ГВ </p> </td> <td width="50%" valign="top"> <p> ГЕС руслового типу; водозливна 10-пролітна гребля гравітаційного типу; суднохідні споруди (однокамерний шлюз); дамби та берегоукріплення довжиною 145,3 км; земляні греблі; лісопропускні споруди; рибопропускні та рибозагороджувальні споруди. </p> </td> </tr> </tbody> </table>
apache-2.0
SnorMagazine/Website
php/site/panel/blueprints/link.php
181
<?php if(!defined('KIRBY')) exit ?> # default Link title: Link pages: false files: false fields: title: label: Text type: text website: label: Link type: text
apache-2.0
djudd/human-name-py
setup.py
2800
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the version from version.py with open('humanname/version.py') as f: exec(f.read(), globals(), locals()) setup( name='humanname', version=__version__, description='Python bindings for the Rust crate `human_name`, a library for parsing and comparing human names', url='https://github.com/djudd/human-name-py', author='David Judd', author_email='[email protected]', license='Apache 2.0', # See https://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ # How mature is this project? Common values are # 3 - Alpha # 4 - Beta # 5 - Production/Stable 'Development Status :: 3 - Alpha', # Indicate who your project is intended for 'Intended Audience :: Developers', 'Topic :: Text Processing :: Linguistic', # Pick your license as you wish (should match "license" above) 'License :: OSI Approved :: Apache Software License', # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', ], # What does your project relate to? keywords='human names, people', # You can just specify the packages manually here if your project is # simple. Or you can use find_packages(). packages=find_packages(exclude=['contrib', 'docs', 'tests']), # Alternatively, if you want to distribute just a my_module.py, uncomment # this: # py_modules=["my_module"], # List run-time dependencies here. These will be installed by pip when # your project is installed. For an analysis of "install_requires" vs pip's # requirements files see: # https://packaging.python.org/en/latest/requirements.html install_requires=[], # List additional groups of dependencies here (e.g. development # dependencies). You can install these using the following syntax, # for example: # $ pip install -e .[dev,test] extras_require={ 'dev': ['check-manifest'], 'test': ['coverage'], }, # If there are data files included in your packages that need to be # installed, specify them here. If using Python 2.6 or less, then these # have to be included in MANIFEST.in as well. package_data={ 'humanname': ['libhuman_name.dylib', 'libhuman_name.so'], }, )
apache-2.0
Syn-Flow/Controller
src/main/java/net/floodlightcontroller/topology/TopologyManager.java
56882
/** * Copyright 2013, Big Switch Networks, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. **/ package net.floodlightcontroller.topology; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import net.floodlightcontroller.core.FloodlightContext; import net.floodlightcontroller.core.HAListenerTypeMarker; import net.floodlightcontroller.core.IFloodlightProviderService; import net.floodlightcontroller.core.IFloodlightProviderService.Role; import net.floodlightcontroller.core.IHAListener; import net.floodlightcontroller.core.IOFMessageListener; import net.floodlightcontroller.core.IOFSwitch; import net.floodlightcontroller.core.annotations.LogMessageCategory; import net.floodlightcontroller.core.annotations.LogMessageDoc; import net.floodlightcontroller.core.module.FloodlightModuleContext; import net.floodlightcontroller.core.module.FloodlightModuleException; import net.floodlightcontroller.core.module.IFloodlightModule; import net.floodlightcontroller.core.module.IFloodlightService; import net.floodlightcontroller.core.util.SingletonTask; import net.floodlightcontroller.counter.ICounterStoreService; import net.floodlightcontroller.debugcounter.IDebugCounter; import net.floodlightcontroller.debugcounter.IDebugCounterService; import net.floodlightcontroller.debugcounter.IDebugCounterService.CounterException; import net.floodlightcontroller.debugcounter.IDebugCounterService.CounterType; import net.floodlightcontroller.debugcounter.NullDebugCounter; import net.floodlightcontroller.debugevent.IDebugEventService; import net.floodlightcontroller.debugevent.IDebugEventService.EventColumn; import net.floodlightcontroller.debugevent.IDebugEventService.EventFieldType; import net.floodlightcontroller.debugevent.IDebugEventService.EventType; import net.floodlightcontroller.debugevent.IDebugEventService.MaxEventsRegistered; import net.floodlightcontroller.debugevent.IEventUpdater; import net.floodlightcontroller.debugevent.NullDebugEvent; import net.floodlightcontroller.linkdiscovery.ILinkDiscoveryListener; //import net.floodlightcontroller.linkdiscovery.ILinkDiscoveryService; import net.floodlightcontroller.packet.BSN; import net.floodlightcontroller.packet.Ethernet; import net.floodlightcontroller.packet.LLDP; import net.floodlightcontroller.restserver.IRestApiService; import net.floodlightcontroller.routing.IRoutingService; import net.floodlightcontroller.routing.Link; import net.floodlightcontroller.routing.Route; import net.floodlightcontroller.threadpool.IThreadPoolService; import net.floodlightcontroller.topology.web.TopologyWebRoutable; import org.openflow.protocol.OFMessage; import org.openflow.protocol.OFPacketIn; import org.openflow.protocol.OFPacketOut; import org.openflow.protocol.OFPort; import org.openflow.protocol.OFType; import org.openflow.protocol.action.OFAction; import org.openflow.protocol.action.OFActionOutput; import org.slf4j.Logger; import org.slf4j.LoggerFactory; //Yikai import edu.linkdiscovery.F3LinkDiscoveryService; /** * Topology manager is responsible for maintaining the controller's notion * of the network graph, as well as implementing tools for finding routes * through the topology. */ @LogMessageCategory("Network Topology") public class TopologyManager implements IFloodlightModule, ITopologyService, IRoutingService, ILinkDiscoveryListener, IOFMessageListener { protected static Logger log = LoggerFactory.getLogger(TopologyManager.class); public static final String MODULE_NAME = "topology"; public static final String CONTEXT_TUNNEL_ENABLED = "com.bigswitch.floodlight.topologymanager.tunnelEnabled"; /** * Role of the controller. */ private Role role; /** * Set of ports for each switch */ protected Map<Long, Set<Integer>> switchPorts; /** * Set of links organized by node port tuple */ protected Map<NodePortTuple, Set<Link>> switchPortLinks; /** * Set of direct links */ protected Map<NodePortTuple, Set<Link>> directLinks; /** * set of links that are broadcast domain links. */ protected Map<NodePortTuple, Set<Link>> portBroadcastDomainLinks; /** * set of tunnel links */ protected Set<NodePortTuple> tunnelPorts; //Yikai protected F3LinkDiscoveryService linkDiscovery; protected IThreadPoolService threadPool; protected IFloodlightProviderService floodlightProvider; protected IRestApiService restApi; protected IDebugCounterService debugCounters; // Modules that listen to our updates protected ArrayList<ITopologyListener> topologyAware; protected BlockingQueue<LDUpdate> ldUpdates; // These must be accessed using getCurrentInstance(), not directly protected TopologyInstance currentInstance; protected TopologyInstance currentInstanceWithoutTunnels; protected SingletonTask newInstanceTask; private Date lastUpdateTime; /** * Flag that indicates if links (direct/tunnel/multihop links) were * updated as part of LDUpdate. */ protected boolean linksUpdated; /** * Flag that indicates if direct or tunnel links were updated as * part of LDUpdate. */ protected boolean dtLinksUpdated; /** Flag that indicates if tunnel ports were updated or not */ protected boolean tunnelPortsUpdated; protected int TOPOLOGY_COMPUTE_INTERVAL_MS = 500; private IHAListener haListener; /** * Debug Counters */ protected static final String PACKAGE = TopologyManager.class.getPackage().getName(); protected IDebugCounter ctrIncoming; /** * Debug Events */ protected IDebugEventService debugEvents; /* * Topology Event Updater */ protected IEventUpdater<TopologyEvent> evTopology; /** * Topology Information exposed for a Topology related event - used inside * the BigTopologyEvent class */ protected class TopologyEventInfo { private final int numOpenflowClustersWithTunnels; private final int numOpenflowClustersWithoutTunnels; private final Map<Long, List<NodePortTuple>> externalPortsMap; private final int numTunnelPorts; public TopologyEventInfo(int numOpenflowClustersWithTunnels, int numOpenflowClustersWithoutTunnels, Map<Long, List<NodePortTuple>> externalPortsMap, int numTunnelPorts) { super(); this.numOpenflowClustersWithTunnels = numOpenflowClustersWithTunnels; this.numOpenflowClustersWithoutTunnels = numOpenflowClustersWithoutTunnels; this.externalPortsMap = externalPortsMap; this.numTunnelPorts = numTunnelPorts; } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("# Openflow Clusters:"); builder.append(" { With Tunnels: "); builder.append(numOpenflowClustersWithTunnels); builder.append(" Without Tunnels: "); builder.append(numOpenflowClustersWithoutTunnels); builder.append(" }"); builder.append(", # External Clusters: "); int numExternalClusters = externalPortsMap.size(); builder.append(numExternalClusters); if (numExternalClusters > 0) { builder.append(" { "); int count = 0; for (Long extCluster : externalPortsMap.keySet()) { builder.append("#" + extCluster + ":Ext Ports: "); builder.append(externalPortsMap.get(extCluster).size()); if (++count < numExternalClusters) { builder.append(", "); } else { builder.append(" "); } } builder.append("}"); } builder.append(", # Tunnel Ports: "); builder.append(numTunnelPorts); return builder.toString(); } } /** * Topology Event class to track topology related events */ protected class TopologyEvent { @EventColumn(name = "Reason", description = EventFieldType.STRING) private final String reason; @EventColumn(name = "Topology Summary") private final TopologyEventInfo topologyInfo; public TopologyEvent(String reason, TopologyEventInfo topologyInfo) { super(); this.reason = reason; this.topologyInfo = topologyInfo; } } // Getter/Setter methods /** * Get the time interval for the period topology updates, if any. * The time returned is in milliseconds. * @return */ public int getTopologyComputeInterval() { return TOPOLOGY_COMPUTE_INTERVAL_MS; } /** * Set the time interval for the period topology updates, if any. * The time is in milliseconds. * @return */ public void setTopologyComputeInterval(int time_ms) { TOPOLOGY_COMPUTE_INTERVAL_MS = time_ms; } /** * Thread for recomputing topology. The thread is always running, * however the function applyUpdates() has a blocking call. */ @LogMessageDoc(level="ERROR", message="Error in topology instance task thread", explanation="An unknown error occured in the topology " + "discovery module.", recommendation=LogMessageDoc.CHECK_CONTROLLER) protected class UpdateTopologyWorker implements Runnable { @Override public void run() { try { if (ldUpdates.peek() != null) updateTopology(); handleMiscellaneousPeriodicEvents(); } catch (Exception e) { log.error("Error in topology instance task thread", e); } finally { if (floodlightProvider.getRole() != Role.SLAVE) newInstanceTask.reschedule(TOPOLOGY_COMPUTE_INTERVAL_MS, TimeUnit.MILLISECONDS); } } } // To be used for adding any periodic events that's required by topology. protected void handleMiscellaneousPeriodicEvents() { return; } public boolean updateTopology() { boolean newInstanceFlag; linksUpdated = false; dtLinksUpdated = false; tunnelPortsUpdated = false; List<LDUpdate> appliedUpdates = applyUpdates(); newInstanceFlag = createNewInstance("link-discovery-updates"); lastUpdateTime = new Date(); informListeners(appliedUpdates); return newInstanceFlag; } // ********************** // ILinkDiscoveryListener // ********************** @Override public void linkDiscoveryUpdate(List<LDUpdate> updateList) { if (log.isTraceEnabled()) { log.trace("Queuing update: {}", updateList); } ldUpdates.addAll(updateList); } @Override public void linkDiscoveryUpdate(LDUpdate update) { if (log.isTraceEnabled()) { log.trace("Queuing update: {}", update); } ldUpdates.add(update); } // **************** // ITopologyService // **************** // // ITopologyService interface methods // @Override public Date getLastUpdateTime() { return lastUpdateTime; } @Override public void addListener(ITopologyListener listener) { topologyAware.add(listener); } @Override public boolean isAttachmentPointPort(long switchid, int port) { return isAttachmentPointPort(switchid, port, true); } @Override public boolean isAttachmentPointPort(long switchid, int port, boolean tunnelEnabled) { // If the switch port is 'tun-bsn' port, it is not // an attachment point port, irrespective of whether // a link is found through it or not. if (linkDiscovery.isTunnelPort(switchid, port)) return false; TopologyInstance ti = getCurrentInstance(tunnelEnabled); // if the port is not attachment point port according to // topology instance, then return false if (ti.isAttachmentPointPort(switchid, port) == false) return false; // Check whether the port is a physical port. We should not learn // attachment points on "special" ports. if ((port & 0xff00) == 0xff00 && port != (short)0xfffe) return false; // Make sure that the port is enabled. IOFSwitch sw = floodlightProvider.getSwitch(switchid); if (sw == null) return false; return (sw.portEnabled(port)); } @Override public long getOpenflowDomainId(long switchId) { return getOpenflowDomainId(switchId, true); } @Override public long getOpenflowDomainId(long switchId, boolean tunnelEnabled) { TopologyInstance ti = getCurrentInstance(tunnelEnabled); return ti.getOpenflowDomainId(switchId); } @Override public long getL2DomainId(long switchId) { return getL2DomainId(switchId, true); } @Override public long getL2DomainId(long switchId, boolean tunnelEnabled) { TopologyInstance ti = getCurrentInstance(tunnelEnabled); return ti.getL2DomainId(switchId); } @Override public boolean inSameOpenflowDomain(long switch1, long switch2) { return inSameOpenflowDomain(switch1, switch2, true); } @Override public boolean inSameOpenflowDomain(long switch1, long switch2, boolean tunnelEnabled) { TopologyInstance ti = getCurrentInstance(tunnelEnabled); return ti.inSameOpenflowDomain(switch1, switch2); } @Override public boolean isAllowed(long sw, int portId) { return isAllowed(sw, portId, true); } @Override public boolean isAllowed(long sw, int portId, boolean tunnelEnabled) { TopologyInstance ti = getCurrentInstance(tunnelEnabled); return ti.isAllowed(sw, portId); } //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// @Override public boolean isIncomingBroadcastAllowed(long sw, int portId) { return isIncomingBroadcastAllowed(sw, portId, true); } @Override public boolean isIncomingBroadcastAllowed(long sw, int portId, boolean tunnelEnabled) { TopologyInstance ti = getCurrentInstance(tunnelEnabled); return ti.isIncomingBroadcastAllowedOnSwitchPort(sw, portId); } //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// /** Get all the ports connected to the switch */ @Override public Set<Integer> getPortsWithLinks(long sw) { return getPortsWithLinks(sw, true); } /** Get all the ports connected to the switch */ @Override public Set<Integer> getPortsWithLinks(long sw, boolean tunnelEnabled) { TopologyInstance ti = getCurrentInstance(tunnelEnabled); return ti.getPortsWithLinks(sw); } //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// /** Get all the ports on the target switch (targetSw) on which a * broadcast packet must be sent from a host whose attachment point * is on switch port (src, srcPort). */ @Override public Set<Integer> getBroadcastPorts(long targetSw, long src, int srcPort) { return getBroadcastPorts(targetSw, src, srcPort, true); } /** Get all the ports on the target switch (targetSw) on which a * broadcast packet must be sent from a host whose attachment point * is on switch port (src, srcPort). */ @Override public Set<Integer> getBroadcastPorts(long targetSw, long src, int srcPort, boolean tunnelEnabled) { TopologyInstance ti = getCurrentInstance(tunnelEnabled); return ti.getBroadcastPorts(targetSw, src, srcPort); } //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// @Override public NodePortTuple getOutgoingSwitchPort(long src, int srcPort, long dst, int dstPort) { // Use this function to redirect traffic if needed. return getOutgoingSwitchPort(src, srcPort, dst, dstPort, true); } @Override public NodePortTuple getOutgoingSwitchPort(long src, int srcPort, long dst, int dstPort, boolean tunnelEnabled) { // Use this function to redirect traffic if needed. TopologyInstance ti = getCurrentInstance(tunnelEnabled); return ti.getOutgoingSwitchPort(src, srcPort, dst, dstPort); } //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// @Override public NodePortTuple getIncomingSwitchPort(long src, int srcPort, long dst, int dstPort) { return getIncomingSwitchPort(src, srcPort, dst, dstPort, true); } @Override public NodePortTuple getIncomingSwitchPort(long src, int srcPort, long dst, int dstPort, boolean tunnelEnabled) { TopologyInstance ti = getCurrentInstance(tunnelEnabled); return ti.getIncomingSwitchPort(src, srcPort, dst, dstPort); } //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// /** * Checks if the two switchports belong to the same broadcast domain. */ @Override public boolean isInSameBroadcastDomain(long s1, int p1, long s2, int p2) { return isInSameBroadcastDomain(s1, p1, s2, p2, true); } @Override public boolean isInSameBroadcastDomain(long s1, int p1, long s2, int p2, boolean tunnelEnabled) { TopologyInstance ti = getCurrentInstance(tunnelEnabled); return ti.inSameBroadcastDomain(s1, p1, s2, p2); } //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// /** * Checks if the switchport is a broadcast domain port or not. */ @Override public boolean isBroadcastDomainPort(long sw, int port) { return isBroadcastDomainPort(sw, port, true); } @Override public boolean isBroadcastDomainPort(long sw, int port, boolean tunnelEnabled) { TopologyInstance ti = getCurrentInstance(tunnelEnabled); return ti.isBroadcastDomainPort(new NodePortTuple(sw, port)); } //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// /** * Checks if the new attachment point port is consistent with the * old attachment point port. */ @Override public boolean isConsistent(long oldSw, int oldPort, long newSw, int newPort) { return isConsistent(oldSw, oldPort, newSw, newPort, true); } @Override public boolean isConsistent(long oldSw, int oldPort, long newSw, int newPort, boolean tunnelEnabled) { TopologyInstance ti = getCurrentInstance(tunnelEnabled); return ti.isConsistent(oldSw, oldPort, newSw, newPort); } //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// /** * Checks if the two switches are in the same Layer 2 domain. */ @Override public boolean inSameL2Domain(long switch1, long switch2) { return inSameL2Domain(switch1, switch2, true); } @Override public boolean inSameL2Domain(long switch1, long switch2, boolean tunnelEnabled) { TopologyInstance ti = getCurrentInstance(tunnelEnabled); return ti.inSameL2Domain(switch1, switch2); } //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// @Override public NodePortTuple getAllowedOutgoingBroadcastPort(long src, int srcPort, long dst, int dstPort) { return getAllowedOutgoingBroadcastPort(src, srcPort, dst, dstPort, true); } @Override public NodePortTuple getAllowedOutgoingBroadcastPort(long src, int srcPort, long dst, int dstPort, boolean tunnelEnabled){ TopologyInstance ti = getCurrentInstance(tunnelEnabled); return ti.getAllowedOutgoingBroadcastPort(src, srcPort, dst, dstPort); } //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// @Override public NodePortTuple getAllowedIncomingBroadcastPort(long src, int srcPort) { return getAllowedIncomingBroadcastPort(src,srcPort, true); } @Override public NodePortTuple getAllowedIncomingBroadcastPort(long src, int srcPort, boolean tunnelEnabled) { TopologyInstance ti = getCurrentInstance(tunnelEnabled); return ti.getAllowedIncomingBroadcastPort(src,srcPort); } //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// @Override public Set<Long> getSwitchesInOpenflowDomain(long switchDPID) { return getSwitchesInOpenflowDomain(switchDPID, true); } @Override public Set<Long> getSwitchesInOpenflowDomain(long switchDPID, boolean tunnelEnabled) { TopologyInstance ti = getCurrentInstance(tunnelEnabled); return ti.getSwitchesInOpenflowDomain(switchDPID); } //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// @Override public Set<NodePortTuple> getBroadcastDomainPorts() { return portBroadcastDomainLinks.keySet(); } @Override public Set<NodePortTuple> getTunnelPorts() { return tunnelPorts; } @Override public Set<NodePortTuple> getBlockedPorts() { Set<NodePortTuple> bp; Set<NodePortTuple> blockedPorts = new HashSet<NodePortTuple>(); // As we might have two topologies, simply get the union of // both of them and send it. bp = getCurrentInstance(true).getBlockedPorts(); if (bp != null) blockedPorts.addAll(bp); bp = getCurrentInstance(false).getBlockedPorts(); if (bp != null) blockedPorts.addAll(bp); return blockedPorts; } //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// // *************** // IRoutingService // *************** @Override public Route getRoute(long src, long dst, long cookie) { return getRoute(src, dst, cookie, true); } @Override public Route getRoute(long src, long dst, long cookie, boolean tunnelEnabled) { TopologyInstance ti = getCurrentInstance(tunnelEnabled); return ti.getRoute(src, dst, cookie); } @Override public Route getRoute(long src, int srcPort, long dst, int dstPort, long cookie) { return getRoute(src, srcPort, dst, dstPort, cookie, true); } @Override public Route getRoute(long src, int srcPort, long dst, int dstPort, long cookie, boolean tunnelEnabled) { TopologyInstance ti = getCurrentInstance(tunnelEnabled); return ti.getRoute(null, src, srcPort, dst, dstPort, cookie); } @Override public boolean routeExists(long src, long dst) { return routeExists(src, dst, true); } @Override public boolean routeExists(long src, long dst, boolean tunnelEnabled) { TopologyInstance ti = getCurrentInstance(tunnelEnabled); return ti.routeExists(src, dst); } @Override public ArrayList<Route> getRoutes(long srcDpid, long dstDpid, boolean tunnelEnabled) { // Floodlight supports single path routing now // return single path now ArrayList<Route> result=new ArrayList<Route>(); result.add(getRoute(srcDpid, dstDpid, 0, tunnelEnabled)); return result; } // ****************** // IOFMessageListener // ****************** @Override public String getName() { return MODULE_NAME; } //Yikai @Override public boolean isCallbackOrderingPrereq(OFType type, String name) { return "f3linkdiscovery".equals(name); } @Override public boolean isCallbackOrderingPostreq(OFType type, String name) { return false; } @Override public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) { switch (msg.getType()) { case PACKET_IN: ctrIncoming.updateCounterNoFlush(); return this.processPacketInMessage(sw, (OFPacketIn) msg, cntx); default: break; } return Command.CONTINUE; } // *************** // IHAListener // *************** private class HAListenerDelegate implements IHAListener { @Override public void transitionToMaster() { role = Role.MASTER; log.debug("Re-computing topology due " + "to HA change from SLAVE->MASTER"); newInstanceTask.reschedule(TOPOLOGY_COMPUTE_INTERVAL_MS, TimeUnit.MILLISECONDS); } @Override public void controllerNodeIPsChanged( Map<String, String> curControllerNodeIPs, Map<String, String> addedControllerNodeIPs, Map<String, String> removedControllerNodeIPs) { // no-op } @Override public String getName() { return TopologyManager.this.getName(); } //Yikai @Override public boolean isCallbackOrderingPrereq(HAListenerTypeMarker type, String name) { return "f3linkdiscovery".equals(name) || "tunnelmanager".equals(name); } @Override public boolean isCallbackOrderingPostreq(HAListenerTypeMarker type, String name) { // TODO Auto-generated method stub return false; } } // ***************** // IFloodlightModule // ***************** @Override public Collection<Class<? extends IFloodlightService>> getModuleServices() { Collection<Class<? extends IFloodlightService>> l = new ArrayList<Class<? extends IFloodlightService>>(); l.add(ITopologyService.class); l.add(IRoutingService.class); return l; } @Override public Map<Class<? extends IFloodlightService>, IFloodlightService> getServiceImpls() { Map<Class<? extends IFloodlightService>, IFloodlightService> m = new HashMap<Class<? extends IFloodlightService>, IFloodlightService>(); // We are the class that implements the service m.put(ITopologyService.class, this); m.put(IRoutingService.class, this); return m; } @Override public Collection<Class<? extends IFloodlightService>> getModuleDependencies() { Collection<Class<? extends IFloodlightService>> l = new ArrayList<Class<? extends IFloodlightService>>(); //Yikai l.add(F3LinkDiscoveryService.class); l.add(IThreadPoolService.class); l.add(IFloodlightProviderService.class); l.add(ICounterStoreService.class); l.add(IRestApiService.class); return l; } @Override public void init(FloodlightModuleContext context) throws FloodlightModuleException { //Yikai linkDiscovery = context.getServiceImpl(F3LinkDiscoveryService.class); threadPool = context.getServiceImpl(IThreadPoolService.class); floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class); restApi = context.getServiceImpl(IRestApiService.class); debugCounters = context.getServiceImpl(IDebugCounterService.class); debugEvents = context.getServiceImpl(IDebugEventService.class); switchPorts = new HashMap<Long,Set<Integer>>(); switchPortLinks = new HashMap<NodePortTuple, Set<Link>>(); directLinks = new HashMap<NodePortTuple, Set<Link>>(); portBroadcastDomainLinks = new HashMap<NodePortTuple, Set<Link>>(); tunnelPorts = new HashSet<NodePortTuple>(); topologyAware = new ArrayList<ITopologyListener>(); ldUpdates = new LinkedBlockingQueue<LDUpdate>(); haListener = new HAListenerDelegate(); registerTopologyDebugCounters(); registerTopologyDebugEvents(); } protected void registerTopologyDebugEvents() throws FloodlightModuleException { if (debugEvents == null) { debugEvents = new NullDebugEvent(); } try { evTopology = debugEvents.registerEvent(PACKAGE, "topologyevent", "Topology Computation", EventType.ALWAYS_LOG, TopologyEvent.class, 100); } catch (MaxEventsRegistered e) { throw new FloodlightModuleException("Max events registered", e); } } @Override public void startUp(FloodlightModuleContext context) { clearCurrentTopology(); // Initialize role to floodlight provider role. this.role = floodlightProvider.getRole(); ScheduledExecutorService ses = threadPool.getScheduledExecutor(); newInstanceTask = new SingletonTask(ses, new UpdateTopologyWorker()); if (role != Role.SLAVE) newInstanceTask.reschedule(TOPOLOGY_COMPUTE_INTERVAL_MS, TimeUnit.MILLISECONDS); linkDiscovery.addListener(this); floodlightProvider.addOFMessageListener(OFType.PACKET_IN, this); floodlightProvider.addHAListener(this.haListener); addRestletRoutable(); } private void registerTopologyDebugCounters() throws FloodlightModuleException { if (debugCounters == null) { log.error("Debug Counter Service not found."); debugCounters = new NullDebugCounter(); } try { ctrIncoming = debugCounters.registerCounter(PACKAGE, "incoming", "All incoming packets seen by this module", CounterType.ALWAYS_COUNT); } catch (CounterException e) { throw new FloodlightModuleException(e.getMessage()); } } protected void addRestletRoutable() { restApi.addRestletRoutable(new TopologyWebRoutable()); } // **************** // Internal methods // **************** /** * If the packet-in switch port is disabled for all data traffic, then * the packet will be dropped. Otherwise, the packet will follow the * normal processing chain. * @param sw * @param pi * @param cntx * @return */ protected Command dropFilter(long sw, OFPacketIn pi, FloodlightContext cntx) { Command result = Command.CONTINUE; int port = pi.getInPort(); // If the input port is not allowed for data traffic, drop everything. // BDDP packets will not reach this stage. if (isAllowed(sw, port) == false) { if (log.isTraceEnabled()) { log.trace("Ignoring packet because of topology " + "restriction on switch={}, port={}", sw, port); result = Command.STOP; } } return result; } /** * TODO This method must be moved to a layer below forwarding * so that anyone can use it. * @param packetData * @param sw * @param ports * @param cntx */ @LogMessageDoc(level="ERROR", message="Failed to clear all flows on switch {switch}", explanation="An I/O error occured while trying send " + "topology discovery packet", recommendation=LogMessageDoc.CHECK_SWITCH) public void doMultiActionPacketOut(byte[] packetData, IOFSwitch sw, Set<Integer> ports, FloodlightContext cntx) { if (ports == null) return; if (packetData == null || packetData.length <= 0) return; OFPacketOut po = (OFPacketOut) floodlightProvider.getOFMessageFactory(). getMessage(OFType.PACKET_OUT); List<OFAction> actions = new ArrayList<OFAction>(); for(int p: ports) { actions.add(new OFActionOutput(p, (short) 0)); } // set actions po.setActions(actions); // set action length po.setActionsLength((short) (OFActionOutput.MINIMUM_LENGTH * ports.size())); // set buffer-id to BUFFER_ID_NONE po.setBufferId(OFPacketOut.BUFFER_ID_NONE); // set in-port to OFPP_ANY po.setInPort(OFPort.OFPP_ANY.getValue()); // set packet data po.setPacketData(packetData); // compute and set packet length. short poLength = (short)(OFPacketOut.MINIMUM_LENGTH + po.getActionsLength() + packetData.length); po.setLength(poLength); try { //counterStore.updatePktOutFMCounterStore(sw, po); if (log.isTraceEnabled()) { log.trace("write broadcast packet on switch-id={} " + "interaces={} packet-data={} packet-out={}", new Object[] {sw.getId(), ports, packetData, po}); } sw.write(po, cntx); } catch (IOException e) { log.error("Failure writing packet out", e); } } /** * Get the set of ports to eliminate for sending out BDDP. The method * returns all the ports that are suppressed for link discovery on the * switch. * packets. * @param sid * @return */ protected Set<Integer> getPortsToEliminateForBDDP(long sid) { Set<NodePortTuple> suppressedNptList = linkDiscovery.getSuppressLLDPsInfo(); if (suppressedNptList == null) return null; Set<Integer> resultPorts = new HashSet<Integer>(); for(NodePortTuple npt: suppressedNptList) { if (npt.getNodeId() == sid) { resultPorts.add(npt.getPortId()); } } return resultPorts; } /** * The BDDP packets are forwarded out of all the ports out of an * openflowdomain. Get all the switches in the same openflow * domain as the sw (disabling tunnels). Then get all the * external switch ports and send these packets out. * @param sw * @param pi * @param cntx */ protected void doFloodBDDP(long pinSwitch, OFPacketIn pi, FloodlightContext cntx) { TopologyInstance ti = getCurrentInstance(false); Set<Long> switches = ti.getSwitchesInOpenflowDomain(pinSwitch); if (switches == null) { // indicates no links are connected to the switches switches = new HashSet<Long>(); switches.add(pinSwitch); } for(long sid: switches) { IOFSwitch sw = floodlightProvider.getSwitch(sid); if (sw == null) continue; Collection<Integer> enabledPorts = sw.getEnabledPortNumbers(); if (enabledPorts == null) continue; Set<Integer> ports = new HashSet<Integer>(); ports.addAll(enabledPorts); // all the ports known to topology // without tunnels. // out of these, we need to choose only those that are // broadcast port, otherwise, we should eliminate. Set<Integer> portsKnownToTopo = ti.getPortsWithLinks(sid); if (portsKnownToTopo != null) { for(int p: portsKnownToTopo) { NodePortTuple npt = new NodePortTuple(sid, p); if (ti.isBroadcastDomainPort(npt) == false) { ports.remove(p); } } } Set<Integer> portsToEliminate = getPortsToEliminateForBDDP(sid); if (portsToEliminate != null) { ports.removeAll(portsToEliminate); } // remove the incoming switch port if (pinSwitch == sid) { ports.remove(pi.getInPort()); } // we have all the switch ports to which we need to broadcast. doMultiActionPacketOut(pi.getPacketData(), sw, ports, cntx); } } protected Command processPacketInMessage(IOFSwitch sw, OFPacketIn pi, FloodlightContext cntx) { // get the packet-in switch. Ethernet eth = IFloodlightProviderService.bcStore. get(cntx,IFloodlightProviderService.CONTEXT_PI_PAYLOAD); if (eth.getPayload() instanceof BSN) { BSN bsn = (BSN) eth.getPayload(); if (bsn == null) return Command.STOP; if (bsn.getPayload() == null) return Command.STOP; // It could be a packet other than BSN LLDP, therefore // continue with the regular processing. if (bsn.getPayload() instanceof LLDP == false) return Command.CONTINUE; doFloodBDDP(sw.getId(), pi, cntx); return Command.STOP; } else { return dropFilter(sw.getId(), pi, cntx); } } /** * Updates concerning switch disconnect and port down are not processed. * LinkDiscoveryManager is expected to process those messages and send * multiple link removed messages. However, all the updates from * LinkDiscoveryManager would be propagated to the listeners of topology. */ @LogMessageDoc(level="ERROR", message="Error reading link discovery update.", explanation="Unable to process link discovery update", recommendation=LogMessageDoc.REPORT_CONTROLLER_BUG) public List<LDUpdate> applyUpdates() { List<LDUpdate> appliedUpdates = new ArrayList<LDUpdate>(); LDUpdate update = null; while (ldUpdates.peek() != null) { try { update = ldUpdates.take(); } catch (Exception e) { log.error("Error reading link discovery update.", e); } if (log.isTraceEnabled()) { log.trace("Applying update: {}", update); } System.out.println("in topology manager: "+update); switch (update.getOperation()) { case LINK_UPDATED: addOrUpdateLink(update.getSrc(), update.getSrcPort(), update.getDst(), update.getDstPort(), update.getType()); break; case LINK_REMOVED: removeLink(update.getSrc(), update.getSrcPort(), update.getDst(), update.getDstPort()); break; case SWITCH_UPDATED: addOrUpdateSwitch(update.getSrc()); break; case SWITCH_REMOVED: removeSwitch(update.getSrc()); break; case TUNNEL_PORT_ADDED: addTunnelPort(update.getSrc(), update.getSrcPort()); break; case TUNNEL_PORT_REMOVED: removeTunnelPort(update.getSrc(), update.getSrcPort()); break; case PORT_UP: case PORT_DOWN: break; } // Add to the list of applied updates. appliedUpdates.add(update); } //Yikai Lin ([email protected]) Map<NodePortTuple, Set<Link>> switchPortLinks = this.getSwitchPortLinks(); for(NodePortTuple tuple:switchPortLinks.keySet()) { System.out.println(tuple+" -> "+switchPortLinks.get(tuple)); } return (Collections.unmodifiableList(appliedUpdates)); } protected void addOrUpdateSwitch(long sw) { // nothing to do here for the time being. return; } public void addTunnelPort(long sw, int port) { NodePortTuple npt = new NodePortTuple(sw, port); tunnelPorts.add(npt); tunnelPortsUpdated = true; } public void removeTunnelPort(long sw, int port) { NodePortTuple npt = new NodePortTuple(sw, port); tunnelPorts.remove(npt); tunnelPortsUpdated = true; } public boolean createNewInstance() { return createNewInstance("internal"); } /** * This function computes a new topology instance. * It ignores links connected to all broadcast domain ports * and tunnel ports. The method returns if a new instance of * topology was created or not. */ protected boolean createNewInstance(String reason) { Set<NodePortTuple> blockedPorts = new HashSet<NodePortTuple>(); if (!linksUpdated) return false; Map<NodePortTuple, Set<Link>> openflowLinks; openflowLinks = new HashMap<NodePortTuple, Set<Link>>(); Set<NodePortTuple> nptList = switchPortLinks.keySet(); if (nptList != null) { for(NodePortTuple npt: nptList) { Set<Link> linkSet = switchPortLinks.get(npt); if (linkSet == null) continue; openflowLinks.put(npt, new HashSet<Link>(linkSet)); } } // Identify all broadcast domain ports. // Mark any port that has inconsistent set of links // as broadcast domain ports as well. Set<NodePortTuple> broadcastDomainPorts = identifyBroadcastDomainPorts(); // Remove all links incident on broadcast domain ports. for(NodePortTuple npt: broadcastDomainPorts) { if (switchPortLinks.get(npt) == null) continue; for(Link link: switchPortLinks.get(npt)) { removeLinkFromStructure(openflowLinks, link); } } // Remove all tunnel links. for(NodePortTuple npt: tunnelPorts) { if (switchPortLinks.get(npt) == null) continue; for(Link link: switchPortLinks.get(npt)) { removeLinkFromStructure(openflowLinks, link); } } TopologyInstance nt = new TopologyInstance(switchPorts, blockedPorts, openflowLinks, broadcastDomainPorts, tunnelPorts); nt.compute(); // We set the instances with and without tunnels to be identical. // If needed, we may compute them differently. currentInstance = nt; currentInstanceWithoutTunnels = nt; TopologyEventInfo topologyInfo = new TopologyEventInfo(0, nt.getClusters().size(), new HashMap<Long, List<NodePortTuple>>(), 0); evTopology.updateEventWithFlush(new TopologyEvent(reason, topologyInfo)); return true; } /** * We expect every switch port to have at most two links. Both these * links must be unidirectional links connecting to the same switch port. * If not, we will mark this as a broadcast domain port. */ protected Set<NodePortTuple> identifyBroadcastDomainPorts() { Set<NodePortTuple> broadcastDomainPorts = new HashSet<NodePortTuple>(); broadcastDomainPorts.addAll(this.portBroadcastDomainLinks.keySet()); Set<NodePortTuple> additionalNpt = new HashSet<NodePortTuple>(); // Copy switchPortLinks Map<NodePortTuple, Set<Link>> spLinks = new HashMap<NodePortTuple, Set<Link>>(); for(NodePortTuple npt: switchPortLinks.keySet()) { spLinks.put(npt, new HashSet<Link>(switchPortLinks.get(npt))); } for(NodePortTuple npt: spLinks.keySet()) { Set<Link> links = spLinks.get(npt); boolean bdPort = false; ArrayList<Link> linkArray = new ArrayList<Link>(); if (links.size() > 2) { bdPort = true; } else if (links.size() == 2) { for(Link l: links) { linkArray.add(l); } // now, there should be two links in [0] and [1]. Link l1 = linkArray.get(0); Link l2 = linkArray.get(1); // check if these two are symmetric. if (l1.getSrc() != l2.getDst() || l1.getSrcPort() != l2.getDstPort() || l1.getDst() != l2.getSrc() || l1.getDstPort() != l2.getSrcPort()) { bdPort = true; } } if (bdPort && (broadcastDomainPorts.contains(npt) == false)) { additionalNpt.add(npt); } } if (additionalNpt.size() > 0) { log.warn("The following switch ports have multiple " + "links incident on them, so these ports will be treated " + " as braodcast domain ports. {}", additionalNpt); broadcastDomainPorts.addAll(additionalNpt); } return broadcastDomainPorts; } public void informListeners(List<LDUpdate> linkUpdates) { if (role != null && role != Role.MASTER) return; for(int i=0; i<topologyAware.size(); ++i) { ITopologyListener listener = topologyAware.get(i); listener.topologyChanged(linkUpdates); } } public void addSwitch(long sid) { if (switchPorts.containsKey(sid) == false) { switchPorts.put(sid, new HashSet<Integer>()); } } private void addPortToSwitch(long s, int p) { addSwitch(s); switchPorts.get(s).add(p); } public void removeSwitch(long sid) { // Delete all the links in the switch, switch and all // associated data should be deleted. if (switchPorts.containsKey(sid) == false) return; // Check if any tunnel ports need to be removed. for(NodePortTuple npt: tunnelPorts) { if (npt.getNodeId() == sid) { removeTunnelPort(npt.getNodeId(), npt.getPortId()); } } Set<Link> linksToRemove = new HashSet<Link>(); for(Integer p: switchPorts.get(sid)) { NodePortTuple n1 = new NodePortTuple(sid, p); linksToRemove.addAll(switchPortLinks.get(n1)); } if (linksToRemove.isEmpty()) return; for(Link link: linksToRemove) { removeLink(link); } } /** * Add the given link to the data structure. Returns true if a link was * added. * @param s * @param l * @return */ private boolean addLinkToStructure(Map<NodePortTuple, Set<Link>> s, Link l) { boolean result1 = false, result2 = false; NodePortTuple n1 = new NodePortTuple(l.getSrc(), l.getSrcPort()); NodePortTuple n2 = new NodePortTuple(l.getDst(), l.getDstPort()); if (s.get(n1) == null) { s.put(n1, new HashSet<Link>()); } if (s.get(n2) == null) { s.put(n2, new HashSet<Link>()); } result1 = s.get(n1).add(l); result2 = s.get(n2).add(l); return (result1 || result2); } /** * Delete the given link from the data strucure. Returns true if the * link was deleted. * @param s * @param l * @return */ private boolean removeLinkFromStructure(Map<NodePortTuple, Set<Link>> s, Link l) { boolean result1 = false, result2 = false; NodePortTuple n1 = new NodePortTuple(l.getSrc(), l.getSrcPort()); NodePortTuple n2 = new NodePortTuple(l.getDst(), l.getDstPort()); if (s.get(n1) != null) { result1 = s.get(n1).remove(l); if (s.get(n1).isEmpty()) s.remove(n1); } if (s.get(n2) != null) { result2 = s.get(n2).remove(l); if (s.get(n2).isEmpty()) s.remove(n2); } return result1 || result2; } protected void addOrUpdateTunnelLink(long srcId, int srcPort, long dstId, int dstPort) { // If you need to handle tunnel links, this is a placeholder. } public void addOrUpdateLink(long srcId, int srcPort, long dstId, int dstPort, LinkType type) { Link link = new Link(srcId, srcPort, dstId, dstPort); if (type.equals(LinkType.MULTIHOP_LINK)) { addPortToSwitch(srcId, srcPort); addPortToSwitch(dstId, dstPort); addLinkToStructure(switchPortLinks, link); addLinkToStructure(portBroadcastDomainLinks, link); dtLinksUpdated = removeLinkFromStructure(directLinks, link); linksUpdated = true; } else if (type.equals(LinkType.DIRECT_LINK)) { addPortToSwitch(srcId, srcPort); addPortToSwitch(dstId, dstPort); addLinkToStructure(switchPortLinks, link); addLinkToStructure(directLinks, link); removeLinkFromStructure(portBroadcastDomainLinks, link); dtLinksUpdated = true; linksUpdated = true; } else if (type.equals(LinkType.TUNNEL)) { addOrUpdateTunnelLink(srcId, srcPort, dstId, dstPort); } } public void removeLink(Link link) { linksUpdated = true; dtLinksUpdated = removeLinkFromStructure(directLinks, link); removeLinkFromStructure(portBroadcastDomainLinks, link); removeLinkFromStructure(switchPortLinks, link); NodePortTuple srcNpt = new NodePortTuple(link.getSrc(), link.getSrcPort()); NodePortTuple dstNpt = new NodePortTuple(link.getDst(), link.getDstPort()); // Remove switch ports if there are no links through those switch ports if (switchPortLinks.get(srcNpt) == null) { if (switchPorts.get(srcNpt.getNodeId()) != null) switchPorts.get(srcNpt.getNodeId()).remove(srcNpt.getPortId()); } if (switchPortLinks.get(dstNpt) == null) { if (switchPorts.get(dstNpt.getNodeId()) != null) switchPorts.get(dstNpt.getNodeId()).remove(dstNpt.getPortId()); } // Remove the node if no ports are present if (switchPorts.get(srcNpt.getNodeId())!=null && switchPorts.get(srcNpt.getNodeId()).isEmpty()) { switchPorts.remove(srcNpt.getNodeId()); } if (switchPorts.get(dstNpt.getNodeId())!=null && switchPorts.get(dstNpt.getNodeId()).isEmpty()) { switchPorts.remove(dstNpt.getNodeId()); } } public void removeLink(long srcId, int srcPort, long dstId, int dstPort) { Link link = new Link(srcId, srcPort, dstId, dstPort); removeLink(link); } public void clear() { switchPorts.clear(); tunnelPorts.clear(); switchPortLinks.clear(); portBroadcastDomainLinks.clear(); directLinks.clear(); } /** * Clears the current topology. Note that this does NOT * send out updates. */ public void clearCurrentTopology() { this.clear(); linksUpdated = true; dtLinksUpdated = true; tunnelPortsUpdated = true; createNewInstance("startup"); lastUpdateTime = new Date(); } /** * Getters. No Setters. */ public Map<Long, Set<Integer>> getSwitchPorts() { return switchPorts; } public Map<NodePortTuple, Set<Link>> getSwitchPortLinks() { return switchPortLinks; } public Map<NodePortTuple, Set<Link>> getPortBroadcastDomainLinks() { return portBroadcastDomainLinks; } public TopologyInstance getCurrentInstance(boolean tunnelEnabled) { if (tunnelEnabled) return currentInstance; else return this.currentInstanceWithoutTunnels; } public TopologyInstance getCurrentInstance() { return this.getCurrentInstance(true); } /** * Switch methods */ @Override public Set<Integer> getPorts(long sw) { IOFSwitch iofSwitch = floodlightProvider.getSwitch(sw); if (iofSwitch == null) return Collections.emptySet(); Collection<Integer> ofpList = iofSwitch.getEnabledPortNumbers(); if (ofpList == null) return Collections.emptySet(); Set<Integer> ports = new HashSet<Integer>(ofpList); Set<Integer> qPorts = linkDiscovery.getQuarantinedPorts(sw); if (qPorts != null) ports.removeAll(qPorts); return ports; } }
apache-2.0
mdoering/backbone
life/Fungi/Ascomycota/Lecanoromycetes/Ostropales/Graphidaceae/Stegobolus/Stegobolus polillensis/README.md
265
# Stegobolus polillensis (Vain.) Frisch SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in in Frisch & Kalb, Biblthca Lichenol. 92: 476 (2006) #### Original name Thelotrema polillense Vain. ### Remarks null
apache-2.0
wildfly-swarm/wildfly-swarm-javadocs
2018.2.0/apidocs/org/wildfly/swarm/config/security/class-use/ElytronRealmConsumer.html
11624
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Thu Feb 08 09:04:08 MST 2018 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Interface org.wildfly.swarm.config.security.ElytronRealmConsumer (BOM: * : All 2018.2.0 API)</title> <meta name="date" content="2018-02-08"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.wildfly.swarm.config.security.ElytronRealmConsumer (BOM: * : All 2018.2.0 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/wildfly/swarm/config/security/ElytronRealmConsumer.html" title="interface in org.wildfly.swarm.config.security">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2018.2.0</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/security/class-use/ElytronRealmConsumer.html" target="_top">Frames</a></li> <li><a href="ElytronRealmConsumer.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface org.wildfly.swarm.config.security.ElytronRealmConsumer" class="title">Uses of Interface<br>org.wildfly.swarm.config.security.ElytronRealmConsumer</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../org/wildfly/swarm/config/security/ElytronRealmConsumer.html" title="interface in org.wildfly.swarm.config.security">ElytronRealmConsumer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config">org.wildfly.swarm.config</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config.security">org.wildfly.swarm.config.security</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.wildfly.swarm.config"> <!-- --> </a> <h3>Uses of <a href="../../../../../../org/wildfly/swarm/config/security/ElytronRealmConsumer.html" title="interface in org.wildfly.swarm.config.security">ElytronRealmConsumer</a> in <a href="../../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</a> with parameters of type <a href="../../../../../../org/wildfly/swarm/config/security/ElytronRealmConsumer.html" title="interface in org.wildfly.swarm.config.security">ElytronRealmConsumer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/wildfly/swarm/config/Security.html" title="type parameter in Security">T</a></code></td> <td class="colLast"><span class="typeNameLabel">Security.</span><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/Security.html#elytronRealm-java.lang.String-org.wildfly.swarm.config.security.ElytronRealmConsumer-">elytronRealm</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;childKey, <a href="../../../../../../org/wildfly/swarm/config/security/ElytronRealmConsumer.html" title="interface in org.wildfly.swarm.config.security">ElytronRealmConsumer</a>&nbsp;consumer)</code> <div class="block">Create and configure a ElytronRealm object to the list of subresources</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.wildfly.swarm.config.security"> <!-- --> </a> <h3>Uses of <a href="../../../../../../org/wildfly/swarm/config/security/ElytronRealmConsumer.html" title="interface in org.wildfly.swarm.config.security">ElytronRealmConsumer</a> in <a href="../../../../../../org/wildfly/swarm/config/security/package-summary.html">org.wildfly.swarm.config.security</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../org/wildfly/swarm/config/security/package-summary.html">org.wildfly.swarm.config.security</a> that return <a href="../../../../../../org/wildfly/swarm/config/security/ElytronRealmConsumer.html" title="interface in org.wildfly.swarm.config.security">ElytronRealmConsumer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>default <a href="../../../../../../org/wildfly/swarm/config/security/ElytronRealmConsumer.html" title="interface in org.wildfly.swarm.config.security">ElytronRealmConsumer</a>&lt;<a href="../../../../../../org/wildfly/swarm/config/security/ElytronRealmConsumer.html" title="type parameter in ElytronRealmConsumer">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">ElytronRealmConsumer.</span><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/security/ElytronRealmConsumer.html#andThen-org.wildfly.swarm.config.security.ElytronRealmConsumer-">andThen</a></span>(<a href="../../../../../../org/wildfly/swarm/config/security/ElytronRealmConsumer.html" title="interface in org.wildfly.swarm.config.security">ElytronRealmConsumer</a>&lt;<a href="../../../../../../org/wildfly/swarm/config/security/ElytronRealmConsumer.html" title="type parameter in ElytronRealmConsumer">T</a>&gt;&nbsp;after)</code>&nbsp;</td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../org/wildfly/swarm/config/security/package-summary.html">org.wildfly.swarm.config.security</a> with parameters of type <a href="../../../../../../org/wildfly/swarm/config/security/ElytronRealmConsumer.html" title="interface in org.wildfly.swarm.config.security">ElytronRealmConsumer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>default <a href="../../../../../../org/wildfly/swarm/config/security/ElytronRealmConsumer.html" title="interface in org.wildfly.swarm.config.security">ElytronRealmConsumer</a>&lt;<a href="../../../../../../org/wildfly/swarm/config/security/ElytronRealmConsumer.html" title="type parameter in ElytronRealmConsumer">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">ElytronRealmConsumer.</span><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/security/ElytronRealmConsumer.html#andThen-org.wildfly.swarm.config.security.ElytronRealmConsumer-">andThen</a></span>(<a href="../../../../../../org/wildfly/swarm/config/security/ElytronRealmConsumer.html" title="interface in org.wildfly.swarm.config.security">ElytronRealmConsumer</a>&lt;<a href="../../../../../../org/wildfly/swarm/config/security/ElytronRealmConsumer.html" title="type parameter in ElytronRealmConsumer">T</a>&gt;&nbsp;after)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/wildfly/swarm/config/security/ElytronRealmConsumer.html" title="interface in org.wildfly.swarm.config.security">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2018.2.0</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/security/class-use/ElytronRealmConsumer.html" target="_top">Frames</a></li> <li><a href="ElytronRealmConsumer.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2018 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
apache-2.0
wildfly-swarm/wildfly-swarm-javadocs
2.7.0.Final/apidocs/org/wildfly/swarm/config/undertow/configuration/package-tree.html
16188
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Wed Jun 10 13:52:57 MST 2020 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>org.wildfly.swarm.config.undertow.configuration Class Hierarchy (BOM: * : All 2.7.0.Final API)</title> <meta name="date" content="2020-06-10"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="org.wildfly.swarm.config.undertow.configuration Class Hierarchy (BOM: * : All 2.7.0.Final API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li class="navBarCell1Rev">Tree</li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.7.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/wildfly/swarm/config/undertow/application_security_domain/package-tree.html">Prev</a></li> <li><a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/mod_cluster/package-tree.html">Next</a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/undertow/configuration/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 class="title">Hierarchy For Package org.wildfly.swarm.config.undertow.configuration</h1> <span class="packageHierarchyLabel">Package Hierarchies:</span> <ul class="horizontal"> <li><a href="../../../../../../overview-tree.html">All Packages</a></li> </ul> </div> <div class="contentContainer"> <h2 title="Class Hierarchy">Class Hierarchy</h2> <ul> <li type="circle">java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><span class="typeNameLink">Object</span></a> <ul> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/CustomFilter.html" title="class in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">CustomFilter</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPage.html" title="class in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">ErrorPage</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ExpressionFilter.html" title="class in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">ExpressionFilter</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/File.html" title="class in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">File</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/Gzip.html" title="class in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">Gzip</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ModCluster.html" title="class in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">ModCluster</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ModCluster.ModClusterResources.html" title="class in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">ModCluster.ModClusterResources</span></a></li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/RequestLimit.html" title="class in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">RequestLimit</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ResponseHeader.html" title="class in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">ResponseHeader</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ReverseProxy.html" title="class in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">ReverseProxy</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ReverseProxy.ReverseProxyResources.html" title="class in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">ReverseProxy.ReverseProxyResources</span></a></li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/Rewrite.html" title="class in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">Rewrite</span></a>&lt;T&gt;</li> </ul> </li> </ul> <h2 title="Interface Hierarchy">Interface Hierarchy</h2> <ul> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/CustomFilterConsumer.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">CustomFilterConsumer</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/CustomFilterSupplier.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">CustomFilterSupplier</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPageConsumer.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">ErrorPageConsumer</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPageSupplier.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">ErrorPageSupplier</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ExpressionFilterConsumer.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">ExpressionFilterConsumer</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ExpressionFilterSupplier.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">ExpressionFilterSupplier</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/FileConsumer.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">FileConsumer</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/FileSupplier.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">FileSupplier</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/GzipConsumer.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">GzipConsumer</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/GzipSupplier.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">GzipSupplier</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ModClusterConsumer.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">ModClusterConsumer</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ModClusterSupplier.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">ModClusterSupplier</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/RequestLimitConsumer.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">RequestLimitConsumer</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/RequestLimitSupplier.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">RequestLimitSupplier</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ResponseHeaderConsumer.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">ResponseHeaderConsumer</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ResponseHeaderSupplier.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">ResponseHeaderSupplier</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ReverseProxyConsumer.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">ReverseProxyConsumer</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ReverseProxySupplier.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">ReverseProxySupplier</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/RewriteConsumer.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">RewriteConsumer</span></a>&lt;T&gt;</li> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/RewriteSupplier.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">RewriteSupplier</span></a>&lt;T&gt;</li> </ul> <h2 title="Enum Hierarchy">Enum Hierarchy</h2> <ul> <li type="circle">java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><span class="typeNameLink">Object</span></a> <ul> <li type="circle">java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang"><span class="typeNameLink">Enum</span></a>&lt;E&gt; (implements java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;T&gt;, java.io.<a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>) <ul> <li type="circle">org.wildfly.swarm.config.undertow.configuration.<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ModCluster.FailoverStrategy.html" title="enum in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">ModCluster.FailoverStrategy</span></a></li> </ul> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li class="navBarCell1Rev">Tree</li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.7.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/wildfly/swarm/config/undertow/application_security_domain/package-tree.html">Prev</a></li> <li><a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/mod_cluster/package-tree.html">Next</a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/undertow/configuration/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2020 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
apache-2.0
DavidMoore/Foundation
Code/Foundation/StateMachine/ValueStateTransition.cs
759
namespace Foundation.StateMachine { public class ValueStateTransition<TStateType, TInputType> : StateTransition<TStateType, TInputType> { public ValueStateTransition(TStateType fromState, TStateType toState, TInputType input) { FromState = fromState; ToState = toState; InputValue = input; InputValidator = ValidateInput; } bool ValidateInput(TInputType value) { return value != null && value.Equals(InputValue); } /// <summary> /// Gets or sets the valid input for this transition. /// </summary> /// <value>The input.</value> public TInputType InputValue { get; set; } } }
apache-2.0
germanosk/machampgate
README.md
100
# Machamp Giveaway Tool Enhanced (machampgate) Is a tool to help pokemon's giveaways on Reddit
apache-2.0
otto-de/jellyfish
app/static/css/footer_day.css
688
footer { background-color: #eee; border-top: 4px solid #ddd; color: #777; font-size: 14px; display: block; } footer .subFooter { color: #777777; font-size: 12px; padding: 12px 0; background-color: #e5e5e5; border-top: 1px solid #ddd; } .list-unstyled { padding-left: 0; list-style: none; } footer ul { margin: 0; } footer h4 { border-bottom: 1px dotted #bbb; font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 18px; font-weight: 400; margin: 0 0 10px; padding-bottom: 10px; } .footerWrap { padding: 20px; } .label-unflashy { background-color: none; color: gray; }
apache-2.0
Esri/arcgis-runtime-samples-android
java/authenticate-with-oauth/src/main/java/com/esri/arcgisruntime/sample/authenticatewithoauth/MainActivity.java
3517
/* * Copyright 2019 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.esri.arcgisruntime.sample.authenticatewithoauth; import java.net.MalformedURLException; import android.os.Bundle; import android.util.Log; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; import com.esri.arcgisruntime.mapping.ArcGISMap; import com.esri.arcgisruntime.mapping.view.MapView; import com.esri.arcgisruntime.portal.Portal; import com.esri.arcgisruntime.portal.PortalItem; import com.esri.arcgisruntime.security.AuthenticationManager; import com.esri.arcgisruntime.security.DefaultAuthenticationChallengeHandler; import com.esri.arcgisruntime.security.OAuthConfiguration; public class MainActivity extends AppCompatActivity { private static final String TAG = MainActivity.class.getSimpleName(); private MapView mMapView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // get a reference to the map view mMapView = findViewById(R.id.mapView); try { // set up an oauth config with url to portal, a client id and a re-direct url // a custom client id for your app can be set on the ArcGIS for Developers dashboard under // Authentication --> Redirect URIs OAuthConfiguration oAuthConfiguration = new OAuthConfiguration(getString(R.string.portal_url), getString(R.string.oauth_client_id), getString(R.string.oauth_redirect_uri) + "://" + getString(R.string.oauth_redirect_host)); // setup AuthenticationManager to handle auth challenges DefaultAuthenticationChallengeHandler defaultAuthenticationChallengeHandler = new DefaultAuthenticationChallengeHandler( this); // use the DefaultChallengeHandler to handle authentication challenges AuthenticationManager.setAuthenticationChallengeHandler(defaultAuthenticationChallengeHandler); // add an OAuth configuration // NOTE: you must add the DefaultOAuthIntentReceiver Activity to the app's manifest to handle starting a browser AuthenticationManager.addOAuthConfiguration(oAuthConfiguration); // load the portal and add the portal item as a map to the map view Portal portal = new Portal(getString(R.string.portal_url)); PortalItem portalItem = new PortalItem(portal, getString(R.string.webmap_world_traffic_id)); ArcGISMap map = new ArcGISMap(portalItem); mMapView.setMap(map); } catch (MalformedURLException e) { String error = "Error in OAuthConfiguration URL: " + e.getMessage(); Log.e(TAG, error); Toast.makeText(this, error, Toast.LENGTH_LONG).show(); } } @Override protected void onResume() { super.onResume(); mMapView.resume(); } @Override protected void onPause() { mMapView.pause(); super.onPause(); } @Override protected void onDestroy() { mMapView.dispose(); super.onDestroy(); } }
apache-2.0
CognizantQAHub/Cognizant-Intelligent-Test-Scripter
QcConnection/src/main/java/com/cognizant/cognizantits/qcconnection/qcupdation/IHierarchySupportList.java
456
package com.cognizant.cognizantits.qcconnection.qcupdation; import com4j.DISPID; import com4j.IID; import com4j.VTID; @IID("{DDE517F0-AF73-4327-A1BD-403E6A047B0A}") public abstract interface IHierarchySupportList extends IFactoryList { @DISPID(12) @VTID(19) public abstract boolean isInFilter(int paramInt); } /* Location: D:\Prabu\jars\QC.jar * Qualified Name: qcupdation.IHierarchySupportList * JD-Core Version: 0.7.0.1 */
apache-2.0
nghiant2710/base-images
balena-base-images/dotnet/amd64/debian/bullseye/5.0-sdk/run/Dockerfile
2953
# AUTOGENERATED FILE FROM balenalib/amd64-debian:bullseye-run RUN apt-get update \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ \ # .NET Core dependencies libc6 \ libgcc1 \ libgssapi-krb5-2 \ libicu63 \ libssl1.1 \ libstdc++6 \ zlib1g \ && rm -rf /var/lib/apt/lists/* # Configure web servers to bind to port 80 when present ENV ASPNETCORE_URLS=http://+:80 \ # Enable detection of running in a container DOTNET_RUNNING_IN_CONTAINER=true # Install .NET Core SDK ENV DOTNET_SDK_VERSION 5.0.103 RUN curl -SL --output dotnet.tar.gz "https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz" \ && dotnet_sha512='bf452dbdaec7a82835cfc7c698d2558e7ac4b092e7ef35092796ba5440eb45dd880e86c1e61f8e170ac4eb813240cf83f9fc2e342dfa8b37e45afdf5cd82fb8e' \ && echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \ && mkdir -p /usr/share/dotnet \ && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \ && rm dotnet.tar.gz \ && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet # Configure web servers to bind to port 80 when present # Enable correct mode for dotnet watch (only mode supported in a container) ENV DOTNET_USE_POLLING_FILE_WATCHER=true \ # Skip extraction of XML docs - generally not useful within an image/container - helps performance NUGET_XMLDOC_MODE=skip # Trigger first run experience by running arbitrary cmd to populate local package cache RUN dotnet help CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/[email protected]" \ && echo "Running test-stack@dotnet" \ && chmod +x [email protected] \ && bash [email protected] \ && rm -rf [email protected] RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: Intel 64-bit (x86-64) \nOS: Debian Bullseye \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \ndotnet 5.0-sdk \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
apache-2.0
mhurne/aws-sdk-java
aws-java-sdk-waf/src/main/java/com/amazonaws/services/waf/model/transform/DeleteIPSetRequestMarshaller.java
3111
/* * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights * Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.waf.model.transform; import java.io.ByteArrayInputStream; import java.util.Collections; import java.util.Map; import java.util.List; import java.util.regex.Pattern; import com.amazonaws.AmazonClientException; import com.amazonaws.Request; import com.amazonaws.DefaultRequest; import com.amazonaws.http.HttpMethodName; import com.amazonaws.services.waf.model.*; import com.amazonaws.transform.Marshaller; import com.amazonaws.util.BinaryUtils; import com.amazonaws.util.StringUtils; import com.amazonaws.util.IdempotentUtils; import com.amazonaws.util.StringInputStream; import com.amazonaws.util.json.*; /** * DeleteIPSetRequest Marshaller */ public class DeleteIPSetRequestMarshaller implements Marshaller<Request<DeleteIPSetRequest>, DeleteIPSetRequest> { public Request<DeleteIPSetRequest> marshall( DeleteIPSetRequest deleteIPSetRequest) { if (deleteIPSetRequest == null) { throw new AmazonClientException( "Invalid argument passed to marshall(...)"); } Request<DeleteIPSetRequest> request = new DefaultRequest<DeleteIPSetRequest>( deleteIPSetRequest, "AWSWAF"); request.addHeader("X-Amz-Target", "AWSWAF_20150824.DeleteIPSet"); request.setHttpMethod(HttpMethodName.POST); request.setResourcePath(""); try { final StructuredJsonGenerator jsonGenerator = SdkJsonProtocolFactory .createWriter(false, "1.1"); jsonGenerator.writeStartObject(); if (deleteIPSetRequest.getIPSetId() != null) { jsonGenerator.writeFieldName("IPSetId").writeValue( deleteIPSetRequest.getIPSetId()); } if (deleteIPSetRequest.getChangeToken() != null) { jsonGenerator.writeFieldName("ChangeToken").writeValue( deleteIPSetRequest.getChangeToken()); } jsonGenerator.writeEndObject(); byte[] content = jsonGenerator.getBytes(); request.setContent(new ByteArrayInputStream(content)); request.addHeader("Content-Length", Integer.toString(content.length)); request.addHeader("Content-Type", jsonGenerator.getContentType()); } catch (Throwable t) { throw new AmazonClientException( "Unable to marshall request to JSON: " + t.getMessage(), t); } return request; } }
apache-2.0
Adeptions/CLArguments
src/main/java/com/adeptions/clarguments/validators/DisallowMultiplesValueValidator.java
893
package com.adeptions.clarguments.validators; import com.adeptions.clarguments.ArgumentName; import com.adeptions.clarguments.BadArgumentException; import com.adeptions.clarguments.arguments.Argument; import static com.adeptions.clarguments.PredefinedBadArgumentReasons.MULTIPLE_ARGUMENT_NOT_ALLOWED; public class DisallowMultiplesValueValidator implements ArgumentValueValidator { /** * {@inheritDoc} */ @Override public Object validate(int tokenPosition, Object value, Argument argument, ArgumentName specifiedArgumentName) throws BadArgumentException { if (argument.wasSeen()) { throw new BadArgumentException(MULTIPLE_ARGUMENT_NOT_ALLOWED, tokenPosition, "Argument '" + specifiedArgumentName.getDisplayName() + "' cannot be specified more than once", argument, specifiedArgumentName); } return value; } }
apache-2.0
H-Hoffmann/Term_Project_Simulation
README.md
4708
## Readme for Term_Project_Simulation ## Introduction This is a project to pass the computer science exam of the University of Applied Sciences "TH-Bingen", where we have to simulate some further programming tasks using Kotlin and IntelliJ IDEA, Git and GitHub, as well as Maven and Travis. The Project started on July 30th, 20017 and has to be finished on August 13th, 2017. The lecturer of the computer science module and the creator of this by now legendary term project is Nicolai Parlog. The Members of this project are (real name / GitHub user name): - Steffen Konrad / SteffenKonrad - Florian Kirch / flowsen39 - Hendrik Hoffmann / H-Hoffmann As this is an public project on GitHub, we decide to add a [license](https://github.com/SteffenKonrad/Term_Project_Simulation/blob/master/License.md) as well as a [code of conduct](https://github.com/SteffenKonrad/Term_Project_Simulation/blob/master/CodeOfConduct.md), so that everyone knows the rules and how to behave. We want everyone participating in this project to treat everyone else respectful and correctly. The Project is divided into four parts with multiple tasks, which we have to go through and solve all the tasks. Below we will list the parts and a short description of each. ## Part 1: Project Infrastucture The first part of this project is all about basic infrastructure, like choosing a language for comments and conversation on GitHub and for the Readme. We choosed German for the conversation and the comments and English for the Readme, which is also a task of this infrastructure part. We also have to pick a code of conduct and a license, that we wan´t to add to our project and to the readme. The next tasks now include some programming, by using Kotlin and IntelliJ to create a project that contains a simple "HelloWorld.kt" class with a main method printing "Hello, World." It should successfully buil a JAR (Java ARchive), so that Maven and Travis can deal with it. By extending "pom.xml" and a writing a small HelloWorldTest, we finish the first part of the project and can release version 1.0. ## Part 2: Create a simple traffic simulation After everything is set up, we go on to the second part of the project where we have to create a traffic simulation. It contains several individual cars and a single road network. Each car announces whether it wants to drive or not and the network should recognize and tally the number of driving cars and compare it to its own capacity. Based on how many cars are in the road compared to this capacity, the network should decide if a car drives or is delayed due to traffic jams. Our task is to write a scenario function with about a dozen cars and to keep them track of wether they can drive or were delayed. This information shall be printed at the end of the simulation. To write a main programm, which uses Univocitx Parsers to parse input and to write the resulting data as CSV is the next step of this part. Last but not least we have to extend this README by writing a user documentation, explaining users how to use the program. After all this is finished, we are able to release version 2.0. ## Part 3: Extend simulation to cover an entire day In this part, we have to extend the simulation by covering an entire day by simulating 24 steps in a row. Also, we randomize the decision for wether each individual car can drive or gets delayed by including some parameters. The result tracking has to be extended, so that each car knows for every step whether it could drive or was delayed. After fullfilling this, we update the scenario function to the simulation´s new requirements. As a last step we extend the CSV input/ output to match the new requirements and results and we update the user documentation to match the new program behavior. Release of version 3.0. ## Part 4: Extend Simulation with various participants In this last part we have to extend the simulation even more, by creating a suitable interface, of which the car is one implementation and adding implementation for other vehicles like trucks or bikes. Then, each kind of traffic participant is assigned some specific parameters like the chance for a delay and how they "load" the road networks capacity. After extending the CSV input to allow defining different participants and updating the user documentation we can release version 4.0. ## Use of the currently published version Visit the release page of our project at the following link: https://github.com/SteffenKonrad/Term_Project_Simulation/releases Download the latest release, the .jar file is located in the downloaded folder. Now any console can be used, here the following command is executed: java -jar "Path To file".
apache-2.0
Sellegit/j2objc
runtime/src/main/java/apple/mapkit/MKOverlayLevel.java
769
package apple.mapkit; import java.io.*; import java.nio.*; import java.util.*; import com.google.j2objc.annotations.*; import com.google.j2objc.runtime.*; import com.google.j2objc.runtime.block.*; import apple.audiotoolbox.*; import apple.corefoundation.*; import apple.coregraphics.*; import apple.coreservices.*; import apple.foundation.*; import apple.corelocation.*; import apple.uikit.*; import apple.dispatch.*; /** * @since Available in iOS 7.0 and later. */ @Library("MapKit/MapKit.h") @Mapping("MKOverlayLevel") public final class MKOverlayLevel extends ObjCEnum { @GlobalConstant("MKOverlayLevelAboveRoads") public static final long Roads = 0L; @GlobalConstant("MKOverlayLevelAboveLabels") public static final long Labels = 1L; }
apache-2.0
BIDS-projects/aggregator
bidsaggregator/utils/config.py
209
""" Configuration file for database connections """ class MySQLConfig: """configuration for MySQL""" username = 'root' password = 'root' host = 'localhost' database = 'ecosystem_mapping'
apache-2.0
FasterXML/jackson-jr
docs/javadoc/jr-all/2.9/com/fasterxml/jackson/jr/type/class-use/TypeResolver.html
6677
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_79) on Sat Jul 29 21:10:44 PDT 2017 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Class com.fasterxml.jackson.jr.type.TypeResolver (jackson-jr-all 2.9.0 API)</title> <meta name="date" content="2017-07-29"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class com.fasterxml.jackson.jr.type.TypeResolver (jackson-jr-all 2.9.0 API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../com/fasterxml/jackson/jr/type/TypeResolver.html" title="class in com.fasterxml.jackson.jr.type">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?com/fasterxml/jackson/jr/type/class-use/TypeResolver.html" target="_top">Frames</a></li> <li><a href="TypeResolver.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class com.fasterxml.jackson.jr.type.TypeResolver" class="title">Uses of Class<br>com.fasterxml.jackson.jr.type.TypeResolver</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../com/fasterxml/jackson/jr/type/TypeResolver.html" title="class in com.fasterxml.jackson.jr.type">TypeResolver</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#com.fasterxml.jackson.jr.ob.impl">com.fasterxml.jackson.jr.ob.impl</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="com.fasterxml.jackson.jr.ob.impl"> <!-- --> </a> <h3>Uses of <a href="../../../../../../com/fasterxml/jackson/jr/type/TypeResolver.html" title="class in com.fasterxml.jackson.jr.type">TypeResolver</a> in <a href="../../../../../../com/fasterxml/jackson/jr/ob/impl/package-summary.html">com.fasterxml.jackson.jr.ob.impl</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation"> <caption><span>Fields in <a href="../../../../../../com/fasterxml/jackson/jr/ob/impl/package-summary.html">com.fasterxml.jackson.jr.ob.impl</a> declared as <a href="../../../../../../com/fasterxml/jackson/jr/type/TypeResolver.html" title="class in com.fasterxml.jackson.jr.type">TypeResolver</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>protected <a href="../../../../../../com/fasterxml/jackson/jr/type/TypeResolver.html" title="class in com.fasterxml.jackson.jr.type">TypeResolver</a></code></td> <td class="colLast"><span class="strong">TypeDetector.</span><code><strong><a href="../../../../../../com/fasterxml/jackson/jr/ob/impl/TypeDetector.html#_typeResolver">_typeResolver</a></strong></code> <div class="block">For generic containers (Collections, Maps, arrays), we may need this guy.</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../com/fasterxml/jackson/jr/type/TypeResolver.html" title="class in com.fasterxml.jackson.jr.type">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?com/fasterxml/jackson/jr/type/class-use/TypeResolver.html" target="_top">Frames</a></li> <li><a href="TypeResolver.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2017 <a href="http://fasterxml.com/">FasterXML</a>. All rights reserved.</small></p> </body> </html>
apache-2.0
kinetichorizons/Devotions
Kinetic Horizons/www/dev/03/23.html
4892
<html> <head> <meta http-equiv=Content-Type content="text/html; charset=windows-1252"> <meta name=Generator content="Microsoft Word 15 (filtered)"> <style> <!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4;} @font-face {font-family:"Century Gothic"; panose-1:2 11 5 2 2 2 2 2 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin-top:0in; margin-right:0in; margin-bottom:13.5pt; margin-left:.5pt; text-indent:-.5pt; line-height:103%; font-size:11.5pt; font-family:"Century Gothic",sans-serif; color:black;} h1 {mso-style-link:"Heading 1 Char"; margin-top:0in; margin-right:0in; margin-bottom:0in; margin-left:1.9pt; margin-bottom:.0001pt; text-align:center;font-size:10.0pt; line-height:107%; page-break-after:avoid; font-size:20.0pt; font-family:"Century Gothic",sans-serif; color:black; font-weight:normal;} span.Heading1Char {mso-style-name:"Heading 1 Char"; mso-style-link:"Heading 1"; font-family:"Century Gothic",sans-serif; color:black;} .MsoChpDefault {font-family:"Calibri",sans-serif;} .MsoPapDefault {margin-bottom:8.0pt; line-height:107%;} @page WordSection1 {size:8.5in 11.0in; margin:1.0in 59.35pt 1.0in .8in;} div.WordSection1 {page:WordSection1;} --> </style> </head> <body lang=EN-US> <div class=WordSection1> <p class=MsoNormal style='margin-top:0in;margin-right:0in;margin-bottom:23.9pt; margin-left:0in;text-indent:0in;line-height:107%'><span style='font-size:11.0pt; line-height:107%'>March 23</span></p> <h1>Coming Together<span style='font-size:12.0pt;line-height:107%'></span></h1> <p class=MsoNormal align=center style='margin-top:0in;margin-right:1.85pt; margin-bottom:0in;margin-left:2.35pt;margin-bottom:.0001pt;text-align:center;font-size:10.0pt; line-height:104%'>Till we all come in the unity of the faith, and of the knowledge of the Son of God, unto a perfect man, unto the measure of the stature of the fulness of Christ.</p> <p class=MsoNormal align=center style='margin-top:0in;margin-right:0in; margin-bottom:13.35pt;margin-left:2.35pt;text-align:center;font-size:10.0pt;line-height:104%'>Ephesians 4:13</p> <p class=MsoNormal style='margin-left:-.25pt'>If you know how to listen to the voice of God, you can hear Him calling throughout the Body of Christ today. He is calling for unity. He is calling us to lay down our disagreements and come together in preparation for Jesus' return.</p> <p class=MsoNormal style='margin-left:-.25pt'>Just the thought of that scares some believers. &quot;How can I unify with someone from another denomination?&quot; they say. &quot;I'm not going to give up my doctrines and agree with theirs just for unity's sake!&quot;</p> <p class=MsoNormal style='margin-left:-.25pt'>What they don't realize is this: scriptural unity isn't based on doctrine.</p> <p class=MsoNormal style='margin-left:-.25pt'>Winds of doctrine, according to Ephesians 4:14, are childish. Winds of doctrine don't unify. They divide and blow people in every direction. The Word doesn't say anything about us coming into the unity of our doctrines. It says we'll come into the unity of the faith.</p> <p class=MsoNormal style='margin-left:-.25pt'>In the past, we've failed to understand that and tried to demand doctrinal unity from each other anyway.</p> <p class=MsoNormal style='margin-left:-.25pt'>&quot;If you don't agree with me on the issue of tongues,&quot; we've said, &quot;or on the timing of the rapture...or on the proper depth for baptismal waters, I won't accept you as a brother in the Lord. I'll break fellowship with you.</p> <p class=MsoNormal style='margin-left:-.25pt'>But that's not God's way of doing things. He doesn't have a long list of doctrinal demands for us to meet. His requirements are simple. First John 3:23 tells us what they are: to believe on the Name of His Son, Jesus Christ, and love one another.</p> <p class=MsoNormal style='margin-left:-.25pt'>Once you and I come to a place where we keep those requirements and quit worrying about the rest, we'll be able to forget our denominational squabbles and come together in the unity of faith. We'll grow so strong together that the winds of doctrine won't be able to drive us apart.</p> <p class=MsoNormal style='margin-left:-.25pt'>When that happens, the devil's going to panic because the unity of the faith of God's people is a staggering thing. It's the most unlimited, powerful thing on earth.</p> <p class=MsoNormal style='margin-left:-.25pt'>Right now all over the world, the Spirit is calling the Church of the living God to unite. Hear Him and obey, and you can be a part of one of the most magnificent moves of God this world has ever seen.</p> <p class=MsoNormal style='margin-left:-.25pt'><b>Scripture Reading:</b> Psalms 132:13-18; 133<span style='font-size:10.0pt;line-height:103%'></span></p> </div> </body> </html>
apache-2.0
haensel-ams/snowplow
4-storage/storage-loader/lib/snowplow-storage-loader.rb
1676
# Copyright (c) 2012-2015 Snowplow Analytics Ltd. All rights reserved. # # This program is licensed to you under the Apache License Version 2.0, # and you may not use this file except in compliance with the Apache License Version 2.0. # You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0. # # Unless required by applicable law or agreed to in writing, # software distributed under the Apache License Version 2.0 is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the Apache License Version 2.0 for the specific language governing permissions and limitations there under. # Author:: Alex Dean (mailto:[email protected]) # Copyright:: Copyright (c) 2012-2015 Snowplow Analytics Ltd # License:: Apache License Version 2.0 # Ruby 1.9.2 onwards doesn't add . into $LOAD_PATH by default - use require_relative instead require_relative 'snowplow-storage-loader/snowplow' require_relative 'snowplow-storage-loader/errors' require_relative 'snowplow-storage-loader/contracts' require_relative 'snowplow-storage-loader/config' require_relative 'snowplow-storage-loader/file_tasks' require_relative 'snowplow-storage-loader/s3_tasks' require_relative 'snowplow-storage-loader/postgres_loader' require_relative 'snowplow-storage-loader/shredded_type' require_relative 'snowplow-storage-loader/redshift_loader' require_relative 'snowplow-storage-loader/sanitization' require_relative 'snowplow-storage-loader/mongo_loader' module Snowplow module StorageLoader NAME = "snowplow-storage-loader" VERSION = "0.11.0-rc5" end end
apache-2.0
cedral/aws-sdk-cpp
aws-cpp-sdk-robomaker/source/model/RobotSoftwareSuite.cpp
2203
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include <aws/robomaker/model/RobotSoftwareSuite.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace RoboMaker { namespace Model { RobotSoftwareSuite::RobotSoftwareSuite() : m_name(RobotSoftwareSuiteType::NOT_SET), m_nameHasBeenSet(false), m_version(RobotSoftwareSuiteVersionType::NOT_SET), m_versionHasBeenSet(false) { } RobotSoftwareSuite::RobotSoftwareSuite(JsonView jsonValue) : m_name(RobotSoftwareSuiteType::NOT_SET), m_nameHasBeenSet(false), m_version(RobotSoftwareSuiteVersionType::NOT_SET), m_versionHasBeenSet(false) { *this = jsonValue; } RobotSoftwareSuite& RobotSoftwareSuite::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("name")) { m_name = RobotSoftwareSuiteTypeMapper::GetRobotSoftwareSuiteTypeForName(jsonValue.GetString("name")); m_nameHasBeenSet = true; } if(jsonValue.ValueExists("version")) { m_version = RobotSoftwareSuiteVersionTypeMapper::GetRobotSoftwareSuiteVersionTypeForName(jsonValue.GetString("version")); m_versionHasBeenSet = true; } return *this; } JsonValue RobotSoftwareSuite::Jsonize() const { JsonValue payload; if(m_nameHasBeenSet) { payload.WithString("name", RobotSoftwareSuiteTypeMapper::GetNameForRobotSoftwareSuiteType(m_name)); } if(m_versionHasBeenSet) { payload.WithString("version", RobotSoftwareSuiteVersionTypeMapper::GetNameForRobotSoftwareSuiteVersionType(m_version)); } return payload; } } // namespace Model } // namespace RoboMaker } // namespace Aws
apache-2.0
play2-maven-plugin/play2-maven-plugin.github.io
play2-maven-plugin/1.0.0-alpha8/play2-providers/play2-provider-play21/dependency-info.html
9271
<!DOCTYPE html> <!-- | Generated by Apache Maven Doxia at 2014-08-25 | Rendered using Apache Maven Fluido Skin 1.3.1 --> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="Date-Revision-yyyymmdd" content="20140825" /> <meta http-equiv="Content-Language" content="en" /> <title>Play! 2.x Provider for Play! 2.1.x &#x2013; Dependency Information</title> <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.1.min.css" /> <link rel="stylesheet" href="./css/site.css" /> <link rel="stylesheet" href="./css/print.css" media="print" /> <script type="text/javascript" src="./js/apache-maven-fluido-1.3.1.min.js"></script> <link rel="stylesheet" type="text/css" href="./css/site.css"/> </head> <body class="topBarDisabled"> <div class="container-fluid"> <div id="banner"> <div class="pull-left"> <div id="bannerLeft"> <h2>Play! 2.x Provider for Play! 2.1.x</h2> </div> </div> <div class="pull-right"> </div> <div class="clear"><hr/></div> </div> <div id="breadcrumbs"> <ul class="breadcrumb"> <li id="publishDate">Last Published: 2014-08-25 <span class="divider">|</span> </li> <li id="projectVersion">Version: 1.0.0-alpha8 </li> </ul> </div> <div class="row-fluid"> <div id="leftColumn" class="span3"> <div class="well sidebar-nav"> <ul class="nav nav-list"> <li class="nav-header">Parent Project</li> <li> <a href="../index.html" title="Play! 2.x Providers"> <i class="none"></i> Play! 2.x Providers</a> </li> <li class="nav-header">Overview</li> <li> <a href="index.html" title="Introduction"> <i class="none"></i> Introduction</a> </li> <li> <a href="apidocs/index.html" title="JavaDocs"> <i class="none"></i> JavaDocs</a> </li> <li class="nav-header">Project Documentation</li> <li> <a href="project-info.html" title="Project Information"> <i class="icon-chevron-down"></i> Project Information</a> <ul class="nav nav-list"> <li> <a href="index.html" title="About"> <i class="none"></i> About</a> </li> <li> <a href="plugin-management.html" title="Plugin Management"> <i class="none"></i> Plugin Management</a> </li> <li> <a href="distribution-management.html" title="Distribution Management"> <i class="none"></i> Distribution Management</a> </li> <li class="active"> <a href="#"><i class="none"></i>Dependency Information</a> </li> <li> <a href="source-repository.html" title="Source Repository"> <i class="none"></i> Source Repository</a> </li> <li> <a href="mail-lists.html" title="Mailing Lists"> <i class="none"></i> Mailing Lists</a> </li> <li> <a href="issue-tracking.html" title="Issue Tracking"> <i class="none"></i> Issue Tracking</a> </li> <li> <a href="integration.html" title="Continuous Integration"> <i class="none"></i> Continuous Integration</a> </li> <li> <a href="plugins.html" title="Project Plugins"> <i class="none"></i> Project Plugins</a> </li> <li> <a href="license.html" title="Project License"> <i class="none"></i> Project License</a> </li> <li> <a href="team-list.html" title="Project Team"> <i class="none"></i> Project Team</a> </li> <li> <a href="project-summary.html" title="Project Summary"> <i class="none"></i> Project Summary</a> </li> <li> <a href="dependencies.html" title="Dependencies"> <i class="none"></i> Dependencies</a> </li> </ul> </li> <li> <a href="project-reports.html" title="Project Reports"> <i class="icon-chevron-right"></i> Project Reports</a> </li> </ul> <hr /> <div id="poweredBy"> <div class="clear"></div> <div class="clear"></div> <div class="clear"></div> <div class="clear"></div> <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"> <img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /> </a> </div> </div> </div> <div id="bodyColumn" class="span9" > <div class="section"> <h2><a name="Dependency_Information"></a>Dependency Information</h2><a name="Dependency_Information"></a> <div class="section"> <h3><a name="Apache_Maven"></a>Apache Maven</h3><a name="Apache_Maven"></a> <div class="source"> <pre>&lt;dependency&gt; &lt;groupId&gt;com.google.code.play2-maven-plugin&lt;/groupId&gt; &lt;artifactId&gt;play2-provider-play21&lt;/artifactId&gt; &lt;version&gt;1.0.0-alpha8&lt;/version&gt; &lt;/dependency&gt;</pre></div></div> <div class="section"> <h3><a name="Apache_Buildr"></a>Apache Buildr</h3><a name="Apache_Buildr"></a> <div class="source"> <pre>'com.google.code.play2-maven-plugin:play2-provider-play21:jar:1.0.0-alpha8'</pre></div></div> <div class="section"> <h3><a name="Apache_Ant"></a>Apache Ant</h3><a name="Apache_Ant"></a> <div class="source"> <pre>&lt;dependency org=&quot;com.google.code.play2-maven-plugin&quot; name=&quot;play2-provider-play21&quot; rev=&quot;1.0.0-alpha8&quot;&gt; &lt;artifact name=&quot;play2-provider-play21&quot; type=&quot;jar&quot; /&gt; &lt;/dependency&gt;</pre></div></div> <div class="section"> <h3><a name="Groovy_Grape"></a>Groovy Grape</h3><a name="Groovy_Grape"></a> <div class="source"> <pre>@Grapes( @Grab(group='com.google.code.play2-maven-plugin', module='play2-provider-play21', version='1.0.0-alpha8') )</pre></div></div> <div class="section"> <h3><a name="Grails"></a>Grails</h3><a name="Grails"></a> <div class="source"> <pre>compile 'com.google.code.play2-maven-plugin:play2-provider-play21:1.0.0-alpha8'</pre></div></div> <div class="section"> <h3><a name="Leiningen"></a>Leiningen</h3><a name="Leiningen"></a> <div class="source"> <pre>[com.google.code.play2-maven-plugin/play2-provider-play21 &quot;1.0.0-alpha8&quot;]</pre></div></div> <div class="section"> <h3><a name="SBT"></a>SBT</h3><a name="SBT"></a> <div class="source"> <pre>libraryDependencies += &quot;com.google.code.play2-maven-plugin&quot; %% &quot;play2-provider-play21&quot; % &quot;1.0.0-alpha8&quot;</pre></div></div></div> </div> </div> </div> <hr/> <footer> <div class="container-fluid"> <div class="row-fluid"> <p >Copyright &copy; 2013&#x2013;2014. All rights reserved. </p> </div> </div> </footer> </body> </html>
apache-2.0
lstav/accumulo
server/tserver/src/test/java/org/apache/accumulo/tserver/compaction/strategies/ConfigurableCompactionStrategyTest.java
3721
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.accumulo.tserver.compaction.strategies; import static org.apache.accumulo.tserver.compaction.DefaultCompactionStrategyTest.getServerContext; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import java.util.HashMap; import java.util.Map; import org.apache.accumulo.core.compaction.CompactionSettings; import org.apache.accumulo.core.conf.ConfigurationTypeHelper; import org.apache.accumulo.core.data.TableId; import org.apache.accumulo.core.dataImpl.KeyExtent; import org.apache.accumulo.core.metadata.schema.DataFileValue; import org.apache.accumulo.server.fs.FileRef; import org.apache.accumulo.tserver.compaction.CompactionPlan; import org.apache.accumulo.tserver.compaction.MajorCompactionReason; import org.apache.accumulo.tserver.compaction.MajorCompactionRequest; import org.junit.Test; public class ConfigurableCompactionStrategyTest { // file selection options are adequately tested by ShellServerIT @Test public void testOutputOptions() { MajorCompactionRequest mcr = new MajorCompactionRequest(new KeyExtent(TableId.of("1"), null, null), MajorCompactionReason.USER, null, getServerContext()); Map<FileRef,DataFileValue> files = new HashMap<>(); files.put(new FileRef("hdfs://nn1/accumulo/tables/1/t-009/F00001.rf"), new DataFileValue(50000, 400)); mcr.setFiles(files); // test setting no output options ConfigurableCompactionStrategy ccs = new ConfigurableCompactionStrategy(); Map<String,String> opts = new HashMap<>(); ccs.init(opts); CompactionPlan plan = ccs.getCompactionPlan(mcr); assertEquals(0, plan.writeParameters.getBlockSize()); assertEquals(0, plan.writeParameters.getHdfsBlockSize()); assertEquals(0, plan.writeParameters.getIndexBlockSize()); assertEquals(0, plan.writeParameters.getReplication()); assertNull(plan.writeParameters.getCompressType()); // test setting all output options ccs = new ConfigurableCompactionStrategy(); CompactionSettings.OUTPUT_BLOCK_SIZE_OPT.put(opts, "64K"); CompactionSettings.OUTPUT_COMPRESSION_OPT.put(opts, "snappy"); CompactionSettings.OUTPUT_HDFS_BLOCK_SIZE_OPT.put(opts, "256M"); CompactionSettings.OUTPUT_INDEX_BLOCK_SIZE_OPT.put(opts, "32K"); CompactionSettings.OUTPUT_REPLICATION_OPT.put(opts, "5"); ccs.init(opts); plan = ccs.getCompactionPlan(mcr); assertEquals(ConfigurationTypeHelper.getFixedMemoryAsBytes("64K"), plan.writeParameters.getBlockSize()); assertEquals(ConfigurationTypeHelper.getFixedMemoryAsBytes("256M"), plan.writeParameters.getHdfsBlockSize()); assertEquals(ConfigurationTypeHelper.getFixedMemoryAsBytes("32K"), plan.writeParameters.getIndexBlockSize()); assertEquals(5, plan.writeParameters.getReplication()); assertEquals("snappy", plan.writeParameters.getCompressType()); } }
apache-2.0
larsbutler/chessboard
setup.py
1395
"""Chessboard: Describe an application once, deploy and manage it anywhere. Chessboard includes utilities for modeling application topologies and deploying/managing applications in a provider-agnostic way. """ import setuptools VERSION = '0.1.0' setuptools.setup( name='chessboard', version=VERSION, maintainer='Rackspace Hosting, Inc.', url='https://github.com/checkmate/chessboard', description='Describe an application once, deploy and manage it anywhere', platforms=['any'], packages=setuptools.find_packages( exclude=['chessboard.tests', 'chessboard.tests.*'] ), provides=['chessboard (%s)' % VERSION], license='Apache License 2.0', keywords=( 'application model topology deployment manage orchestration ' 'configuration automation checkmate' ), include_package_data=True, data_files=[('chessboard', ['chessboard/schema_docs.yaml'])], classifiers=( 'Development Status :: 1 - Planning', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: Apache Software License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.4', 'Topic :: Software Development', 'Topic :: System :: Systems Administration', ), )
apache-2.0
mosaic-cloud/mosaic-java-platform
drivers-core/src/main/java/eu/mosaic_cloud/drivers/exceptions/NullCompletionCallback.java
2985
/* * #%L * mosaic-platform-core * %% * Copyright (C) 2010 - 2013 Institute e-Austria Timisoara (Romania) * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ package eu.mosaic_cloud.drivers.exceptions; /** * Exception thrown when no operation completion callback is set. * * @author Georgiana Macariu */ public class NullCompletionCallback extends Exception { /** * Constructs a new exception with null as its detail message. The cause is not initialized, and may subsequently be * initialized by a call to {@link Throwable#initCause(Throwable)}. */ public NullCompletionCallback () { super (); } /** * Constructs a new exception with the specified detail message. The cause is not initialized, and may subsequently be * initialized by a call to {@link Throwable#initCause(Throwable)}. * * @param message * the detail message. The detail message is saved for later retrieval by the {@link Throwable#getMessage()} * method */ public NullCompletionCallback (final String message) { super (message); } /** * Constructs a new exception with the specified detail message and cause. Note that the detail message associated with * cause is not automatically incorporated in this exception's detail message. * * @param message * the detail message. The detail message is saved for later retrieval by the {@link Throwable#getMessage()} * method * @param cause * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A null value is * permitted, and indicates that the cause is nonexistent or unknown.) */ public NullCompletionCallback (final String message, final Throwable cause) { super (message, cause); } /** * Constructs a new exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) * (which typically contains the class and detail message of cause). This constructor is useful for exceptions that are * little more than wrappers for other throwables. * * @param cause * the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method). (A null value is * permitted, and indicates that the cause is nonexistent or unknown.) */ public NullCompletionCallback (final Throwable cause) { super (cause); } private static final long serialVersionUID = -3388438945086356985L; }
apache-2.0
gastrodia/hot-csv
test.js
619
/** * Created by yang on 14/12/8. */ var SimpleHotCSV = require('./index').SimpleHotCSV; var HotCSV = require('./index').HotCSV; var path = require('path'); var hostCityList = path.join(__dirname,'./whiteCityList.csv'); var hotCity1 = new SimpleHotCSV(hostCityList); hotCity1.init(function(){ setInterval(function(){ console.log('simpleHotCity length ' + hotCity1.getList().length) },1000); }); var hotCity2 = new HotCSV(hostCityList); hotCity2.init( {headers : ["column1"]},function(){ setInterval(function(){ console.log('hotCity length ' + hotCity1.getList().length) },1000); });
apache-2.0
nbargnesi/bel-parser
lib/bel_parser/language/version2_0/relationships/biomarker_for.rb
1152
require_relative '../../version2_0' require_relative '../../relationship' module BELParser module Language module Version2_0 module Relationships # BiomarkerFor: +A biomarkerFor P+ - For term A and process term # P, +A biomarkerFor P+ indicates that changes in or detection # of A is used in some way to be a biomarker for pathology or # biological process P. class BiomarkerFor extend Relationship SHORT = :biomarkerFor LONG = :biomarkerFor DESCRIPTION = ' +A biomarkerFor P+ - For term A and process erm P, +A biomarkerFor P+ indicates that changes n or detection of A is used in some way to be biomarker for pathology or biological process .'.freeze def self.short SHORT end def self.long LONG end def self.description DESCRIPTION end def self.deprecated? true end def self.directed? true end end end end end end
apache-2.0
runfriends/PurchaseNear
purchasenear/purchasenear-goods/src/main/java/cn/purchasenear/v1/goods/domain/Brand.java
66
package cn.purchasenear.v1.goods.domain; public class Brand { }
apache-2.0
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Cactaceae/Mammillaria/Mammillaria melanacantha/README.md
191
# Mammillaria melanacantha Hort. ex Foerst. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
apache-2.0
yprokule/learn-ruby
random_number.rb
709
#!/bin/env ruby my_rand = rand(100) attempts = 10 print "Please enter your name: " # read the inpute and remove trailing 'newline' gamer = gets.chomp while attempts >= 1 puts "#{gamer} - You have #{attempts} attempts left" puts "Please make your choice" user_choice = gets.to_i if user_choice > my_rand then puts "Error. Your choice is higher than actual value" elsif user_choice < my_rand then puts "Error. Your guess is lower than actual value" elsif user_choice == my_rand puts "Congrats, #{gamer}! Coorect answer is #{my_rand}" exit 0 end attempts -= 1 end puts "Sorry #{gamer}. U didn't guess the number: #{my_rand}" exit 0
apache-2.0
Patschke/dsworkbench
Core/src/main/java/de/tor/tribes/ui/components/FillingLabel.java
2819
/* * Copyright 2015 Torridity. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package de.tor.tribes.ui.components; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.text.NumberFormat; import javax.swing.*; /** * * @author Torridity */ public class FillingLabel extends JLabel { private double[] fillings = null; private Color[] colors = null; private String text = ""; public void setData(double[] fillings, double capacity) { this.fillings = fillings; NumberFormat nf = NumberFormat.getInstance(); nf.setMinimumFractionDigits(1); nf.setMaximumFractionDigits(1); double res = 0; for (Double v : fillings) { res += v * capacity; } res /= 1000; if(res > 0) { text = nf.format(res) + " K"; } else { text = "keine"; } } public void setColors(Color[] colors) { this.colors = colors; } @Override public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D) g; if (fillings == null || colors == null || fillings.length != colors.length) { return; } int h = getHeight() / fillings.length; if (h == 0) { return; } for (int i = 0; i < fillings.length; i++) { g2d.setColor(colors[i]); g2d.fill3DRect(0, i * h, (int) Math.rint(getWidth() * fillings[i]), h, true); } g2d.setColor(Color.LIGHT_GRAY); g2d.drawRect(0, 0, getWidth() - 1, getHeight() - 1); g2d.setColor(Color.BLACK); g2d.drawString(text, 1, getHeight() - 1); } public static void main(String[] args) { JFrame f = new JFrame(); f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); FillingLabel l = new FillingLabel(); l.setPreferredSize(new Dimension(100, 24)); l.setData(new double[]{134644.0 / 400000.0, 180000.0 / 400000.0, 161743.0 / 400000.0}, 400000.0); l.setColors(new Color[]{new Color(187, 148, 70), new Color(242, 131, 30), new Color(224, 211, 209)}); f.getContentPane().add(l); f.pack(); f.setVisible(true); } }
apache-2.0
mdoering/backbone
life/Fungi/Ascomycota/Leotiomycetes/Helotiales/Sclerotiniaceae/Ciboria/Ciboria poronioides/README.md
221
# Ciboria poronioides Speg. SPECIES #### Status ACCEPTED #### According to Index Fungorum #### Published in Anal. Mus. nac. B. Aires, Ser. 2 6: 305 (1899) #### Original name Ciboria poronioides Speg. ### Remarks null
apache-2.0
mdoering/backbone
life/Fungi/Basidiomycota/Pucciniomycetes/Pucciniales/Pucciniaceae/Rostrupia/README.md
140
# Rostrupia GENUS #### Status ACCEPTED #### According to Index Fungorum #### Published in null #### Original name null ### Remarks null
apache-2.0
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Crossosomatales/Staphyleaceae/Euscaphis/Euscaphis japonica/Euscaphis japonica japonica/README.md
169
# Euscaphis japonica f. japonica FORM #### Status ACCEPTED #### According to NUB Generator [autonym] #### Published in null #### Original name null ### Remarks null
apache-2.0
calvera/admingenerator-template
symfony_facl.sh
526
#!/bin/bash sudo rm -rf var/cache/* sudo rm -rf var/logs/* sudo rm -rf var/sessions/* mkdir -p var/cache var/logs var/sessions web/cache HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` if [ "$1" ]; then ME=$1; else ME=`whoami`; fi sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:"$ME":rwX var/cache var/logs var/sessions web/cache web/images/user sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:"$ME":rwX var/cache var/logs var/sessions web/cache web/images/user
apache-2.0
wiacekm/gatling
gatling-http/src/test/scala/io/gatling/http/config/HttpProtocolBuilderSpec.scala
1833
/* * Copyright 2011-2018 GatlingCorp (http://gatling.io) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.gatling.http.config import io.gatling.BaseSpec import io.gatling.http.ahc.HttpEngine import io.gatling.http.cache.HttpCaches import io.gatling.core.config.GatlingConfiguration import io.gatling.http.protocol.{ HttpProtocolBuilder, HttpProtocol } import io.gatling.http.request.ExtraInfo class HttpProtocolBuilderSpec extends BaseSpec { val configuration = GatlingConfiguration.loadForTest() val httpCaches = new HttpCaches(configuration) val httpEngine = mock[HttpEngine] val httpProtocolBuilder = HttpProtocolBuilder(configuration) "http protocol configuration builder" should "support an optional extra info extractor" in { val expectedExtractor = (extraInfo: ExtraInfo) => Nil val builder = httpProtocolBuilder .disableWarmUp .extraInfoExtractor(expectedExtractor) val config: HttpProtocol = builder.build config.responsePart.extraInfoExtractor.get shouldBe expectedExtractor } it should "set a silent URI regex" in { val builder = httpProtocolBuilder .silentURI(".*") val config: HttpProtocol = builder.build val actualPattern: String = config.requestPart.silentURI.get.toString actualPattern.equals(".*") shouldBe true } }
apache-2.0
crazy1235/BaseJavaProject
BaseJavaProject/src/com/jacksen/java/leetcode/ReverseString.java
2437
package com.jacksen.java.leetcode; import java.util.Stack; /** * 字符串翻转 * * @author jacksen * */ public class ReverseString { public static void main(String[] args) { System.out.println(reverseString7("yansen")); } /** * 时间复杂度 o(n) * * @param s * @return */ public static String reverseString(String s) { String result = ""; char[] ch = s.toCharArray(); for (int i = ch.length - 1; i >= 0; i--) { result += ch[i]; } return result; } /** * 时间复杂度 o(n) * * @param s * @return */ public static String reverseString2(String s) { String result = ""; for (int i = s.length() - 1; i >= 0; i--) { result += s.charAt(i); } return result; } /** * 使用StringBuffer类中的reverse方法 * * @param s * @return */ public static String reverseString3(String s) { return new StringBuffer(s).reverse().toString(); } /** * 时间复杂度o(n/2) * * @param s * @return */ public static String reverseString4(String s) { char[] ch = s.toCharArray(); int halfLength = s.length() / 2; char temp; for (int i = 0; i < halfLength; i++) { temp = ch[s.length() - 1 - i]; ch[s.length() - 1 - i] = ch[i]; ch[i] = temp; } return new String(ch); } /** * 异或运算 -- 时间复杂度o(n/2) * * @param s * @return */ public static String reverseString5(String s) { char[] ch = s.toCharArray(); int start = 0; int end = ch.length - 1; while (start < end) { ch[start] = (char) (ch[start] ^ ch[end]); ch[end] = (char) (ch[start] ^ ch[end]); ch[start] = (char) (ch[start] ^ ch[end]); start++; end--; } return new String(ch); } /** * 通过入栈和出栈的思想来做 -- 时间复杂度o(2n) * * @param s * @return */ public static String reverseString6(String s) { Stack<Character> stack = new Stack<>(); char[] ch = s.toCharArray(); String result = ""; for (int i = 0; i < ch.length; i++) { stack.push(ch[i]); } for (int i = 0; i < ch.length; i++) { result += stack.pop(); } return result; } /** * 通过递归来做 * * @param s * @return */ public static String reverseString7(String s) { int length = s.length(); if (length <= 1) { return s; } String leftStr = s.substring(0, length / 2); String rightStr = s.substring(length / 2, length); return reverseString7(rightStr) + reverseString7(leftStr); } }
apache-2.0
iantalarico/google-cloud-dotnet
apis/Google.Cloud.BigQuery.V2/Google.Cloud.BigQuery.V2.Tests/ListJobsOptionsTest.cs
1544
// Copyright 2016 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using Google.Apis.Bigquery.v2; using Xunit; using static Google.Apis.Bigquery.v2.JobsResource; using static Google.Apis.Bigquery.v2.JobsResource.ListRequest; namespace Google.Cloud.BigQuery.V2.Tests { public class ListJobsOptionsTest { [Fact] public void ModifyRequest() { var options = new ListJobsOptions { PageSize = 25, StateFilter = JobState.Pending, AllUsers = true, Projection = ProjectionEnum.Full }; ListRequest request = new ListRequest(new BigqueryService(), "project"); options.ModifyRequest(request); Assert.Equal(25, request.MaxResults); Assert.Equal(StateFilterEnum.Pending, request.StateFilter); Assert.Equal(true, request.AllUsers); Assert.Equal(ProjectionEnum.Full, request.Projection); } } }
apache-2.0
phoswald/annotation-printer
src/test/java/phoswald/annotation/printer/annotations/MyEnum.java
94
package phoswald.annotation.printer.annotations; public enum MyEnum { VALUE_1, VALUE_2 }
apache-2.0
julianhyde/calcite
core/src/main/java/org/apache/calcite/rex/RexSubQuery.java
5459
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to you under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.calcite.rex; import org.apache.calcite.plan.RelOptUtil; import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.type.RelDataType; import org.apache.calcite.rel.type.RelDataTypeFactory; import org.apache.calcite.rel.type.RelDataTypeField; import org.apache.calcite.sql.SqlKind; import org.apache.calcite.sql.SqlOperator; import org.apache.calcite.sql.fun.SqlQuantifyOperator; import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.sql.type.SqlTypeName; import com.google.common.collect.ImmutableList; import java.util.List; import java.util.Objects; import javax.annotation.Nonnull; /** * Scalar expression that represents an IN, EXISTS or scalar sub-query. */ public class RexSubQuery extends RexCall { public final RelNode rel; private RexSubQuery(RelDataType type, SqlOperator op, ImmutableList<RexNode> operands, RelNode rel) { super(type, op, operands); this.rel = rel; } /** Creates an IN sub-query. */ public static RexSubQuery in(RelNode rel, ImmutableList<RexNode> nodes) { final RelDataType type = type(rel, nodes); return new RexSubQuery(type, SqlStdOperatorTable.IN, nodes, rel); } /** Creates a SOME sub-query. * * <p>There is no ALL. For {@code x comparison ALL (sub-query)} use instead * {@code NOT (x inverse-comparison SOME (sub-query))}. * If {@code comparison} is {@code >} * then {@code negated-comparison} is {@code <=}, and so forth. * * <p>Also =SOME is rewritten into IN</p> */ public static RexSubQuery some(RelNode rel, ImmutableList<RexNode> nodes, SqlQuantifyOperator op) { assert op.kind == SqlKind.SOME; if (op == SqlStdOperatorTable.SOME_EQ) { return RexSubQuery.in(rel, nodes); } final RelDataType type = type(rel, nodes); return new RexSubQuery(type, op, nodes, rel); } static RelDataType type(RelNode rel, ImmutableList<RexNode> nodes) { assert rel.getRowType().getFieldCount() == nodes.size(); final RelDataTypeFactory typeFactory = rel.getCluster().getTypeFactory(); boolean nullable = false; for (RexNode node : nodes) { if (node.getType().isNullable()) { nullable = true; } } for (RelDataTypeField field : rel.getRowType().getFieldList()) { if (field.getType().isNullable()) { nullable = true; } } return typeFactory.createTypeWithNullability( typeFactory.createSqlType(SqlTypeName.BOOLEAN), nullable); } /** Creates an EXISTS sub-query. */ public static RexSubQuery exists(RelNode rel) { final RelDataTypeFactory typeFactory = rel.getCluster().getTypeFactory(); final RelDataType type = typeFactory.createSqlType(SqlTypeName.BOOLEAN); return new RexSubQuery(type, SqlStdOperatorTable.EXISTS, ImmutableList.of(), rel); } /** Creates a scalar sub-query. */ public static RexSubQuery scalar(RelNode rel) { final List<RelDataTypeField> fieldList = rel.getRowType().getFieldList(); assert fieldList.size() == 1; final RelDataTypeFactory typeFactory = rel.getCluster().getTypeFactory(); final RelDataType type = typeFactory.createTypeWithNullability(fieldList.get(0).getType(), true); return new RexSubQuery(type, SqlStdOperatorTable.SCALAR_QUERY, ImmutableList.of(), rel); } @Override public <R> R accept(RexVisitor<R> visitor) { return visitor.visitSubQuery(this); } @Override public <R, P> R accept(RexBiVisitor<R, P> visitor, P arg) { return visitor.visitSubQuery(this, arg); } @Override protected @Nonnull String computeDigest(boolean withType) { final StringBuilder sb = new StringBuilder(op.getName()); sb.append("("); for (RexNode operand : operands) { sb.append(operand); sb.append(", "); } sb.append("{\n"); sb.append(RelOptUtil.toString(rel)); sb.append("})"); return sb.toString(); } @Override public RexSubQuery clone(RelDataType type, List<RexNode> operands) { return new RexSubQuery(type, getOperator(), ImmutableList.copyOf(operands), rel); } public RexSubQuery clone(RelNode rel) { return new RexSubQuery(type, getOperator(), operands, rel); } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof RexSubQuery)) { return false; } RexSubQuery sq = (RexSubQuery) obj; return op.equals(sq.op) && operands.equals(sq.operands) && rel.deepEquals(sq.rel); } @Override public int hashCode() { if (hash == 0) { hash = Objects.hash(op, operands, rel.deepHashCode()); } return hash; } }
apache-2.0
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Bruniales/Bruniaceae/Berzelia/Berzelia alopecurioides/README.md
179
# Berzelia alopecurioides Sond. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
apache-2.0
yasenagat/AndroidTest
VolleyTest/src/main/java/com/dgcy/http/msg/INF1000_Res.java
4492
package com.dgcy.http.msg; import com.google.gson.annotations.Expose; import com.dgcy.http.base.AbstractResponseBody; import com.dgcy.http.base.AbstractResponseMsg; import java.io.Serializable; import java.util.ArrayList; import java.util.List; public class INF1000_Res extends AbstractResponseMsg<INF1000_Res.INF1000_Res_Body> { public static class INF1000_Res_Body extends AbstractResponseBody { @Expose private List<InfoItem> items = new ArrayList<InfoItem>(); public List<InfoItem> getItems() { return items; } public void setItems(List<InfoItem> items) { this.items = items; } public static class InfoItem implements Serializable { /** * */ private static final long serialVersionUID = 1L; @Expose private String sn = ""; // 序号 @Expose private String id = ""; // 编号 @Expose private String title = ""; // 标题 @Expose private String from = ""; // 来源 @Expose private String editor = ""; // 作者 @Expose private String time = ""; // 时间 @Expose private String type = ""; // 类型 @Expose private String name = ""; // 类别名称 @Expose private String intro = ""; // 简介 @Expose private String hot = ""; // 是否热门 @Expose private String top = ""; // 是否置顶 @Expose private String url = ""; @Expose private String relateType = ""; @Expose private String relateContent = ""; public String getSn() { return sn; } public void setSn(String sn) { this.sn = sn; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getFrom() { return from; } public void setFrom(String from) { this.from = from; } public String getEditor() { return editor; } public void setEditor(String editor) { this.editor = editor; } public String getTime() { return time; } public void setTime(String time) { this.time = time; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getIntro() { return intro; } public void setIntro(String intro) { this.intro = intro; } public String getHot() { return hot; } public void setHot(String hot) { this.hot = hot; } public String getTop() { return top; } public void setTop(String top) { this.top = top; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getRelateType() { return relateType; } public void setRelateType(String relateType) { this.relateType = relateType; } public String getRelateContent() { return relateContent; } public void setRelateContent(String relateContent) { this.relateContent = relateContent; } } } @Override protected Class<INF1000_Res_Body> getResBodyType() { return INF1000_Res_Body.class; } }
apache-2.0
Hexworks/zircon
docs/2021.1.0-RELEASE-KOTLIN/zircon.core/zircon.core/org.hexworks.zircon.internal.component.data/-common-component-properties/component12.html
5261
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> <title>component12</title> <link href="../../../images/logo-icon.svg" rel="icon" type="image/svg"> <script>var pathToRoot = "../../../";</script> <script type="text/javascript" src="../../../scripts/sourceset_dependencies.js" async="async"></script> <link href="../../../styles/style.css" rel="Stylesheet"> <link href="../../../styles/logo-styles.css" rel="Stylesheet"> <link href="../../../styles/jetbrains-mono.css" rel="Stylesheet"> <link href="../../../styles/main.css" rel="Stylesheet"> <script type="text/javascript" src="../../../scripts/clipboard.js" async="async"></script> <script type="text/javascript" src="../../../scripts/navigation-loader.js" async="async"></script> <script type="text/javascript" src="../../../scripts/platform-content-handler.js" async="async"></script> <script type="text/javascript" src="../../../scripts/main.js" async="async"></script> </head> <body> <div id="container"> <div id="leftColumn"> <div id="logo"></div> <div id="paneSearch"></div> <div id="sideMenu"></div> </div> <div id="main"> <div id="leftToggler"><span class="icon-toggler"></span></div> <script type="text/javascript" src="../../../scripts/pages.js"></script> <script type="text/javascript" src="../../../scripts/main.js"></script> <div class="main-content" id="content" pageIds="org.hexworks.zircon.internal.component.data/CommonComponentProperties/component12/#/PointingToDeclaration//-755115832"> <div class="navigation-wrapper" id="navigation-wrapper"> <div class="breadcrumbs"><a href="../../index.html">zircon.core</a>/<a href="../index.html">org.hexworks.zircon.internal.component.data</a>/<a href="index.html">CommonComponentProperties</a>/<a href="component12.html">component12</a></div> <div class="pull-right d-flex"> <div class="filter-section" id="filter-section"><button class="platform-tag platform-selector common-like" data-active="" data-filter=":zircon.core:dokkaHtml/commonMain">common</button></div> <div id="searchBar"></div> </div> </div> <div class="cover "> <h1 class="cover"><span>component12</span></h1> </div> <div class="divergent-group" data-filterable-current=":zircon.core:dokkaHtml/commonMain" data-filterable-set=":zircon.core:dokkaHtml/commonMain"><div class="with-platform-tags"><span class="pull-right"></span></div> <div> <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":zircon.core:dokkaHtml/commonMain"><div class="symbol monospace">operator fun <a href="component12.html">component12</a>(): <span data-unresolved-link="org.hexworks.cobalt.databinding.api.property/Property///PointingToDeclaration/">Property</span>&lt;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a>&gt;<span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div> </div> </div> <h2 class="">Sources</h2> <div class="table" data-togglable="Sources"><a data-name="%5Borg.hexworks.zircon.internal.component.data%2FCommonComponentProperties%2Fcomponent12%2F%23%2FPointingToDeclaration%2F%5D%2FSource%2F-755115832" anchor-label="https://github.com/Hexworks/zircon/tree/master/zircon.core/src/commonMain/kotlin/org/hexworks/zircon/internal/component/data/CommonComponentProperties.kt#L33" id="%5Borg.hexworks.zircon.internal.component.data%2FCommonComponentProperties%2Fcomponent12%2F%23%2FPointingToDeclaration%2F%5D%2FSource%2F-755115832" data-filterable-set=":zircon.core:dokkaHtml/commonMain"></a> <div class="table-row" data-filterable-current=":zircon.core:dokkaHtml/commonMain" data-filterable-set=":zircon.core:dokkaHtml/commonMain"> <div class="main-subrow keyValue "> <div class=""><span class="inline-flex"><a href="https://github.com/Hexworks/zircon/tree/master/zircon.core/src/commonMain/kotlin/org/hexworks/zircon/internal/component/data/CommonComponentProperties.kt#L33">(source)</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="%5Borg.hexworks.zircon.internal.component.data%2FCommonComponentProperties%2Fcomponent12%2F%23%2FPointingToDeclaration%2F%5D%2FSource%2F-755115832"></span> <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div> </span></span></div> <div></div> </div> </div> </div> </div> <div class="footer"><span class="go-to-top-icon"><a href="#content"></a></span><span>© 2020 Copyright</span><span class="pull-right"><span>Sponsored and developed by dokka</span><a href="https://github.com/Kotlin/dokka"><span class="padded-icon"></span></a></span></div> </div> </div> </body> </html>
apache-2.0
scorpionvicky/elasticsearch
x-pack/plugin/mapper-unsigned-long/src/main/java/org/elasticsearch/xpack/unsignedlong/DocValuesWhitelistExtension.java
1850
/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ package org.elasticsearch.xpack.unsignedlong; import org.elasticsearch.painless.spi.PainlessExtension; import org.elasticsearch.painless.spi.Whitelist; import org.elasticsearch.painless.spi.WhitelistLoader; import org.elasticsearch.script.AggregationScript; import org.elasticsearch.script.BucketAggregationSelectorScript; import org.elasticsearch.script.FieldScript; import org.elasticsearch.script.FilterScript; import org.elasticsearch.script.NumberSortScript; import org.elasticsearch.script.ScoreScript; import org.elasticsearch.script.ScriptContext; import org.elasticsearch.script.StringSortScript; import java.util.List; import java.util.Map; import static java.util.Collections.singletonList; public class DocValuesWhitelistExtension implements PainlessExtension { private static final Whitelist WHITELIST = WhitelistLoader.loadFromResourceFiles(DocValuesWhitelistExtension.class, "whitelist.txt"); @Override public Map<ScriptContext<?>, List<Whitelist>> getContextWhitelists() { List<Whitelist> whitelist = singletonList(WHITELIST); Map<ScriptContext<?>, List<Whitelist>> contexts = Map.of( FieldScript.CONTEXT, whitelist, ScoreScript.CONTEXT, whitelist, FilterScript.CONTEXT, whitelist, AggregationScript.CONTEXT, whitelist, NumberSortScript.CONTEXT, whitelist, StringSortScript.CONTEXT, whitelist, BucketAggregationSelectorScript.CONTEXT, whitelist ); return contexts; } }
apache-2.0
googleapis/nodejs-billing-budgets
src/index.ts
1081
// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // ** This file is automatically generated by synthtool. ** // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** import * as v1 from './v1'; import * as v1beta1 from './v1beta1'; const BudgetServiceClient = v1.BudgetServiceClient; type BudgetServiceClient = v1.BudgetServiceClient; export {v1, v1beta1, BudgetServiceClient}; export default {v1, v1beta1, BudgetServiceClient}; import * as protos from '../protos/protos'; export {protos};
apache-2.0
hanya/MRI
pythonpath/mytools_Mri/ui/tools.py
2328
# Copyright 2011 Tsutomu Uchino # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. def create_popupmenu(ctx, items): """ create popup menu from items [ [id, pos, type, 'label', "command", acc_key], [] ] """ try: menu = ctx.getServiceManager().createInstanceWithContext( "com.sun.star.awt.PopupMenu", ctx) for i in items: if i[0] is None or i[0] == -1: menu.insertSeparator(i[1]) else: menu.insertItem(i[0], i[3], i[2], i[1]) menu.setCommand(i[0], i[4]) if i[5] is not None: try: menu.setAcceleratorKeyEvent(i[0], i[5]) except: pass except Exception as e: print(e) return menu def get_current_sentence(target, mini): """ (\n| )... min ... """ lfstart = target.rfind("\n", 0, mini) lfend = target.find("\n", mini) if lfend < 0: lfend = len(target) spstart = target.rfind(" ", 0, mini) spend = target.find(" ", mini) if spend < 0: spend = len(target) if lfstart >= spstart: start = lfstart +1 if start < 0: start = 0 else: start = spstart +2 if spend < lfend: end = spend else: end = lfend return (start, end) def get_current_line(target, mini): """ # xxx\n...min....\nxxx """ start = target.rfind("\n", 0, mini) +1 if start < 0: start = 0 end = target.find("\n", mini) if end < 0: end = len(target) return (start, end) def get_first_word(line): pos = line.lstrip().find(" ") if pos < 0: pos = len(line) return line[0:pos]
apache-2.0
aws/aws-sdk-java
aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/AdminDisableProviderForUserResult.java
2427
/* * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.cognitoidp.model; import java.io.Serializable; import javax.annotation.Generated; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDisableProviderForUser" * target="_top">AWS API Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AdminDisableProviderForUserResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable { /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AdminDisableProviderForUserResult == false) return false; AdminDisableProviderForUserResult other = (AdminDisableProviderForUserResult) obj; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; return hashCode; } @Override public AdminDisableProviderForUserResult clone() { try { return (AdminDisableProviderForUserResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }
apache-2.0
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Lotus/Lotus maritimus/Tetragonolobus maritimus maritimus/README.md
181
# Tetragonolobus maritimus var. maritimus VARIETY #### Status ACCEPTED #### According to NUB Generator [autonym] #### Published in null #### Original name null ### Remarks null
apache-2.0
julianhyde/foodmart-data-json
HISTORY.md
1046
# Foodmart data for JSON release history and change log For a full list of releases, see <a href="https://github.com/julianhyde/foodmart-data-json/releases">github</a>. ## <a href="https://github.com/julianhyde/foodmart-data-json/releases/tag/foodmart-data-json-0.4">0.4</a> / 2015-03-06 * [<a href="https://issues.apache.org/jira/browse/DRILL-367">DRILL-367</a>] FoodMart data (category.json) packaged with Drill does not conform with JSON specification * [<a href="https://issues.apache.org/jira/browse/DRILL-412">DRILL-412</a>] FoodMart data (account.json) cause JsonParseException * Publish releases to <a href="http://search.maven.org/">Maven Central</a> * Sign jars * Rename class `mondrian.test.data.FoodMartJson` to `net.hydromatic.foodmart.data.json.FoodmartJson` * Create README and HISTORY * Expand POM so that one can build a release * Use <a href="https://github.com/julianhyde/hydromatic-parent">net.hydromatic parent POM</a> * Creation from [Pentaho mondrian-data-foodmart-json](http://mondrian.pentaho.com) version 0.3.2
apache-2.0
allanbank/mongodb-async-driver
src/main/java/com/allanbank/mongodb/client/metrics/basic/package-info.java
1122
/* * #%L * package-info.java - mongodb-async-driver - Allanbank Consulting, Inc. * %% * Copyright (C) 2011 - 2014 Allanbank Consulting, Inc. * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ /** * Contains an implementation of the metrics collection that collects metrics * for users to manually inspect. * * @api.no This package is <b>NOT</b> part of the drivers API. This class may be * mutated in incompatible ways between any two releases of the driver. * @copyright 2014, Allanbank Consulting, Inc., All Rights Reserved */ package com.allanbank.mongodb.client.metrics.basic;
apache-2.0
ankuradhey/dealtrip
js/general.js
7612
// JavaScript Document function run_timer() { var today = new Date(); var ndate=today.toString(); //April 23, 2009, 02:04:25 pm ndate=ndate.split('GMT'); document.getElementById("TimeDiv").style.border='transparent'; document.getElementById("TimeDiv").innerHTML=ndate[0]; setTimeout(run_timer,1000); } function getHeightWidht() { var viewportwidth; var viewportheight; // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight if (typeof window.innerWidth != 'undefined') { viewportwidth = window.innerWidth, viewportheight = window.innerHeight } // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document) else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) { viewportwidth = document.documentElement.clientWidth; viewportheight = document.documentElement.clientHeight } // older versions of IE else { viewportwidth = document.getElementsById('bodyid').clientWidth; viewportheight = document.getElementsById('bodyid').clientHeight; } return parseInt(viewportwidth); } function checkall(thisid) { for(var i=1;document.getElementById('check'+i);i++){ if(document.getElementById(thisid.id).checked==true){ document.getElementById('check'+i).checked = true; } if(document.getElementById(thisid.id).checked==false){ document.getElementById('check'+i).checked = false; } } } function check_check(spanid,checkid){ var chkchkstat = true; for(var i=1; document.getElementById('check'+i); i++){ if(document.getElementById('check'+i).checked == false){ chkchkstat = false; break; } } //alert(chkchkstat); if(chkchkstat == false){ $('#'+spanid).html(''); document.getElementById(checkid).checked = false; } else { document.getElementById(checkid).checked = true; } return true; } function checknummsp(e) { evt=e || window.event; var keypressed=evt.which || evt.keyCode; //alert(keypressed); if(keypressed!="48" && keypressed!="49" && keypressed!="50" && keypressed!="51" && keypressed!="52" && keypressed!="53" && keypressed!="54" && keypressed!="55" && keypressed!="8" && keypressed!="56" && keypressed!="57" && keypressed!="45" && keypressed!="46" && keypressed!="37" && keypressed!="39" && keypressed!="9") { return false; } } function showhidedata(show) { if(show==1) { if(document.getElementById('firstdiv').style.display=="block") { document.getElementById('firstdiv').style.display="none"; } else { document.getElementById('firstdiv').style.display="block"; } } } function showhidediscp(show) { if(show==1) { if(document.getElementById('dispdiv').style.display=="block") { document.getElementById('dispdiv').style.display="none"; } else { document.getElementById('dispdiv').style.display="block"; } } } function hrefHandler() { var a=window.location.pathname; var b=a.match(/[\/|\\]([^\\\/]+)$/); var ans=confirm("Are you sure? You want to delete."); return ans; } function EmptyListbox(listBoxId) { var elSel = document.getElementById(listBoxId); for (i = elSel.length - 1; i>=0; i--) { elSel.remove(i); } } function AddOptiontoListBox(listBoxId,Value,Text) { var elSel = document.getElementById(listBoxId); var opt = document.createElement("option"); elSel.options.add(opt); opt.text=Text; opt.value=Value; } function CollaspeExpand(divName) { $('#Child'+divName).slideToggle("slow"); /*if(document.getElementById('Child'+divName).style.display=="block") { document.getElementById('Child'+divName).style.display="none"; } else { document.getElementById('Child'+divName).style.display="block"; }*/ } //phone no function checkLen(charlen,e) { var mb= document.getElementById('phone_number').value; //alert(mb.length); evt=e || window.event; var keypressed=evt.which || evt.keyCode; //alert(keypressed); if(keypressed!="48" && keypressed!="49" && keypressed!="50" && keypressed!="51" && keypressed!="52" && keypressed!="53" && keypressed!="54" && keypressed!="55" && keypressed!="8" && keypressed!="56" && keypressed!="57" && keypressed!="45" && keypressed!="46" && keypressed!="37" && keypressed!="39" && keypressed!="9") { return false; } else { if(mb.length<3) { return charlen; } else if(mb.length==3 || mb.length==7 ) { var dashchar="-"; var charlen1=charlen+dashchar; var charlen2=document.getElementById('phone_number').value=charlen1; //var charlen2=charlen1.join("-"); //alert(charlen2); return charlen1; //return charlen1; } } } //print_r function print_r(arr,level) { var dumped_text = ""; if(!level) level = 0; //The padding given at the beginning of the line. var level_padding = ""; for(var j=0;j<level+1;j++) level_padding += " "; if(typeof(arr) == 'object') { //Array/Hashes/Objects for(var item in arr) { var value = arr[item]; if(typeof(value) == 'object') { //If it is an array, dumped_text += level_padding + "'" + item + "' ...\n"; dumped_text += print_r(value,level+1); } else { dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n"; } } } else { //Stings/Chars/Numbers etc. dumped_text = "===>"+arr+"<===("+typeof(arr)+")"; } return dumped_text; } function makepropertyinsurance(){ //check if checkbox is checked console.log($('#insurance'),$('#insurance').attr('checked')); if($('#insurance').attr('checked')=='checked'){ $('#is_insured').val('true'); }else{ $('#is_insured').val('false'); } } //loading overlay //element - jquery object [ $('#element') ] //image_path - path to image i.e. absolute url **:- omit trailing slash in path function loading(element,image_path){ element.append('<div class="question-overlay question-overlay-box"></div><img src="'+image_path+'/fancybox_loading2x.gif" class="question-overlay loading-image">') } function loadingComplete(){ $('.question-overlay').remove(); } function linkify(inputText) { var replacedText, replacePattern1, replacePattern2, replacePattern3; //URLs starting with http://, https://, or ftp:// replacePattern1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim; replacedText = inputText.replace(replacePattern1, '<a href="$1" target="_blank">$1</a>'); //URLs starting with "www." (without // before it, or it'd re-link the ones done above). replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim; replacedText = replacedText.replace(replacePattern2, '$1<a href="http://$2" target="_blank">$2</a>'); //Change email addresses to mailto:: links. replacePattern3 = /(([a-zA-Z0-9\-\_\.])+@[a-zA-Z\_]+?(\.[a-zA-Z]{2,6})+)/gim; replacedText = replacedText.replace(replacePattern3, '<a href="mailto:$1">$1</a>'); return replacedText; }
apache-2.0
mariofusco/lambdaj
html/apidocs/ch/lambdaj/function/convert/class-use/StringPropertyExtractor.html
4493
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="it"> <head> <!-- Generated by javadoc (version 1.7.0_01) on Sun Feb 12 22:30:27 CET 2012 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>Uses of Class ch.lambdaj.function.convert.StringPropertyExtractor (lambdaj 2.4-SNAPSHOT API)</title> <meta name="date" content="2012-02-12"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class ch.lambdaj.function.convert.StringPropertyExtractor (lambdaj 2.4-SNAPSHOT API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../ch/lambdaj/function/convert/StringPropertyExtractor.html" title="class in ch.lambdaj.function.convert">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?ch/lambdaj/function/convert/\class-useStringPropertyExtractor.html" target="_top">Frames</a></li> <li><a href="StringPropertyExtractor.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class ch.lambdaj.function.convert.StringPropertyExtractor" class="title">Uses of Class<br>ch.lambdaj.function.convert.StringPropertyExtractor</h2> </div> <div class="classUseContainer">No usage of ch.lambdaj.function.convert.StringPropertyExtractor</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../ch/lambdaj/function/convert/StringPropertyExtractor.html" title="class in ch.lambdaj.function.convert">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?ch/lambdaj/function/convert/\class-useStringPropertyExtractor.html" target="_top">Frames</a></li> <li><a href="StringPropertyExtractor.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2012. All Rights Reserved.</small></p> </body> </html>
apache-2.0
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Lamiaceae/Sideritis/Sideritis arborescens/Sideritis arborescens maireana/README.md
263
# Sideritis arborescens subsp. maireana (Font Quer & Pau) O.Socorro & M.L.Arrebola SUBSPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name Sideritis maireana Font Quer & Pau ### Remarks null
apache-2.0
mdoering/backbone
life/Fungi/Ascomycota/Dothideomycetes/Loculohypoxylon/Loculohypoxylon grandineum/ Syn. Hypoxylon grandineum/README.md
239
# Hypoxylon grandineum (Berk. & Ravenel) J.H. Mill. SPECIES #### Status SYNONYM #### According to Index Fungorum #### Published in Mycologia 33(1): 74 (1941) #### Original name Diatrype grandinea Berk. & Ravenel, 1876 ### Remarks null
apache-2.0
mdoering/backbone
life/Plantae/Chlorophyta/Zygnematophyceae/Zygnematales/Desmidiaceae/Cosmarium/Cosmarium quadrifarium/Cosmarium quadrifarium hexasticha/README.md
211
# Cosmarium quadrifarium hexasticha (Lundell) Nordstedt VARIETY #### Status ACCEPTED #### According to Integrated Taxonomic Information System #### Published in null #### Original name null ### Remarks null
apache-2.0
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Eriochloa/Eriochloa acuminata/ Syn. Eriochloa lemmonii minor/README.md
186
# Eriochloa lemmonii var. minor VARIETY #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
apache-2.0
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Aizoaceae/Mesembryanthemum/Mesembryanthemum theris/README.md
179
# Mesembryanthemum theris Perr. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
apache-2.0
mdoering/backbone
life/Fungi/Ascomycota/Leotiomycetes/Helotiales/Sclerotiniaceae/Ramularites/Ramularites oblongisporus/README.md
247
# Ramularites oblongisporus (Casp.) Pia SPECIES #### Status ACCEPTED #### According to Index Fungorum #### Published in in Hirmer, Handbuch der Paläobotanik (Berlin) 122 (1927) #### Original name Ramularia oblongispora Casp. ### Remarks null
apache-2.0
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Prosthechea/Prosthechea aemula/ Syn. Epidendrum fragrans alticallum/README.md
192
# Epidendrum fragrans var. alticallum VARIETY #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
apache-2.0
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Sapindales/Rutaceae/Glycosmis/Glycosmis cambodiana/README.md
177
# Glycosmis cambodiana Pierre SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
apache-2.0
mdoering/backbone
life/Fungi/Glomeromycota/Glomeromycetes/Diversisporales/Acaulosporaceae/Entrophospora/Entrophospora infrequens/ Syn. Glomus infrequens/README.md
255
# Glomus infrequens I.R. Hall, 1977 SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in Trans. Br. mycol. Soc. 68(3): 345 (1977) #### Original name Glomus infrequens I.R. Hall, 1977 ### Remarks null
apache-2.0
nextreports/nextreports-server
src/ro/nextreports/server/web/schedule/ScheduleWizard$ScheduleBatchStep.html
69
<wicket:panel> <div wicket:id="batchPanel"></div> </wicket:panel>
apache-2.0
adbrucker/SecureBPMN
runtime/src/modules/activiti-engine/src/main/java/org/activiti/engine/impl/context/Context.java
2992
/* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.activiti.engine.impl.context; import java.util.Stack; import org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl; import org.activiti.engine.impl.interceptor.CommandContext; import org.activiti.engine.impl.pvm.runtime.InterpretableExecution; /** * @author Tom Baeyens */ public class Context { protected static ThreadLocal<Stack<CommandContext>> commandContextThreadLocal = new ThreadLocal<Stack<CommandContext>>(); protected static ThreadLocal<Stack<ProcessEngineConfigurationImpl>> processEngineConfigurationStackThreadLocal = new ThreadLocal<Stack<ProcessEngineConfigurationImpl>>(); protected static ThreadLocal<Stack<ExecutionContext>> executionContextStackThreadLocal = new ThreadLocal<Stack<ExecutionContext>>(); public static CommandContext getCommandContext() { Stack<CommandContext> stack = getStack(commandContextThreadLocal); if (stack.isEmpty()) { return null; } return stack.peek(); } public static void setCommandContext(CommandContext commandContext) { getStack(commandContextThreadLocal).push(commandContext); } public static void removeCommandContext() { getStack(commandContextThreadLocal).pop(); } public static ProcessEngineConfigurationImpl getProcessEngineConfiguration() { Stack<ProcessEngineConfigurationImpl> stack = getStack(processEngineConfigurationStackThreadLocal); if (stack.isEmpty()) { return null; } return stack.peek(); } public static void setProcessEngineConfiguration(ProcessEngineConfigurationImpl processEngineConfiguration) { getStack(processEngineConfigurationStackThreadLocal).push(processEngineConfiguration); } public static void removeProcessEngineConfiguration() { getStack(processEngineConfigurationStackThreadLocal).pop(); } public static ExecutionContext getExecutionContext() { return getStack(executionContextStackThreadLocal).peek(); } public static void setExecutionContext(InterpretableExecution execution) { getStack(executionContextStackThreadLocal).push(new ExecutionContext(execution)); } public static void removeExecutionContext() { getStack(executionContextStackThreadLocal).pop(); } protected static <T> Stack<T> getStack(ThreadLocal<Stack<T>> threadLocal) { Stack<T> stack = threadLocal.get(); if (stack==null) { stack = new Stack<T>(); threadLocal.set(stack); } return stack; } }
apache-2.0
marcus-nl/flowable-engine
modules/flowable-ui-admin/flowable-ui-admin-app/src/main/webapp/scripts/process-instance-controllers.js
29675
/* Copyright 2005-2015 Alfresco Software, Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ 'use strict'; flowableAdminApp.controller('ProcessInstanceController', ['$scope', '$rootScope', '$http', '$timeout', '$location', '$routeParams', '$modal', '$translate', '$q', 'gridConstants', function ($scope, $rootScope, $http, $timeout, $location, $routeParams, $modal, $translate, $q, gridConstants) { $rootScope.navigation = {main: 'process-engine', sub: 'instances'}; $scope.tabData = { tabs: [ {id: 'tasks', name: 'PROCESS-INSTANCE.TITLE.TASKS'}, {id: 'variables', name: 'PROCESS-INSTANCE.TITLE.VARIABLES'}, {id: 'subProcesses', name: 'PROCESS-INSTANCE.TITLE.SUBPROCESSES'}, {id: 'jobs', name: 'PROCESS-INSTANCE.TITLE.JOBS'} ] }; $scope.tabData.activeTab = $scope.tabData.tabs[0].id; $scope.returnToList = function () { $location.path("/process-instances"); }; $scope.openTask = function (task) { if (task && task.getProperty('id')) { $location.path("/task/" + task.getProperty('id')); } }; $scope.openJob = function (job) { if (job && job.getProperty('id')) { $location.path("/job/" + job.getProperty('id')); } }; $scope.openProcessInstance = function (instance) { if (instance) { var id; if (instance.getProperty !== undefined) { id = instance.getProperty('id'); } else { id = instance; } $location.path("/process-instance/" + id); } }; $scope.showAllTasks = function () { // Populate the task-filter with parentId $rootScope.filters.forced.taskFilter = { processInstanceId: $scope.process.id }; $location.path("/tasks"); }; $scope.showAllSubprocesses = function () { // Populate the process-filter with parentId $rootScope.filters.forced.instanceFilter = { superProcessInstanceId: $scope.process.id }; $scope.returnToList(); }; $scope.openProcessDefinition = function (processDefinitionId) { if (processDefinitionId) { $location.path("/process-definition/" + processDefinitionId); } }; $scope.showProcessDiagram = function () { $modal.open({ templateUrl: 'views/process-instance-diagram-popup.html', windowClass: 'modal modal-full-width', controller: 'ShowProcessInstanceDiagramPopupCtrl', resolve: { process: function () { return $scope.process; } } }); }; $scope.openDecisionTable = function (decisionTable) { if (decisionTable && decisionTable.getProperty('id')) { $location.path("/decision-table-execution/" + decisionTable.getProperty('id')); } }; $scope.openFormInstance = function (submittedForm) { if (submittedForm && submittedForm.getProperty('id')) { $location.path("/form-instance/" + submittedForm.getProperty('id')); } }; $scope.loadProcessDefinition = function () { // Load definition $http({ method: 'GET', url: '/app/rest/admin/process-definitions/' + $scope.process.processDefinitionId }).success(function (data, status, headers, config) { $scope.definition = data; }).error(function (data, status, headers, config) { }); }; $scope.loadProcessInstance = function () { $scope.process = undefined; // Load process $http({ method: 'GET', url: '/app/rest/admin/process-instances/' + $routeParams.processInstanceId }).success(function (data, status, headers, config) { $scope.process = data; if (data) { $scope.processCompleted = data.endTime != undefined; } // Start loading children $scope.loadProcessDefinition(); $scope.loadTasks(); $scope.loadVariables(); $scope.loadSubProcesses(); $scope.loadJobs(); $scope.loadDecisionTables() $scope.tabData.tabs.push({id: 'decisionTables', name: 'PROCESS-INSTANCE.TITLE.DECISION-TABLES'}); $scope.tabData.tabs.push({id: 'forms', name: 'PROCESS-INSTANCE.TITLE.FORM-INSTANCES'}); //TODO: implement when decision task runtime data is stored // $scope.loadDecisionTables(); $scope.loadFormInstances(); }).error(function (data, status, headers, config) { if (data && data.message) { // Extract error-message $rootScope.addAlert(data.message, 'error'); } else { // Use default error-message $rootScope.addAlert($translate.instant('ALERT.GENERAL.HTTP-ERROR'), 'error'); } }); }; var dateTemplate = '<div><div class="ngCellText" title="{{row.getProperty(col.field) | dateformat:\'full\'}}">{{row.getProperty(col.field) | dateformat}}</div></div>'; // Config for subtasks grid $q.all([$translate('TASKS.HEADER.ID'), $translate('TASKS.HEADER.NAME'), $translate('TASKS.HEADER.ASSIGNEE'), $translate('TASKS.HEADER.OWNER'), $translate('TASKS.HEADER.CREATE-TIME'), $translate('TASKS.HEADER.END-TIME')]) .then(function (headers) { $scope.gridTasks = { data: 'tasks.data', enableRowReordering: false, multiSelect: false, keepLastSelected: false, enableSorting: false, rowHeight: 36, afterSelectionChange: $scope.openTask, columnDefs: [ {field: 'id', displayName: headers[0], width: 50}, {field: 'name', displayName: headers[1]}, {field: 'assignee', displayName: headers[2], cellTemplate: gridConstants.defaultTemplate}, {field: 'owner', displayName: headers[3], cellTemplate: gridConstants.defaultTemplate}, {field: 'startTime', displayName: headers[4], cellTemplate: dateTemplate}, {field: 'endTime', displayName: headers[5], cellTemplate: dateTemplate} ] }; }); $q.all([$translate('VARIABLES.HEADER.NAME'), $translate('VARIABLES.HEADER.TYPE'), $translate('VARIABLES.HEADER.VALUE')]) .then(function (headers) { var variableValueTemplate = '<div><div class="ngCellText">{{row.getProperty("variable.valueUrl") && "(Binary)" || row.getProperty(col.field)}}</div></div>'; var variableTypeTemplate = '<div><div class="ngCellText">{{row.getProperty(col.field) && row.getProperty(col.field) || "null"}}</div></div>'; $scope.selectedVariables = []; // Config for variable grid $scope.gridVariables = { data: 'variables.data', enableRowReordering: false, multiSelect: false, keepLastSelected: false, enableSorting: false, rowHeight: 36, selectedItems: $scope.selectedVariables, columnDefs: [ {field: 'variable.name', displayName: headers[0]}, {field: 'variable.type', displayName: headers[1], cellTemplate: variableTypeTemplate}, {field: 'variable.value', displayName: headers[2], cellTemplate: variableValueTemplate} ] }; }); $q.all([$translate('PROCESS-INSTANCES.HEADER.ID'), $translate('PROCESS-INSTANCES.HEADER.NAME'), $translate('PROCESS-INSTANCES.HEADER.PROCESS-DEFINITION'), $translate('PROCESS-INSTANCES.HEADER.STATUS')]) .then(function (headers) { var subprocessStateTemplate = '<div><div class="ngCellText">{{row.getProperty("endTime") && "Completed" || "Active"}}</div></div>'; // Config for variable grid $scope.gridSubprocesses = { data: 'subprocesses.data', enableRowReordering: false, multiSelect: false, keepLastSelected: false, enableSorting: false, rowHeight: 36, afterSelectionChange: $scope.openProcessInstance, columnDefs: [ {field: 'id', displayName: headers[0]}, {field: 'name', displayName: headers[1]}, {field: 'processDefinitionId', displayName: headers[2]}, {field: 'endTime', displayName: headers[3], cellTemplate: subprocessStateTemplate} ] }; }); $q.all([$translate('JOBS.HEADER.ID'), $translate('JOBS.HEADER.DUE-DATE'), $translate('JOBS.HEADER.RETRIES'), $translate('JOBS.HEADER.EXCEPTION')]) .then(function (headers) { var dateTemplate = '<div><div class="ngCellText" title="{{row.getProperty(col.field) | dateformat:\'full\'}}">{{row.getProperty(col.field) | dateformat}}</div></div>'; // Config for variable grid $scope.gridJobs = { data: 'jobs.data', enableRowReordering: false, multiSelect: false, keepLastSelected: false, enableSorting: false, rowHeight: 36, afterSelectionChange: $scope.openJob, columnDefs: [ {field: 'id', displayName: headers[0], width: 50}, {field: 'dueDate', displayName: headers[1], cellTemplate: dateTemplate}, {field: 'retries', displayName: headers[2]}, {field: 'exceptionMessage', displayName: headers[3]} ] }; }); $q.all([$translate('DECISION-TABLE-EXECUTION.HEADER.ID'), $translate('DECISION-TABLE-EXECUTION.HEADER.DECISION-KEY'), $translate('DECISION-TABLE-EXECUTION.HEADER.DECISION-DEFINITION-ID'), $translate('DECISION-TABLE-EXECUTION.HEADER.END-TIME'), $translate('DECISION-TABLE-EXECUTION.HEADER.FAILED')]) .then(function (headers) { $scope.gridDecisionTables = { data: 'decisionTables.data', enableRowReordering: false, multiSelect: false, keepLastSelected: false, enableSorting: false, rowHeight: 36, afterSelectionChange: $scope.openDecisionTable, columnDefs: [ {field: 'id', displayName: headers[0]}, {field: 'decisionKey', displayName: headers[1]}, {field: 'decisionDefinitionId', displayName: headers[2]}, { field: 'endTime', displayName: headers[3], cellTemplate: gridConstants.dateTemplate }, {field: 'decisionExecutionFailed', displayName: headers[4]} ] }; }); $q.all([$translate('FORM-INSTANCE.HEADER.ID'), $translate('FORM-INSTANCE.HEADER.TASK-ID'), $translate('FORM-INSTANCE.HEADER.PROCESS-ID'), $translate('FORM-INSTANCE.HEADER.SUBMITTED'), $translate('FORM-INSTANCE.HEADER.SUBMITTED-BY')]) .then(function (headers) { $scope.gridFormInstances = { data: 'formInstances.data', enableRowReordering: false, multiSelect: false, keepLastSelected: false, enableSorting: false, rowHeight: 36, afterSelectionChange: $scope.openFormInstance, columnDefs: [ {field: 'id', displayName: headers[0]}, {field: 'taskId', displayName: headers[1]}, {field: 'processInstanceId', displayName: headers[2]}, {field: 'submittedDate', displayName: headers[3], cellTemplate: gridConstants.dateTemplate}, {field: 'submittedBy', displayName: headers[4], cellTemplate: gridConstants.userObjectTemplate} ] }; }); $scope.showAllJobs = function () { // Populate the job-filter with process id $rootScope.filters.forced.jobFilter = { processInstanceId: $scope.process.id }; $location.path("/jobs"); }; $scope.loadTasks = function () { $scope.tasks = undefined; $http({ method: 'GET', url: '/app/rest/admin/process-instances/' + $scope.process.id + '/tasks' }).success(function (data, status, headers, config) { $scope.tasks = data; $scope.tabData.tabs[0].info = data.total; }); }; $scope.loadVariables = function () { $scope.variables = undefined; $http({ method: 'GET', url: '/app/rest/admin/process-instances/' + $scope.process.id + '/variables' }).success(function (data, status, headers, config) { $scope.variables = data; $scope.tabData.tabs[1].info = data.total; }); }; $scope.loadSubProcesses = function () { $scope.subprocesses = undefined; $http({ method: 'GET', url: '/app/rest/admin/process-instances/' + $scope.process.id + '/subprocesses' }).success(function (data, status, headers, config) { $scope.subprocesses = data; $scope.tabData.tabs[2].info = data.total; }); }; $scope.loadJobs = function () { $scope.jobs = undefined; $http({ method: 'GET', url: '/app/rest/admin/process-instances/' + $scope.process.id + '/jobs' }).success(function (data, status, headers, config) { $scope.jobs = data; $scope.tabData.tabs[3].info = data.total; }); }; $scope.loadProcessDefinition = function () { // Load definition $http({ method: 'GET', url: '/app/rest/admin/process-definitions/' + $scope.process.processDefinitionId }).success(function (data, status, headers, config) { $scope.definition = data; }).error(function (data, status, headers, config) { }); }; $scope.loadDecisionTables = function () { // Load decision tables $http({ method: 'GET', url: '/app/rest/admin/process-instances/' + $scope.process.id + '/decision-executions' }).success(function (data, status, headers, config) { $scope.decisionTables = data; $scope.tabData.tabs[4].info = data.total; }).error(function (data, status, headers, config) { }); }; $scope.loadFormInstances = function () { // Load form instances $http({ method: 'GET', url: '/app/rest/admin/process-form-instances/' + $scope.process.id }).success(function (data, status, headers, config) { $scope.formInstances = data; $scope.tabData.tabs[5].info = data.total; }).error(function (data, status, headers, config) { }); }; $scope.executeWhenReady(function () { $scope.loadProcessInstance(); }); // Dialogs $scope.deleteProcessInstance = function (action) { if (!action) { action = "delete"; } var modalInstance = $modal.open({ templateUrl: 'views/process-instance-delete-popup.html', controller: 'DeleteProcessModalInstanceCtrl', resolve: { process: function () { return $scope.process; }, action: function () { return action; } } }); modalInstance.result.then(function (deleteProcessInstance) { if (deleteProcessInstance) { if (action == 'delete') { $scope.addAlert($translate.instant('ALERT.PROCESS-INSTANCE.DELETED', $scope.process), 'info'); $scope.returnToList(); } else { $scope.addAlert($translate.instant('ALERT.PROCESS-INSTANCE.TERMINATED', $scope.process), 'info'); $scope.loadProcessInstance(); } } }); }; $scope.updateSelectedVariable = function () { if ($scope.selectedVariables && $scope.selectedVariables.length > 0) { var selectedVariable = $scope.selectedVariables[0]; var modalInstance = $modal.open({ templateUrl: 'views/update-variable-popup.html', controller: 'UpdateVariableCtrl', resolve: { variable: function () { return selectedVariable.variable; }, processInstanceId: function () { return $scope.process.id; } } }); modalInstance.result.then(function (updated) { if (updated == true) { $scope.selectedVariables.splice(0, $scope.selectedVariables.length); $scope.loadVariables(); } }); } }; $scope.deleteVariable = function () { if ($scope.selectedVariables && $scope.selectedVariables.length > 0) { var selectedVariable = $scope.selectedVariables[0]; var modalInstance = $modal.open({ templateUrl: 'views/variable-delete-popup.html', controller: 'DeleteVariableCtrl', resolve: { variable: function () { return selectedVariable.variable; }, processInstanceId: function () { return $scope.process.id; } } }); modalInstance.result.then(function (updated) { if (updated == true) { $scope.selectedVariables.splice(0, $scope.selectedVariables.length); $scope.loadVariables(); } }); } }; $scope.addVariable = function () { var modalInstance = $modal.open({ templateUrl: 'views/variable-add-popup.html', controller: 'AddVariableCtrl', resolve: { processInstanceId: function () { return $scope.process.id; } } }); modalInstance.result.then(function (updated) { if (updated == true) { $scope.selectedVariables.splice(0, $scope.selectedVariables.length); $scope.loadVariables(); } }); }; $scope.terminateProcessInstance = function () { $scope.deleteProcessInstance("terminate"); }; }]); flowableAdminApp.controller('DeleteProcessModalInstanceCtrl', ['$rootScope', '$scope', '$modalInstance', '$http', 'process', 'action', function ($rootScope, $scope, $modalInstance, $http, process, action) { $scope.process = process; $scope.action = action; $scope.status = {loading: false}; $scope.model = {}; $scope.ok = function () { $scope.status.loading = true; var dataForPost = {action: $scope.action}; if ($scope.action == 'terminate' && $scope.model.deleteReason) { dataForPost.deleteReason = $scope.model.deleteReason; } $http({ method: 'POST', url: '/app/rest/admin/process-instances/' + $scope.process.id, data: dataForPost }).success(function (data, status, headers, config) { $modalInstance.close(true); $scope.status.loading = false; }).error(function (data, status, headers, config) { $modalInstance.close(false); $scope.status.loading = false; }); }; $scope.cancel = function () { if (!$scope.status.loading) { $modalInstance.dismiss('cancel'); } }; }]); flowableAdminApp.controller('ShowProcessInstanceDiagramPopupCtrl', ['$rootScope', '$scope', '$modalInstance', '$http', 'process', '$timeout', function ($rootScope, $scope, $modalInstance, $http, process, $timeout) { $scope.model = { id: process.id, name: process.name }; $scope.status = {loading: false}; $scope.cancel = function () { if (!$scope.status.loading) { $modalInstance.dismiss('cancel'); } }; $timeout(function () { $("#bpmnModel").attr("data-instance-id", process.id); $("#bpmnModel").attr("data-definition-id", process.processDefinitionId); $("#bpmnModel").attr("data-server-id", $rootScope.activeServers['process'].id); if (process.endTime != undefined) { $("#bpmnModel").attr("data-history-id", process.id); } $("#bpmnModel").load("./display/displaymodel.html?instanceId=" + process.id); }, 200); }]); flowableAdminApp.controller('UpdateVariableCtrl', ['$rootScope', '$scope', '$modalInstance', '$http', 'variable', 'processInstanceId', function ($rootScope, $scope, $modalInstance, $http, variable, processInstanceId) { $scope.status = {loading: false}; $scope.originalVariable = variable; $scope.updateVariable = { name: variable.name, value: variable.value, type: variable.type }; $scope.executeUpdateVariable = function () { $scope.status.loading = true; var dataForPut = { name: $scope.updateVariable.name, type: $scope.updateVariable.type }; if ($scope.updateVariable.value !== null || $scope.updateVariable.value !== undefined || $scope.updateVariable.value !== '') { if ($scope.updateVariable.type === 'string') { dataForPut.value = $scope.updateVariable.value; } else if ($scope.updateVariable.type === 'boolean') { if ($scope.updateVariable.value) { dataForPut.value = true; } else { dataForPut.value = false; } } else if ($scope.updateVariable.type === 'date') { dataForPut.value = $scope.updateVariable.value; } else if ($scope.updateVariable.type === 'double' || $scope.updateVariable.type === 'long' || $scope.updateVariable.type === 'integer' || $scope.updateVariable.type === 'short') { dataForPut.value = Number($scope.updateVariable.value); } } else { dataForPut.value = null; } $http({ method: 'PUT', url: '/app/rest/admin/process-instances/' + processInstanceId + '/variables/' + $scope.updateVariable.name, data: dataForPut }).success(function (data, status, headers, config) { $modalInstance.close(true); $scope.status.loading = false; }).error(function (data, status, headers, config) { $modalInstance.close(false); $scope.status.loading = false; }); }; $scope.cancel = function () { $modalInstance.dismiss('cancel'); }; }]); flowableAdminApp.controller('DeleteVariableCtrl', ['$rootScope', '$scope', '$modalInstance', '$http', 'variable', 'processInstanceId', function ($rootScope, $scope, $modalInstance, $http, variable, processInstanceId) { $scope.status = {loading: false}; $scope.variable = variable; $scope.deleteVariable = function () { $http({ method: 'DELETE', url: '/app/rest/admin/process-instances/' + processInstanceId + '/variables/' + $scope.variable.name }).success(function (data, status, headers, config) { $modalInstance.close(true); $scope.status.loading = false; }).error(function (data, status, headers, config) { $modalInstance.close(false); $scope.status.loading = false; }); }; $scope.cancel = function () { $modalInstance.dismiss('cancel'); }; }]); flowableAdminApp.controller('AddVariableCtrl', ['$rootScope', '$scope', '$modalInstance', '$http', 'processInstanceId', function ($rootScope, $scope, $modalInstance, $http, processInstanceId) { $scope.status = {loading: false}; $scope.types = [ "string", "boolean", "date", "double", "integer", "long", "short" ]; $scope.newVariable = {}; $scope.createVariable = function () { var data = { name: $scope.newVariable.name, type: $scope.newVariable.type, }; if ($scope.newVariable.type === 'string') { data.value = $scope.newVariable.value; } else if ($scope.newVariable.type === 'boolean') { if ($scope.newVariable.value) { data.value = true; } else { data.value = false; } } else if ($scope.newVariable.type === 'date') { data.value = $scope.newVariable.value; } else if ($scope.newVariable.type === 'double' || $scope.newVariable.type === 'long' || $scope.newVariable.type === 'integer' || $scope.newVariable.type === 'short') { data.value = Number($scope.newVariable.value); } $http({ method: 'POST', url: '/app/rest/admin/process-instances/' + processInstanceId + '/variables', data: data }).success(function (data, status, headers, config) { $modalInstance.close(true); $scope.status.loading = false; }).error(function (data, status, headers, config) { $modalInstance.close(false); $scope.status.loading = false; }); }; $scope.cancel = function () { $modalInstance.dismiss('cancel'); }; }]);
apache-2.0
erupakov/legacy
Core/Cryptany.Core.ConfigOM/CashChannel.cs
979
/* Copyright 2006-2017 Cryptany, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ using System; using System.Collections.Generic; using System.Text; using Cryptany.Core.DPO.MetaObjects.Attributes; namespace Cryptany.Core.ConfigOM { [Serializable] [DbSchema("services")] [Table("Channels", "ServiceID", ConditionOperation.Equals, "44771D42-3C46-4FDA-B415-8CC8FC8C8DEC")] public class CashChannel : Channel { } }
apache-2.0
emcvipr/dataservices-sdk-dotnet
AWSSDK/Amazon.SimpleWorkflow/Model/Internal/MarshallTransformations/StartWorkflowExecutionRequestMarshaller.cs
7086
/* * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.SimpleWorkflow.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.SimpleWorkflow.Model.Internal.MarshallTransformations { /// <summary> /// Start Workflow Execution Request Marshaller /// </summary> internal class StartWorkflowExecutionRequestMarshaller : IMarshaller<IRequest, StartWorkflowExecutionRequest> { public IRequest Marshall(StartWorkflowExecutionRequest startWorkflowExecutionRequest) { IRequest request = new DefaultRequest(startWorkflowExecutionRequest, "AmazonSimpleWorkflow"); string target = "SimpleWorkflowService.StartWorkflowExecution"; request.Headers["X-Amz-Target"] = target; request.Headers["Content-Type"] = "application/x-amz-json-1.0"; string uriResourcePath = ""; if (uriResourcePath.Contains("?")) { string queryString = uriResourcePath.Substring(uriResourcePath.IndexOf("?") + 1); uriResourcePath = uriResourcePath.Substring(0, uriResourcePath.IndexOf("?")); foreach (string s in queryString.Split('&', ';')) { string[] nameValuePair = s.Split('='); if (nameValuePair.Length == 2 && nameValuePair[1].Length > 0) { request.Parameters.Add(nameValuePair[0], nameValuePair[1]); } else { request.Parameters.Add(nameValuePair[0], null); } } } request.ResourcePath = uriResourcePath; using (StringWriter stringWriter = new StringWriter()) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); if (startWorkflowExecutionRequest != null && startWorkflowExecutionRequest.IsSetDomain()) { writer.WritePropertyName("domain"); writer.Write(startWorkflowExecutionRequest.Domain); } if (startWorkflowExecutionRequest != null && startWorkflowExecutionRequest.IsSetWorkflowId()) { writer.WritePropertyName("workflowId"); writer.Write(startWorkflowExecutionRequest.WorkflowId); } if (startWorkflowExecutionRequest != null) { WorkflowType workflowType = startWorkflowExecutionRequest.WorkflowType; if (workflowType != null) { writer.WritePropertyName("workflowType"); writer.WriteObjectStart(); if (workflowType != null && workflowType.IsSetName()) { writer.WritePropertyName("name"); writer.Write(workflowType.Name); } if (workflowType != null && workflowType.IsSetVersion()) { writer.WritePropertyName("version"); writer.Write(workflowType.Version); } writer.WriteObjectEnd(); } } if (startWorkflowExecutionRequest != null) { TaskList taskList = startWorkflowExecutionRequest.TaskList; if (taskList != null) { writer.WritePropertyName("taskList"); writer.WriteObjectStart(); if (taskList != null && taskList.IsSetName()) { writer.WritePropertyName("name"); writer.Write(taskList.Name); } writer.WriteObjectEnd(); } } if (startWorkflowExecutionRequest != null && startWorkflowExecutionRequest.IsSetInput()) { writer.WritePropertyName("input"); writer.Write(startWorkflowExecutionRequest.Input); } if (startWorkflowExecutionRequest != null && startWorkflowExecutionRequest.IsSetExecutionStartToCloseTimeout()) { writer.WritePropertyName("executionStartToCloseTimeout"); writer.Write(startWorkflowExecutionRequest.ExecutionStartToCloseTimeout); } if (startWorkflowExecutionRequest != null && startWorkflowExecutionRequest.TagList != null && startWorkflowExecutionRequest.TagList.Count > 0) { List<string> tagListList = startWorkflowExecutionRequest.TagList; writer.WritePropertyName("tagList"); writer.WriteArrayStart(); foreach (string tagListListValue in tagListList) { writer.Write(StringUtils.FromString(tagListListValue)); } writer.WriteArrayEnd(); } if (startWorkflowExecutionRequest != null && startWorkflowExecutionRequest.IsSetTaskStartToCloseTimeout()) { writer.WritePropertyName("taskStartToCloseTimeout"); writer.Write(startWorkflowExecutionRequest.TaskStartToCloseTimeout); } if (startWorkflowExecutionRequest != null && startWorkflowExecutionRequest.IsSetChildPolicy()) { writer.WritePropertyName("childPolicy"); writer.Write(startWorkflowExecutionRequest.ChildPolicy); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } } }
apache-2.0
metatron-app/metatron-discovery
discovery-server/src/main/java/app/metatron/discovery/domain/datasource/DataSourceFilterRequest.java
2116
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package app.metatron.discovery.domain.datasource; import java.util.List; import app.metatron.discovery.common.criteria.ListFilterRequest; /** * */ public class DataSourceFilterRequest extends ListFilterRequest { List<String> status; List<String> workspace; List<String> userGroup; List<String> dataSourceType; List<String> sourceType; List<String> connectionType; List<Boolean> published; public List<String> getStatus() { return status; } public void setStatus(List<String> status) { this.status = status; } public List<String> getWorkspace() { return workspace; } public void setWorkspace(List<String> workspace) { this.workspace = workspace; } public List<String> getUserGroup() { return userGroup; } public void setUserGroup(List<String> userGroup) { this.userGroup = userGroup; } public List<String> getDataSourceType() { return dataSourceType; } public void setDataSourceType(List<String> dataSourceType) { this.dataSourceType = dataSourceType; } public List<String> getSourceType() { return sourceType; } public void setSourceType(List<String> sourceType) { this.sourceType = sourceType; } public List<String> getConnectionType() { return connectionType; } public void setConnectionType(List<String> connectionType) { this.connectionType = connectionType; } public List<Boolean> getPublished() { return published; } public void setPublished(List<Boolean> published) { this.published = published; } }
apache-2.0