repo_name stringlengths 5 108 | path stringlengths 6 333 | size stringlengths 1 6 | content stringlengths 4 977k | license stringclasses 15 values |
|---|---|---|---|---|
panos--/ella | src/main/java/org/unbunt/ella/exception/EllaNonLocalReturnException.java | 2197 | /* EllaNonLocalReturnException.java
Copyright (C) 2009, 2010 Thomas Weiß <panos@unbunt.org>
This file is part of the Ella scripting language interpreter.
Ella is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
Ella is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with Ella; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package org.unbunt.ella.exception;
public class EllaNonLocalReturnException extends EllaRuntimeException {
public EllaNonLocalReturnException() {
}
public EllaNonLocalReturnException(Throwable cause) {
super(cause);
}
public EllaNonLocalReturnException(String message) {
super(message);
}
public EllaNonLocalReturnException(String message, Throwable cause) {
super(message, cause);
}
} | gpl-2.0 |
aldifahrezi/DDP | Assignment 1 (Melempar Meriam Game)/melemparmeriam/MeriamConstants.java | 511 | package melemparmeriam;
/*
* Kelas ini merupakan kelas yang mengandung konstanta yang dipakai dalam class lain pada package melemparmeriam.
*
* @author Aldi Fahrezi
* @version 1.0.0
*
*/
public class MeriamConstants {
/**
* EPS merupakan konstanta epsilon yang digunakan dalam membandingkan double
*/
protected static final double EPS = 1e-7;
/**
* GRAVITY merupakan konstanta gravitasi yang digunakan dalam perhitungan gerakan parabolic BolaMeriam
*/
protected static double GRAVITY = -9.81;
} | gpl-2.0 |
mickem/check_jmx | src/main/java/name/medin/monitoring/jmx/JMXConnection.java | 2018 | package name.medin.monitoring.jmx;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
import javax.management.openmbean.CompositeDataSupport;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import javax.naming.Context;
public class JMXConnection {
private final JMXConnector connector;
private final MBeanServerConnection connection;
public JMXConnection(final String url, final String provider, final String username, final String password) throws IOException {
JMXServiceURL jmxUrl = new JMXServiceURL(url);
Map<String, Object> env = new HashMap<String, Object>();
if (username != null) {
env.put(Context.SECURITY_PRINCIPAL, username);
env.put(Context.SECURITY_CREDENTIALS, password);
}
if (provider != null)
env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, provider);
connector = JMXConnectorFactory.connect(jmxUrl, env);
connection = connector.getMBeanServerConnection();
}
public void disconnect() throws IOException {
connector.close();
}
public long fetch(final String object, final String attribute, final String attribute_key) throws Exception {
Object attr = connection.getAttribute(new ObjectName(object), attribute);
if (attr instanceof CompositeDataSupport) {
CompositeDataSupport cds = (CompositeDataSupport) attr;
if (attribute_key == null)
throw new ParseError("Attribute key is null for composed data " + object);
return parseData(cds.get(attribute_key));
} else {
return parseData(attr);
}
}
private long parseData(final Object o) {
if (o instanceof Number) {
return ((Number) o).longValue();
} else if (o instanceof Boolean) {
boolean b = ((Boolean) o).booleanValue();
return b ? 1 : 0;
} else {
return Long.parseLong(o.toString());
}
}
}
| gpl-2.0 |
iammyr/Benchmark | src/main/java/org/owasp/benchmark/testcode/BenchmarkTest01710.java | 2330 | /**
* OWASP Benchmark Project v1.1
*
* This file is part of the Open Web Application Security Project (OWASP)
* Benchmark Project. For details, please see
* <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>.
*
* The Benchmark is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation, version 2.
*
* The Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* @author Nick Sanidas <a href="https://www.aspectsecurity.com">Aspect Security</a>
* @created 2015
*/
package org.owasp.benchmark.testcode;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/BenchmarkTest01710")
public class BenchmarkTest01710 extends HttpServlet {
private static final long serialVersionUID = 1L;
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String param = "";
java.util.Enumeration<String> headerNames = request.getHeaderNames();
if (headerNames.hasMoreElements()) {
param = headerNames.nextElement(); // just grab first element
}
String bar = "safe!";
java.util.HashMap<String,Object> map28110 = new java.util.HashMap<String,Object>();
map28110.put("keyA-28110", "a_Value"); // put some stuff in the collection
map28110.put("keyB-28110", param.toString()); // put it in a collection
map28110.put("keyC", "another_Value"); // put some stuff in the collection
bar = (String)map28110.get("keyB-28110"); // get it back out
bar = (String)map28110.get("keyA-28110"); // get safe value back out
java.io.FileOutputStream fos = new java.io.FileOutputStream(new java.io.File(org.owasp.benchmark.helpers.Utils.testfileDir + bar));
}
}
| gpl-2.0 |
hdadler/sensetrace-src | com.ipv.sensetrace.RDFDatamanager/jena-2.11.0/jena-core/src/main/java/com/hp/hpl/jena/graph/compose/DisjointUnion.java | 1903 | /*
* 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 com.hp.hpl.jena.graph.compose;
import com.hp.hpl.jena.graph.Graph;
import com.hp.hpl.jena.graph.Triple;
import com.hp.hpl.jena.graph.TripleMatch;
import com.hp.hpl.jena.util.iterator.ExtendedIterator;
/**
DisjointUnion - a version of Union that assumes the graphs are disjoint, and
hence that <code>find</code> need not do duplicate-removal. Adding things
to the graph adds them to the left component, and does <i>not</i> add
triples that are already in the right component.
*/
public class DisjointUnion extends Dyadic
{
public DisjointUnion( Graph L, Graph R )
{ super( L, R ); }
@Override protected ExtendedIterator<Triple> _graphBaseFind( TripleMatch m )
{ return L.find( m ) .andThen( R.find( m ) ); }
@Override public boolean graphBaseContains( Triple t )
{ return L.contains( t ) || R.contains( t ); }
@Override public void performDelete( Triple t )
{ L.delete( t ); R.delete( t ); }
@Override public void performAdd( Triple t )
{ if (!R.contains( t )) L.add( t ); }
}
| gpl-2.0 |
google/desugar_jdk_libs | jdk11/src/java.base/share/classes/java/lang/CharacterData0E.java | 19723 | // This file was generated AUTOMATICALLY from a template file Tue Jan 26 13:20:08 PST 2021
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.lang;
/** The CharacterData class encapsulates the large tables found in
Java.lang.Character. */
class CharacterData0E extends CharacterData {
/* The character properties are currently encoded into 32 bits in the following manner:
1 bit mirrored property
4 bits directionality property
9 bits signed offset used for converting case
1 bit if 1, adding the signed offset converts the character to lowercase
1 bit if 1, subtracting the signed offset converts the character to uppercase
1 bit if 1, this character has a titlecase equivalent (possibly itself)
3 bits 0 may not be part of an identifier
1 ignorable control; may continue a Unicode identifier or Java identifier
2 may continue a Java identifier but not a Unicode identifier (unused)
3 may continue a Unicode identifier or Java identifier
4 is a Java whitespace character
5 may start or continue a Java identifier;
may continue but not start a Unicode identifier (underscores)
6 may start or continue a Java identifier but not a Unicode identifier ($)
7 may start or continue a Unicode identifier or Java identifier
Thus:
5, 6, 7 may start a Java identifier
1, 2, 3, 5, 6, 7 may continue a Java identifier
7 may start a Unicode identifier
1, 3, 5, 7 may continue a Unicode identifier
1 is ignorable within an identifier
4 is Java whitespace
2 bits 0 this character has no numeric property
1 adding the digit offset to the character code and then
masking with 0x1F will produce the desired numeric value
2 this character has a "strange" numeric value
3 a Java supradecimal digit: adding the digit offset to the
character code, then masking with 0x1F, then adding 10
will produce the desired numeric value
5 bits digit offset
5 bits character type
The encoding of character properties is subject to change at any time.
*/
int getProperties(int ch) {
char offset = (char)ch;
int props = A[Y[X[offset>>5]|((offset>>1)&0xF)]|(offset&0x1)];
return props;
}
int getPropertiesEx(int ch) {
char offset = (char)ch;
int props = B[Y[X[offset>>5]|((offset>>1)&0xF)]|(offset&0x1)];
return props;
}
boolean isOtherLowercase(int ch) {
int props = getPropertiesEx(ch);
return (props & 0x0001) != 0;
}
boolean isOtherUppercase(int ch) {
int props = getPropertiesEx(ch);
return (props & 0x0002) != 0;
}
boolean isOtherAlphabetic(int ch) {
int props = getPropertiesEx(ch);
return (props & 0x0004) != 0;
}
boolean isIdeographic(int ch) {
int props = getPropertiesEx(ch);
return (props & 0x0010) != 0;
}
int getType(int ch) {
int props = getProperties(ch);
return (props & 0x1F);
}
boolean isJavaIdentifierStart(int ch) {
int props = getProperties(ch);
return ((props & 0x00007000) >= 0x00005000);
}
boolean isJavaIdentifierPart(int ch) {
int props = getProperties(ch);
return ((props & 0x00003000) != 0);
}
boolean isUnicodeIdentifierStart(int ch) {
int props = getProperties(ch);
return ((props & 0x00007000) == 0x00007000);
}
boolean isUnicodeIdentifierPart(int ch) {
int props = getProperties(ch);
return ((props & 0x00001000) != 0);
}
boolean isIdentifierIgnorable(int ch) {
int props = getProperties(ch);
return ((props & 0x00007000) == 0x00001000);
}
int toLowerCase(int ch) {
int mapChar = ch;
int val = getProperties(ch);
if ((val & 0x00020000) != 0) {
int offset = val << 5 >> (5+18);
mapChar = ch + offset;
}
return mapChar;
}
int toUpperCase(int ch) {
int mapChar = ch;
int val = getProperties(ch);
if ((val & 0x00010000) != 0) {
int offset = val << 5 >> (5+18);
mapChar = ch - offset;
}
return mapChar;
}
int toTitleCase(int ch) {
int mapChar = ch;
int val = getProperties(ch);
if ((val & 0x00008000) != 0) {
// There is a titlecase equivalent. Perform further checks:
if ((val & 0x00010000) == 0) {
// The character does not have an uppercase equivalent, so it must
// already be uppercase; so add 1 to get the titlecase form.
mapChar = ch + 1;
}
else if ((val & 0x00020000) == 0) {
// The character does not have a lowercase equivalent, so it must
// already be lowercase; so subtract 1 to get the titlecase form.
mapChar = ch - 1;
}
// else {
// The character has both an uppercase equivalent and a lowercase
// equivalent, so it must itself be a titlecase form; return it.
// return ch;
//}
}
else if ((val & 0x00010000) != 0) {
// This character has no titlecase equivalent but it does have an
// uppercase equivalent, so use that (subtract the signed case offset).
mapChar = toUpperCase(ch);
}
return mapChar;
}
int digit(int ch, int radix) {
int value = -1;
if (radix >= Character.MIN_RADIX && radix <= Character.MAX_RADIX) {
int val = getProperties(ch);
int kind = val & 0x1F;
if (kind == Character.DECIMAL_DIGIT_NUMBER) {
value = ch + ((val & 0x3E0) >> 5) & 0x1F;
}
else if ((val & 0xC00) == 0x00000C00) {
// Java supradecimal digit
value = (ch + ((val & 0x3E0) >> 5) & 0x1F) + 10;
}
}
return (value < radix) ? value : -1;
}
int getNumericValue(int ch) {
int val = getProperties(ch);
int retval = -1;
switch (val & 0xC00) {
default: // cannot occur
case (0x00000000): // not numeric
retval = -1;
break;
case (0x00000400): // simple numeric
retval = ch + ((val & 0x3E0) >> 5) & 0x1F;
break;
case (0x00000800) : // "strange" numeric
retval = -2;
break;
case (0x00000C00): // Java supradecimal
retval = (ch + ((val & 0x3E0) >> 5) & 0x1F) + 10;
break;
}
return retval;
}
boolean isDigit(int ch) {
int props = getProperties(ch);
return (props & 0x1F) == Character.DECIMAL_DIGIT_NUMBER;
}
boolean isLowerCase(int ch) {
int props = getProperties(ch);
return (props & 0x1F) == Character.LOWERCASE_LETTER;
}
boolean isUpperCase(int ch) {
int props = getProperties(ch);
return (props & 0x1F) == Character.UPPERCASE_LETTER;
}
boolean isWhitespace(int ch) {
int props = getProperties(ch);
return ((props & 0x00007000) == 0x00004000);
}
byte getDirectionality(int ch) {
int val = getProperties(ch);
byte directionality = (byte)((val & 0x78000000) >> 27);
if (directionality == 0xF ) {
directionality = Character.DIRECTIONALITY_UNDEFINED;
}
return directionality;
}
boolean isMirrored(int ch) {
int props = getProperties(ch);
return ((props & 0x80000000) != 0);
}
static final CharacterData instance = new CharacterData0E();
private CharacterData0E() {};
// The X table has 2048 entries for a total of 4096 bytes.
static final char X[] = (
"\000\020\020\020\040\040\040\040\060\060\060\060\060\060\060\100\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040"+
"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040").toCharArray();
// The Y table has 80 entries for a total of 160 bytes.
static final char Y[] = (
"\000\002\002\002\002\002\002\002\002\002\002\002\002\002\002\002\004\004\004"+
"\004\004\004\004\004\004\004\004\004\004\004\004\004\002\002\002\002\002\002"+
"\002\002\002\002\002\002\002\002\002\002\006\006\006\006\006\006\006\006\006"+
"\006\006\006\006\006\006\006\006\006\006\006\006\006\006\006\002\002\002\002"+
"\002\002\002\002").toCharArray();
// The A table has 8 entries for a total of 32 bytes.
static final int A[] = new int[8];
static final String A_DATA =
"\u7800\000\u4800\u1010\u7800\000\u7800\000\u4800\u1010\u4800\u1010\u4000\u3006"+
"\u4000\u3006";
// The B table has 8 entries for a total of 16 bytes.
static final char B[] = (
"\000\000\000\000\000\000\000\000").toCharArray();
// In all, the character property tables require 4288 bytes.
static {
{ // THIS CODE WAS AUTOMATICALLY CREATED BY GenerateCharacter:
char[] data = A_DATA.toCharArray();
assert (data.length == (8 * 2));
int i = 0, j = 0;
while (i < (8 * 2)) {
int entry = data[i++] << 16;
A[j++] = entry | data[i++];
}
}
}
}
| gpl-2.0 |
vishwaAbhinav/OpenNMS | opennms-provision/opennms-detector-lineoriented/src/test/java/org/opennms/netmgt/provision/detector/NrpeDetectorTest.java | 3783 | /*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2008-2012 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2012 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
*
* OpenNMS(R) is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* OpenNMS(R) is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenNMS(R). If not, see:
* http://www.gnu.org/licenses/
*
* For more information contact:
* OpenNMS(R) Licensing <license@opennms.org>
* http://www.opennms.org/
* http://www.opennms.com/
*******************************************************************************/
package org.opennms.netmgt.provision.detector;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.net.UnknownHostException;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opennms.netmgt.provision.ServiceDetector;
import org.opennms.netmgt.provision.detector.simple.NrpeDetector;
import org.opennms.test.mock.MockLogAppender;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* @author Donald Desloge
*
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath:/META-INF/opennms/detectors.xml"})
public class NrpeDetectorTest implements ApplicationContextAware {
private NrpeDetector m_detector;
private ApplicationContext m_applicationContext;
@Before
public void setUp() {
MockLogAppender.setupLogging();
m_detector = getDetector(NrpeDetector.class);
m_detector.setPort(5666);
m_detector.init();
}
//Tested against a local windows box with NSClient++
@Test(timeout=90000)
public void testDetectorSuccess() throws UnknownHostException {
//assertTrue(m_detector.isServiceDetected(InetAddressUtils.addr("192.168.1.103")));
}
@Test(timeout=90000)
public void testDetectorFailWrongPort() throws UnknownHostException {
//m_detector.setPort(12489);
//assertFalse(m_detector.isServiceDetected(InetAddressUtils.addr("192.168.1.103")));
}
@Test(timeout=90000)
public void testDetectorFailNotUsingSSL() throws UnknownHostException {
//m_detector.setUseSsl(false);
//assertFalse(m_detector.isServiceDetected(InetAddressUtils.addr("192.168.1.103")));
}
/* (non-Javadoc)
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
*/
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
m_applicationContext = applicationContext;
}
private NrpeDetector getDetector(Class<? extends ServiceDetector> detectorClass) {
Object bean = m_applicationContext.getBean(detectorClass.getName());
assertNotNull(bean);
assertTrue(detectorClass.isInstance(bean));
return (NrpeDetector)bean;
}
}
| gpl-2.0 |
indiyskiy/WorldOnline | src/model/xmlparser/xmlview/card/cardshopping/Shopping.java | 8441 | package model.xmlparser.xmlview.card.cardshopping;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;
@Root(name = "Shopping")
public class Shopping {
@Attribute(name = "id", required = true)
public String id;
@Element(name = "ParentMenuID", required = false)
public String parentMenuID;
@Element(name = "NameRU", required = false)
public String nameRU;
@Element(name = "NameEN", required = false)
public String nameEN;
@Element(name = "Lat", required = false)
public String lat;
@Element(name = "Lon", required = false)
public String lon;
@Element(name = "PriceFile", required = false)
public String priceFile;
@Element(name = "Phone", required = false)
public String phone;
@Element(name = "AddrRU", required = false)
public String addrRU;
@Element(name = "AddrEN", required = false)
public String addrEN;
@Element(name = "OpenHours", required = false)
public String openHours;
@Element(name = "Photo", required = false)
public String photo;
@Element(name = "DescrRU", required = false)
public String descrRU;
@Element(name = "DescrEN", required = false)
public String descrEN;
@Element(name = "Site", required = false)
public String site;
@Element(name = "Email", required = false)
public String email;
@Element(name = "Vkcom", required = false)
public String vkCom;
@Element(name = "Fbcom", required = false)
public String fbCom;
@Element(name = "Twitter", required = false)
public String twitter;
@Element(name = "Frsqr", required = false)
public String frsqr;
@Element(name = "PanoramaToList", required = false)
public String panoramaToList;
@Element(name = "Booking", required = false)
public String booking;
@Element(name = "MiddlePrice", required = false)
public String middlePrice;
@Element(name = "Youtube", required = false)
public String youtube;
@Element(name = "Panorama", required = false)
public String panorama;
@Element(name = "Billboard", required = false)
public String billboard;
@Element(name = "Metro", required = false)
public String metro;
@Element(name = "WifiLogin", required = false)
public String wifiLogin;
@Element(name = "WifiPass", required = false)
public String wifiPass;
@Element(name = "Kitchen", required = false)
public String kitchen;
@Element(name = "Categories", required = false)
public String categories;
@Element(name = "NotShow", required = false)
public String notShow;
@Element(name = "Ribbons", required = false)
public String ribbons;
@Element(name = "CardImage", required = false)
public String cardImage;
@Element(name = "LiveJournal", required = false)
public String liveJournal;
@Element(name = "AppStore", required = false)
public String appStore;
@Element(name = "GooglePlay", required = false)
public String googlePlay;
@Element(name = "Tripadviser", required = false)
public String tripadviser;
@Element(name = "NewsRu", required = false)
public String newsRu;
@Element(name = "NewsEn", required = false)
public String newsEn;
@Element(name = "OffersRu", required = false)
public String offersRu;
@Element(name = "OffersEn", required = false)
public String offersEn;
@Element(name = "Instagramm", required = false)
public String instagramm;
@Element(name = "Apoi", required = false)
public String apoi;
@Element(name = "Ayda", required = false)
public String ayda;
@Element(name = "BlogFcsSpb", required = false)
public String blogFcsSpb;
@Element(name = "CafeSpb", required = false)
public String cafeSpb;
@Element(name = "DpRu", required = false)
public String dpRu;
@Element(name = "Flamp", required = false)
public String flamp;
@Element(name = "ImhoNet", required = false)
public String imhoNet;
@Element(name = "IRecommend", required = false)
public String iRecommend;
@Element(name = "Komandirovka", required = false)
public String komandirovka;
@Element(name = "MenuRu", required = false)
public String menuRu;
@Element(name = "Otzovik", required = false)
public String otzovik;
@Element(name = "PeterburgRu", required = false)
public String peterburgRu;
@Element(name = "Restlook", required = false)
public String restlook;
@Element(name = "Restop", required = false)
public String restop;
@Element(name = "Restoran", required = false)
public String restoran;
@Element(name = "Restozoom", required = false)
public String restozoom;
@Element(name = "Spbrestoran", required = false)
public String spbrestoran;
@Element(name = "SzoSpr", required = false)
public String szoSpr;
@Element(name = "TheVillage", required = false)
public String theVillage;
@Element(name = "Tourprom", required = false)
public String tourprom;
@Element(name = "Traveltipz", required = false)
public String traveltipz;
@Element(name = "Tulp", required = false)
public String tulp;
@Element(name = "Turbina", required = false)
public String turbina;
@Element(name = "Uvoice", required = false)
public String uvoice;
@Element(name = "Wrestorane", required = false)
public String wrestorane;
@Element(name = "Yell", required = false)
public String yell;
@Element(name = "Zoon", required = false)
public String zoon;
@Element(name = "FreePass", required = false)
public String freePass;
@Element(name = "Facts", required = false)
public String facts;
@Element(name = "Legends", required = false)
public String legends;
@Element(name = "Literature", required = false)
public String literature;
@Element(name = "Anecdotes", required = false)
public String anecdotes;
@Element(name = "Films", required = false)
public String films;
@Element(name = "FamousPassers", required = false)
public String famousPassers;
@Element(name = "Citations", required = false)
public String citations;
@Element(name = "BorisStars", required = false)
public String borisStars;
@Element(name = "Restoclub", required = false)
public String restoclub;
@Element(name = "Afisha", required = false)
public String afisha;
@Element(name = "Timeout", required = false)
public String timeout;
@Element(name = "Wikipedia", required = false)
public String wikipedia;
@Element(name = "Wikitravel", required = false)
public String wikitravel;
@Element(name = "ReservationDiscount", required = false)
public String reservationDiscount;
@Element(name = "ReservationPhone", required = false)
public String reservationPhone;
@Element(name = "RestaurantChain", required = false)
public String restaurantChain;
@Element(name = "AdditionalPhone", required = false)
public String additionalPhone;
@Element(name = "AllCafe", required = false)
public String allCafe;
@Element(name = "FactsEn", required = false)
public String factsEn;
@Element(name = "LegendsEn", required = false)
public String legendsEn;
@Element(name = "LiteratureEn", required = false)
public String literatureEn;
@Element(name = "AnecdotesEn", required = false)
public String anecdotesEn;
@Element(name = "FilmsEn", required = false)
public String filmsEn;
@Element(name = "FamousPassersEn", required = false)
public String famousPassersEn;
@Element(name = "CitationsEn", required = false)
public String citationsEn;
@Element(name = "WikipediaEn", required = false)
public String wikipediaEn;
@Element(name = "WikimapiaRu", required = false)
public String wikimapiaRu;
@Element(name = "WikimapiaEn", required = false)
public String wikimapiaEn;
@Element(name = "EncspbRu", required = false)
public String encspbRu;
@Element(name = "EncspbEn", required = false)
public String encspbEn;
@Element(name = "Walkspb", required = false)
public String walkspb;
@Element(name = "Spbin", required = false)
public String spbin;
@Element(name = "EtovidetRu", required = false)
public String etovidetRu;
@Element(name = "NoBarriers", required = false)
public String noBarriers;
}
| gpl-2.0 |
ikezhenxu/wx-sdk | src/huilai/kezhenxu/WxFactory.java | 1077 | package huilai.kezhenxu;
import java.io.IOException;
import java.util.Properties;
/**
* Created by kezhenxu on 4/17/15.
*/
public class WxFactory {
public static final String TOKEN = "hl.token";
public static final String ACCESS_TOKEN_LIFE = "hl.access.token.refresh.interval";
public static final String APP_ID = "hl.app.id";
public static final String SECRET = "hl.secret";
public static final String DEFAULT_RESOURCE = "/wx.properties";
private Properties properties;
private static WxFactory SINGLETON = null;
public WxFactory ( String propertiesFile ) {
properties = new Properties ();
try {
properties.load (
getClass ().getResourceAsStream ( propertiesFile )
);
} catch ( IOException e ) {
e.printStackTrace ();
}
}
synchronized
public static WxFactory getDefault () {
if ( SINGLETON == null ) {
SINGLETON = new WxFactory (DEFAULT_RESOURCE);
}
return SINGLETON;
}
public String getProperty ( String property ) {
return properties.getProperty ( property );
}
}
| gpl-2.0 |
vishwaAbhinav/OpenNMS | opennms-config/target/generated-sources/castor/org/opennms/netmgt/config/ami/descriptors/AmiConfigDescriptor.java | 18339 | /*
* This class was automatically generated with
* <a href="http://www.castor.org">Castor 1.1.2.1</a>, using an XML
* Schema.
* $Id$
*/
package org.opennms.netmgt.config.ami.descriptors;
//---------------------------------/
//- Imported classes and packages -/
//---------------------------------/
import org.opennms.netmgt.config.ami.AmiConfig;
/**
* Class AmiConfigDescriptor.
*
* @version $Revision$ $Date$
*/
@SuppressWarnings("all") public class AmiConfigDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
//--------------------------/
//- Class/Member Variables -/
//--------------------------/
/**
* Field _elementDefinition.
*/
private boolean _elementDefinition;
/**
* Field _nsPrefix.
*/
private java.lang.String _nsPrefix;
/**
* Field _nsURI.
*/
private java.lang.String _nsURI;
/**
* Field _xmlName.
*/
private java.lang.String _xmlName;
/**
* Field _identity.
*/
private org.exolab.castor.xml.XMLFieldDescriptor _identity;
//----------------/
//- Constructors -/
//----------------/
public AmiConfigDescriptor() {
super();
_nsURI = "http://xmlns.opennms.org/xsd/config/ami";
_xmlName = "ami-config";
_elementDefinition = true;
//-- set grouping compositor
setCompositorAsSequence();
org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
org.exolab.castor.mapping.FieldHandler handler = null;
org.exolab.castor.xml.FieldValidator fieldValidator = null;
//-- initialize attribute descriptors
//-- _port
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_port", "port", org.exolab.castor.xml.NodeType.Attribute);
handler = new org.exolab.castor.xml.XMLFieldHandler() {
@Override
public java.lang.Object getValue( java.lang.Object object )
throws IllegalStateException
{
AmiConfig target = (AmiConfig) object;
if (!target.hasPort()) { return null; }
return new java.lang.Integer(target.getPort());
}
@Override
public void setValue( java.lang.Object object, java.lang.Object value)
throws IllegalStateException, IllegalArgumentException
{
try {
AmiConfig target = (AmiConfig) object;
// if null, use delete method for optional primitives
if (value == null) {
target.deletePort();
return;
}
target.setPort( ((java.lang.Integer) value).intValue());
} catch (java.lang.Exception ex) {
throw new IllegalStateException(ex.toString());
}
}
@Override
@SuppressWarnings("unused")
public java.lang.Object newInstance(java.lang.Object parent) {
return null;
}
};
desc.setSchemaType("int");
desc.setHandler(handler);
desc.setMultivalued(false);
addFieldDescriptor(desc);
//-- validation code for: _port
fieldValidator = new org.exolab.castor.xml.FieldValidator();
{ //-- local scope
org.exolab.castor.xml.validators.IntValidator typeValidator;
typeValidator = new org.exolab.castor.xml.validators.IntValidator();
fieldValidator.setValidator(typeValidator);
typeValidator.setMinInclusive(-2147483648);
typeValidator.setMaxInclusive(2147483647);
}
desc.setValidator(fieldValidator);
//-- _useSsl
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_useSsl", "use-ssl", org.exolab.castor.xml.NodeType.Attribute);
handler = new org.exolab.castor.xml.XMLFieldHandler() {
@Override
public java.lang.Object getValue( java.lang.Object object )
throws IllegalStateException
{
AmiConfig target = (AmiConfig) object;
if (!target.hasUseSsl()) { return null; }
return (target.getUseSsl() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
}
@Override
public void setValue( java.lang.Object object, java.lang.Object value)
throws IllegalStateException, IllegalArgumentException
{
try {
AmiConfig target = (AmiConfig) object;
// if null, use delete method for optional primitives
if (value == null) {
target.deleteUseSsl();
return;
}
target.setUseSsl( ((java.lang.Boolean) value).booleanValue());
} catch (java.lang.Exception ex) {
throw new IllegalStateException(ex.toString());
}
}
@Override
@SuppressWarnings("unused")
public java.lang.Object newInstance(java.lang.Object parent) {
return null;
}
};
desc.setSchemaType("boolean");
desc.setHandler(handler);
desc.setMultivalued(false);
addFieldDescriptor(desc);
//-- validation code for: _useSsl
fieldValidator = new org.exolab.castor.xml.FieldValidator();
{ //-- local scope
org.exolab.castor.xml.validators.BooleanValidator typeValidator;
typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
fieldValidator.setValidator(typeValidator);
}
desc.setValidator(fieldValidator);
//-- _timeout
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_timeout", "timeout", org.exolab.castor.xml.NodeType.Attribute);
handler = new org.exolab.castor.xml.XMLFieldHandler() {
@Override
public java.lang.Object getValue( java.lang.Object object )
throws IllegalStateException
{
AmiConfig target = (AmiConfig) object;
if (!target.hasTimeout()) { return null; }
return new java.lang.Integer(target.getTimeout());
}
@Override
public void setValue( java.lang.Object object, java.lang.Object value)
throws IllegalStateException, IllegalArgumentException
{
try {
AmiConfig target = (AmiConfig) object;
// if null, use delete method for optional primitives
if (value == null) {
target.deleteTimeout();
return;
}
target.setTimeout( ((java.lang.Integer) value).intValue());
} catch (java.lang.Exception ex) {
throw new IllegalStateException(ex.toString());
}
}
@Override
@SuppressWarnings("unused")
public java.lang.Object newInstance(java.lang.Object parent) {
return null;
}
};
desc.setSchemaType("int");
desc.setHandler(handler);
desc.setMultivalued(false);
addFieldDescriptor(desc);
//-- validation code for: _timeout
fieldValidator = new org.exolab.castor.xml.FieldValidator();
{ //-- local scope
org.exolab.castor.xml.validators.IntValidator typeValidator;
typeValidator = new org.exolab.castor.xml.validators.IntValidator();
fieldValidator.setValidator(typeValidator);
typeValidator.setMinInclusive(-2147483648);
typeValidator.setMaxInclusive(2147483647);
}
desc.setValidator(fieldValidator);
//-- _retry
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_retry", "retry", org.exolab.castor.xml.NodeType.Attribute);
handler = new org.exolab.castor.xml.XMLFieldHandler() {
@Override
public java.lang.Object getValue( java.lang.Object object )
throws IllegalStateException
{
AmiConfig target = (AmiConfig) object;
if (!target.hasRetry()) { return null; }
return new java.lang.Integer(target.getRetry());
}
@Override
public void setValue( java.lang.Object object, java.lang.Object value)
throws IllegalStateException, IllegalArgumentException
{
try {
AmiConfig target = (AmiConfig) object;
// if null, use delete method for optional primitives
if (value == null) {
target.deleteRetry();
return;
}
target.setRetry( ((java.lang.Integer) value).intValue());
} catch (java.lang.Exception ex) {
throw new IllegalStateException(ex.toString());
}
}
@Override
@SuppressWarnings("unused")
public java.lang.Object newInstance(java.lang.Object parent) {
return null;
}
};
desc.setSchemaType("int");
desc.setHandler(handler);
desc.setMultivalued(false);
addFieldDescriptor(desc);
//-- validation code for: _retry
fieldValidator = new org.exolab.castor.xml.FieldValidator();
{ //-- local scope
org.exolab.castor.xml.validators.IntValidator typeValidator;
typeValidator = new org.exolab.castor.xml.validators.IntValidator();
fieldValidator.setValidator(typeValidator);
typeValidator.setMinInclusive(-2147483648);
typeValidator.setMaxInclusive(2147483647);
}
desc.setValidator(fieldValidator);
//-- _username
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_username", "username", org.exolab.castor.xml.NodeType.Attribute);
desc.setImmutable(true);
handler = new org.exolab.castor.xml.XMLFieldHandler() {
@Override
public java.lang.Object getValue( java.lang.Object object )
throws IllegalStateException
{
AmiConfig target = (AmiConfig) object;
return target.getUsername();
}
@Override
public void setValue( java.lang.Object object, java.lang.Object value)
throws IllegalStateException, IllegalArgumentException
{
try {
AmiConfig target = (AmiConfig) object;
target.setUsername( (java.lang.String) value);
} catch (java.lang.Exception ex) {
throw new IllegalStateException(ex.toString());
}
}
@Override
@SuppressWarnings("unused")
public java.lang.Object newInstance(java.lang.Object parent) {
return null;
}
};
desc.setSchemaType("string");
desc.setHandler(handler);
desc.setRequired(true);
desc.setMultivalued(false);
addFieldDescriptor(desc);
//-- validation code for: _username
fieldValidator = new org.exolab.castor.xml.FieldValidator();
fieldValidator.setMinOccurs(1);
{ //-- local scope
org.exolab.castor.xml.validators.StringValidator typeValidator;
typeValidator = new org.exolab.castor.xml.validators.StringValidator();
fieldValidator.setValidator(typeValidator);
typeValidator.setWhiteSpace("preserve");
}
desc.setValidator(fieldValidator);
//-- _password
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_password", "password", org.exolab.castor.xml.NodeType.Attribute);
desc.setImmutable(true);
handler = new org.exolab.castor.xml.XMLFieldHandler() {
@Override
public java.lang.Object getValue( java.lang.Object object )
throws IllegalStateException
{
AmiConfig target = (AmiConfig) object;
return target.getPassword();
}
@Override
public void setValue( java.lang.Object object, java.lang.Object value)
throws IllegalStateException, IllegalArgumentException
{
try {
AmiConfig target = (AmiConfig) object;
target.setPassword( (java.lang.String) value);
} catch (java.lang.Exception ex) {
throw new IllegalStateException(ex.toString());
}
}
@Override
@SuppressWarnings("unused")
public java.lang.Object newInstance(java.lang.Object parent) {
return null;
}
};
desc.setSchemaType("string");
desc.setHandler(handler);
desc.setMultivalued(false);
addFieldDescriptor(desc);
//-- validation code for: _password
fieldValidator = new org.exolab.castor.xml.FieldValidator();
{ //-- local scope
org.exolab.castor.xml.validators.StringValidator typeValidator;
typeValidator = new org.exolab.castor.xml.validators.StringValidator();
fieldValidator.setValidator(typeValidator);
typeValidator.setWhiteSpace("preserve");
}
desc.setValidator(fieldValidator);
//-- initialize element descriptors
//-- _definitionList
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.opennms.netmgt.config.ami.Definition.class, "_definitionList", "definition", org.exolab.castor.xml.NodeType.Element);
handler = new org.exolab.castor.xml.XMLFieldHandler() {
@Override
public java.lang.Object getValue( java.lang.Object object )
throws IllegalStateException
{
AmiConfig target = (AmiConfig) object;
return target.getDefinition();
}
@Override
public void setValue( java.lang.Object object, java.lang.Object value)
throws IllegalStateException, IllegalArgumentException
{
try {
AmiConfig target = (AmiConfig) object;
target.addDefinition( (org.opennms.netmgt.config.ami.Definition) value);
} catch (java.lang.Exception ex) {
throw new IllegalStateException(ex.toString());
}
}
public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
try {
AmiConfig target = (AmiConfig) object;
target.removeAllDefinition();
} catch (java.lang.Exception ex) {
throw new IllegalStateException(ex.toString());
}
}
@Override
@SuppressWarnings("unused")
public java.lang.Object newInstance(java.lang.Object parent) {
return new org.opennms.netmgt.config.ami.Definition();
}
};
desc.setSchemaType("org.opennms.netmgt.config.ami.Definition");
desc.setHandler(handler);
desc.setNameSpaceURI("http://xmlns.opennms.org/xsd/config/ami");
desc.setMultivalued(true);
addFieldDescriptor(desc);
addSequenceElement(desc);
//-- validation code for: _definitionList
fieldValidator = new org.exolab.castor.xml.FieldValidator();
fieldValidator.setMinOccurs(0);
{ //-- local scope
}
desc.setValidator(fieldValidator);
}
//-----------/
//- Methods -/
//-----------/
/**
* Method getAccessMode.
*
* @return the access mode specified for this class.
*/
@Override()
public org.exolab.castor.mapping.AccessMode getAccessMode(
) {
return null;
}
/**
* Method getIdentity.
*
* @return the identity field, null if this class has no
* identity.
*/
@Override()
public org.exolab.castor.mapping.FieldDescriptor getIdentity(
) {
return _identity;
}
/**
* Method getJavaClass.
*
* @return the Java class represented by this descriptor.
*/
@Override()
public java.lang.Class<?> getJavaClass(
) {
return org.opennms.netmgt.config.ami.AmiConfig.class;
}
/**
* Method getNameSpacePrefix.
*
* @return the namespace prefix to use when marshaling as XML.
*/
@Override()
public java.lang.String getNameSpacePrefix(
) {
return _nsPrefix;
}
/**
* Method getNameSpaceURI.
*
* @return the namespace URI used when marshaling and
* unmarshaling as XML.
*/
@Override()
public java.lang.String getNameSpaceURI(
) {
return _nsURI;
}
/**
* Method getValidator.
*
* @return a specific validator for the class described by this
* ClassDescriptor.
*/
@Override()
public org.exolab.castor.xml.TypeValidator getValidator(
) {
return this;
}
/**
* Method getXMLName.
*
* @return the XML Name for the Class being described.
*/
@Override()
public java.lang.String getXMLName(
) {
return _xmlName;
}
/**
* Method isElementDefinition.
*
* @return true if XML schema definition of this Class is that
* of a global
* element or element with anonymous type definition.
*/
public boolean isElementDefinition(
) {
return _elementDefinition;
}
}
| gpl-2.0 |
gruppo4/quercus-upstream | modules/resin/src/com/caucho/server/hmux/HmuxRequest.java | 45485 | /*
* Copyright (c) 1998-2012 Caucho Technology -- all rights reserved
*
* This file is part of Resin(R) Open Source
*
* Each copy or derived work must preserve the copyright notice and this
* notice unmodified.
*
* Resin Open Source is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Resin Open Source is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
* of NON-INFRINGEMENT. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with Resin Open Source; if not, write to the
*
* Free Software Foundation, Inc.
* 59 Temple Place, Suite 330
* Boston, MA 02111-1307 USA
*
* @author Scott Ferguson
*/
package com.caucho.server.hmux;
import java.io.IOException;
import java.io.InputStream;
import java.io.InterruptedIOException;
import java.net.InetAddress;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.caucho.cloud.bam.BamSystem;
import com.caucho.cloud.hmtp.HmtpRequest;
import com.caucho.network.listen.Protocol;
import com.caucho.network.listen.ProtocolConnection;
import com.caucho.network.listen.SocketLink;
import com.caucho.server.cluster.ServletService;
import com.caucho.server.dispatch.Invocation;
import com.caucho.server.http.AbstractHttpRequest;
import com.caucho.server.http.AbstractResponseStream;
import com.caucho.server.http.HttpServletRequestImpl;
import com.caucho.server.http.HttpServletResponseImpl;
import com.caucho.server.webapp.ErrorPageManager;
import com.caucho.util.ByteBuffer;
import com.caucho.util.CharBuffer;
import com.caucho.util.CharSegment;
import com.caucho.vfs.ClientDisconnectException;
import com.caucho.vfs.ReadStream;
import com.caucho.vfs.StreamImpl;
import com.caucho.vfs.WriteStream;
/**
* Handles requests from a remote dispatcher. For example, mod_caucho
* and the IIS plugin use this protocol to talk to the backend.
*
* <p>Packets are straightforward:
* <pre>code l2 l1 l0 contents</pre>
* Where code is the code of the packet and l2-0 give 12 bits of length.
*
* <p>The protocol is designed to allow pipelining and buffering whenever
* possible. So most commands are not acked. Data from the frontend (POST)
* does need acks to prevent deadlocks at either end while waiting
* for new data.
*
* <p>The overriding protocol is controlled by requests from the
* frontend server.
*
* <p>A ping request:
* <pre>
* Frontend Backend
* CSE_PING
* CSE_END
* CSE_END
* <pre>
*
* <p>A GET request:
* <pre>
* Frontend Backend
* CSE_METHOD
* ...
* CSE_HEADER/CSE_VALUE
* CSE_END
* CSE_DATA
* CSE_DATA
* CSE_END
* <pre>
*
* <p>Short POST:
* <pre>
* Frontend Backend
* CSE_METHOD
* ...
* CSE_HEADER/CSE_VALUE
* CSE_DATA
* CSE_END
* CSE_DATA
* CSE_DATA
* CSE_END
* <pre>
*
* <p>Long POST:
* <pre>
* Frontend Backend
* CSE_METHOD
* ...
* CSE_HEADER/CSE_VALUE
* CSE_DATA
* CSE_DATA (optional)
* CSE_DATA
* CSE_ACK
* CSE_DATA (optional)
* CSE_DATA
* CSE_ACK
* CSE_END
* CSE_DATA
* CSE_END
* <pre>
*
*/
public class HmuxRequest extends AbstractHttpRequest
implements ProtocolConnection
{
private static final Logger log
= Logger.getLogger(HmuxRequest.class.getName());
// HMUX channel control codes
public static final int HMUX_CHANNEL = 'C';
public static final int HMUX_ACK = 'A';
public static final int HMUX_ERROR = 'E';
public static final int HMUX_YIELD = 'Y';
public static final int HMUX_QUIT = 'Q';
public static final int HMUX_EXIT = 'X';
public static final int HMUX_DATA = 'D';
public static final int HMUX_URI = 'U';
public static final int HMUX_STRING = 'S';
public static final int HMUX_HEADER = 'H';
public static final int HMUX_BINARY = 'B';
public static final int HMUX_PROTOCOL = 'P';
public static final int HMUX_META_HEADER = 'M';
// The following are HTTP codes
public static final int CSE_NULL = '?';
public static final int CSE_PATH_INFO = 'b';
public static final int CSE_PROTOCOL = 'c';
public static final int CSE_REMOTE_USER = 'd';
public static final int CSE_QUERY_STRING = 'e';
public static final int HMUX_FLUSH = 'f';
public static final int CSE_SERVER_PORT = 'g';
public static final int CSE_REMOTE_HOST = 'h';
public static final int CSE_REMOTE_ADDR = 'i';
public static final int CSE_REMOTE_PORT = 'j';
public static final int CSE_REAL_PATH = 'k';
public static final int CSE_SCRIPT_FILENAME = 'l';
public static final int HMUX_METHOD = 'm';
public static final int CSE_AUTH_TYPE = 'n';
public static final int CSE_URI = 'o';
public static final int CSE_CONTENT_LENGTH = 'p';
public static final int CSE_CONTENT_TYPE = 'q';
public static final int CSE_IS_SECURE = 'r';
public static final int HMUX_STATUS = 's';
public static final int CSE_CLIENT_CERT = 't';
public static final int CSE_SERVER_TYPE = 'u';
public static final int HMUX_SERVER_NAME = 'v';
public static final int CSE_SEND_HEADER = 'G';
public static final int CSE_FLUSH = 'F';
public static final int CSE_KEEPALIVE = 'K';
public static final int CSE_END = 'Z';
// other, specialized protocols
public static final int CSE_QUERY = 'Q';
public static final int HMUX_TO_UNIDIR_HMTP = '7';
public static final int HMUX_SWITCH_TO_HMTP = '8';
public static final int HMUX_HMTP_OK = '9';
// public static final int HMUX_CLUSTER_PROTOCOL = 0x101;
public static final int HMUX_DISPATCH_PROTOCOL = 0x102;
public static final int HMUX_JMS_PROTOCOL = 0x103;
public static final int HMUX_HTTP_PROXY_PROTOCOL = 0x104;
public enum ProtocolResult {
QUIT,
EXIT,
YIELD
};
static final int HTTP_0_9 = 0x0009;
static final int HTTP_1_0 = 0x0100;
static final int HTTP_1_1 = 0x0101;
private static final int HEADER_CAPACITY = 256;
static final CharBuffer _getCb = new CharBuffer("GET");
static final CharBuffer _headCb = new CharBuffer("HEAD");
static final CharBuffer _postCb = new CharBuffer("POST");
private final CharBuffer _method; // "GET"
private String _methodString; // "GET"
// private CharBuffer scheme; // "http:"
private CharBuffer _host; // www.caucho.com
private ByteBuffer _uri; // "/path/test.jsp/Junk"
private CharBuffer _protocol; // "HTTP/1.0"
private int _version;
private CharBuffer _remoteAddr;
private CharBuffer _remoteHost;
private CharBuffer _serverName;
private CharBuffer _serverPort;
private CharBuffer _remotePort;
private boolean _isSecure;
private ByteBuffer _clientCert;
private CharBuffer []_headerKeys;
private CharBuffer []_headerValues;
private int _headerSize;
private int _serverType;
// write stream from the connection
private WriteStream _rawWrite;
private int _bufferStartOffset;
// StreamImpl to break reads and writes to the underlying protocol
private ServletFilter _filter;
private int _pendingData;
private CharBuffer _cb1;
private CharBuffer _cb2;
private boolean _hasRequest;
private final HmuxDispatchRequest _dispatchRequest;
private HmtpRequest _hmtpRequest;
private ProtocolConnection _subProtocol;
private HmuxProtocol _hmuxProtocol;
private ErrorPageManager _errorManager;
public HmuxRequest(ServletService server,
SocketLink conn,
HmuxProtocol protocol)
{
super(server, conn);
_errorManager = new ErrorPageManager(server);
_hmuxProtocol = protocol;
_rawWrite = conn.getWriteStream();
// XXX: response.setIgnoreClientDisconnect(server.getIgnoreClientDisconnect());
_dispatchRequest = new HmuxDispatchRequest(this);
_uri = new ByteBuffer();
_method = new CharBuffer();
_host = new CharBuffer();
_protocol = new CharBuffer();
_headerKeys = new CharBuffer[HEADER_CAPACITY];
_headerValues = new CharBuffer[_headerKeys.length];
for (int i = 0; i < _headerKeys.length; i++) {
_headerKeys[i] = new CharBuffer();
_headerValues[i] = new CharBuffer();
}
_remoteHost = new CharBuffer();
_remoteAddr = new CharBuffer();
_serverName = new CharBuffer();
_serverPort = new CharBuffer();
_remotePort = new CharBuffer();
_clientCert = new ByteBuffer();
_cb1 = new CharBuffer();
_cb2 = new CharBuffer();
_filter = new ServletFilter();
BamSystem bamService = BamSystem.getCurrent();
_hmtpRequest = new HmtpRequest(conn, bamService);
}
@Override
public HmuxResponse createResponse()
{
return new HmuxResponse(this, getConnection().getWriteStream());
}
@Override
public boolean isWaitForRead()
{
return true;
}
/**
* Returns true if a valid HTTP request has started.
*/
@Override
public boolean hasRequest()
{
return _hasRequest;
}
@Override
public boolean isSuspend()
{
return super.isSuspend() || _subProtocol != null;
}
@Override
public boolean handleRequest()
throws IOException
{
try {
ProtocolConnection subProtocol = _subProtocol;
if (subProtocol != null) {
return subProtocol.handleRequest();
}
else {
return handleRequestImpl();
}
} catch (RuntimeException e) {
throw e;
} catch (IOException e) {
throw e;
}
}
/**
* Handles a new request. Initializes the protocol handler and
* the request streams.
*
* <p>Note: ClientDisconnectException must be rethrown to
* the caller.
*/
private boolean handleRequestImpl()
throws IOException
{
// XXX: should be moved to TcpConnection
Thread thread = Thread.currentThread();
thread.setContextClassLoader(getServer().getClassLoader());
if (log.isLoggable(Level.FINE))
log.fine(dbgId() + "start request");
_filter.init(this, getRawRead(), getRawWrite());
try {
startRequest();
startInvocation();
return handleInvocation();
} finally {
if (! _hasRequest) {
getResponse().setHeaderWritten(true);
}
if (_subProtocol == null) {
finishInvocation();
}
try {
// server/0190, server/1ld7
if (! isSuspend()) {
finishRequest();
}
} catch (ClientDisconnectException e) {
throw e;
} catch (Exception e) {
killKeepalive("hmux finishRequest exception " + e);
log.log(Level.FINE, dbgId() + e, e);
}
// cluster/6610 - hmtp mode doesn't close the stream.
if (_subProtocol == null && ! isSuspend()) {
try {
ReadStream is = getReadStream();
is.setDisableClose(false);
is.close();
} catch (Exception e) {
killKeepalive("hmux close exception: " + e);
log.log(Level.FINE, dbgId() + e, e);
}
}
}
}
private boolean handleInvocation()
throws IOException
{
try {
_hasRequest = false;
if (! scanHeaders() || ! getConnection().isPortActive()) {
_hasRequest = false;
killKeepalive("hmux scanHeaders failure");
return false;
}
else if (! _hasRequest) {
return true;
}
} catch (InterruptedIOException e) {
killKeepalive("hmux parse header exception: "+ e);
log.fine(dbgId() + "interrupted keepalive");
return false;
}
if (_isSecure)
getClientCertificate();
_hasRequest = true;
// setStartDate();
ServletService server = getServer();
if (server == null || server.isDestroyed()) {
log.fine(dbgId() + "server is closed");
ReadStream is = getRawRead();
try {
is.setDisableClose(false);
is.close();
} catch (Exception e) {
}
return false;
}
_filter.setPending(_pendingData);
try {
if (_method.getLength() == 0)
throw new RuntimeException("HTTP protocol exception, expected method");
Invocation invocation;
invocation = getInvocation(getHost(),
_uri.getBuffer(), _uri.getLength());
getRequestFacade().setInvocation(invocation);
startInvocation();
if (getServer().isPreview() && ! "resin.admin".equals(getHost())) {
return sendBusyResponse();
}
invocation.service(getRequestFacade(), getResponseFacade());
} catch (ClientDisconnectException e) {
throw e;
} catch (Throwable e) {
log.log(Level.FINER, e.toString(), e);
try {
_errorManager.sendServletError(e, getRequestFacade(),
getResponseFacade());
} catch (ClientDisconnectException e1) {
throw e1;
} catch (Exception e1) {
log.log(Level.FINE, e1.toString(), e1);
}
}
return true;
}
/**
* Initialize the read stream from the raw stream.
*/
@Override
public boolean initStream(ReadStream readStream,
ReadStream rawStream)
throws IOException
{
readStream.init(_filter, null);
return true;
}
private void getClientCertificate()
{
HttpServletRequestImpl request = getRequestFacade();
String cipher = getHeader("SSL_CIPHER");
if (cipher == null)
cipher = getHeader("HTTPS_CIPHER");
if (cipher != null)
request.setAttribute("javax.servlet.request.cipher_suite", cipher);
String keySize = getHeader("SSL_CIPHER_USEKEYSIZE");
if (keySize == null)
keySize = getHeader("SSL_SECRETKEYSIZE");
if (keySize != null)
request.setAttribute("javax.servlet.request.key_size", keySize);
if (_clientCert.size() == 0)
return;
try {
CertificateFactory cf = CertificateFactory.getInstance("X.509");
InputStream is = _clientCert.createInputStream();
X509Certificate cert = (X509Certificate) cf.generateCertificate(is);
is.close();
request.setAttribute("javax.servlet.request.X509Certificate",
new X509Certificate[]{cert});
request.setAttribute(com.caucho.security.AbstractLogin.LOGIN_USER,
((X509Certificate) cert).getSubjectDN());
} catch (Exception e) {
log.log(Level.FINE, e.toString(), e);
}
}
protected boolean checkLogin()
{
return true;
}
@Override
public void onStartConnection()
{
super.onStartConnection();
_hmtpRequest.onStartConnection();
_subProtocol = null;
}
/**
* Clears variables at the start of a new request.
*/
@Override
protected void startRequest()
throws IOException
{
super.startRequest();
_method.clear();
_methodString = null;
_protocol.clear();
_version = 0;
_uri.clear();
_host.clear();
_headerSize = 0;
_remoteHost.clear();
_remoteAddr.clear();
_serverName.clear();
_serverPort.clear();
_remotePort.clear();
_clientCert.clear();
_pendingData = 0;
_bufferStartOffset = 0;
_isSecure = getConnection().isSecure();
}
/**
* Sends busy response for preview mode.
*/
private boolean sendBusyResponse()
throws IOException
{
HttpServletResponseImpl response = getResponseFacade();
response.sendError(503);
return true;
}
/**
* Fills request parameters from the stream.
*/
private boolean scanHeaders()
throws IOException
{
boolean isLoggable = log.isLoggable(Level.FINE);
ReadStream is = getRawRead();
WriteStream os = getRawWrite();
CharBuffer cb = getCharBuffer();
int code;
int len;
while (true) {
_rawWrite.flush();
code = is.read();
ServletService server = getServer();
if (server == null || server.isDestroyed()) {
log.fine(dbgId() + " request after server close");
killKeepalive("after server close");
return false;
}
switch (code) {
case -1:
if (isLoggable)
log.fine(dbgId() + "r: end of file");
_filter.setClientClosed(true);
killKeepalive("hmux end of file");
return false;
case HMUX_CHANNEL:
int channel = (is.read() << 8) + is.read();
if (isLoggable)
log.fine(dbgId() + "channel-r " + channel);
break;
case HMUX_YIELD:
if (log.isLoggable(Level.FINER))
log.finer(dbgId() + (char) code + "-r: yield");
os.write(HMUX_ACK);
os.write(0);
os.write(0);
os.flush();
break;
case HMUX_QUIT:
if (isLoggable)
log.fine(dbgId() + (char) code + "-r: end of request");
return true;
case HMUX_EXIT:
if (isLoggable)
log.fine(dbgId() + (char) code + "-r: end of socket");
killKeepalive("hmux exit");
return true;
case HMUX_PROTOCOL:
len = (is.read() << 8) + is.read();
if (len != 4) {
log.fine(dbgId() + (char) code + "-r: protocol length (" + len + ") must be 4.");
killKeepalive("hmux protocol");
return false;
}
int value = ((is.read() << 24)
+ (is.read() << 16)
+ (is.read() << 8)
+ (is.read()));
dispatchProtocol(is, code, value);
return true;
case HMUX_URI:
len = (is.read() << 8) + is.read();
_uri.setLength(len);
is.readAll(_uri.getBuffer(), 0, len);
if (isLoggable)
log.fine(dbgId() + (char) code + ":uri " + _uri);
_hasRequest = true;
break;
case HMUX_METHOD:
len = (is.read() << 8) + is.read();
is.readAll(_method, len);
if (isLoggable)
log.fine(dbgId() +
(char) code + ":method " + _method);
break;
case CSE_REAL_PATH:
len = (is.read() << 8) + is.read();
_cb1.clear();
is.readAll(_cb1, len);
code = is.read();
if (code != HMUX_STRING)
throw new IOException("protocol expected HMUX_STRING");
_cb2.clear();
is.readAll(_cb2, readLength(is));
//http.setRealPath(cb1.toString(), cb2.toString());
if (isLoggable)
log.fine(dbgId() + (char) code + " " +
_cb1.toString() + "->" + _cb2.toString());
//throw new RuntimeException();
break;
case CSE_REMOTE_HOST:
len = (is.read() << 8) + is.read();
is.readAll(_remoteHost, len);
if (isLoggable)
log.fine(dbgId() + (char) code + " " + _remoteHost);
break;
case CSE_REMOTE_ADDR:
len = (is.read() << 8) + is.read();
is.readAll(_remoteAddr, len);
if (isLoggable)
log.fine(dbgId() + (char) code + " " + _remoteAddr);
break;
case HMUX_SERVER_NAME:
len = (is.read() << 8) + is.read();
is.readAll(_serverName, len);
if (isLoggable)
log.fine(dbgId() + (char) code + " server-host: " + _serverName);
break;
case CSE_REMOTE_PORT:
len = (is.read() << 8) + is.read();
is.readAll(_remotePort, len);
if (isLoggable)
log.fine(dbgId() + (char) code +
" remote-port: " + _remotePort);
break;
case CSE_SERVER_PORT:
len = (is.read() << 8) + is.read();
is.readAll(_serverPort, len);
if (isLoggable)
log.fine(dbgId() + (char) code +
" server-port: " + _serverPort);
break;
case CSE_QUERY_STRING:
len = (is.read() << 8) + is.read();
if (len > 0) {
_uri.add('?');
_uri.ensureCapacity(_uri.getLength() + len);
is.readAll(_uri.getBuffer(), _uri.getLength(), len);
_uri.setLength(_uri.getLength() + len);
}
break;
case CSE_PROTOCOL:
len = (is.read() << 8) + is.read();
is.readAll(_protocol, len);
if (isLoggable)
log.fine(dbgId() + (char) code + " protocol: " + _protocol);
for (int i = 0; i < len; i++) {
char ch = _protocol.charAt(i);
if ('0' <= ch && ch <= '9')
_version = 16 * _version + ch - '0';
else if (ch == '.')
_version = 16 * _version;
}
break;
case HMUX_HEADER:
len = (is.read() << 8) + is.read();
int headerSize = _headerSize;
CharBuffer key = _headerKeys[headerSize];
key.clear();
CharBuffer valueCb = _headerValues[headerSize];
valueCb.clear();
is.readAll(key, len);
code = is.read();
if (code != HMUX_STRING)
throw new IOException("protocol expected HMUX_STRING at " + (char) code);
is.readAll(valueCb, readLength(is));
if (isLoggable)
log.fine(dbgId() + "H " + key + "=" + valueCb);
if (addHeaderInt(key.getBuffer(), 0, key.length(), valueCb)) {
_headerSize++;
}
break;
case CSE_CONTENT_LENGTH:
len = (is.read() << 8) + is.read();
if (_headerKeys.length <= _headerSize)
resizeHeaders();
_headerKeys[_headerSize].clear();
_headerKeys[_headerSize].append("Content-Length");
_headerValues[_headerSize].clear();
is.readAll(_headerValues[_headerSize], len);
setContentLength(_headerValues[_headerSize]);
if (isLoggable)
log.fine(dbgId() + (char) code + " content-length=" +
_headerValues[_headerSize]);
_headerSize++;
break;
case CSE_CONTENT_TYPE:
len = (is.read() << 8) + is.read();
if (_headerKeys.length <= _headerSize)
resizeHeaders();
_headerKeys[_headerSize].clear();
_headerKeys[_headerSize].append("Content-Type");
_headerValues[_headerSize].clear();
is.readAll(_headerValues[_headerSize], len);
if (isLoggable)
log.fine(dbgId() + (char) code
+ " content-type=" + _headerValues[_headerSize]);
_headerSize++;
break;
case CSE_IS_SECURE:
len = (is.read() << 8) + is.read();
_isSecure = true;
if (isLoggable)
log.fine(dbgId() + "secure");
is.skip(len);
break;
case CSE_CLIENT_CERT:
len = (is.read() << 8) + is.read();
_clientCert.clear();
_clientCert.setLength(len);
is.readAll(_clientCert.getBuffer(), 0, len);
if (isLoggable)
log.fine(dbgId() + (char) code + " cert=" + _clientCert
+ " len:" + len);
break;
case CSE_SERVER_TYPE:
len = (is.read() << 8) + is.read();
_cb1.clear();
is.readAll(_cb1, len);
if (isLoggable)
log.fine(dbgId() + (char) code + " server=" + _cb1);
if (_cb1.length() > 0)
_serverType = _cb1.charAt(0);
break;
case CSE_REMOTE_USER:
len = (is.read() << 8) + is.read();
cb.clear();
is.readAll(cb, len);
if (isLoggable)
log.fine(dbgId() + (char) code + " " + cb);
getRequestFacade().setAttribute(com.caucho.security.AbstractLogin.LOGIN_USER,
new com.caucho.security.BasicPrincipal(cb.toString()));
break;
case HMUX_DATA:
len = (is.read() << 8) + is.read();
_pendingData = len;
if (isLoggable)
log.fine(dbgId() + (char) code + " post-data: " + len);
if (len > 0) {
return true;
}
break;
case HMUX_TO_UNIDIR_HMTP:
case HMUX_SWITCH_TO_HMTP: {
if (_hasRequest)
throw new IllegalStateException();
is.unread();
if (isLoggable)
log.fine(dbgId() + (char) code + "-r switch-to-hmtp");
_subProtocol = _hmtpRequest;
boolean result = _hmtpRequest.handleRequest();
return result;
}
case ' ': case '\n':
// skip for debugging
break;
default:
{
int d1 = is.read();
int d2 = is.read();
if (d2 < 0) {
if (isLoggable)
log.fine(dbgId() + "r: unexpected end of file");
killKeepalive("hmux data end of file");
return false;
}
len = (d1 << 8) + d2;
if (isLoggable)
log.fine(dbgId() + (char) code + " " + len);
is.skip(len);
break;
}
}
}
}
private void dispatchProtocol(ReadStream is, int code, int value)
throws IOException
{
int result = HMUX_EXIT;
boolean isKeepalive = false;
if (value == HMUX_DISPATCH_PROTOCOL) {
if (log.isLoggable(Level.FINE))
log.fine(dbgId() + (char) code + "-r: dispatch protocol");
_filter.setClientClosed(true);
isKeepalive = _dispatchRequest.handleRequest(is, _rawWrite);
if (isKeepalive)
result = HMUX_QUIT;
else
result = HMUX_EXIT;
}
else {
Protocol ext = _hmuxProtocol.getExtension(value);
if (ext != null) {
if (log.isLoggable(Level.FINE))
log.fine(dbgId() + (char) code + "-r: extension " + ext);
_filter.setClientClosed(true);
_subProtocol = ext.createConnection(getTcpSocketLink());
_subProtocol.handleRequest();
return;
}
else {
log.fine(dbgId() + (char) code + "-r: unknown protocol (" + value + ")");
result = HMUX_EXIT;
}
}
if (result == HMUX_YIELD) {
_rawWrite.write(HMUX_ACK);
_rawWrite.write(0);
_rawWrite.write(0);
_rawWrite.flush();
return; // XXX:
}
else {
if (result == HMUX_QUIT && ! isKeepalive())
result = HMUX_EXIT;
if (result == HMUX_QUIT) {
_rawWrite.write(HMUX_QUIT);
_rawWrite.flush();
}
else {
killKeepalive("hmux failed result: " + (char) result);
_rawWrite.write(HMUX_EXIT);
_rawWrite.close();
}
}
}
private void resizeHeaders()
{
CharBuffer []newKeys = new CharBuffer[_headerSize * 2];
CharBuffer []newValues = new CharBuffer[_headerSize * 2];
for (int i = 0; i < _headerSize; i++) {
newKeys[i] = _headerKeys[i];
newValues[i] = _headerValues[i];
}
for (int i = _headerSize; i < newKeys.length; i++) {
newKeys[i] = new CharBuffer();
newValues[i] = new CharBuffer();
}
_headerKeys = newKeys;
_headerValues = newValues;
}
private int readLength(ReadStream is)
throws IOException
{
return ((is.read() << 8) + is.read());
}
void writeFlush()
throws IOException
{
WriteStream out = _rawWrite;
synchronized (out) {
out.flush();
}
}
/**
* Returns the header.
*/
@Override
public String getMethod()
{
if (_methodString == null) {
CharSegment cb = getMethodBuffer();
if (cb.length() == 0) {
_methodString = "GET";
return _methodString;
}
switch (cb.charAt(0)) {
case 'G':
_methodString = cb.equals(_getCb) ? "GET" : cb.toString();
break;
case 'H':
_methodString = cb.equals(_headCb) ? "HEAD" : cb.toString();
break;
case 'P':
_methodString = cb.equals(_postCb) ? "POST" : cb.toString();
break;
default:
_methodString = cb.toString();
}
}
return _methodString;
}
public CharSegment getMethodBuffer()
{
return _method;
}
/**
* Returns a char buffer containing the host.
*/
@Override
protected CharBuffer getHost()
{
if (_host.length() > 0)
return _host;
_host.append(_serverName);
_host.toLowerCase();
return _host;
}
public final byte []getUriBuffer()
{
return _uri.getBuffer();
}
public final int getUriLength()
{
return _uri.getLength();
}
/**
* Returns the protocol.
*/
public String getProtocol()
{
return _protocol.toString();
}
public CharSegment getProtocolBuffer()
{
return _protocol;
}
final int getVersion()
{
return _version;
}
/**
* Returns true if the request is secure.
*/
@Override
public boolean isSecure()
{
return super.isSecure() || _isSecure;
}
/**
* Returns the header.
*/
public String getHeader(String key)
{
CharSegment buf = getHeaderBuffer(key);
if (buf != null)
return buf.toString();
else
return null;
}
@Override
public CharSegment getHeaderBuffer(String key)
{
for (int i = 0; i < _headerSize; i++) {
CharBuffer test = _headerKeys[i];
if (test.equalsIgnoreCase(key))
return _headerValues[i];
}
return null;
}
public CharSegment getHeaderBuffer(char []buf, int length)
{
for (int i = 0; i < _headerSize; i++) {
CharBuffer test = _headerKeys[i];
if (test.length() != length)
continue;
char []keyBuf = test.getBuffer();
int j;
for (j = 0; j < length; j++) {
char a = buf[j];
char b = keyBuf[j];
if (a == b)
continue;
if (a >= 'A' && a <= 'Z')
a += 'a' - 'A';
if (b >= 'A' && b <= 'Z')
b += 'a' - 'A';
if (a != b)
break;
}
if (j == length)
return _headerValues[i];
}
return null;
}
@Override
public void setHeader(String key, String value)
{
if (_headerKeys.length <= _headerSize)
resizeHeaders();
_headerKeys[_headerSize].clear();
_headerKeys[_headerSize].append(key);
_headerValues[_headerSize].clear();
_headerValues[_headerSize].append(value);
_headerSize++;
}
@Override
public void getHeaderBuffers(String key, ArrayList<CharSegment> values)
{
CharBuffer cb = getCharBuffer();
cb.clear();
cb.append(key);
int size = _headerSize;
for (int i = 0; i < size; i++) {
CharBuffer test = _headerKeys[i];
if (test.equalsIgnoreCase(cb))
values.add(_headerValues[i]);
}
}
public Enumeration<String> getHeaderNames()
{
HashSet<String> names = new HashSet<String>();
for (int i = 0; i < _headerSize; i++)
names.add(_headerKeys[i].toString());
return Collections.enumeration(names);
}
/**
* Returns the URI for the request, special casing the IIS issues.
* Because IIS already escapes the URI before sending it, the URI
* needs to be re-escaped.
*/
@Override
public String getRequestURI()
{
if (_serverType == 'R')
return super.getRequestURI();
String _rawURI = super.getRequestURI();
if (_rawURI == null)
return null;
CharBuffer cb = CharBuffer.allocate();
for (int i = 0; i < _rawURI.length(); i++) {
char ch = _rawURI.charAt(i);
if (ch <= ' ' || ch >= 0x80 || ch == '%') {
addHex(cb, ch);
}
else
cb.append(ch);
}
return cb.close();
}
/**
* Adds a hex escape.
*
* @param cb the char buffer containing the escape.
* @param ch the character to be escaped.
*/
private void addHex(CharBuffer cb, int ch)
{
cb.append('%');
int d = (ch >> 4) & 0xf;
if (d < 10)
cb.append((char) ('0' + d));
else
cb.append((char) ('a' + d - 10));
d = ch & 0xf;
if (d < 10)
cb.append((char) ('0' + d));
else
cb.append((char) ('a' + d - 10));
}
/**
* Returns the server name.
*/
@Override
public String getServerName()
{
CharBuffer host = getHost();
if (host == null) {
InetAddress addr = getConnection().getRemoteAddress();
return addr.getHostName();
}
int p = host.indexOf(':');
if (p >= 0)
return host.substring(0, p);
else
return host.toString();
}
@Override
public int getServerPort()
{
int len = _serverPort.length();
int port = 0;
for (int i = 0; i < len; i++) {
char ch = _serverPort.charAt(i);
port = 10 * port + ch - '0';
}
return port;
}
@Override
public String getRemoteAddr()
{
return _remoteAddr.toString();
}
public void getRemoteAddr(CharBuffer cb)
{
cb.append(_remoteAddr);
}
@Override
public int printRemoteAddr(byte []buffer, int offset)
throws IOException
{
char []buf = _remoteAddr.getBuffer();
int len = _remoteAddr.getLength();
for (int i = 0; i < len; i++)
buffer[offset + i] = (byte) buf[i];
return offset + len;
}
@Override
public String getRemoteHost()
{
return _remoteHost.toString();
}
/**
* Called for a connection: close
*/
@Override
protected void handleConnectionClose()
{
// ignore for hmux
}
@Override
public void finishRequest()
throws IOException
{
try {
super.finishRequest();
} finally {
_filter.close();
}
}
// Response data
void writeStatus(CharBuffer message)
throws IOException
{
writeString(HMUX_STATUS, message);
}
/**
* Complete sending of all headers.
*/
void sendHeader()
throws IOException
{
writeString(CSE_SEND_HEADER, "");
}
/**
* Writes a header to the plugin.
*
* @param key the header's key
* @param value the header's value
*/
void writeHeader(String key, String value)
throws IOException
{
writeString(HMUX_HEADER, key);
writeString(HMUX_STRING, value);
}
/**
* Writes a header to the plugin.
*
* @param key the header's key
* @param value the header's value
*/
void writeHeader(String key, CharBuffer value)
throws IOException
{
writeString(HMUX_HEADER, key);
writeString(HMUX_STRING, value);
}
void flushResponseBuffer()
throws IOException
{
HttpServletRequestImpl request = getRequestFacade();
if (request != null) {
AbstractResponseStream stream = request.getResponse().getResponseStream();
stream.flushNext();
}
}
//
// HmuxResponseStream methods
//
protected byte []getNextBuffer()
{
return _rawWrite.getBuffer();
}
protected int getNextStartOffset()
{
if (_bufferStartOffset == 0) {
int bufferLength = _rawWrite.getBuffer().length;
int startOffset = _rawWrite.getBufferOffset() + 3;
if (bufferLength <= startOffset) {
try {
_rawWrite.flush();
} catch (IOException e) {
log.log(Level.FINE, e.toString(), e);
}
startOffset = _rawWrite.getBufferOffset() + 3;
}
_rawWrite.setBufferOffset(startOffset);
_bufferStartOffset = startOffset;
}
return _bufferStartOffset;
}
protected int getNextBufferOffset()
throws IOException
{
if (_bufferStartOffset == 0) {
int bufferLength = _rawWrite.getBuffer().length;
int startOffset = _rawWrite.getBufferOffset() + 3;
if (bufferLength <= startOffset) {
_rawWrite.flush();
startOffset = _rawWrite.getBufferOffset() + 3;
}
_rawWrite.setBufferOffset(startOffset);
_bufferStartOffset = startOffset;
}
return _rawWrite.getBufferOffset();
}
protected void setNextBufferOffset(int offset)
throws IOException
{
offset = fillDataBuffer(offset);
_rawWrite.setBufferOffset(offset);
}
protected byte []writeNextBuffer(int offset)
throws IOException
{
offset = fillDataBuffer(offset);
return _rawWrite.nextBuffer(offset);
}
protected void flushNext()
throws IOException
{
if (flushNextBuffer()) {
// server/26u2
_rawWrite.write(HMUX_FLUSH);
_rawWrite.write(0);
_rawWrite.write(0);
if (log.isLoggable(Level.FINE)) {
log.fine(dbgId() + "flush-w()");
}
}
_rawWrite.flush();
}
protected boolean flushNextBuffer()
throws IOException
{
WriteStream next = _rawWrite;
int startOffset = _bufferStartOffset;
if (startOffset > 0) {
_bufferStartOffset = 0;
if (startOffset == next.getBufferOffset()) {
next.setBufferOffset(startOffset - 3);
}
else {
// illegal state because the data isn't filled
throw new IllegalStateException();
}
return true;
}
else {
return false;
}
}
protected void writeTail()
throws IOException
{
WriteStream next = _rawWrite;
int offset = next.getBufferOffset();
offset = fillDataBuffer(offset);
// server/26a6
// Use setBufferOffset because nextBuffer would
// force an early flush
next.setBufferOffset(offset);
}
private int fillDataBuffer(int offset)
throws IOException
{
// server/2642
int bufferStart = _bufferStartOffset;
if (bufferStart == 0)
return offset;
byte []buffer = _rawWrite.getBuffer();
// if (bufferStart > 0 && offset == buffer.length) {
int length = offset - bufferStart;
_bufferStartOffset = 0;
// server/26a0
if (length == 0) {
offset = bufferStart - 3;
}
else {
buffer[bufferStart - 3] = (byte) HmuxRequest.HMUX_DATA;
buffer[bufferStart - 2] = (byte) (length >> 8);
buffer[bufferStart - 1] = (byte) (length);
if (log.isLoggable(Level.FINE))
log.fine(dbgId() + (char) HmuxRequest.HMUX_DATA + "-w(" + length + ")");
}
_bufferStartOffset = 0;
return offset;
}
void writeString(int code, String value)
throws IOException
{
int len = value.length();
WriteStream os = _rawWrite;
os.write(code);
os.write(len >> 8);
os.write(len);
os.print(value);
if (log.isLoggable(Level.FINE))
log.fine(dbgId() + (char)code + "-w " + value);
}
void writeString(int code, CharBuffer cb)
throws IOException
{
int len = cb.length();
WriteStream os = _rawWrite;
os.write(code);
os.write(len >> 8);
os.write(len);
os.print(cb.getBuffer(), 0, len);
if (log.isLoggable(Level.FINE))
log.fine(dbgId() + (char)code + "-w: " + cb);
}
/**
* Close when the socket closes.
*/
@Override
public void onCloseConnection()
{
_subProtocol = null;
_hmtpRequest.onCloseConnection();
super.onCloseConnection();
}
protected String getRequestId()
{
String id = getServer().getServerId();
if (id.equals(""))
return "server-" + getConnection().getId();
else
return "server-" + id + ":" + getConnection().getId();
}
@Override
public final String dbgId()
{
String id = getServer().getServerId();
if (id.equals(""))
return "Hmux[" + getConnection().getId() + "] ";
else
return "Hmux[" + id + ":" + getConnection().getId() + "] ";
}
@Override
public String toString()
{
return "HmuxRequest" + dbgId();
}
/**
* Implements the protocol for data reads and writes. Data from the
* web server to the JVM must be acked, except for the first data.
* Data back to the web server needs no ack.
*/
static class ServletFilter extends StreamImpl {
HmuxRequest _request;
ReadStream _is;
WriteStream _os;
byte []_buffer = new byte[16];
int _pendingData;
boolean _needsAck;
boolean _isClosed;
boolean _isClientClosed;
ServletFilter()
{
}
void init(HmuxRequest request,
ReadStream nextRead, WriteStream nextWrite)
{
_request = request;
_is = nextRead;
_os = nextWrite;
_pendingData = 0;
_isClosed = false;
_isClientClosed = false;
_needsAck = false;
}
void setPending(int pendingData)
{
_pendingData = pendingData;
}
void setClientClosed(boolean isClientClosed)
{
_isClientClosed = isClientClosed;
}
@Override
public boolean canRead()
{
return true;
}
@Override
public int getAvailable()
{
return _pendingData;
}
/**
* Reads available data. If the data needs an ack, then do so.
*/
@Override
public int read(byte []buf, int offset, int length)
throws IOException
{
int sublen = _pendingData;
ReadStream is = _is;
if (sublen <= 0)
return -1;
if (length < sublen)
sublen = length;
_os.flush();
int readLen = is.read(buf, offset, sublen);
_pendingData -= readLen;
if (log.isLoggable(Level.FINEST))
log.finest(new String(buf, offset, readLen));
while (_pendingData == 0) {
_os.flush();
int code = is.read();
switch (code) {
case HMUX_DATA: {
int len = (is.read() << 8) + is.read();
if (log.isLoggable(Level.FINE))
log.fine(_request.dbgId() + "D-r:post-data " + len);
_pendingData = len;
if (len > 0)
return readLen;
break;
}
case HMUX_QUIT: {
if (log.isLoggable(Level.FINE))
log.fine(_request.dbgId() + "Q-r:quit");
return readLen;
}
case HMUX_EXIT: {
if (log.isLoggable(Level.FINE))
log.fine(_request.dbgId() + "X-r:exit");
_request.killKeepalive("hmux request exit");
return readLen;
}
case HMUX_YIELD: {
_request.flushResponseBuffer();
_os.write(HMUX_ACK);
_os.write(0);
_os.write(0);
_os.flush();
if (log.isLoggable(Level.FINE)) {
log.fine(_request.dbgId() + "Y-r:yield");
log.fine(_request.dbgId() + "A-w:ack");
}
break;
}
case HMUX_CHANNEL: {
int channel = (is.read() << 8) + is.read();
if (log.isLoggable(Level.FINE))
log.fine(_request.dbgId() + "channel-r " + channel);
break;
}
case ' ': case '\n':
break;
default:
if (code < 0) {
_request.killKeepalive("hmux request end-of-file");
return readLen;
}
else {
_request.killKeepalive("hmux unknown request: " + (char) code);
int len = (is.read() << 8) + is.read();
if (log.isLoggable(Level.FINE))
log.fine(_request.dbgId() + "unknown-r '" + (char) code + "' " + len);
is.skip(len);
}
}
}
return readLen;
}
@Override
public boolean canWrite()
{
return true;
}
/**
* Send data back to the web server
*/
@Override
public void write(byte []buf, int offset, int length, boolean isEnd)
throws IOException
{
_request.flushResponseBuffer();
if (log.isLoggable(Level.FINE)) {
log.fine(_request.dbgId() + (char) HMUX_DATA + ":data " + length);
if (log.isLoggable(Level.FINEST))
log.finest(_request.dbgId() + "data <" + new String(buf, offset, length) + ">");
}
byte []tempBuf = _buffer;
Thread.dumpStack();
while (length > 0) {
int sublen = length;
if (32 * 1024 < sublen)
sublen = 32 * 1024;
// The 3 bytes are already allocated by setPrefixWrite
tempBuf[0] = HMUX_DATA;
tempBuf[1] = (byte) (sublen >> 8);
tempBuf[2] = (byte) sublen;
_os.write(tempBuf, 0, 3);
_os.write(buf, offset, sublen);
length -= sublen;
offset += sublen;
}
}
@Override
public void flush()
throws IOException
{
if (! _request._hasRequest) {
return;
}
System.out.println("HMUX_FLUSH:");
if (log.isLoggable(Level.FINE)) {
log.fine(_request.dbgId() + (char) HMUX_FLUSH + "-w:flush");
}
_os.write(HMUX_FLUSH);
_os.write(0);
_os.write(0);
_os.flush();
}
@Override
public void close()
throws IOException
{
if (_isClosed)
return;
_isClosed = true;
if (_pendingData > 0) {
_is.skip(_pendingData);
_pendingData = 0;
}
HmuxRequest request = _request;
if (request == null) {
return;
}
boolean keepalive = request.isKeepalive();
if (! _isClientClosed) {
if (log.isLoggable(Level.FINE)) {
if (keepalive)
log.fine(request.dbgId() + (char) HMUX_QUIT + "-w: quit channel");
else
log.fine(request.dbgId() + (char) HMUX_EXIT + "-w: exit socket");
}
if (keepalive)
_os.write(HMUX_QUIT);
else
_os.write(HMUX_EXIT);
}
if (keepalive)
_os.flush();
else
_os.close();
//nextRead.close();
}
}
}
| gpl-2.0 |
callakrsos/Gargoyle | VisualFxVoEditor/src/main/java/com/kyj/fx/voeditor/visual/component/text/XMLEditor.java | 8947 | package com.kyj.fx.voeditor.visual.component.text;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.util.Collection;
import java.util.Collections;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.fxmisc.richtext.CodeArea;
import org.fxmisc.richtext.LineNumberFactory;
import org.fxmisc.richtext.model.StyleSpans;
import org.fxmisc.richtext.model.StyleSpansBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.kyj.fx.commons.fx.controls.text.CodeAreaCustomMenusHandler;
import com.kyj.fx.commons.fx.controls.text.CodeAreaHelper;
import com.kyj.fx.commons.fx.controls.xpath.XpathScriptComposite;
import com.kyj.fx.commons.utils.GargoyleOpenExtension;
import com.kyj.fx.voeditor.visual.component.tree.XMLTreeView;
import com.kyj.fx.voeditor.visual.util.FileUtil;
import com.kyj.fx.voeditor.visual.util.FxUtil;
import com.kyj.fx.voeditor.visual.util.ValueUtil;
import com.kyj.fx.voeditor.visual.util.XMLFormatter;
import javafx.beans.value.ObservableValue;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.MenuItem;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.BorderPane;
@Deprecated
public class XMLEditor extends BorderPane implements GargoyleOpenExtension {
/**
* @최초생성일 2016. 10. 12.
*/
// private static final String REGEX =
// "(?<ELEMENT>(</?\\h*)(\\w+)([^<>]*)(\\h*/?>))" +
// "|(?<COMMENT><!--[^<>]+-->)";
private static final String REGEX2 = "(?<ELEMENT>(</?\\h*)(\\w+)([^<>]*)(\\h*/?>))" + "|(?<COMMENT><!--[^!]+-->)";
private static final Pattern XML_TAG = Pattern.compile(REGEX2);
private static final Pattern ATTRIBUTES = Pattern.compile("([\\w+|]\\h*)(=)(\\h*\"[^\"]+\")");
private static final int GROUP_OPEN_BRACKET = 2;
private static final int GROUP_ELEMENT_NAME = 3;
private static final int GROUP_ATTRIBUTES_SECTION = 4;
private static final int GROUP_CLOSE_BRACKET = 5;
private static final int GROUP_ATTRIBUTE_NAME = 1;
private static final int GROUP_EQUAL_SYMBOL = 2;
private static final int GROUP_ATTRIBUTE_VALUE = 3;
private CodeArea codeArea;
// private XMLTreeView xmlTreeView;
private CodeAreaHelper<CodeArea> codeHelperDeligator;
public XMLEditor() {
codeArea = new CodeArea();
codeHelperDeligator = new CodeAreaHelper(codeArea);
codeHelperDeligator.customMenuHandler(new CodeAreaCustomMenusHandler<CodeArea>() {
@Override
public void customMenus(CodeArea codeArea, ContextMenu contextMenu) {
{
MenuItem e = new MenuItem("Format");
e.setOnAction(evt -> doformat());
contextMenu.getItems().add(e);
}
{
MenuItem e = new MenuItem("Show Application Code");
e.setOnAction(evt -> FxUtil.EasyFxUtils.showApplicationCode(codeArea.getText()));
contextMenu.getItems().add(e);
}
{
MenuItem e = new MenuItem("Show XML Structure");
e.setOnAction(evt -> {
XMLTreeView xmlTreeView = new XMLTreeView();
xmlTreeView.setXml(getText());
xmlTreeView.setPrefSize(1200d, 800d);
xmlTreeView.setContextMenu(XMLTreeView.createContextMenu(xmlTreeView));
FxUtil.createStageAndShow(xmlTreeView, stage -> {
stage.setTitle("XML Structure");
stage.initOwner(FxUtil.getWindow(XMLEditor.this));
});
});
contextMenu.getItems().add(e);
}
{
MenuItem e = new MenuItem("Show XPath-Script");
e.setOnAction(evt -> {
XpathScriptComposite parent = new XpathScriptComposite();
FxUtil.createStageAndShow(parent, stage -> {
stage.setTitle("XPath-Script");
stage.initOwner(FxUtil.getWindow(XMLEditor.this));
});
String text = codeArea.getSelectedText();
if(ValueUtil.isEmpty(text))
text = XMLEditor.this.getText();
parent.setXml(text);
});
contextMenu.getItems().add(e);
}
}
});
codeArea.setParagraphGraphicFactory(LineNumberFactory.get(codeArea));
codeArea.setOnKeyPressed(this::codeAreaKeyClick);
codeArea.textProperty().addListener((obs, oldText, newText) -> {
codeArea.setStyleSpans(0, computeHighlighting(newText));
});
// xmlTreeView = new XMLTreeView();
// SplitPane sp = new SplitPane(codeArea, xmlTreeView);
setCenter(codeArea);
this.getStylesheets().add(JavaTextArea.class.getResource("xml-highlighting.css").toExternalForm());
}
/**
* @작성자 : KYJ
* @작성일 : 2018. 3. 9.
* @return
*/
public ObservableValue<String> textProperty() {
return this.codeArea.textProperty();
}
public String getText() {
return this.codeArea.getText();
}
public void setText(String text) {
this.codeArea.replaceText(text);
}
private XMLFormatter formatter = new XMLFormatter();
/**
* 키클릭 이벤트 처리
*
* @작성자 : KYJ
* @작성일 : 2016. 10. 6.
* @param e
*/
public void codeAreaKeyClick(KeyEvent e) {
codeHelperDeligator.codeAreaKeyClick(e);
// CTRL + SHIFT + F do xml format.
if (e.getCode() == KeyCode.F && e.isControlDown() && e.isShiftDown() && !e.isAltDown()) {
if (e.isConsumed())
return;
doformat();
e.consume();
}
}
private static final Logger LOGGER = LoggerFactory.getLogger(XMLEditor.class);
/**
*
* 17.09.07 포멧팅을 시도하면서 에러가 발생하는 경우 기존 텍스트에 대한 상태를 변경하지않게 하기위해 try ~ catch문을
* 추가적으로 작성.
*
* @작성자 : KYJ
* @작성일 : 2017. 9. 1.
*/
private void doformat() {
try {
String text = this.codeArea.getText();
String format = formatter.formatWithAttributes(text);
setContent(format);
} catch (Exception e) {
LOGGER.error(ValueUtil.toString(e));
}
}
/**
* setContent
*
* @작성자 : KYJ
* @작성일 : 2017. 9. 1.
* @param content
*/
public void setContent(String content) {
codeHelperDeligator.setContent(content);
}
private static StyleSpans<Collection<String>> computeHighlighting(String text) {
Matcher matcher = XML_TAG.matcher(text);
int lastKwEnd = 0;
StyleSpansBuilder<Collection<String>> spansBuilder = new StyleSpansBuilder<>();
while (matcher.find()) {
spansBuilder.add(Collections.emptyList(), matcher.start() - lastKwEnd);
if (matcher.group("COMMENT") != null) {
spansBuilder.add(Collections.singleton("comment"), matcher.end() - matcher.start());
} else {
if (matcher.group("ELEMENT") != null) {
String attributesText = matcher.group(GROUP_ATTRIBUTES_SECTION);
spansBuilder.add(Collections.singleton("tagmark"), matcher.end(GROUP_OPEN_BRACKET) - matcher.start(GROUP_OPEN_BRACKET));
spansBuilder.add(Collections.singleton("anytag"), matcher.end(GROUP_ELEMENT_NAME) - matcher.end(GROUP_OPEN_BRACKET));
if (!attributesText.isEmpty()) {
lastKwEnd = 0;
Matcher amatcher = ATTRIBUTES.matcher(attributesText);
while (amatcher.find()) {
spansBuilder.add(Collections.emptyList(), amatcher.start() - lastKwEnd);
spansBuilder.add(Collections.singleton("attribute"),
amatcher.end(GROUP_ATTRIBUTE_NAME) - amatcher.start(GROUP_ATTRIBUTE_NAME));
spansBuilder.add(Collections.singleton("tagmark"),
amatcher.end(GROUP_EQUAL_SYMBOL) - amatcher.end(GROUP_ATTRIBUTE_NAME));
spansBuilder.add(Collections.singleton("avalue"),
amatcher.end(GROUP_ATTRIBUTE_VALUE) - amatcher.end(GROUP_EQUAL_SYMBOL));
lastKwEnd = amatcher.end();
}
if (attributesText.length() > lastKwEnd)
spansBuilder.add(Collections.emptyList(), attributesText.length() - lastKwEnd);
}
lastKwEnd = matcher.end(GROUP_ATTRIBUTES_SECTION);
spansBuilder.add(Collections.singleton("tagmark"), matcher.end(GROUP_CLOSE_BRACKET) - lastKwEnd);
}
}
lastKwEnd = matcher.end();
}
spansBuilder.add(Collections.emptyList(), text.length() - lastKwEnd);
return spansBuilder.create();
}
public void setEditable(boolean editable) {
codeArea.setEditable(editable);
}
/**
* 특정라인으로 이동처리하는 메소드
*
* 특정라인블록 전체를 선택처리함.
*
* @작성자 : KYJ
* @작성일 : 2016. 10. 4.
* @param moveToLine
*/
public void moveToLine(int moveToLine) {
codeHelperDeligator.moveToLine(moveToLine);
}
public void moveToLine(int moveToLine, int startCol) {
codeHelperDeligator.moveToLine(moveToLine, startCol);
}
public void moveToLine(int moveToLine, int startCol, int endCol) {
codeHelperDeligator.moveToLine(moveToLine, startCol, endCol);
}
/**
* @작성자 : KYJ
* @작성일 : 2018. 3. 9.
* @return
*/
public ContextMenu getContextMenu() {
return this.codeHelperDeligator.getContextMenu();
}
@Override
public boolean canOpen(File file) {
String ext = FileUtil.getFileExtension(file);
return "xml".equalsIgnoreCase(ext);
}
@Override
public void setOpenFile(File file) {
codeArea.replaceText(FileUtil.readConversion(file, StandardCharsets.UTF_8));
}
} | gpl-2.0 |
muxiaobai/CourseExercises | java/ProjectTest/src/us/codecraft/tinyioc/aop/Advisor.java | 134 | package us.codecraft.tinyioc.aop;
/**
* @author yihua.huang@dianping.com
*/
public interface Advisor {
Advice getAdvice();
}
| gpl-2.0 |
crotwell/fissuresIDL | src/main/java/edu/iris/Fissures/IfSeismogramMgr/EncodedDataSeqHelper.java | 2240 | // **********************************************************************
//
// Generated by the ORBacus IDL to Java Translator
//
// Copyright (c) 2000
// Object Oriented Concepts, Inc.
// Billerica, MA, USA
//
// All Rights Reserved
//
// **********************************************************************
// Version: 4.0.5
package edu.iris.Fissures.IfSeismogramMgr;
//
// IDL:iris.edu/Fissures/IfSeismogramMgr/EncodedDataSeq:1.0
//
final public class EncodedDataSeqHelper
{
public static void
insert(org.omg.CORBA.Any any, edu.iris.Fissures.IfTimeSeries.EncodedData[] val)
{
org.omg.CORBA.portable.OutputStream out = any.create_output_stream();
write(out, val);
any.read_value(out.create_input_stream(), type());
}
public static edu.iris.Fissures.IfTimeSeries.EncodedData[]
extract(org.omg.CORBA.Any any)
{
if(any.type().equivalent(type()))
return read(any.create_input_stream());
else
throw new org.omg.CORBA.BAD_OPERATION();
}
private static org.omg.CORBA.TypeCode typeCode_;
public static org.omg.CORBA.TypeCode
type()
{
if(typeCode_ == null)
{
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
typeCode_ = orb.create_alias_tc(id(), "EncodedDataSeq", orb.create_sequence_tc(0, EncodedDataHelper.type()));
}
return typeCode_;
}
public static String
id()
{
return "IDL:iris.edu/Fissures/IfSeismogramMgr/EncodedDataSeq:1.0";
}
public static edu.iris.Fissures.IfTimeSeries.EncodedData[]
read(org.omg.CORBA.portable.InputStream in)
{
edu.iris.Fissures.IfTimeSeries.EncodedData[] _ob_v;
int len0 = in.read_ulong();
_ob_v = new edu.iris.Fissures.IfTimeSeries.EncodedData[len0];
for(int i0 = 0 ; i0 < len0 ; i0++)
_ob_v[i0] = EncodedDataHelper.read(in);
return _ob_v;
}
public static void
write(org.omg.CORBA.portable.OutputStream out, edu.iris.Fissures.IfTimeSeries.EncodedData[] val)
{
int len0 = val.length;
out.write_ulong(len0);
for(int i0 = 0 ; i0 < len0 ; i0++)
EncodedDataHelper.write(out, val[i0]);
}
}
| gpl-2.0 |
anthony-salutari/BetterGRT | app/src/main/java/com/asal/bettergrt/SearchActivity.java | 7936 | package com.asal.bettergrt;
import android.content.Context;
import android.content.SharedPreferences;
import android.support.design.widget.TabLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.lapism.searchview.SearchAdapter;
import com.lapism.searchview.SearchHistoryTable;
import com.lapism.searchview.SearchItem;
import com.lapism.searchview.SearchView;
import java.util.ArrayList;
import java.util.List;
public class SearchActivity extends AppCompatActivity {
/**
* The {@link android.support.v4.view.PagerAdapter} that will provide
* fragments for each of the sections. We use a
* {@link FragmentPagerAdapter} derivative, which will keep every
* loaded fragment in memory. If this becomes too memory intensive, it
* may be best to switch to a
* {@link android.support.v4.app.FragmentStatePagerAdapter}.
*/
private SectionsPagerAdapter mSectionsPagerAdapter;
/**
* The {@link ViewPager} that will host the section contents.
*/
private ViewPager mViewPager;
private SearchView mSearchView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences mPreferences = getSharedPreferences("app_status", Context.MODE_PRIVATE);
Utilities.mTheme = mPreferences.getInt("theme", Utilities.BLUE);
Utilities.onCreateChangeTheme(this, mPreferences);
setContentView(R.layout.activity_search);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
setTitle(null);
// Create the adapter that will return a fragment for each of the three
// primary sections of the activity.
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.container);
mViewPager.setAdapter(mSectionsPagerAdapter);
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setupWithViewPager(mViewPager);
setSearchView();
}
private void setSearchView() {
mSearchView = (SearchView) findViewById(R.id.searchView);
if (mSearchView != null) {
// customize the searchview
mSearchView.setVersion(SearchView.VERSION_TOOLBAR);
mSearchView.setVersionMargins(SearchView.VERSION_MARGINS_TOOLBAR_BIG);
mSearchView.setDivider(true);
mSearchView.setAnimationDuration(SearchView.ANIMATION_DURATION);
mSearchView.setHint("Search");
mSearchView.setOnMenuClickListener(new SearchView.OnMenuClickListener() {
@Override
public void onMenuClick() {
if (mSearchView.isSearchOpen()) {
mSearchView.close(true);
} else {
finish();
}
}
});
mSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextChange(String newText) {
return false;
}
@Override
public boolean onQueryTextSubmit(String query) {
return false;
}
});
mSearchView.setOnOpenCloseListener(new SearchView.OnOpenCloseListener() {
@Override
public void onClose() {
}
@Override
public void onOpen() {
}
});
List<SearchItem> suggestionsList = new ArrayList<>();
suggestionsList.add(new SearchItem("search1"));
suggestionsList.add(new SearchItem("search2"));
suggestionsList.add(new SearchItem("search3"));
SearchAdapter searchAdapter = new SearchAdapter(this, suggestionsList);
searchAdapter.setOnItemClickListener(new SearchAdapter.OnItemClickListener() {
@Override
public void onItemClick(View view, int position) {
mSearchView.close(true);
}
});
mSearchView.setAdapter(searchAdapter);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_search, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
/* if (id == R.id.action_settings) {
return true;
}*/
return super.onOptionsItemSelected(item);
}
/**
* A placeholder fragment containing a simple view.
*/
public static class PlaceholderFragment extends Fragment {
/**
* The fragment argument representing the section number for this
* fragment.
*/
private static final String ARG_SECTION_NUMBER = "section_number";
public PlaceholderFragment() {
}
/**
* Returns a new instance of this fragment for the given section
* number.
*/
public static PlaceholderFragment newInstance(int sectionNumber) {
PlaceholderFragment fragment = new PlaceholderFragment();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
return fragment;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_search, container, false);
TextView textView = (TextView) rootView.findViewById(R.id.section_label);
textView.setText(getString(R.string.section_format, getArguments().getInt(ARG_SECTION_NUMBER)));
return rootView;
}
}
/**
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to
* one of the sections/tabs/pages.
*/
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
// getItem is called to instantiate the fragment for the given page.
// Return a PlaceholderFragment (defined as a static inner class below).
return PlaceholderFragment.newInstance(position + 1);
}
@Override
public int getCount() {
// Show 3 total pages.
return 2;
}
@Override
public CharSequence getPageTitle(int position) {
switch (position) {
case 0:
return "Bus Stops";
case 1:
return "Routes";
}
return null;
}
}
}
| gpl-2.0 |
xuie0000/vlc-android | vlc-android/tv/src/org/videolan/vlc/gui/tv/browser/MusicFragment.java | 11002 | /*
* *************************************************************************
* MusicFragment.java
* **************************************************************************
* Copyright © 2015 VLC authors and VideoLAN
* Author: Geoffrey Métais
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* ***************************************************************************
*/
package org.videolan.vlc.gui.tv.browser;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Message;
import android.support.v17.leanback.widget.OnItemViewClickedListener;
import android.support.v17.leanback.widget.Presenter;
import android.support.v17.leanback.widget.Row;
import android.support.v17.leanback.widget.RowPresenter;
import org.videolan.vlc.MediaLibrary;
import org.videolan.vlc.MediaWrapper;
import org.videolan.vlc.R;
import org.videolan.vlc.gui.tv.MainTvActivity;
import org.videolan.vlc.gui.audio.MediaComparators;
import org.videolan.vlc.gui.tv.audioplayer.AudioPlayerActivity;
import org.videolan.vlc.util.WeakHandler;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class MusicFragment extends MediaLibBrowserFragment {
public static final String MEDIA_SECTION = "section";
public static final String AUDIO_CATEGORY = "category";
public static final String AUDIO_FILTER = "filter";
public static final long FILTER_ARTIST = 3;
public static final long FILTER_GENRE = 4;
public static final int CATEGORY_NOW_PLAYING = 0;
public static final int CATEGORY_ARTISTS = 1;
public static final int CATEGORY_ALBUMS = 2;
public static final int CATEGORY_GENRES = 3;
public static final int CATEGORY_SONGS = 4;
protected Map<String, ListItem> mMediaItemMap;
protected ArrayList<ListItem> mMediaItemList;
private volatile AsyncAudioUpdate mUpdater = null;
String mFilter;
int mCategory;
long mType;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState != null){
mType = savedInstanceState.getLong(MEDIA_SECTION);
mCategory = savedInstanceState.getInt(AUDIO_CATEGORY);
mFilter = savedInstanceState.getString(AUDIO_FILTER);
} else {
mType = getActivity().getIntent().getLongExtra(MEDIA_SECTION, -1);
mCategory = getActivity().getIntent().getIntExtra(AUDIO_CATEGORY, 0);
mFilter = getActivity().getIntent().getStringExtra(AUDIO_FILTER);
}
}
public void onResume() {
super.onResume();
if (mUpdater == null) {
mUpdater = new AsyncAudioUpdate();
mUpdater.execute();
}
mMediaLibrary.addUpdateHandler(mHandler);
}
@Override
public void onPause() {
super.onPause();
if (mUpdater != null)
mUpdater.cancel(true);
}
public void onSaveInstanceState(Bundle outState){
super.onSaveInstanceState(outState);
outState.putInt(AUDIO_CATEGORY, mCategory);
outState.putLong(MEDIA_SECTION, mType);
}
public class AsyncAudioUpdate extends AsyncTask<Void, ListItem, String> {
public AsyncAudioUpdate() {}
@Override
protected void onPreExecute() {
setTitle(getString(R.string.app_name_full));
mAdapter.clear();
mMediaItemMap = new HashMap<String, ListItem>();
mMediaItemList = new ArrayList<ListItem>();
((BrowserActivity)getActivity()).showProgress(true);
}
@Override
protected String doInBackground(Void... params) {
String title;
ListItem item;
List<MediaWrapper> audioList = MediaLibrary.getInstance().getAudioItems();
if (CATEGORY_ARTISTS == mCategory){
Collections.sort(audioList, MediaComparators.byArtist);
title = getString(R.string.artists);
for (MediaWrapper mediaWrapper : audioList){
item = add(mediaWrapper.getArtist(), null, mediaWrapper);
if (item != null)
publishProgress(item);
}
} else if (CATEGORY_ALBUMS == mCategory){
title = getString(R.string.albums);
Collections.sort(audioList, MediaComparators.byAlbum);
for (MediaWrapper mediaWrapper : audioList){
if (mFilter == null
|| (mType == FILTER_ARTIST && mFilter.equals(mediaWrapper.getArtist()))
|| (mType == FILTER_GENRE && mFilter.equals(mediaWrapper.getGenre()))) {
item = add(mediaWrapper.getAlbum(), mediaWrapper.getArtist(), mediaWrapper);
if (item != null)
publishProgress(item);
}
}
//Customize title for artist/genre browsing
if (mType == FILTER_ARTIST){
title = title + " " + mMediaItemList.get(0).mediaList.get(0).getArtist();
} else if (mType == FILTER_GENRE){
title = title + " " + mMediaItemList.get(0).mediaList.get(0).getGenre();
}
} else if (CATEGORY_GENRES == mCategory){
title = getString(R.string.genres);
Collections.sort(audioList, MediaComparators.byGenre);
for (MediaWrapper mediaWrapper : audioList){
item = add(mediaWrapper.getGenre(), null, mediaWrapper);
if (item != null)
publishProgress(item);
}
} else if (CATEGORY_SONGS == mCategory){
title = getString(R.string.songs);
Collections.sort(audioList, MediaComparators.byName);
ListItem mediaItem;
for (MediaWrapper mediaWrapper : audioList){
mediaItem = new ListItem(mediaWrapper.getTitle(), mediaWrapper.getArtist(), mediaWrapper);
mMediaItemMap.put(title, mediaItem);
mMediaItemList.add(mediaItem);
publishProgress(mediaItem);
}
} else {
title = getString(R.string.app_name_full);
}
return title;
}
protected void onProgressUpdate(ListItem... items){
mAdapter.add(items[0]);
}
@Override
protected void onPostExecute(String title) {
((BrowserActivity)getActivity()).showProgress(false);
setTitle(title);
setOnItemViewClickedListener(new OnItemViewClickedListener() {
@Override
public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
RowPresenter.ViewHolder rowViewHolder, Row row) {
ListItem listItem = (ListItem) item;
Intent intent;
if (CATEGORY_ARTISTS == mCategory) {
intent = new Intent(mContext, VerticalGridActivity.class);
intent.putExtra(MainTvActivity.BROWSER_TYPE, MainTvActivity.HEADER_CATEGORIES);
intent.putExtra(AUDIO_CATEGORY, CATEGORY_ALBUMS);
intent.putExtra(MEDIA_SECTION, FILTER_ARTIST);
intent.putExtra(AUDIO_FILTER, listItem.mediaList.get(0).getArtist());
} else if (CATEGORY_GENRES == mCategory) {
intent = new Intent(mContext, VerticalGridActivity.class);
intent.putExtra(MainTvActivity.BROWSER_TYPE, MainTvActivity.HEADER_CATEGORIES);
intent.putExtra(AUDIO_CATEGORY, CATEGORY_ALBUMS);
intent.putExtra(MEDIA_SECTION, FILTER_GENRE);
intent.putExtra(AUDIO_FILTER, listItem.mediaList.get(0).getGenre());
} else {
if (CATEGORY_ALBUMS == mCategory)
Collections.sort(listItem.mediaList, MediaComparators.byTrackNumber);
intent = new Intent(mContext, AudioPlayerActivity.class);
intent.putExtra(AudioPlayerActivity.MEDIA_LIST, listItem.mediaList);
}
startActivity(intent);
}
});
}
}
public static class ListItem {
public String mTitle;
public String mSubTitle;
public ArrayList<MediaWrapper> mediaList;
public ListItem(String title, String subTitle, MediaWrapper MediaWrapper) {
mediaList = new ArrayList<MediaWrapper>();
if (MediaWrapper != null)
mediaList.add(MediaWrapper);
mTitle = title;
mSubTitle = subTitle;
}
}
public ListItem add(String title, String subTitle, MediaWrapper MediaWrapper) {
if(title == null) return null;
title = title.trim();
if(subTitle != null) subTitle = subTitle.trim();
if (mMediaItemMap.containsKey(title))
mMediaItemMap.get(title).mediaList.add(MediaWrapper);
else {
ListItem item = new ListItem(title, subTitle, MediaWrapper);
mMediaItemMap.put(title, item);
mMediaItemList.add(item);
return item;
}
return null;
}
@Override
protected void updateList() {
if (mUpdater == null) {
mUpdater = new AsyncAudioUpdate();
mUpdater.execute();
}
}
private MediaLibHandler mHandler = new MediaLibHandler(this);
private static class MediaLibHandler extends WeakHandler<MusicFragment> {
public MediaLibHandler(MusicFragment owner) {
super(owner);
}
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what){
case MediaLibrary.MEDIA_ITEMS_UPDATED:
if (getOwner() != null)
getOwner().updateList();
break;
}
}
}
} | gpl-2.0 |
axlecho/meowu-app | app/src/main/java/cn/meowu/client/network/model/SizeInfoShort.java | 253 | package cn.meowu.client.network.model;
public class SizeInfoShort extends BaseModel {
public final String name;
public final String id;
public SizeInfoShort(String name, String id) {
this.name = name;
this.id = id;
}
}
| gpl-2.0 |
CleverCloud/Bianca | bianca/src/main/java/com/clevercloud/bianca/marshal/JavaListMarshal.java | 3081 | /*
* Copyright (c) 1998-2010 Caucho Technology -- all rights reserved
* Copyright (c) 2011-2012 Clever Cloud SAS -- all rights reserved
*
* This file is part of Bianca(R) Open Source
*
* Each copy or derived work must preserve the copyright notice and this
* notice unmodified.
*
* Bianca Open Source is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Bianca Open Source is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
* of NON-INFRINGEMENT. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with Bianca Open Source; if not, write to the
*
* Free Software Foundation, Inc.
* 59 Temple Place, Suite 330
* Boston, MA 02111-1307 USA
*
* @author Scott Ferguson
*/
package com.clevercloud.bianca.marshal;
import com.clevercloud.bianca.env.Env;
import com.clevercloud.bianca.env.JavaListAdapter;
import com.clevercloud.bianca.env.Value;
import com.clevercloud.bianca.program.JavaClassDef;
import com.clevercloud.util.L10N;
/**
* Code for marshalling arguments.
*/
public class JavaListMarshal extends JavaMarshal {
private static final L10N L = new L10N(JavaMarshal.class);
public JavaListMarshal(JavaClassDef def,
boolean isNotNull) {
this(def, isNotNull, false);
}
public JavaListMarshal(JavaClassDef def,
boolean isNotNull,
boolean isUnmarshalNullAsFalse) {
super(def, isNotNull, isUnmarshalNullAsFalse);
}
@Override
public Object marshal(Env env, Value value, Class argClass) {
if (!value.isset()) {
if (_isNotNull) {
env.warning(L.l("null is an unexpected argument, expected {0}",
shortName(argClass)));
}
return null;
}
Object obj = value.toJavaList(env, argClass);
if (obj == null) {
if (_isNotNull) {
env.warning(L.l("null is an unexpected argument, expected {0}",
shortName(argClass)));
}
return null;
} else if (!argClass.isAssignableFrom(obj.getClass())) {
env.warning(L.l(
"'{0}' of type '{1}' is an unexpected argument, expected {2}",
value,
shortName(value.getClass()),
shortName(argClass)));
return null;
}
return obj;
}
@Override
protected int getMarshalingCostImpl(Value argValue) {
if (argValue instanceof JavaListAdapter
&& getExpectedClass().isAssignableFrom(argValue.toJavaObject().getClass())) {
return Marshal.ZERO;
} else if (argValue.isArray()) {
return Marshal.THREE;
} else {
return Marshal.FOUR;
}
}
}
| gpl-2.0 |
makelove/book-hadoop-hacks | hadoop-hacks/src/main/java/ch2/p73/CustomWritable/CustomWritable.java | 794 | package ch2.p73.CustomWritable;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable;
/**
* 自定义Writable类型
* @author PLAYMORE
*
*/
public class CustomWritable implements Writable{
private Text foo;
private IntWritable bar;
private String hoge;
public CustomWritable(Text foo, IntWritable bar, String hoge) {
super();
this.foo = foo;
this.bar = bar;
this.hoge = hoge;
}
public void readFields(DataInput in) throws IOException {
foo.readFields(in);
bar.readFields(in);
hoge=in.readUTF();
}
public void write(DataOutput out) throws IOException {
foo.write(out);
bar.write(out);
out.writeUTF(hoge);
}
}
| gpl-2.0 |
JudeRosario/WordPress-Android | WordPress/src/main/java/org/wordpress/android/ui/reader/adapters/ReaderPostAdapter.java | 25127 | package org.wordpress.android.ui.reader.adapters;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Build;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import org.wordpress.android.R;
import org.wordpress.android.analytics.AnalyticsTracker;
import org.wordpress.android.datasets.ReaderPostTable;
import org.wordpress.android.models.ReaderPost;
import org.wordpress.android.models.ReaderPostList;
import org.wordpress.android.models.ReaderTag;
import org.wordpress.android.ui.reader.ReaderActivityLauncher;
import org.wordpress.android.ui.reader.ReaderAnim;
import org.wordpress.android.ui.reader.ReaderConstants;
import org.wordpress.android.ui.reader.ReaderInterfaces;
import org.wordpress.android.ui.reader.ReaderTypes;
import org.wordpress.android.ui.reader.actions.ReaderActions;
import org.wordpress.android.ui.reader.actions.ReaderBlogActions;
import org.wordpress.android.ui.reader.actions.ReaderPostActions;
import org.wordpress.android.ui.reader.views.ReaderFollowButton;
import org.wordpress.android.ui.reader.views.ReaderIconCountView;
import org.wordpress.android.util.AppLog;
import org.wordpress.android.util.DateTimeUtils;
import org.wordpress.android.util.DisplayUtils;
import org.wordpress.android.util.ToastUtils;
import org.wordpress.android.widgets.WPNetworkImageView;
public class ReaderPostAdapter extends RecyclerView.Adapter<ReaderPostAdapter.ReaderPostViewHolder> {
private ReaderTag mCurrentTag;
private long mCurrentBlogId;
private final int mPhotonWidth;
private final int mPhotonHeight;
private final int mAvatarSz;
private final int mMarginLarge;
private boolean mCanRequestMorePosts = false;
private final ReaderTypes.ReaderPostListType mPostListType;
private final ReaderPostList mPosts = new ReaderPostList();
private ReaderInterfaces.OnPostSelectedListener mPostSelectedListener;
private ReaderInterfaces.OnTagSelectedListener mOnTagSelectedListener;
private ReaderInterfaces.OnPostPopupListener mOnPostPopupListener;
private ReaderInterfaces.RequestReblogListener mReblogListener;
private ReaderInterfaces.DataLoadedListener mDataLoadedListener;
private ReaderActions.DataRequestedListener mDataRequestedListener;
// the large "tbl_posts.text" column is unused here, so skip it when querying
private static final boolean EXCLUDE_TEXT_COLUMN = true;
private static final int MAX_ROWS = ReaderConstants.READER_MAX_POSTS_TO_DISPLAY;
class ReaderPostViewHolder extends RecyclerView.ViewHolder {
private final TextView txtTitle;
private final TextView txtText;
private final TextView txtBlogName;
private final TextView txtDate;
private final TextView txtTag;
private final ReaderIconCountView commentCount;
private final ReaderIconCountView likeCount;
private final ReaderFollowButton followButton;
private final ImageView imgBtnReblog;
private final ImageView imgMore;
private final WPNetworkImageView imgFeatured;
private final WPNetworkImageView imgAvatar;
private final ViewGroup layoutPostHeader;
public ReaderPostViewHolder(View itemView) {
super(itemView);
txtTitle = (TextView) itemView.findViewById(R.id.text_title);
txtText = (TextView) itemView.findViewById(R.id.text_excerpt);
txtBlogName = (TextView) itemView.findViewById(R.id.text_blog_name);
txtDate = (TextView) itemView.findViewById(R.id.text_date);
txtTag = (TextView) itemView.findViewById(R.id.text_tag);
commentCount = (ReaderIconCountView) itemView.findViewById(R.id.count_comments);
likeCount = (ReaderIconCountView) itemView.findViewById(R.id.count_likes);
followButton = (ReaderFollowButton) itemView.findViewById(R.id.follow_button);
imgFeatured = (WPNetworkImageView) itemView.findViewById(R.id.image_featured);
imgAvatar = (WPNetworkImageView) itemView.findViewById(R.id.image_avatar);
imgMore = (ImageView) itemView.findViewById(R.id.image_more);
layoutPostHeader = (ViewGroup) itemView.findViewById(R.id.layout_post_header);
imgBtnReblog = (ImageView) itemView.findViewById(R.id.image_reblog_btn);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
imgBtnReblog.setBackgroundResource(R.drawable.ripple_oval);
}
}
}
@Override
public ReaderPostViewHolder onCreateViewHolder(ViewGroup parent, int position) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.reader_cardview_post, parent, false);
return new ReaderPostViewHolder(view);
}
@Override
public void onBindViewHolder(final ReaderPostViewHolder holder, final int position) {
final ReaderPost post = mPosts.get(position);
ReaderTypes.ReaderPostListType postListType = getPostListType();
holder.txtTitle.setText(post.getTitle());
holder.txtDate.setText(DateTimeUtils.javaDateToTimeSpan(post.getDatePublished()));
// hide the post header (avatar, blog name & follow button) if we're showing posts
// in a specific blog
if (postListType == ReaderTypes.ReaderPostListType.BLOG_PREVIEW) {
holder.layoutPostHeader.setVisibility(View.GONE);
} else {
holder.layoutPostHeader.setVisibility(View.VISIBLE);
holder.imgAvatar.setImageUrl(post.getPostAvatarForDisplay(mAvatarSz), WPNetworkImageView.ImageType.AVATAR);
if (post.hasBlogName()) {
holder.txtBlogName.setText(post.getBlogName());
} else if (post.hasAuthorName()) {
holder.txtBlogName.setText(post.getAuthorName());
} else {
holder.txtBlogName.setText(null);
}
// follow/following
holder.followButton.setIsFollowed(post.isFollowedByCurrentUser);
holder.followButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
toggleFollow((ReaderFollowButton) v, position);
}
});
// show blog/feed preview when avatar is tapped
holder.imgAvatar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ReaderActivityLauncher.showReaderBlogPreview(view.getContext(), post);
}
});
}
if (post.hasExcerpt()) {
holder.txtText.setVisibility(View.VISIBLE);
holder.txtText.setText(post.getExcerpt());
} else {
holder.txtText.setVisibility(View.GONE);
}
final int titleMargin;
if (post.hasFeaturedImage()) {
final String imageUrl = post.getFeaturedImageForDisplay(mPhotonWidth, mPhotonHeight);
holder.imgFeatured.setImageUrl(imageUrl, WPNetworkImageView.ImageType.PHOTO);
holder.imgFeatured.setVisibility(View.VISIBLE);
titleMargin = mMarginLarge;
} else if (post.hasFeaturedVideo()) {
holder.imgFeatured.setVideoUrl(post.postId, post.getFeaturedVideo());
holder.imgFeatured.setVisibility(View.VISIBLE);
titleMargin = mMarginLarge;
} else {
holder.imgFeatured.setVisibility(View.GONE);
titleMargin = (holder.layoutPostHeader.getVisibility() == View.VISIBLE ? 0 : mMarginLarge);
}
// set the top margin of the title based on whether there's a featured image and post header
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) holder.txtTitle.getLayoutParams();
params.topMargin = titleMargin;
// show the best tag for this post
final String tagToDisplay = (mCurrentTag != null ? post.getTagForDisplay(mCurrentTag.getTagName()) : null);
if (!TextUtils.isEmpty(tagToDisplay)) {
holder.txtTag.setText(tagToDisplay);
holder.txtTag.setVisibility(View.VISIBLE);
holder.txtTag.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mOnTagSelectedListener != null) {
mOnTagSelectedListener.onTagSelected(tagToDisplay);
}
}
});
} else {
holder.txtTag.setVisibility(View.GONE);
holder.txtTag.setOnClickListener(null);
}
// likes, comments & reblogging - supported by wp posts only
boolean showLikes = post.isWP() && post.isLikesEnabled;
boolean showComments = post.isWP() && (post.isCommentsOpen || post.numReplies > 0);
if (showLikes || showComments) {
showCounts(holder, post, false);
}
if (showLikes) {
holder.likeCount.setSelected(post.isLikedByCurrentUser);
holder.likeCount.setVisibility(View.VISIBLE);
holder.likeCount.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
toggleLike(v.getContext(), holder, position);
}
});
} else {
holder.likeCount.setVisibility(View.GONE);
holder.likeCount.setOnClickListener(null);
}
if (showComments) {
holder.commentCount.setVisibility(View.VISIBLE);
holder.commentCount.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ReaderActivityLauncher.showReaderComments(v.getContext(), post);
}
});
} else {
holder.commentCount.setVisibility(View.GONE);
holder.commentCount.setOnClickListener(null);
}
if (post.canReblog()) {
showReblogStatus(holder.imgBtnReblog, post.isRebloggedByCurrentUser);
holder.imgBtnReblog.setVisibility(View.VISIBLE);
if (!post.isRebloggedByCurrentUser) {
holder.imgBtnReblog.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ReaderAnim.animateReblogButton(holder.imgBtnReblog);
if (mReblogListener != null) {
mReblogListener.onRequestReblog(post, v);
}
}
});
} else {
holder.imgBtnReblog.setOnClickListener(null);
}
} else {
// use INVISIBLE rather than GONE to ensure container maintains the same height
holder.imgBtnReblog.setVisibility(View.INVISIBLE);
holder.imgBtnReblog.setOnClickListener(null);
}
// more menu with "block this blog" only shows for public wp posts in followed tags
if (post.isWP() && !post.isPrivate && postListType == ReaderTypes.ReaderPostListType.TAG_FOLLOWED) {
holder.imgMore.setVisibility(View.VISIBLE);
holder.imgMore.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (mOnPostPopupListener != null) {
mOnPostPopupListener.onShowPostPopup(view, post);
}
}
});
} else {
holder.imgMore.setVisibility(View.GONE);
holder.imgMore.setOnClickListener(null);
}
// if we're nearing the end of the posts, fire request to load more
if (mCanRequestMorePosts && mDataRequestedListener != null && (position >= getItemCount() - 1)) {
mDataRequestedListener.onRequestData();
}
if (mPostSelectedListener != null) {
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mPostSelectedListener.onPostSelected(post.blogId, post.postId);
}
});
}
}
// ********************************************************************************************
public ReaderPostAdapter(Context context, ReaderTypes.ReaderPostListType postListType) {
super();
mPostListType = postListType;
mAvatarSz = context.getResources().getDimensionPixelSize(R.dimen.avatar_sz_medium);
mMarginLarge = context.getResources().getDimensionPixelSize(R.dimen.margin_large);
int displayWidth = DisplayUtils.getDisplayPixelWidth(context);
int cardSpacing = context.getResources().getDimensionPixelSize(R.dimen.reader_card_spacing);
mPhotonWidth = displayWidth - (cardSpacing * 2);
mPhotonHeight = context.getResources().getDimensionPixelSize(R.dimen.reader_featured_image_height);
setHasStableIds(true);
}
public void setOnPostSelectedListener(ReaderInterfaces.OnPostSelectedListener listener) {
mPostSelectedListener = listener;
}
public void setOnTagSelectedListener(ReaderInterfaces.OnTagSelectedListener listener) {
mOnTagSelectedListener = listener;
}
public void setOnDataLoadedListener(ReaderInterfaces.DataLoadedListener listener) {
mDataLoadedListener = listener;
}
public void setOnDataRequestedListener(ReaderActions.DataRequestedListener listener) {
mDataRequestedListener = listener;
}
public void setOnReblogRequestedListener(ReaderInterfaces.RequestReblogListener listener) {
mReblogListener = listener;
}
public void setOnPostPopupListener(ReaderInterfaces.OnPostPopupListener onPostPopupListener) {
mOnPostPopupListener = onPostPopupListener;
}
ReaderTypes.ReaderPostListType getPostListType() {
return (mPostListType != null ? mPostListType : ReaderTypes.DEFAULT_POST_LIST_TYPE);
}
// used when the viewing tagged posts
public void setCurrentTag(ReaderTag tag) {
if (!ReaderTag.isSameTag(tag, mCurrentTag)) {
mCurrentTag = tag;
reload();
}
}
public boolean isCurrentTag(ReaderTag tag) {
return ReaderTag.isSameTag(tag, mCurrentTag);
}
// used when the list type is ReaderPostListType.BLOG_PREVIEW
public void setCurrentBlog(long blogId) {
if (blogId != mCurrentBlogId) {
mCurrentBlogId = blogId;
reload();
}
}
private void clear() {
if (!mPosts.isEmpty()) {
mPosts.clear();
notifyDataSetChanged();
}
}
public void refresh() {
loadPosts();
}
/*
* same as refresh() above but first clears the existing posts
*/
void reload() {
clear();
loadPosts();
}
void removeItem(int position) {
if (isValidPosition(position)) {
mPosts.remove(position);
notifyItemRemoved(position);
}
}
void removePost(ReaderPost post) {
removeItem(indexOfPost(post));
}
public void removePostsInBlog(long blogId) {
ReaderPostList postsInBlog = mPosts.getPostsInBlog(blogId);
for (ReaderPost post : postsInBlog) {
removePost(post);
}
}
/*
* reload a single post
*/
public void reloadPost(ReaderPost post) {
int index = indexOfPost(post);
if (index == -1) {
return;
}
final ReaderPost updatedPost = ReaderPostTable.getPost(post.blogId, post.postId, true);
if (updatedPost != null) {
mPosts.set(index, updatedPost);
notifyDataSetChanged();
}
}
int indexOfPost(ReaderPost post) {
return mPosts.indexOfPost(post);
}
/*
* copy the follow status from the passed post to other posts in the same blog
*/
private void copyBlogFollowStatus(final ReaderPost post) {
if (isEmpty() || post == null) {
return;
}
long blogId = post.blogId;
String blogUrl = post.getBlogUrl();
boolean hasBlogId = (blogId != 0);
boolean hasBlogUrl = !TextUtils.isEmpty(blogUrl);
if (!hasBlogId && !hasBlogUrl) {
return;
}
long skipPostId = post.postId;
boolean followStatus = post.isFollowedByCurrentUser;
boolean isMatched;
for (ReaderPost thisPost : mPosts) {
if (hasBlogId) {
isMatched = (blogId == thisPost.blogId && skipPostId != thisPost.postId);
} else {
isMatched = blogUrl.equals(thisPost.getBlogUrl());
}
if (isMatched && thisPost.isFollowedByCurrentUser != followStatus) {
thisPost.isFollowedByCurrentUser = followStatus;
int position = mPosts.indexOfPost(thisPost);
if (position > -1) {
notifyItemChanged(position);
}
}
}
}
private void loadPosts() {
if (mIsTaskRunning) {
AppLog.w(AppLog.T.READER, "reader posts task already running");
return;
}
new LoadPostsTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
public ReaderPost getItem(int position) {
if (isValidPosition(position)) {
return mPosts.get(position);
} else {
return null;
}
}
@Override
public int getItemCount() {
return mPosts.size();
}
public boolean isEmpty() {
return (getItemCount() == 0);
}
boolean isValidPosition(int position) {
return (position >= 0 && position < getItemCount());
}
@Override
public long getItemId(int position) {
return mPosts.get(position).getStableId();
}
/*
* shows like & comment count
*/
private void showCounts(ReaderPostViewHolder holder, ReaderPost post, boolean animateChanges) {
holder.likeCount.setCount(post.numLikes, animateChanges);
if (post.numReplies > 0 || post.isCommentsOpen) {
holder.commentCount.setCount(post.numReplies, animateChanges);
holder.commentCount.setVisibility(View.VISIBLE);
} else {
holder.commentCount.setVisibility(View.GONE);
}
}
/*
* triggered when user taps the like button (textView)
*/
private void toggleLike(Context context, ReaderPostViewHolder holder, int position) {
ReaderPost post = getItem(position);
if (post == null) {
return;
}
boolean isCurrentlyLiked = ReaderPostTable.isPostLikedByCurrentUser(post);
boolean isAskingToLike = !isCurrentlyLiked;
ReaderAnim.animateLikeButton(holder.likeCount.getImageView(), isAskingToLike);
if (!ReaderPostActions.performLikeAction(post, isAskingToLike)) {
ToastUtils.showToast(context, R.string.reader_toast_err_generic);
return;
}
if (isAskingToLike) {
AnalyticsTracker.track(AnalyticsTracker.Stat.READER_LIKED_ARTICLE);
}
// update post in array and on screen
ReaderPost updatedPost = ReaderPostTable.getPost(post.blogId, post.postId, true);
if (updatedPost != null) {
mPosts.set(position, updatedPost);
holder.likeCount.setSelected(updatedPost.isLikedByCurrentUser);
showCounts(holder, updatedPost, true);
}
}
/*
* triggered when user taps the follow button
*/
private void toggleFollow(final ReaderFollowButton followButton, int position) {
ReaderPost post = getItem(position);
if (post == null) {
return;
}
final boolean isAskingToFollow = !post.isFollowedByCurrentUser;
followButton.setIsFollowedAnimated(isAskingToFollow);
ReaderActions.ActionListener actionListener = new ReaderActions.ActionListener() {
@Override
public void onActionResult(boolean succeeded) {
if (!succeeded) {
int resId = (isAskingToFollow ? R.string.reader_toast_err_follow_blog : R.string.reader_toast_err_unfollow_blog);
ToastUtils.showToast(followButton.getContext(), resId);
followButton.setIsFollowed(!isAskingToFollow);
}
}
};
if (ReaderBlogActions.followBlogForPost(post, isAskingToFollow, actionListener)) {
ReaderPost updatedPost = ReaderPostTable.getPost(post.blogId, post.postId, true);
if (updatedPost != null) {
mPosts.set(position, updatedPost);
copyBlogFollowStatus(updatedPost);
}
}
}
private void showReblogStatus(ImageView imgBtnReblog, boolean isRebloggedByCurrentUser) {
if (isRebloggedByCurrentUser != imgBtnReblog.isSelected()) {
imgBtnReblog.setSelected(isRebloggedByCurrentUser);
}
if (isRebloggedByCurrentUser) {
imgBtnReblog.setOnClickListener(null);
}
}
/*
* AsyncTask to load posts in the current tag
*/
private boolean mIsTaskRunning = false;
private class LoadPostsTask extends AsyncTask<Void, Void, Boolean> {
ReaderPostList allPosts;
@Override
protected void onPreExecute() {
mIsTaskRunning = true;
}
@Override
protected void onCancelled() {
mIsTaskRunning = false;
}
@Override
protected Boolean doInBackground(Void... params) {
final int numExisting;
switch (getPostListType()) {
case TAG_PREVIEW:
case TAG_FOLLOWED:
allPosts = ReaderPostTable.getPostsWithTag(mCurrentTag, MAX_ROWS, EXCLUDE_TEXT_COLUMN);
numExisting = ReaderPostTable.getNumPostsWithTag(mCurrentTag);
break;
case BLOG_PREVIEW:
allPosts = ReaderPostTable.getPostsInBlog(mCurrentBlogId, MAX_ROWS, EXCLUDE_TEXT_COLUMN);
numExisting = ReaderPostTable.getNumPostsInBlog(mCurrentBlogId);
break;
default:
return false;
}
if (mPosts.isSameList(allPosts)) {
return false;
}
// if we're not already displaying the max # posts, enable requesting more when
// the user scrolls to the end of the list
mCanRequestMorePosts = (numExisting < ReaderConstants.READER_MAX_POSTS_TO_DISPLAY);
return true;
}
@Override
protected void onPostExecute(Boolean result) {
if (result) {
if (mPosts.size() == 0) {
// full refresh if existing list was empty
mPosts.addAll(allPosts);
notifyDataSetChanged();
} else {
// full refresh if any posts were removed (can happen after user unfollows a blog)
boolean anyRemoved = false;
for (ReaderPost post: mPosts) {
if (allPosts.indexOfPost(post) == -1) {
anyRemoved = true;
mPosts.clear();
mPosts.addAll(allPosts);
notifyDataSetChanged();
break;
}
}
// do more optimal check for new/changed posts if none were removed
if (!anyRemoved) {
int addIndex = 0;
int index;
for (ReaderPost post : allPosts) {
index = mPosts.indexOfPost(post);
if (index == -1) {
mPosts.add(addIndex, post);
notifyItemInserted(addIndex);
addIndex++;
} else {
addIndex = index + 1;
if (!post.isSamePost(mPosts.get(index))) {
mPosts.set(index, post);
notifyItemChanged(index);
}
}
}
}
}
}
if (mDataLoadedListener != null) {
mDataLoadedListener.onDataLoaded(isEmpty());
}
mIsTaskRunning = false;
}
}
}
| gpl-2.0 |
bdaum/zoraPD | com.bdaum.zoom.recipes.acr/src/com/bdaum/zoom/recipes/acr/internal/AcrDetector.java | 34216 | /*******************************************************************************
* Copyright (c) 2009-2010 Berthold Daum.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Berthold Daum - initial API and implementation
*******************************************************************************/
package com.bdaum.zoom.recipes.acr.internal;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Map;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.graphics.RGB;
import Jama.Matrix;
import com.adobe.xmp.XMPException;
import com.adobe.xmp.XMPIterator;
import com.adobe.xmp.XMPMeta;
import com.adobe.xmp.XMPMetaFactory;
import com.adobe.xmp.XMPSchemaRegistry;
import com.adobe.xmp.XMPUtils;
import com.adobe.xmp.options.IteratorOptions;
import com.adobe.xmp.properties.XMPProperty;
import com.adobe.xmp.properties.XMPPropertyInfo;
import com.bdaum.zoom.cat.model.meta.WatchedFolder;
import com.bdaum.zoom.core.AbstractRecipeDetector;
import com.bdaum.zoom.core.Core;
import com.bdaum.zoom.core.IRecipeDetector;
import com.bdaum.zoom.core.QueryField;
import com.bdaum.zoom.image.IFocalLengthProvider;
import com.bdaum.zoom.image.ImageUtilities;
import com.bdaum.zoom.image.recipe.ColorShift;
import com.bdaum.zoom.image.recipe.Cropping;
import com.bdaum.zoom.image.recipe.Curve;
import com.bdaum.zoom.image.recipe.GrayConvert;
import com.bdaum.zoom.image.recipe.PerspectiveCorrection;
import com.bdaum.zoom.image.recipe.Recipe;
import com.bdaum.zoom.image.recipe.SplitTone;
import com.bdaum.zoom.image.recipe.UnsharpMask;
import com.bdaum.zoom.image.recipe.Vignette;
import com.bdaum.zoom.program.BatchUtilities;
import com.bdaum.zoom.program.DiskFullException;
public class AcrDetector extends AbstractRecipeDetector {
private static final String XMP = ".xmp"; //$NON-NLS-1$
private static final String DNG = ".dng"; //$NON-NLS-1$
// not handled
// <crs:ColorNoiseReduction>25</crs:ColorNoiseReduction>
// <crs:ShadowTint>0</crs:ShadowTint>
// <crs:RedHue>0</crs:RedHue>
// <crs:RedSaturation>0</crs:RedSaturation>
// <crs:GreenHue>0</crs:GreenHue>
// <crs:GreenSaturation>0</crs:GreenSaturation>
// <crs:BlueHue>0</crs:BlueHue>
// <crs:BlueSaturation>0</crs:BlueSaturation>
// <crs:Defringe>0</crs:Defringe>
// <crs:PaintBasedCorrections>
// <crs:LensManualDistortionAmount>0</crs:LensManualDistortionAmount>
// crs:Whites2012="0"
// crs:Blacks2012="0"
public int isRecipeXMPembbedded(String uri) {
if (isRecipeEmbbedded(uri) >= 0)
return -1;
return getIntegerParameterValue(IRecipeDetector.XMPEMBEDDED);
}
public int isRecipeEmbbedded(String uri) {
if (uri.toLowerCase().endsWith(DNG)) {
try {
File file = new File(new URI(uri));
return file.canWrite() ? 0 : -1;
} catch (URISyntaxException e) {
// do nothing
}
}
return -1;
}
public long getRecipeModificationTimestamp(String uri) {
if (uri.toLowerCase().endsWith(DNG)) {
try {
File file = new File(new URI(uri));
if (file.canWrite())
return file.lastModified();
} catch (URISyntaxException e) {
// do nothing
}
}
try {
File[] sidecars = Core.getSidecarFiles(new URI(uri), false);
return (sidecars.length > 0) ? sidecars[sidecars.length - 1].lastModified() : 0L;
} catch (URISyntaxException e1) {
// should never happen
}
return -1L;
}
public Recipe loadRecipeForImage(String uri, boolean highres, IFocalLengthProvider focalLengthProvider,
Map<String, String> overlayMap) {
String xmpUri = uri;
InputStream xmpIn = null;
if (isRecipeEmbbedded(uri) >= 0) {
try {
xmpIn = ImageUtilities.extractXMP(uri);
} catch (IOException e) {
// ignore
} catch (URISyntaxException e) {
// should never happen
}
} else {
File xmpFile;
try {
File[] sidecars = Core.getSidecarFiles(new URI(uri), true);
if (sidecars.length > 0) {
xmpFile = sidecars[0];
if (xmpFile.exists()) {
xmpUri = xmpFile.toURI().toString();
xmpIn = new FileInputStream(xmpFile);
}
}
} catch (URISyntaxException e1) {
// should never happen
} catch (FileNotFoundException e) {
// no XMP file
}
}
return (xmpIn != null) ? loadRecipeFile(xmpUri, xmpIn, overlayMap) : null;
}
private Recipe loadRecipeFile(String xmpUri, InputStream xmpIn, Map<String, String> overlayMap) {
Recipe recipe = null;
// Values
int orientation = 1;
float colorTemperature = 6500f;
float tint = 1f;
float brightness = 0f;
float contrast = 0f;
float saturation = 1f;
float fillLight = 0f;
float shadow2012 = 0f;
float highlights = 0f;
float whites = 0f;
float blacks = 0f;
boolean convertToGrayScale = false;
float sharpenEdgeMasking = 0f;
float sharpen = 0f;
float sharpenRadius = 0f;
float sharpenDetail = 0f;
float hueAdjustmentMagenta = 0f;
float hueAdjustmentPurple = 0f;
float hueAdjustmentBlue = 0f;
float hueAdjustmentAqua = 0f;
float hueAdjustmentGreen = 0f;
float hueAdjustmentYellow = 0f;
float hueAdjustmentOrange = 0f;
float hueAdjustmentRed = 0f;
float saturationAdjustmentMagenta = 1f;
float saturationAdjustmentPurple = 1f;
float saturationAdjustmentBlue = 1f;
float saturationAdjustmentAqua = 1f;
float saturationAdjustmentGreen = 1f;
float saturationAdjustmentYellow = 1f;
float saturationAdjustmentOrange = 1f;
float saturationAdjustmentRed = 1f;
float luminanceAdjustmentMagenta = 1f;
float luminanceAdjustmentPurple = 1f;
float luminanceAdjustmentBlue = 1f;
float luminanceAdjustmentAqua = 1f;
float luminanceAdjustmentGreen = 1f;
float luminanceAdjustmentYellow = 1f;
float luminanceAdjustmentOrange = 1f;
float luminanceAdjustmentRed = 1f;
float vibrance = 1f;
float grayMixerRed = 1f;
float grayMixerOrange = 1f;
float grayMixerYellow = 1f;
float grayMixerGreen = 1f;
float grayMixerAqua = 1f;
float grayMixerBlue = 1f;
float grayMixerPurple = 1f;
float grayMixerMagenta = 1f;
float parametricHighlights = 0f;
float parametricLights = 0f;
float parametricDarks = 0f;
float parametricShadows = 0f;
float parametricShadowSplit = 0.25f;
float parametricMidtoneSplit = 0.5f;
float parametricHighlightSplit = 0.75f;
float clarity = 0f;
float shadows = 0f;
float cropLeft = 0f;
float cropBottom = 1f;
float cropRight = 1f;
float cropTop = 0f;
float cropAngle = 0f;
boolean cropConstrainToWarp = false;
float vignetteAmount = 0f;
float vignetteMidpoint = 0.5f;
boolean hasCrop = false;
float splitToningShadowHue = 0f;
float splitToningShadowSaturation = 0f;
float splitToningHighlightHue = 0f;
float splitToningHighlightSaturation = 0f;
float splitToningBalance = 0.5f;
Curve pointCurve = null;
String whiteBalanceMethod = null;
float exposure = 0f;
float chromaticAberrationR = 0f;
float chromaticAberrationB = 0f;
float highlightRecovery = 0f;
float luminanceSmoothing = 0f;
float perspectiveVertical = 0f;
float perspectiveHorizontal = 0f;
float perspectiveRotate = 0f;
float perspectiveScale = 1f;
double focalLength = DIA35MM;
try {
XMPSchemaRegistry schemaRegistry = XMPMetaFactory.getSchemaRegistry();
String crs = QueryField.NS_ACR.defaultPrefix;
String crsPrefix = crs + ':';
schemaRegistry.registerNamespace(QueryField.NS_ACR.uri, crs);
schemaRegistry.registerNamespace(QueryField.NS_EXIF.uri, QueryField.NS_EXIF.defaultPrefix);
schemaRegistry.registerNamespace(QueryField.NS_TIFF.uri, QueryField.NS_TIFF.defaultPrefix);
XMPMeta xmpMeta = XMPMetaFactory.parse(xmpIn);
Integer v = xmpMeta.getPropertyInteger(QueryField.NS_TIFF.uri, "Orientation"); //$NON-NLS-1$
if (v != null)
orientation = v;
IteratorOptions options = new IteratorOptions();
options.setJustLeafnodes(true).setJustLeafname(true);
XMPProperty prop = xmpMeta.getProperty(QueryField.NS_EXIF.uri, "FocalLengthIn35mmFilm"); //$NON-NLS-1$
if (prop != null)
focalLength = convertToFloat(prop.getValue().toString());
XMPIterator iterator = xmpMeta.iterator(QueryField.NS_ACR.uri, null, options);
while (iterator.hasNext()) {
XMPPropertyInfo info = (XMPPropertyInfo) iterator.next();
String key = info.getPath();
if (!key.startsWith(crsPrefix))
continue;
if (recipe == null)
recipe = new Recipe(getName(), xmpUri, true);
key = key.substring(crsPrefix.length()).intern();
String value = info.getValue().toString();
try {
if (key == "WhiteBalance") { //$NON-NLS-1$
whiteBalanceMethod = value;
} else if (key == "Temperature") { //$NON-NLS-1$
colorTemperature = convertToFloat(value);
} else if (key == "Tint") { //$NON-NLS-1$
tint = convertToFloat(value);
} else if (key == "Exposure") { //$NON-NLS-1$
exposure = convertToFloat(value);
} else if (key == "Exposure2012") { //$NON-NLS-1$
exposure = convertToFloat(value);
} else if (key == "ChromaticAberrationR") { //$NON-NLS-1$
chromaticAberrationR = convertToFloat(value);
} else if (key == "ChromaticAberrationB") { //$NON-NLS-1$
chromaticAberrationB = convertToFloat(value);
} else if (key == "HighlightRecovery") { //$NON-NLS-1$
highlightRecovery = convertToFloat(value);
} else if (key == "Brightness") { //$NON-NLS-1$
brightness = convertToFloat(value);
} else if (key == "Contrast") { //$NON-NLS-1$
contrast = convertToFloat(value);
} else if (key == "Contrast2012") { //$NON-NLS-1$
contrast = convertToFloat(value) / 2;
} else if (key == "Shadows") { //$NON-NLS-1$
shadows = (convertToFloat(value) - 3f) / 255f;
} else if (key == "Shadows2012") { //$NON-NLS-1$
shadow2012 = convertToFloat(value) / 255f;
} else if (key == "Highlights2012") { //$NON-NLS-1$
highlights = convertToFloat(value) / 255f;
} else if (key == "Whites2012") { //$NON-NLS-1$
whites = convertToFloat(value) / 255f;
} else if (key == "Blacks2012") { //$NON-NLS-1$
blacks = convertToFloat(value) / 255f;
} else if (key == "FillLight") { //$NON-NLS-1$
fillLight = convertToFloat(value);
} else if (key == "Saturation") { //$NON-NLS-1$
saturation = convertToFloat(value);
} else if (key == "ConvertToGrayscale") { //$NON-NLS-1$
convertToGrayScale = Boolean.parseBoolean(value);
} else if (key == "Sharpness") { //$NON-NLS-1$
sharpen = convertToFloat(value);
} else if (key == "SharpenRadius") { //$NON-NLS-1$
sharpenRadius = convertToFloat(value);
} else if (key == "SharpenEdgeMasking") { //$NON-NLS-1$
sharpenEdgeMasking = convertToFloat(value);
} else if (key == "SharpenDetail") { //$NON-NLS-1$
sharpenDetail = convertToFloat(value);
} else if (key == "HueAdjustmentRed") { //$NON-NLS-1$
hueAdjustmentRed = convertToFloat(value);
} else if (key == "HueAdjustmentOrange") { //$NON-NLS-1$
hueAdjustmentOrange = convertToFloat(value);
} else if (key == "HueAdjustmentYellow") { //$NON-NLS-1$
hueAdjustmentYellow = convertToFloat(value);
} else if (key == "HueAdjustmentGreen") { //$NON-NLS-1$
hueAdjustmentGreen = convertToFloat(value);
} else if (key == "HueAdjustmentAqua") { //$NON-NLS-1$
hueAdjustmentAqua = convertToFloat(value);
} else if (key == "HueAdjustmentBlue") { //$NON-NLS-1$
hueAdjustmentBlue = convertToFloat(value);
} else if (key == "HueAdjustmentPurple") { //$NON-NLS-1$
hueAdjustmentPurple = convertToFloat(value);
} else if (key == "HueAdjustmentMagenta") { //$NON-NLS-1$
hueAdjustmentMagenta = convertToFloat(value);
} else if (key == "SaturationAdjustmentRed") { //$NON-NLS-1$
saturationAdjustmentRed = convertToFloat(value);
} else if (key == "SaturationAdjustmentOrange") { //$NON-NLS-1$
saturationAdjustmentOrange = convertToFloat(value);
} else if (key == "SaturationAdjustmentYellow") { //$NON-NLS-1$
saturationAdjustmentYellow = convertToFloat(value);
} else if (key == "SaturationAdjustmentGreen") { //$NON-NLS-1$
saturationAdjustmentGreen = convertToFloat(value);
} else if (key == "SaturationAdjustmentAqua") { //$NON-NLS-1$
saturationAdjustmentAqua = convertToFloat(value);
} else if (key == "SaturationAdjustmentBlue") { //$NON-NLS-1$
saturationAdjustmentBlue = convertToFloat(value);
} else if (key == "SaturationAdjustmentPurple") { //$NON-NLS-1$
saturationAdjustmentPurple = convertToFloat(value);
} else if (key == "SaturationAdjustmentMagenta") { //$NON-NLS-1$
saturationAdjustmentMagenta = convertToFloat(value);
} else if (key == "LuminanceAdjustmentRed") { //$NON-NLS-1$
luminanceAdjustmentRed = convertToFloat(value);
} else if (key == "LuminanceAdjustmentOrange") { //$NON-NLS-1$
luminanceAdjustmentOrange = convertToFloat(value);
} else if (key == "LuminanceAdjustmentYellow") { //$NON-NLS-1$
luminanceAdjustmentYellow = convertToFloat(value);
} else if (key == "LuminanceAdjustmentGreen") { //$NON-NLS-1$
luminanceAdjustmentGreen = convertToFloat(value);
} else if (key == "LuminanceAdjustmentAqua") { //$NON-NLS-1$
luminanceAdjustmentAqua = convertToFloat(value);
} else if (key == "LuminanceAdjustmentBlue") { //$NON-NLS-1$
luminanceAdjustmentBlue = convertToFloat(value);
} else if (key == "LuminanceAdjustmentPurple") { //$NON-NLS-1$
luminanceAdjustmentPurple = convertToFloat(value);
} else if (key == "LuminanceAdjustmentMagenta") { //$NON-NLS-1$
luminanceAdjustmentMagenta = convertToFloat(value);
} else if (key == "Vibrance") { //$NON-NLS-1$
vibrance = convertToFloat(value);
} else if (key == "ParametricShadows") { //$NON-NLS-1$
parametricShadows = convertToFloat(value);
} else if (key == "ParametricDarks") { //$NON-NLS-1$
parametricDarks = convertToFloat(value);
} else if (key == "ParametricLights") { //$NON-NLS-1$
parametricLights = convertToFloat(value);
} else if (key == "ParametricHighlights") { //$NON-NLS-1$
parametricHighlights = convertToFloat(value);
} else if (key == "ParametricShadowSplit") { //$NON-NLS-1$
parametricShadowSplit = convertToFloat(value);
} else if (key == "ParametricMidtoneSplit") { //$NON-NLS-1$
parametricMidtoneSplit = convertToFloat(value);
} else if (key == "ParametricHighlightSplit") { //$NON-NLS-1$
parametricHighlightSplit = convertToFloat(value);
} else if (key == "Clarity") { //$NON-NLS-1$
clarity = convertToFloat(value);
} else if (key == "Clarity2012") { //$NON-NLS-1$
clarity = convertToFloat(value) * 5;
} else if (key == "CropLeft") { //$NON-NLS-1$
cropLeft = convertToFloat(value);
} else if (key == "CropBottom") { //$NON-NLS-1$
cropBottom = convertToFloat(value);
} else if (key == "CropRight") { //$NON-NLS-1$
cropRight = convertToFloat(value);
} else if (key == "CropTop") { //$NON-NLS-1$
cropTop = convertToFloat(value);
} else if (key == "CropAngle") { //$NON-NLS-1$
cropAngle = convertToFloat(value);
} else if (key == "HasCrop") { //$NON-NLS-1$
hasCrop = Boolean.parseBoolean(value);
} else if (key == "CropConstrainToWarp") { //$NON-NLS-1$
cropConstrainToWarp = Boolean.parseBoolean(value);
} else if (key == "VignetteAmount") { //$NON-NLS-1$
vignetteAmount = convertToFloat(value);
} else if (key == "VignetteMidpoint") { //$NON-NLS-1$
vignetteMidpoint = convertToFloat(value);
} else if (key == "GrayMixerRed") { //$NON-NLS-1$
grayMixerRed = convertToFloat(value);
} else if (key == "GrayMixerOrange") { //$NON-NLS-1$
grayMixerOrange = convertToFloat(value);
} else if (key == "GrayMixerYellow") { //$NON-NLS-1$
grayMixerYellow = convertToFloat(value);
} else if (key == "GrayMixerGreen") { //$NON-NLS-1$
grayMixerGreen = convertToFloat(value);
} else if (key == "GrayMixerAqua") { //$NON-NLS-1$
grayMixerAqua = convertToFloat(value);
} else if (key == "GrayMixerBlue") { //$NON-NLS-1$
grayMixerBlue = convertToFloat(value);
} else if (key == "GrayMixerPurple") { //$NON-NLS-1$
grayMixerPurple = convertToFloat(value);
} else if (key == "GrayMixerMagenta") { //$NON-NLS-1$
grayMixerMagenta = convertToFloat(value);
} else if (key == "SplitToningShadowHue") { //$NON-NLS-1$
splitToningShadowHue = convertToFloat(value);
} else if (key == "SplitToningShadowSaturation") { //$NON-NLS-1$
splitToningShadowSaturation = convertToFloat(value);
} else if (key == "SplitToningHighlightHue") { //$NON-NLS-1$
splitToningHighlightHue = convertToFloat(value);
} else if (key == "SplitToningHighlightSaturation") { //$NON-NLS-1$
splitToningHighlightSaturation = convertToFloat(value);
} else if (key == "SplitToningBalance") { //$NON-NLS-1$
splitToningBalance = convertToFloat(value);
} else if (key == "LuminanceSmoothing") { //$NON-NLS-1$
luminanceSmoothing = convertToFloat(value);
} else if (key == "PerspectiveVertical") { //$NON-NLS-1$
perspectiveVertical = convertToFloat(value);
} else if (key == "PerspectiveHorizontal") { //$NON-NLS-1$
perspectiveHorizontal = convertToFloat(value);
} else if (key == "PerspectiveRotate") { //$NON-NLS-1$
perspectiveRotate = convertToFloat(value);
} else if (key == "PerspectiveScale") { //$NON-NLS-1$
perspectiveScale = convertToFloat(value) / 100f;
}
} catch (XMPException e) {
AcrActivator.getDefault().logError(NLS.bind(Messages.AcrDetector_cannot_decode, key, value), e);
}
}
// Point curve
iterator = xmpMeta.iterator(QueryField.NS_ACR.uri, "crs:ToneCurve", options); //$NON-NLS-1$
if (iterator.hasNext()) {
if (recipe == null)
recipe = new Recipe(getName(), xmpUri, true);
pointCurve = new Curve(Curve.TYPE_CATMULL_ROM, "PointCurve", Curve.CHANNEL_ALL, 0f); //$NON-NLS-1$
while (iterator.hasNext()) {
XMPPropertyInfo info = (XMPPropertyInfo) iterator.next();
String s = info.getValue().toString();
int q = s.indexOf(',');
if (q > 0) {
try {
pointCurve.addKnot(convertToFloat(s.substring(0, q)) / 255f,
convertToFloat(s.substring(q + 1).trim()) / 255f);
} catch (XMPException e) {
AcrActivator.getDefault()
.logError(NLS.bind(Messages.AcrDetector_cannot_decode, "crs:ToneCurve", //$NON-NLS-1$
s), e);
}
}
}
}
} catch (XMPException e) {
AcrActivator.getDefault().logError(NLS.bind(Messages.AcrDetector_cannot_read_xmp_file, xmpUri), e);
} finally {
try {
xmpIn.close();
} catch (IOException e) {
// ignore
}
}
if (recipe != null) {
double horizontalTilt, verticalTilt;
float leftCrop, rightCrop, topCrop, bottomCrop;
switch (orientation) {
case 2:
// 2 = The 0th row represents the visual top of the image, and
// the 0th column represents the visual right-hand side.
horizontalTilt = -perspectiveHorizontal;
verticalTilt = perspectiveVertical;
leftCrop = 1f - cropRight;
rightCrop = 1f - cropLeft;
topCrop = cropTop;
bottomCrop = cropBottom;
break;
case 3:
// 3 = The 0th row represents the visual bottom of the image,
// and the 0th column represents the visual right-hand side.
horizontalTilt = -perspectiveHorizontal;
verticalTilt = -perspectiveVertical;
leftCrop = 1f - cropRight;
rightCrop = 1f - cropLeft;
topCrop = 1f - cropBottom;
bottomCrop = 1f - cropTop;
break;
case 4:
// 4 = The 0th row represents the visual bottom of the image,
// and the 0th column represents the visual left-hand side.
horizontalTilt = perspectiveHorizontal;
verticalTilt = -perspectiveVertical;
leftCrop = cropLeft;
rightCrop = cropRight;
topCrop = 1f - cropBottom;
bottomCrop = 1f - cropTop;
break;
case 5:
// 5 = The 0th row represents the visual left-hand side of the
// image, and the 0th column represents the visual top.
horizontalTilt = perspectiveVertical;
verticalTilt = perspectiveHorizontal;
leftCrop = cropTop;
rightCrop = cropBottom;
topCrop = cropLeft;
bottomCrop = cropRight;
break;
case 6:
// 6 = The 0th row represents the visual right-hand side of the
// image, and the 0th column represents the visual top.
horizontalTilt = -perspectiveVertical;
verticalTilt = perspectiveHorizontal;
leftCrop = 1f - cropBottom;
rightCrop = 1f - cropTop;
topCrop = cropLeft;
bottomCrop = cropRight;
break;
case 7:
// 7 = The 0th row represents the visual right-hand side of the
// image, and the 0th column represents the visual bottom.
horizontalTilt = -perspectiveVertical;
verticalTilt = -perspectiveHorizontal;
leftCrop = 1f - cropBottom;
rightCrop = 1f - cropTop;
topCrop = 1f - cropRight;
bottomCrop = 1f - cropLeft;
break;
case 8:
// 8 = The 0th row represents the visual left-hand side of the
// image, and the 0th column represents the visual bottom.
horizontalTilt = perspectiveVertical;
verticalTilt = -perspectiveHorizontal;
leftCrop = cropTop;
rightCrop = cropBottom;
topCrop = 1f - cropRight;
bottomCrop = 1f - cropLeft;
break;
default:
// 1 = The 0th row represents the visual top of the image, and
// the 0th column represents the visual left-hand side.
horizontalTilt = perspectiveHorizontal;
verticalTilt = perspectiveVertical;
leftCrop = cropLeft;
rightCrop = cropRight;
topCrop = cropTop;
bottomCrop = cropBottom;
break;
}
// White balance
if ("As Shot".equals(whiteBalanceMethod)) //$NON-NLS-1$
recipe.whiteBalanceMethod = Recipe.wbASSHOT;
else if ("Auto".equals(whiteBalanceMethod)) //$NON-NLS-1$
recipe.whiteBalanceMethod = Recipe.wbAUTO;
else
recipe.whiteBalanceMethod = Recipe.wbNONE;
if (recipe.whiteBalanceMethod == Recipe.wbNONE && (colorTemperature != 6500f || tint != 0f))
recipe.setColorTemperature(colorTemperature, tint / 255f + 1f);
// Exposure
recipe.exposure = (float) Math.pow(2d, exposure);
if (exposure < 0)
recipe.highlightRecovery = 2;
// Hightlightrecovery
int h = (int) (highlightRecovery / 100 * 7);
recipe.highlightRecovery = h == 0 ? 0 : 2 + h;
// Chromatic abberation
recipe.chromaticAberrationR = 1f + chromaticAberrationR / 50000f;
recipe.chromaticAberrationB = 1f + chromaticAberrationB / 50000f;
// Cropping
if (hasCrop)
recipe.setCropping(new Cropping(topCrop, bottomCrop, leftCrop, rightCrop, cropAngle,
cropConstrainToWarp ? Cropping.FILL : Cropping.NOFILL, new RGB(128, 128, 128)));
if (vignetteAmount != 0f)
recipe.setVignette(new Vignette(vignetteAmount / 100f, vignetteMidpoint / 100f, Vignette.HSL));
// Brightness and contrast
if (brightness != 0d || contrast != 0d || shadows != 0f || fillLight != 0f || shadow2012 != 0f
|| highlights != 0f || blacks != 0 || whites != 0) {
float b = brightness / 255f + 1f;
float c = contrast / 255f + 1f;
float f = fillLight / 255f;
Curve brightnessCurve = new Curve(Curve.TYPE_B_SPLINE, "BrightnessContrast", Curve.CHANNEL_ALL, 1f); //$NON-NLS-1$
// Equation: y = (brightness*x-0.5) * contrast + 0.5
float xHigh = (c + 1f) / (2f * c * b);
float yHigh;
float xShadow = (c - 1f) / (2f * c * b);
float yShadow;
xShadow += shadows + blacks;
xHigh += whites;
if (xShadow <= 0f) {
float diff = Math.min(-blacks, -xShadow);
yShadow = (1f - c) / 2f + f;
if (diff > 0) {
brightnessCurve.addKnot(0f, 0f);
xShadow = diff;
} else
xShadow = 0;
} else {
brightnessCurve.addKnot(0f, f);
yShadow = f + (1 - xShadow);
}
brightnessCurve.addKnot(xShadow, yShadow);
if (xHigh >= 1f) {
float diff = Math.min(whites, xHigh - 1f);
yHigh = ((2f * b - 1f) * c + 1f) / 2f + f + diff;
xHigh = 1f;
} else {
yHigh = 1f;
}
if (shadow2012 != 0f) {
float xs = xShadow + (xHigh - xShadow) / 4;
float ys = yShadow + (yHigh - yShadow) / 4 + shadow2012;
brightnessCurve.addKnot(xs, ys);
}
if (shadow2012 != 0f || highlights != 0f) {
float xMed = xShadow + (xHigh - xShadow) / 2;
float yMed = yShadow + (yHigh - yShadow) / 2;
brightnessCurve.addKnot(xMed, yMed);
}
if (highlights != 0f) {
float xs = xShadow + (xHigh - xShadow) / 4 * 3;
float ys = yShadow + (yHigh - yShadow) / 4 * 3 + highlights;
brightnessCurve.addKnot(xs, ys);
}
if (shadow2012 < 0 || blacks < 0 || highlights < 0 || whites < 0)
brightnessCurve.setPreserveShadow(0f);
brightnessCurve.addKnot(xHigh, yHigh);
if (xHigh < 1f)
brightnessCurve.addKnot(1f, 1f);
recipe.addCurve(brightnessCurve);
}
// Parametric curve
if (parametricHighlights != 0f || parametricLights != 0f || parametricDarks != 0f || parametricShadows != 0f
|| parametricShadowSplit != 25f || parametricMidtoneSplit != 50f
|| parametricHighlightSplit != 75f) {
Curve parmCurve = new Curve(Curve.TYPE_B_SPLINE, "ParametricCurve", Curve.CHANNEL_ALL, 0f); //$NON-NLS-1$
parmCurve.addKnot(0f, 0f);
float px1 = parametricShadowSplit / 100f * 0.5f;
float py1 = px1 + parametricShadows / 100f + parametricShadowSplit / 100f;
parmCurve.addKnot(px1, py1);
float px2 = parametricShadowSplit / 100f;
float py2 = px2 + parametricDarks / 100f * parametricMidtoneSplit / 100f;
parmCurve.addKnot(px2, py2);
float px3 = parametricHighlightSplit / 100f;
float py3 = px3 + parametricLights / 100f * (1f - parametricMidtoneSplit / 100f);
parmCurve.addKnot(px3, py3);
float px4 = (parametricHighlightSplit / 100f + 1f) * 0.5f;
float py4 = px4 + parametricHighlights / 100f * (1f - parametricHighlightSplit / 100f);
parmCurve.addKnot(px4, py4);
parmCurve.addKnot(1f, 1f);
recipe.addCurve(parmCurve);
}
// Color
if (convertToGrayScale)
recipe.setGrayConvert(new GrayConvert(grayMixerRed / 100f + 1f, grayMixerOrange / 100f + 1f,
grayMixerYellow / 100f + 1f, grayMixerGreen / 100f + 1f, grayMixerAqua / 100f + 1f,
grayMixerBlue / 100f + 1f, grayMixerPurple / 100f + 1f, grayMixerMagenta / 100f + 1f));
else {
ColorShift shift = new ColorShift(0f, Float.NaN, saturation / 100f + 1f, ColorShift.SAT_MULT, 1f,
vibrance / 100f + 1f);
shift.addSector(0.98f, 0.0666f, 0.0666f, hueAdjustmentRed / 100f, saturationAdjustmentRed / 100f + 1f,
luminanceAdjustmentRed / 255f + 1f, ColorShift.SAT_MULT);
shift.addSector(0.082f, 0.045f, 0.045f, hueAdjustmentOrange / 100f,
saturationAdjustmentOrange / 100f + 1f, luminanceAdjustmentOrange / 255f + 1f,
ColorShift.SAT_MULT);
shift.addSector(0.22f, 0.0666f, 0.0666f, hueAdjustmentYellow / 100f,
saturationAdjustmentYellow / 100f + 1f, luminanceAdjustmentYellow / 255f + 1f,
ColorShift.SAT_MULT);
shift.addSector(0.333f, 0.086f, 0.086f, hueAdjustmentGreen / 100f,
saturationAdjustmentGreen / 100f + 1f, luminanceAdjustmentGreen / 255f + 1f,
ColorShift.SAT_MULT);
shift.addSector(0.5f, 0.086f, 0.086f, hueAdjustmentAqua / 100f, saturationAdjustmentAqua / 100f + 1f,
luminanceAdjustmentAqua / 255f + 1f, ColorShift.SAT_MULT);
shift.addSector(0.647f, 0.0666f, 0.0666f, hueAdjustmentBlue / 100f,
saturationAdjustmentBlue / 100f + 1f, luminanceAdjustmentBlue / 255f + 1f, ColorShift.SAT_MULT);
shift.addSector(0.749f, 0.045f, 0.045f, hueAdjustmentPurple / 100f,
saturationAdjustmentPurple / 100f + 1f, luminanceAdjustmentPurple / 255f + 1f,
ColorShift.SAT_MULT);
shift.addSector(0.855f, 0.0666f, 0.0666f, hueAdjustmentMagenta / 100f,
saturationAdjustmentMagenta / 100f + 1f, luminanceAdjustmentMagenta / 255f + 1f,
ColorShift.SAT_MULT);
recipe.setHSL(shift);
}
// Point curve
recipe.addCurve(pointCurve);
// Split toning
Curve splitMask = new Curve(Curve.TYPE_B_SPLINE, "splitMask", Curve.CHANNEL_ALL, 1f); //$NON-NLS-1$
splitMask.addKnot(0, 0);
splitMask.addKnot(0.5f - splitToningBalance / 200f, 0.5f);
splitMask.addKnot(1f, 1f);
recipe.setSplitToning(new SplitTone(splitToningShadowHue / 360f, splitToningShadowSaturation / 255,
splitToningHighlightHue / 360f, splitToningHighlightSaturation / 255, splitMask));
// Sharpening
if (sharpen > 0d && sharpenRadius > 0f)
recipe.addUnsharpFilter(new UnsharpMask(sharpen / 150f, sharpenRadius, sharpenEdgeMasking / 255f,
sharpenDetail / 100f, null, UnsharpMask.SHARPEN));
// Local contrast
if (clarity != 0f) {
Curve toneMask = new Curve(Curve.TYPE_LINEAR, "toneMask", Curve.CHANNEL_ALL, 1f); //$NON-NLS-1$
toneMask.addKnot(0, 0);
toneMask.addKnot(1 / 3f, 1f);
toneMask.addKnot(2 / 3f, 1f);
toneMask.addKnot(1f, 0f);
recipe.addUnsharpFilter(new UnsharpMask(clarity / 30f, Math.abs(clarity / 150f) + 30, -05f, 0f,
toneMask, UnsharpMask.LOCAL_CONTRAST));
}
// Noise reduction
recipe.noiseReduction = 100 + 9 * (int) luminanceSmoothing;
// Perspective
if (horizontalTilt != 0f || verticalTilt != 0f || perspectiveScale != 1f || perspectiveRotate != 0f) {
double flen = focalLength / DIA35MM;
Matrix trans = new Matrix(new double[][] { { 1d, 0d, 0d, 0d }, { 0d, 1d, 0d, 0d },
{ 0d, 0d, 1d, -flen }, { 0d, 0d, 0d, 1d } });
double theta = verticalTilt / 200d;
Matrix xrot = new Matrix(
new double[][] { { 1d, 0d, 0d, 0d }, { 0d, Math.cos(theta), -Math.sin(theta), 0d },
{ 0d, Math.sin(theta), Math.cos(theta), 0d }, { 0d, 0d, 0d, 1d } });
theta = -horizontalTilt / 200d;
Matrix yrot = new Matrix(new double[][] { { Math.cos(theta), 0d, Math.sin(theta), 0d },
{ 0d, 1d, 0d, 0d }, { -Math.sin(theta), 0d, Math.cos(theta), 0d }, { 0d, 0d, 0d, 1d } });
theta = -Math.toRadians(perspectiveRotate);
Matrix zrot = new Matrix(new double[][] { { Math.cos(theta), -Math.sin(theta), 0d, 0d },
{ Math.sin(theta), Math.cos(theta), 0d, 0d }, { 0d, 0d, 1d, 0d }, { 0d, 0d, 0d, 1d } });
double f = 1d / perspectiveScale;
Matrix persp = new Matrix(new double[][] { { flen, 0d, 0d, 0d }, { 0d, flen, 0d, 0d },
{ 0d, 0d, flen, 0d }, { 0d, 0d, 1d, 0d } });
Matrix pm = new Matrix(new double[][] { { f, 0d, 0d, 0d }, { 0d, f, 0d, 0d }, { 0d, 0d, 1d, 0d },
{ 0d, 0d, 0d, 1d } });
pm = pm.times(persp);
pm = pm.times(trans.inverse());
pm = pm.times(zrot);
pm = pm.times(yrot);
pm = pm.times(xrot);
pm = pm.times(trans);
recipe.setPerspectiveCorrection(new PerspectiveCorrection(pm, flen, new RGB(128, 128, 128)));
}
}
return recipe;
}
private static float convertToFloat(String value) throws XMPException {
return (float) XMPUtils.convertToDouble(value.startsWith("+") ? value.substring(1) : value); //$NON-NLS-1$
}
public List<RecipeFolder> computeWatchedMetaFilesOrFolders(WatchedFolder[] watchedFolders,
Map<File, List<IRecipeDetector>> detectorMap, Map<File, List<IRecipeDetector>> recursiveDetectorMap,
boolean update, boolean remove) {
return null;
}
public File getChangedImageFile(File metaFile) {
return null;
}
public File getChangedImageFile(File metaFile, WatchedFolder[] watchedFolders) {
return null;
}
public boolean usesIncrementalUpdate() {
return false;
}
public File[] getMetafiles(String uri) {
if (isRecipeEmbbedded(uri) < 0) {
try {
File[] sidecars = Core.getSidecarFiles(new URI(uri), true);
if (sidecars.length > 0) {
File xmpFile = sidecars[0];
if (xmpFile.exists())
return new File[] { xmpFile };
}
} catch (URISyntaxException e1) {
// should never happen
}
}
return null;
}
public void archiveRecipes(File targetFolder, String uri, String newUri, boolean readOnly)
throws IOException, DiskFullException {
File[] metafiles = getMetafiles(uri);
if (metafiles != null) {
for (File file : metafiles) {
File targetFile = new File(targetFolder, Core.getFileName(newUri, false) + XMP);
BatchUtilities.copyFile(file, targetFile, null);
if (readOnly)
targetFile.setReadOnly();
}
}
}
public Recipe loadRecipe(String uri, boolean highres, IFocalLengthProvider focalLengthProvider,
Map<String, String> overlayMap) {
uri = uri.toLowerCase();
try {
if (uri.endsWith(XMP))
return loadRecipeFile(uri, new FileInputStream(new File(new URI(uri))), overlayMap);
if (uri.endsWith(DNG)) {
InputStream xmpIn = ImageUtilities.extractXMP(uri);
if (xmpIn != null)
return loadRecipeFile(uri, xmpIn, overlayMap);
}
} catch (URISyntaxException e) {
AcrActivator.getDefault().logError(NLS.bind(Messages.AcrDetector_bad_uri, uri), e);
} catch (IOException e) {
AcrActivator.getDefault().logError(NLS.bind(Messages.AcrDetector_io_exception, uri), e);
}
return null;
}
}
| gpl-2.0 |
hchapman/libpulse-android | src/main/java/com/harrcharr/pulse/SourceOutputInfoCallback.java | 257 | package com.harrcharr.pulse;
public abstract class SourceOutputInfoCallback extends InfoCallback<SourceOutput> {
@Override
public final void run(long ptr) {
run(new SourceOutput(mPulse, ptr));
}
public abstract void run(final SourceOutput node);
}
| gpl-2.0 |
aosm/gcc_40 | libjava/java/awt/Robot.java | 3692 | /* Robot.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt;
import java.awt.image.BufferedImage;
/**
* @since 1.3
*/
/** STUB CLASS ONLY */
public class Robot
{
private GraphicsDevice screen;
private boolean waitForIdle;
private int autoDelay;
/**
* Creates a <code>Robot</code> object.
*
* @exception AWTException If GraphicsEnvironment.isHeadless() returns true.
* @exception SecurityException If createRobot permission is not granted.
*/
public Robot() throws AWTException
{
throw new Error("not implemented");
}
/**
* Creates a <code>Robot</code> object.
*
* @exception AWTException If GraphicsEnvironment.isHeadless() returns true.
* @exception IllegalArgumentException If <code>screen</code> is not a screen
* GraphicsDevice.
* @exception SecurityException If createRobot permission is not granted.
*/
public Robot(GraphicsDevice screen) throws AWTException
{
this();
this.screen = screen;
}
public void mouseMove(int x, int y)
{
}
public void mousePress(int buttons)
{
}
public void mouseRelease(int buttons)
{
}
public void mouseWheel(int wheelAmt)
{
}
public void keyPress(int keycode)
{
}
public void keyRelease(int keycode)
{
}
public Color getPixelColor(int x, int y)
{
return null;
}
public BufferedImage createScreenCapture(Rectangle screen)
{
return null;
}
public boolean isAutoWaitForIdle()
{
return waitForIdle;
}
public void setAutoWaitForIdle(boolean value)
{
waitForIdle = value;
}
public int getAutoDelay()
{
return autoDelay;
}
public void setAutoDelay(int ms)
{
if (ms < 0 || ms > 60000)
throw new IllegalArgumentException();
autoDelay = ms;
}
public void delay(int ms)
{
if (ms < 0 || ms > 60000)
throw new IllegalArgumentException();
}
public void waitForIdle()
{
}
public String toString()
{
return "unimplemented";
}
} // class Robot
| gpl-2.0 |
christianchristensen/resin | modules/quercus/src/com/caucho/quercus/QuercusRuntimeException.java | 1458 | /*
* Copyright (c) 1998-2010 Caucho Technology -- all rights reserved
*
* This file is part of Resin(R) Open Source
*
* Each copy or derived work must preserve the copyright notice and this
* notice unmodified.
*
* Resin Open Source is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Resin Open Source is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
* of NON-INFRINGEMENT. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with Resin Open Source; if not, write to the
*
* Free Software Foundation, Inc.
* 59 Temple Place, Suite 330
* Boston, MA 02111-1307 USA
*
* @author Scott Ferguson
*/
package com.caucho.quercus;
/**
* Parent of PHP runtime exceptions
*/
public class QuercusRuntimeException extends QuercusException {
public QuercusRuntimeException()
{
}
public QuercusRuntimeException(String msg)
{
super(msg);
}
public QuercusRuntimeException(Throwable cause)
{
super(cause);
}
public QuercusRuntimeException(String msg, Throwable cause)
{
super(msg, cause);
}
}
| gpl-2.0 |
RockyNiu/LeetCode | src/com/rockyniu/leetcode/CopyListwithRandomPointer.java | 3528 | package com.rockyniu.leetcode;
import java.util.ArrayList;
import java.util.Random;
public class CopyListwithRandomPointer {
/**
* A linked list is given such that each node contains an additional random
* pointer which could point to any node in the list or null.
*
* Return a deep copy of the list.
*/
public static void main(String[] args) {
int[] A = {5, 6, 8, 10, 12, 15, 16, 9}; // must be not empty
Random random = new Random();
ArrayList<RandomListNode> list = new ArrayList<RandomListNode>();
list.add(null);
for (int i = 0; i < A.length; i++) {
RandomListNode r = new RandomListNode(A[i]);
list.add(r);
list.get(i+1).next = list.get(i);
list.get(i+1).random = null;
}
for (int i = 0; i < list.size(); i++) {
RandomListNode pre = list.get(i);
if (pre!=null){
int k = random.nextInt(list.size()-1);
RandomListNode rnd = list.get(k);
findRandom: while (rnd != null){
if (rnd.random == null){
break findRandom;
}
else {
RandomListNode temp = rnd;
while ((temp != null) && (!temp.equals(pre)) && (!temp.equals(rnd))){
temp = temp.random;
}
if (temp == null){
break findRandom;
}
else{
k = random.nextInt(list.size()-1);
rnd = list.get(k);
}
}
}
pre.random = rnd;
}
}
for (int i = 1; i < list.size(); i++) {
System.out.print(list.get(i).label + "'s next: " + list.get(i).labelOfNext());
System.out.println();
}
for (int i = 1; i < list.size(); i++) {
System.out.print(list.get(i).label + "'s random: "+ list.get(i).labelOfRandom());
System.out.println();
}
Solution138 solution = new Solution138();
RandomListNode result = solution.copyRandomList(list.get(list.size()-1));
System.out.println("*******result**********\nhead:"+result.label);
RandomListNode node = result;
while (node != null){
System.out.println("label:"+node.label
+" next:"+node.labelOfNext()+" random:"+node.labelOfRandom());
node = node.next;
}
}
}
/**
* Definition for singly-linked list with a random pointer.
* class RandomListNode {
* int label;
* RandomListNode next, random;
* RandomListNode(int x) { this.label = x; }
* };
*/
class Solution138{
public RandomListNode copyRandomList(RandomListNode head) {
if (head == null)
return null;
RandomListNode header = new RandomListNode(0);
header.next = head;
RandomListNode index = head;
while (index != null) {
RandomListNode node = new RandomListNode(index.label);
node.next = index.next;
node.random = index.random;
index.next = node;
index = node.next;
}
index = head;
while (index!=null){
index = index.next;
if( index.random != null){
index.random = index.random.next;
}
index = index.next;
}
RandomListNode pre = header;
index = head;
while (index != null){
pre.next = index.next;
index.next = index.next.next;
pre = pre.next;
index = index.next;
}
return header.next;
}
}
class RandomListNode {
public int label;
public RandomListNode next, random;
RandomListNode(int x) {
this.label = x;
}
String labelOfNext(){
if (this.next == null){
return "null";
}
else{
return Integer.toString(this.next.label);
}
}
String labelOfRandom(){
if (this.random == null){
return "null";
}
else{
return Integer.toString(this.random.label);
}
}
} | gpl-2.0 |
AIKO-Aaron/AikoCore | src/ch/aiko/engine/AikoCore.java | 365 | package ch.aiko.engine;
public class AikoCore {
public static final int MAJOR = 0;
public static final int MINOR = 1;
public static final int PATCH = 1;
public static final char TREE = 'B';
public static final String getVersion() {
return "AikoCore version: " + MAJOR + "." + MINOR + "." + PATCH + TREE;
}
public static final boolean DEBUG = false;
}
| gpl-2.0 |
glaudiston/project-bianca | arduino/code/myrobotlab-1.0.119/src/org/myrobotlab/service/Arduino.java | 48459 | package org.myrobotlab.service;
import static org.myrobotlab.codec.ArduinoMsgCodec.ANALOG_READ_POLLING_START;
import static org.myrobotlab.codec.ArduinoMsgCodec.ANALOG_READ_POLLING_STOP;
import static org.myrobotlab.codec.ArduinoMsgCodec.ANALOG_WRITE;
import static org.myrobotlab.codec.ArduinoMsgCodec.DIGITAL_READ_POLLING_START;
import static org.myrobotlab.codec.ArduinoMsgCodec.DIGITAL_READ_POLLING_STOP;
import static org.myrobotlab.codec.ArduinoMsgCodec.DIGITAL_WRITE;
import static org.myrobotlab.codec.ArduinoMsgCodec.GET_VERSION;
import static org.myrobotlab.codec.ArduinoMsgCodec.MAGIC_NUMBER;
import static org.myrobotlab.codec.ArduinoMsgCodec.MAX_MSG_SIZE;
import static org.myrobotlab.codec.ArduinoMsgCodec.MRLCOMM_VERSION;
import static org.myrobotlab.codec.ArduinoMsgCodec.PIN_MODE;
import static org.myrobotlab.codec.ArduinoMsgCodec.PUBLISH_CUSTOM_MSG;
import static org.myrobotlab.codec.ArduinoMsgCodec.PUBLISH_LOAD_TIMING_EVENT;
import static org.myrobotlab.codec.ArduinoMsgCodec.PUBLISH_MRLCOMM_ERROR;
import static org.myrobotlab.codec.ArduinoMsgCodec.PUBLISH_PIN;
import static org.myrobotlab.codec.ArduinoMsgCodec.PUBLISH_PULSE;
import static org.myrobotlab.codec.ArduinoMsgCodec.PUBLISH_SERVO_EVENT;
import static org.myrobotlab.codec.ArduinoMsgCodec.PUBLISH_STEPPER_EVENT;
import static org.myrobotlab.codec.ArduinoMsgCodec.PUBLISH_VERSION;
import static org.myrobotlab.codec.ArduinoMsgCodec.PULSE_IN;
import static org.myrobotlab.codec.ArduinoMsgCodec.SENSOR_ATTACH;
import static org.myrobotlab.codec.ArduinoMsgCodec.SENSOR_POLLING_START;
import static org.myrobotlab.codec.ArduinoMsgCodec.SENSOR_POLLING_STOP;
import static org.myrobotlab.codec.ArduinoMsgCodec.SERVO_ATTACH;
import static org.myrobotlab.codec.ArduinoMsgCodec.SERVO_DETACH;
import static org.myrobotlab.codec.ArduinoMsgCodec.SERVO_SWEEP_START;
import static org.myrobotlab.codec.ArduinoMsgCodec.SERVO_SWEEP_STOP;
import static org.myrobotlab.codec.ArduinoMsgCodec.SERVO_WRITE;
import static org.myrobotlab.codec.ArduinoMsgCodec.SERVO_WRITE_MICROSECONDS;
import static org.myrobotlab.codec.ArduinoMsgCodec.SET_DEBOUNCE;
import static org.myrobotlab.codec.ArduinoMsgCodec.SET_DIGITAL_TRIGGER_ONLY;
import static org.myrobotlab.codec.ArduinoMsgCodec.SET_LOAD_TIMING_ENABLED;
import static org.myrobotlab.codec.ArduinoMsgCodec.SET_PWMFREQUENCY;
import static org.myrobotlab.codec.ArduinoMsgCodec.SET_SAMPLE_RATE;
import static org.myrobotlab.codec.ArduinoMsgCodec.SET_SERIAL_RATE;
import static org.myrobotlab.codec.ArduinoMsgCodec.SET_SERVO_EVENTS_ENABLED;
import static org.myrobotlab.codec.ArduinoMsgCodec.SET_SERVO_SPEED;
import static org.myrobotlab.codec.ArduinoMsgCodec.SET_TRIGGER;
import static org.myrobotlab.codec.ArduinoMsgCodec.STEPPER_ATTACH;
import static org.myrobotlab.codec.ArduinoMsgCodec.STEPPER_MOVE_TO;
import static org.myrobotlab.codec.ArduinoMsgCodec.STEPPER_RESET;
import static org.myrobotlab.codec.ArduinoMsgCodec.STEPPER_STOP;
import java.io.IOException;
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import org.myrobotlab.fileLib.FileIO;
import org.myrobotlab.framework.Peers;
import org.myrobotlab.framework.Service;
import org.myrobotlab.framework.Status;
import org.myrobotlab.logging.Level;
import org.myrobotlab.logging.LoggerFactory;
import org.myrobotlab.logging.Logging;
import org.myrobotlab.logging.LoggingFactory;
import org.myrobotlab.service.Stepper.StepperEvent;
import org.myrobotlab.service.data.Pin;
import org.myrobotlab.service.interfaces.CustomMsgListener;
import org.myrobotlab.service.interfaces.MotorControl;
import org.myrobotlab.service.interfaces.MotorController;
import org.myrobotlab.service.interfaces.SensorDataPublisher;
import org.myrobotlab.service.interfaces.SerialDataListener;
import org.myrobotlab.service.interfaces.ServoControl;
import org.myrobotlab.service.interfaces.ServoController;
import org.myrobotlab.service.interfaces.StepperController;
import org.slf4j.Logger;
/**
* Implementation of a Arduino Service connected to MRL through a serial port.
* The protocol is basically a pass through of system calls to the Arduino
* board. Data can be passed back from the digital or analog ports by request to
* start polling. The serial port can be wireless (bluetooth), rf, or wired. The
* communication protocol supported is in MRLComm.ino
*
* Should support nearly all Arduino board types
*
* digitalRead() works on all pins. It will just round the analog value received
* and present it to you. If analogRead(A0) is greater than or equal to 512,
* digitalRead(A0) will be 1, else 0. digitalWrite() works on all pins, with
* allowed parameter 0 or 1. digitalWrite(A0,0) is the same as
* analogWrite(A0,0), and digitalWrite(A0,1) is the same as analogWrite(A0,255)
* analogRead() works only on analog pins. It can take any value between 0 and
* 1023. analogWrite() works on all analog pins and all digital PWM pins. You
* can supply it any value between 0 and 255
*
* TODO - make microcontroller interface - getPins digitalWrite analogWrite
* writeMicroseconds pinMode etc.. TODO - remove all non-microcontroller methods
* TODO - call-back parseData() from serial service --> to MicroController - so
* microcontoller can parse format messages to universal REST format
*
* TODO - set trigger in combination of polling should be a universal
* microcontroller function
*
*
* // need a method to identify type of board //
* http://forum.arduino.cc/index.php?topic=100557.0
*
* public static final int STEPPER_EVENT_STOP = 1; public static final int
* STEPPER_TYPE_POLOLU = 1; public static final int CUSTOM_MSG = 50;
*
* FUTURE UPLOADS
* https://pragprog.com/magazines/2011-04/advanced-arduino-hacking
*
*/
public class Arduino extends Service implements SensorDataPublisher, SerialDataListener, ServoController, MotorController, StepperController {
/**
* MotorData is the combination of a Motor and any controller data needed to
* implement all of MotorController API
*
*/
class MotorData implements Serializable {
private static final long serialVersionUID = 1L;
transient MotorControl motor = null;
String type = null;
int PWMPin = -1;
int dirPin0 = -1;
int dirPin1 = -1;
}
class SensorData implements Serializable {
private static final long serialVersionUID = 1L;
// -- FIXME - make Sensor(controller?) interface - when we get a new
// sensor
public transient UltrasonicSensor sensor = null;
public int sensorIndex = -1;
public long duration; // for ultrasonic
}
// ---------- MRLCOMM FUNCTION INTERFACE BEGIN -----------
/**
* ServoController data needed to run a servo
*
*/
class ServoData implements Serializable {
private static final long serialVersionUID = 1L;
transient ServoControl servo = null;
Integer pin = null;
int servoIndex = -1;
}
public static class Sketch {
public String data;
public String name;
public Sketch(String name, String data) {
this.name = name;
this.data = data;
}
}
public Sketch sketch;
private static final long serialVersionUID = 1L;
public transient final static Logger log = LoggerFactory.getLogger(Arduino.class);
public static final int DIGITAL_VALUE = 1; // normalized with PinData <---
// direction
public static final int ANALOG_VALUE = 3; // normalized with PinData
public static final int SENSOR_DATA = 37;
// SUBTYPES ...
public static final int ARDUINO_TYPE_INT = 16;
// servo event types
public static final int SERVO_EVENT_STOPPED = 1;
public static final int SERVO_EVENT_POSITION_UPDATE = 2;
// error types
public static final int ERROR_SERIAL = 1;
public static final int ERROR_UNKOWN_CMD = 2;
// sensor types
public static final int SENSOR_ULTRASONIC = 1;
public static final int COMMUNICATION_RESET = 252;
public static final int SOFT_RESET = 253;
public static final int NOP = 255;
public static final int TRUE = 1;
public static final int FALSE = 0;
public Integer mrlCommVersion = null;
public transient static final int REVISION = 100;
public transient static final String BOARD_TYPE_UNO = "uno";
public transient static final String BOARD_TYPE_ATMEGA168 = "atmega168";
public transient static final String BOARD_TYPE_ATMEGA328P = "atmega328p";
public transient static final String BOARD_TYPE_ATMEGA2560 = "atmega2560";
public transient static final String BOARD_TYPE_ATMEGA1280 = "atmega1280";
public transient static final String BOARD_TYPE_ATMEGA32U4 = "atmega32u4";
// vendor specific pins start at 50
public static final String VENDOR_DEFINES_BEGIN = "// --VENDOR DEFINE SECTION BEGIN--";
public static final String VENDOR_SETUP_BEGIN = "// --VENDOR SETUP BEGIN--";
public static final String VENDOR_CODE_BEGIN = "// --VENDOR CODE BEGIN--";
/**
* pin description of board
*/
ArrayList<Pin> pinList = null;
// data and mapping for data going from MRL ---to---> Arduino
HashMap<String, Stepper> steppers = new HashMap<String, Stepper>();
// index for data mapping going from Arduino ---to---> MRL
HashMap<Integer, Stepper> stepperIndex = new HashMap<Integer, Stepper>();
// data and mapping for data going from MRL ---to---> Arduino
HashMap<String, SensorData> sensors = new HashMap<String, SensorData>();
// index for data mapping going from Arduino ---to---> MRL
HashMap<Integer, SensorData> sensorsIndex = new HashMap<Integer, SensorData>();
// needed to dynamically adjust PWM rate (D. only?)
public static final int TCCR0B = 0x25; // register for pins 6,7
public static final int TCCR1B = 0x2E; // register for pins 9,10
public static final int TCCR2B = 0xA1; // register for pins 3,11
// FIXME - more depending on board (mega)
// http://playground.arduino.cc/Code/MegaServo
// Servos[NBR_SERVOS] ; // max servos is 48 for mega, 12 for other boards
// int pos
// public static final int MAX_SERVOS = 12;
public static final int MAX_SERVOS = 48;
// imported Arduino constants
public static final int HIGH = 0x1;
public static final int LOW = 0x0;
public static final int INPUT = 0x0;
public static final int OUTPUT = 0x1;
public static final int MOTOR_FORWARD = 1;
public static final int MOTOR_BACKWARD = 0;
String board;
/**
* blocking queues to support blocking methods
*/
// Member field vs local define for single entry ?
transient BlockingQueue<Integer> pulseQueue = new LinkedBlockingQueue<Integer>();
transient BlockingQueue<Integer> versionQueue = new LinkedBlockingQueue<Integer>();
HashMap<String, Motor> motors = new HashMap<String, Motor>();
HashMap<Integer, String> encoderPins = new HashMap<Integer, String>();
transient CustomMsgListener customEventListener = null;
/**
* servos - name index of servo we need 2 indexes for servos because they
* will be referenced by name OR by index
*/
HashMap<String, ServoData> servos = new HashMap<String, ServoData>();
/**
* index reference of servo
*/
HashMap<Integer, ServoData> servoIndex = new HashMap<Integer, ServoData>();
/**
* Serial service - the Arduino's serial connection
*/
transient Serial serial;
int error_arduino_to_mrl_rx_cnt;
int error_mrl_to_arduino_rx_cnt;
int byteCount;
int msgSize;
int[] msg = new int[MAX_MSG_SIZE];
public static Peers getPeers(String name) {
Peers peers = new Peers(name);
peers.put("serial", "Serial", "serial device for this Arduino");
return peers;
}
// ---------------------------- ServoController End -----------------------
// ---------------------- Protocol Methods Begin ------------------
public Arduino(String n) {
super(n);
serial = (Serial) createPeer("serial");
createPinList();
String mrlcomm = FileIO.resourceToString("Arduino/MRLComm2.ino");
setSketch(new Sketch("MRLComm", mrlcomm));
}
public void addCustomMsgListener(CustomMsgListener service) {
customEventListener = service;
}
/**
* start analog polling of selected pin
*
* @param pin
*/
public void analogReadPollingStart(Integer pin) {
sendMsg(PIN_MODE, pin, INPUT);
sendMsg(ANALOG_READ_POLLING_START, pin);
}
/**
* stop the selected pin from polling analog reads
*
* @param pin
*/
public void analogReadPollingStop(Integer pin) {
sendMsg(ANALOG_READ_POLLING_STOP, pin);
}
public void analogWrite(Integer address, Integer value) {
log.info(String.format("analogWrite(%d,%d) to %s", address, value, serial.getName()));
// FIXME
// if (pin.mode == INPUT) {sendMsg(PIN_MODE, OUTPUT)}
sendMsg(ANALOG_WRITE, address, value);
}
/**
* default params to connect to Arduino & MRLComm.ino
*
* @param port
* @return
* @throws IOException
* @throws SerialDeviceException
*/
public boolean connect(String port) {
// FIXME ! <<<-- REMOVE ,this) - patterns should be to add listener on
// startService
// return connect(port, 57600, 8, 1, 0); <- put this back ?
return serial.connect(port); // <<<-- REMOVE ,this) - patterns
// should be to add listener on
// startService
}
// TODO - should be override .. ??
public Serial connectVirtualUART() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, SecurityException,
IllegalArgumentException, InvocationTargetException {
Serial uart = serial.createVirtualUART();
uart.setCodec("arduino");
connect(serial.getName());
return uart;
}
public ArrayList<Pin> createPinList() {
pinList = new ArrayList<Pin>();
int pinType = Pin.DIGITAL_VALUE;
if (board != null && board.toLowerCase().contains("mega")) {
for (int i = 0; i < 70; ++i) {
if (i < 1 || (i > 13 && i < 54)) {
pinType = Pin.DIGITAL_VALUE;
} else if (i > 53) {
pinType = Pin.ANALOG_VALUE;
} else {
pinType = Pin.PWM_VALUE;
}
pinList.add(new Pin(i, pinType, 0, getName()));
}
} else {
for (int i = 0; i < 20; ++i) {
if (i < 14) {
pinType = Pin.DIGITAL_VALUE;
} else {
pinType = Pin.ANALOG_VALUE;
}
if (i == 3 || i == 5 || i == 6 || i == 9 || i == 10 || i == 11) {
pinType = Pin.PWM_VALUE;
}
pinList.add(new Pin(i, pinType, 0, getName()));
}
}
return pinList;
}
/**
* start polling data from the selected pin
*
* @param pin
*/
public void digitalReadPollingStart(Integer pin) {
sendMsg(PIN_MODE, pin, INPUT);
sendMsg(DIGITAL_READ_POLLING_START, pin);
}
/**
* stop polling the selected pin
*
* @param pin
*/
public void digitalReadPollingStop(Integer pin) {
sendMsg(DIGITAL_READ_POLLING_STOP, pin);
}
public void digitalWrite(Integer address, Integer value) {
info("digitalWrite (%d,%d) to %s", address, value, serial.getName());
sendMsg(DIGITAL_WRITE, address, value);
pinList.get(address).value = value;
}
public void disconnect() {
serial.disconnect();
}
public String getBoardType() {
return board;
}
@Override
public String[] getCategories() {
return new String[] { "microcontroller" };
}
@Override
public String getDescription() {
return "This service interfaces with an Arduino micro-controller.";
}
@Override
public ArrayList<Pin> getPinList() {
return pinList;
}
/**
* Use the serial service for serial activities ! No reason to replicate
* methods
*
* @return
*/
public Serial getSerial() {
return serial;
}
public Sketch getSketch() {
return sketch;
}
public Integer refreshVersion(){
mrlCommVersion = null;
return getVersion();
}
/**
* GOOD DESIGN !! - blocking version of getVersion - blocks on
* publishVersion method returns null if 1 second timeout is reached.
*
* This is a good pattern for future blocking methods.
*
* @return
*/
public Integer getVersion() {
log.info("getVersion");
// cached
if (mrlCommVersion != null){
invoke("publishVersion", mrlCommVersion);
return mrlCommVersion;
}
try {
versionQueue.clear();
sendMsg(GET_VERSION);
mrlCommVersion = versionQueue.poll(1000, TimeUnit.MILLISECONDS);
} catch (Exception e) {
Logging.logError(e);
}
if (mrlCommVersion == null) {
error("did not get response from arduino....");
} else if (!mrlCommVersion.equals(MRLCOMM_VERSION)) {
error(String.format("MRLComm.ino responded with version %s expected version is %s", mrlCommVersion, MRLCOMM_VERSION));
} else {
info(String.format("connected %s responded version %s ... goodtimes...", serial.getName(), mrlCommVersion));
}
return mrlCommVersion;
}
public boolean isConnected() {
return serial.isConnected();
}
@Override
public boolean motorAttach(String motorName, Integer pwmPin, Integer dirPin) {
return motorAttach(motorName, Motor.TYPE_PWM_DIR, pwmPin, dirPin, null);
}
@Override
public boolean motorAttach(String motorName, String type, Integer pwmPin, Integer dirPin) {
return motorAttach(motorName, type, pwmPin, dirPin, null);
}
// ----------- motor controller api begin ----------------
// very old problem - how much logic in controller versus motor
// the concept of a 2 pin controller is pretty ubiquitous and probably
// should be in the motor
@Override
public boolean motorAttach(String motorName, String type, Integer pwmPin, Integer dirPin, Integer encoderPin) {
Motor motor = (Motor) Runtime.getService(motorName);
if (!motor.isLocal()) {
error("motor is not in the same MRL instance as the motor controller");
return false;
}
motor.type = type;
motors.put(motor.getName(), motor);
motor.setController(this);
if (encoderPin != null) {
motor.encoderPin = encoderPin;
// sendMsg(PINMODE, md.encoderPin, INPUT);
encoderPins.put(motor.encoderPin, motor.getName());
analogReadPollingStart(motor.encoderPin);
}
if (Motor.TYPE_LPWM_RPWM.equals(motor.type)) {
motor.pwmLeft = pwmPin;
motor.pwmRight = dirPin;
sendMsg(PIN_MODE, motor.pwmLeft, OUTPUT);
sendMsg(PIN_MODE, motor.pwmRight, OUTPUT);
} else {
motor.pwmPin = pwmPin;
motor.dirPin = dirPin;
sendMsg(PIN_MODE, motor.pwmPin, OUTPUT);
sendMsg(PIN_MODE, motor.dirPin, OUTPUT);
}
motor.broadcastState();
return true;
}
@Override
public boolean motorDetach(String motorName) {
boolean ret = motors.containsKey(motorName);
if (ret) {
motors.remove(motorName);
}
return ret;
}
@Override
public void motorMove(String name) {
Motor motor = motors.get(name);
double powerLevel = motor.getPowerLevel();
if (Motor.TYPE_LPWM_RPWM.equals(motor.type)) {
if (powerLevel < 0) {
sendMsg(ANALOG_WRITE, motor.pwmLeft, 0);
sendMsg(ANALOG_WRITE, motor.pwmRight, Math.abs((int) (powerLevel)));
} else {
sendMsg(ANALOG_WRITE, motor.pwmRight, 0);
sendMsg(ANALOG_WRITE, motor.pwmLeft, Math.abs((int) (powerLevel)));
}
} else {
sendMsg(DIGITAL_WRITE, motor.dirPin, (powerLevel < 0) ? MOTOR_BACKWARD : MOTOR_FORWARD);
sendMsg(ANALOG_WRITE, motor.pwmPin, Math.abs((int) (powerLevel)));
}
}
@Override
public void motorMoveTo(String name, double position) {
// TODO Auto-generated method stub
}
/**
* Callback for Serial service - local (not remote) although a
* publish/subscribe could be created - this method is called by a thread
* waiting on the Serial's RX BlockingQueue
*
* Other services may use the same technique or subscribe to a Serial's
* publishByte method
*
* it might be worthwhile to look in optimizing reads into arrays vs single
* byte processing .. but maybe there would be no gain
*
*/
@Override
public Integer onByte(Integer newByte) {
try {
// log.info(String.format("onByte %d", newByte));
/**
* Archtype InputStream read - rxtxLib does not have this
* straightforward design, but the details of how it behaves is is
* handled in the Serial service and we are given a unified
* interface
*
* The "read()" is data taken from a blocking queue in the Serial
* service. If we want to support blocking functions in Arduino then
* we'll "publish" to our local queues
*/
// while (serial.isConnected() && (newByte = serial.read()) > -1) {
++byteCount;
if (byteCount == 1) {
if (newByte != MAGIC_NUMBER) {
byteCount = 0;
msgSize = 0;
warn(String.format("Arduino->MRL error - bad magic number %d - %d rx errors", newByte, ++error_arduino_to_mrl_rx_cnt));
// dump.setLength(0);
}
return newByte;
} else if (byteCount == 2) {
// get the size of message
if (newByte > 64) {
byteCount = 0;
msgSize = 0;
error(String.format("Arduino->MRL error %d rx sz errors", ++error_arduino_to_mrl_rx_cnt));
return newByte;
}
msgSize = (byte) newByte.intValue();
// dump.append(String.format("MSG|SZ %d", msgSize));
} else if (byteCount > 2) {
// remove header - fill msg data - (2) headbytes -1
// (offset)
// dump.append(String.format("|P%d %d", byteCount,
// newByte));
msg[byteCount - 3] = (byte) newByte.intValue();
}
// process valid message
if (byteCount == 2 + msgSize) {
// log.error("A {}", dump.toString());
// dump.setLength(0);
// MSG CONTENTS = FN | D0 | D1 | ...
int function = msg[0];
// log.info(String.format("%d", msg[1]));
switch (function) {
case PUBLISH_MRLCOMM_ERROR: {
++error_mrl_to_arduino_rx_cnt;
error("MRL->Arduino rx %d type %d", error_mrl_to_arduino_rx_cnt, msg[1]);
break;
}
case PUBLISH_VERSION: {
// TODO - get vendor version
// String version = String.format("%d", msg[1]);
versionQueue.add(msg[1] & 0xff);
int v = msg[1] & 0xff;
log.info(String.format("PUBLISH_VERSION %d", msg[1] & 0xff));
invoke("publishVersion", v);
break;
}
// FIXME PUBLISH_PULSE_IN
case PUBLISH_PULSE: {
// extract signed Java long from byte array offset 1
// - length 4 :P
Integer pulse = Serial.bytesToInt(msg, 1, 4);
pulseQueue.add(pulse);
break;
}
case PUBLISH_PIN: {
// Pin p = new Pin(msg[1], msg[0], (((msg[2] & 0xFF)
// << 8) + (msg[3] & 0xFF)), getName());
// FIXME
//Pin pin = pinList.get(msg[1]); BIG BUG - if a reference is sent and
// the same reference whic his trying to be displayed is changed underneath
Pin pin = new Pin(pinList.get(msg[1]));
pin.value = ((msg[2] & 0xFF) << 8) + (msg[3] & 0xFF);
invoke("publishPin", pin);
break;
}
/*
* case PUBLISH_DIGITAL_VALUE: { Pin pin = pinList.get(msg[1]);
* pin.value = msg[2]; invoke("publishPin", pin); break; }
*/
case PUBLISH_LOAD_TIMING_EVENT: {
long microsPerLoop = Serial.bytesToInt(msg, 1, 4);
info("load %d us", microsPerLoop);
// invoke("publishPin", pin);
break;
}
case PUBLISH_SERVO_EVENT: {
int index = msg[1];
int eventType = msg[2];
int currentPos = msg[3];
int targetPos = msg[4];
log.info(String.format(" index %d type %d cur %d target %d", index, eventType, currentPos & 0xff, targetPos & 0xff));
// uber good -
// TODO - deprecate ServoControl interface - not
// needed Servo is abstraction enough
Servo servo = (Servo) servoIndex.get(index).servo;
servo.invoke("publishServoEvent", currentPos & 0xff);
break;
}
/*
* case PUBLISH_SENSOR_DATA: { int index = (int) msg[1];
* SensorData sd = sensorsIndex.get(index); sd.duration =
* Serial.bytesToInt(msg, 2, 4); // HMM WAY TO GO - is NOT to
* invoke its own but // invoke publishSensorData on Sensor //
* since its its own service // invoke("publishSensorData", sd);
* // NICE !! - force sensor to have publishSensorData // or
* publishRange in interface !!! //
* sd.sensor.invoke("publishRange", sd);
* sd.sensor.invoke("publishRange", sd.duration); break; }
*/
case PUBLISH_STEPPER_EVENT: {
int index = msg[1];
int eventType = msg[2];
int currentPos = (msg[3] << 8) + (msg[4] & 0xff);
log.info(String.format(" index %d type %d cur pos %d", index, eventType, currentPos));
// uber good -
// TODO - stepper ServoControl interface - not
// needed Servo is abstraction enough
Stepper stepper = (Stepper) stepperIndex.get(index);
//stepper.invoke("publishStepperEvent", currentPos);
// LOCAL !!! - Remote from Arduino or Stepper ?!?!?
// ?? stepper.publishStepperEvent(currentPos);
// GOOD - model this pattern
// set service data directly
// not having a local call back seems ridiculous ! ie. controller separated from controlled periphery
// should not be supported - after updating data directly invoke the event on the stepper
stepper.setPos(currentPos);
// based on config of stepper - invoke or don't
stepper.invoke("publishStepperEvent", new StepperEvent(eventType, currentPos));
//
break;
}
case PUBLISH_CUSTOM_MSG: {
// msg or data is of size byteCount
int paramCnt = msg[1];
int paramIndex = 2; // current index in buffer
// decode parameters
Object[] params = new Object[paramCnt];
int paramType = 0;
for (int i = 0; i < paramCnt; ++i) {
// get parameter type
// paramType = msg[];
paramType = msg[paramIndex];
Integer x = 0;
// convert
if (paramType == ARDUINO_TYPE_INT) {
// params[i] =
x = ((msg[++paramIndex] & 0xFF) << 8) + (msg[++paramIndex] & 0xFF);
if (x > 32767) {
x = x - 65536;
}
params[i] = x;
log.info(String.format("parameter %d is type ARDUINO_TYPE_INT value %d", i, x));
++paramIndex;
} else {
error("CUSTOM_MSG - unhandled type %d", paramType);
}
}
// how to reflectively invoke multi-param method
// (Python?)
// FIXME - if local call directly? - this is an optimization
if (customEventListener != null) {
//send(customEventListener.getName(), "onCustomMsg", params);
customEventListener.onCustomMsg(params);
}
// FIXME more effecient to only allow subscribers which have used the addCustomMsgListener?
invoke("publishCustomMsg", new Object[]{params});
break;
}
default: {
// FIXME - use formatter for message
error("unknown serial event <- ");
break;
}
} // end switch
if (log.isDebugEnabled()) {
// FIXME - use formatter
log.debug("serialEvent <- ");//
}
// processed msg
// reset msg buffer
msgSize = 0;
byteCount = 0;
}
// } // while (serial.isOpen() && (newByte =
// serial.read()) > -1
} catch (Exception e) {
++error_mrl_to_arduino_rx_cnt;
error("msg structure violation %d", error_mrl_to_arduino_rx_cnt);
// try again ?
msgSize = 0;
byteCount = 0;
Logging.logError(e);
}
return newByte;
}
@Override
public String onConnect(String portName) {
info("%s connected to %s", getName(), portName);
getVersion();
return portName;
}
public String getPortName(){
return serial.getPortName();
}
public void onCustomMsg(Integer ax, Integer ay, Integer az) {
log.info("onCustomMsg");
}
@Override
public String onDisconnect(String portName) {
info("%s disconnected from %s", getName(), portName);
return portName;
}
public void pinMode(int address, String mode) {
if (mode != null && mode.equalsIgnoreCase("INPUT")) {
pinMode(address, INPUT);
} else {
pinMode(address, OUTPUT);
}
}
public void pinMode(Integer address, Integer value) {
log.info(String.format("pinMode(%d,%d) to %s", address, value, serial.getName()));
sendMsg(PIN_MODE, address, value);
}
public Object[] publishCustomMsg(Object[] data) {
return data;
}
// ----------- motor controller api end ----------------
public Long publishLoadTimingEvent(Long us) {
log.info(String.format("publishLoadTimingEvent - %d", us));
return us;
}
public Integer publishMRLCommError(Integer code) {
return code;
}
/**
* This method is called with Pin data whene a pin value is changed on the
* Arduino board the Arduino must be told to poll the desired pin(s). This
* is done with a analogReadPollingStart(pin) or digitalReadPollingStart()
*/
@Override
public Pin publishPin(Pin p) {
// log.debug(p);
pinList.get(p.pin).value = p.value;
return p;
}
/**
* GOOD ! - asynchronous call-back for a pulseIn, it can be subscribed to,
* or with the blocking queue a different thread can use it as a blocking
* call
*
* Easy testing can be accomplished by using the blocking pulseIn which
* utilizes the queue
*
* @param data
* @return
*/
public Integer publishPulse(Integer data) {
pulseQueue.add(data);
return data;
}
// ----------- MotorController API End ----------------
public int publishServoEvent(Integer pos) {
return pos;
}
public SensorData publishSesorData(SensorData data) {
return data;
}
public Pin publishTrigger(Pin pin) {
return pin;
}
// -- StepperController begin ----
public Integer publishVersion(Integer version) {
info("publishVersion %d", version);
return version;
}
// often used as a ping echo pulse - timing is critical
// so it has to be done on the uC .. therefore
// a trigger pin has to be sent as well to the pulseIn
// as well as the pulse/echo pin
public long pulseIn(int trigPin, int echoPin) {
return pulseIn(trigPin, echoPin, HIGH, 1000);
}
/**
* The pulseIn - does not use the Arduino language "pulseIn" because that
* method blocks. We don't want to be blocked inside of MRLComm ! But for
* convenience the elves have created a blocking pulseIn which works with
* the asynchronous event and non-blocking pulseIn in MRLComm
*
* @param trigPin
* @param echoPin
* @param value
* @param timeout
* @return
*/
// FIXME - rather application specific - possible to add variable delays on
// trigger
// and echo
public int pulseIn(int trigPin, int echoPin, int value, int timeout) {
try {
if (serial != null) {
pulseQueue.clear();
sendMsg(PULSE_IN, trigPin, echoPin, value, timeout);
// downstream longer timeout than upstream
Integer pulse = pulseQueue.poll(250 + timeout, TimeUnit.MILLISECONDS);
if (pulse == null) {
return 0;
}
return pulse;
} else {
return 0;
}
} catch (Exception e) {
Logging.logError(e);
return 0;
}
}
public long pulseIn(int trigPin, int echoPin, int timeout, String highLow) {
int value = HIGH;
if (highLow != null && highLow.equalsIgnoreCase("LOW")) {
value = LOW;
}
return pulseIn(trigPin, echoPin, value, timeout);
}
public long pulseIn(int trigPin, int echoPin, Integer timeout) {
if (timeout != null) {
timeout = 1000;
}
return pulseIn(trigPin, echoPin, 1000, null);
}
@Override
public void releaseService() {
super.releaseService();
// soft reset - detaches servos & resets polling & pinmodes
softReset();
sleep(300);
disconnect();
}
/**
* MRL protocol method
*
* @param function
* @param param1
* @param param2
*
* TODO - take the cheese out of this method .. it shold be
* sendMsg(byte[]...data)
*/
public synchronized void sendMsg(int function, int... params) {
// log.debug("sendMsg magic | fn " + function + " p1 " + param1 + " p2 "
// + param2);
try {
// not CRC16 - but cheesy error correction of bytestream
// http://www.java2s.com/Open-Source/Java/6.0-JDK-Modules-sun/misc/sun/misc/CRC16.java.htm
// #include <util/crc16.h>
// _crc16_update (test, testdata);
serial.write(MAGIC_NUMBER);
// msg size = function byte + x param bytes
// msg size does not include MAGIC_NUMBER & size
// MAGIC_NUMBER|3|FUNCTION|PARAM0|PARAM2 would be valid
serial.write(1 + params.length);
serial.write(function);
for (int i = 0; i < params.length; ++i) {
serial.write(params[i]);
}
} catch (Exception e) {
error("sendMsg " + e.getMessage());
}
}
public synchronized int sensorAttach(String sensorName) {
UltrasonicSensor sensor = (UltrasonicSensor) Runtime.getService(sensorName);
if (sensor == null) {
log.error("Sensor {} not valid", sensorName);
return -1;
}
return sensorAttach(sensor);
}
public synchronized int sensorAttach(UltrasonicSensor sensor) {
String sensorName = sensor.getName();
log.info(String.format("sensorAttach %s", sensorName));
int sensorIndex = -1;
if (serial == null) {
error("could not attach sensor - no serial device!");
return -1;
}
if (sensors.containsKey(sensorName)) {
log.warn("sensor already attach - detach first");
return -1;
}
int type = -1;
if (sensor instanceof UltrasonicSensor) {
type = SENSOR_ULTRASONIC;
}
if (type == SENSOR_ULTRASONIC) {
// simple count = index mapping
sensorIndex = sensors.size();
// attach index pin
sendMsg(SENSOR_ATTACH, sensorIndex, SENSOR_ULTRASONIC, sensor.getTriggerPin(), sensor.getEchoPin());
SensorData sd = new SensorData();
sd.sensor = sensor;
sd.sensorIndex = sensorIndex;
sensors.put(sensorName, sd);
sensorsIndex.put(sensorIndex, sd);
log.info(String.format("sensor SR04 index %d pin trig %d echo %d attached ", sensorIndex, sensor.getTriggerPin(), sensor.getEchoPin()));
}
return sensorIndex;
}
public boolean sensorPollingStart(String name, int timeoutMS) {
info("sensorPollingStart %s", name);
if (!sensors.containsKey(name)) {
error("can not poll sensor %s - not defined", name);
return false;
}
int index = sensors.get(name).sensorIndex;
sendMsg(SENSOR_POLLING_START, index, timeoutMS);
return true;
}
public boolean sensorPollingStop(String name) {
info("sensorPollingStop %s", name);
if (!sensors.containsKey(name)) {
error("can not poll sensor %s - not defined", name);
return false;
}
int index = sensors.get(name).sensorIndex;
sendMsg(SENSOR_POLLING_STOP, index);
return true;
}
// FIXME - need interface for this
public synchronized boolean servoAttach(Servo servo, Integer pin) {
String servoName = servo.getName();
log.info(String.format("servoAttach %s pin %d", servoName, pin));
if (serial == null) {
error("could not attach servo to pin %d serial is null - not initialized?", pin);
return false;
}
if (servos.containsKey(servo.getName())) {
log.info("servo already attach - detach first");
// important to return true - because we are "attached" !
return true;
}
// simple re-map - to guarantee the same MRL Servo gets the same
// MRLComm.ino servo
if (pin < 2 || pin > MAX_SERVOS + 2) {
error("pin out of range 2 < %d < %d", pin, MAX_SERVOS + 2);
return false;
}
// complex formula to calculate servo index
// this "could" be complicated - even so compicated
// as asking MRLComm.ino to find the "next available index
// and send it back - but I've tried that scheme and
// because the Servo's don't fully "detach" using the standard library
// it proved very "bad"
// simplistic mapping where Java is in control seems best
int index = pin - 2;
// we need to send the servo ascii name - format of SERVO_ATTCH is
// SERVO_ATTACH (1 byte) | servo index (1 byte) | servo pin (1 byte) |
// size of name (1 byte) | ASCII name of servo (N - bytes)
// The name is not needed in MRLComm.ino - but it is needed in
// virtualized Blender servo
int payloadSize = 1 + 1 + 1 + servoName.length();
int[] payload = new int[payloadSize];
// payload[0] = SERVO_ATTACH;
payload[0] = index;
payload[1] = pin;
payload[2] = servoName.length();
byte ascii[] = servoName.getBytes();
for (int i = 0; i < servoName.length(); ++i) {
payload[i + 3] = 0xFF & ascii[i];
}
sendMsg(SERVO_ATTACH, payload);
ServoData sd = new ServoData();
sd.pin = pin;
sd.servoIndex = index;
sd.servo = servo;
servos.put(servo.getName(), sd);
servoIndex.put(index, sd);
servo.setController(this);
servo.setPin(pin);
log.info("servo index {} pin {} attached ", index, pin);
return true;
}
@Override
public boolean servoAttach(String servoName, Integer pin) {
Servo servo = (Servo) Runtime.getService(servoName);
if (servo == null) {
error("servoAttach can not attach %s no service exists", servoName);
return false;
}
return servoAttach(servo, servo.getPin());
}
// FIXME make & merge interface for this
public synchronized boolean servoDetach(Servo servo) {
String servoName = servo.getName();
log.info(String.format("servoDetach(%s)", servoName));
if (servos.containsKey(servoName)) {
ServoData sd = servos.get(servoName);
sendMsg(SERVO_DETACH, sd.servoIndex, 0);
servos.remove(servoName);
servoIndex.remove(sd.servoIndex);
return true;
}
error("servo %s detach failed - not found", servoName);
return false;
}
@Override
public boolean servoDetach(String servoName) {
Servo servo = (Servo) Runtime.getService(servoName);
return servoDetach(servo);
}
@Override
public void servoSweepStart(String servoName, int min, int max, int step) {
if (!servos.containsKey(servoName)) {
warn("Servo %s not attached to %s", servoName, getName());
return;
}
int index = servos.get(servoName).servoIndex;
log.info(String.format("servoSweep %s index %d min %d max %d step %d", servoName, index, min, max, step));
sendMsg(SERVO_SWEEP_START, index, min, max, step);
}
@Override
public void servoSweepStop(String servoName) {
int index = servos.get(servoName).servoIndex;
sendMsg(SERVO_SWEEP_STOP, index);
}
@Override
public void servoWrite(String servoName, Integer newPos) {
if (!servos.containsKey(servoName)) {
warn("Servo %s not attached to %s", servoName, getName());
return;
}
int index = servos.get(servoName).servoIndex;
log.info(String.format("servoWrite %s %d index %d", servoName, newPos, index));
sendMsg(SERVO_WRITE, index, newPos);
}
// FIXME - not "servo" .. just writeMicroseconds
// FIXME FIXME FIXME - start fixing up & creating interface of PIN WRITING
// READING GETTING AND CONTROLL CUZ
// THATS WHAT MICROCONTROLLERS DO !
@Override
public void servoWriteMicroseconds(String servoName, Integer newPos) {
if (!servos.containsKey(servoName)) {
warn("Servo %s not attached to %s", servoName, getName());
return;
}
int index = servos.get(servoName).servoIndex;
log.info(String.format("writeMicroseconds %s %d index %d", servoName, newPos, index));
sendMsg(SERVO_WRITE_MICROSECONDS, index, newPos);
}
public String setBoard(String board) {
this.board = board;
createPinList();
broadcastState();
return board;
}
/**
* easy way to set to a 54 pin arduino
* @return
*/
public String setBoardMega(){
board = BOARD_TYPE_ATMEGA2560;
createPinList();
broadcastState();
return board;
}
/**
* Debounce ensures that only a single signal will be acted upon for a
* single opening or closing of a contact. the delay is the min number of pc
* cycles must occur before a reading is taken
*
* Affects all reading of pins setting to 0 sets it off
*
* @param delay
*/
public void setDebounce(int delay) {
if (delay < 0 || delay > 32767) {
error(String.format("%d debounce delay must be 0 < delay < 32767", delay));
}
int lsb = delay & 0xff;
int msb = (delay >> 8) & 0xff;
sendMsg(SET_DEBOUNCE, msb, lsb);
}
public void setDigitalTriggerOnly(Boolean b) {
if (!b)
sendMsg(SET_DIGITAL_TRIGGER_ONLY, FALSE);
else
sendMsg(SET_DIGITAL_TRIGGER_ONLY, TRUE);
}
public boolean setLoadTimingEnabled(boolean enable) {
log.info(String.format("setLoadTimingEnabled %b", enable));
if (enable) {
sendMsg(SET_LOAD_TIMING_ENABLED, TRUE);
} else {
sendMsg(SET_LOAD_TIMING_ENABLED, FALSE);
}
return enable;
}
public void setPWMFrequency(Integer address, Integer freq) {
int prescalarValue = 0;
switch (freq) {
case 31:
case 62:
prescalarValue = 0x05;
break;
case 125:
case 250:
prescalarValue = 0x04;
break;
case 500:
case 1000:
prescalarValue = 0x03;
break;
case 4000:
case 8000:
prescalarValue = 0x02;
break;
case 32000:
case 64000:
prescalarValue = 0x01;
break;
default:
prescalarValue = 0x03;
}
sendMsg(SET_PWMFREQUENCY, address, prescalarValue);
}
/**
* this sets the sample rate of polling reads both digital and analog it is
* a loop count modulus - default is 1 which seems to be a bit high of a
* rate to be broadcasting across the internet to several webclients :)
* valid ranges are 1 to 32,767 (for Arduino's 2 byte signed integer)
*
* @param rate
*/
public int setSampleRate(int rate) {
if (rate < 1 || rate > 32767) {
error(String.format("%d sample rate can not be < 1", rate));
}
int lsb = rate & 0xff;
int msb = (rate >> 8) & 0xff;
sendMsg(SET_SAMPLE_RATE, msb, lsb);
return rate;
}
public void setSerialRate(int rate) {
sendMsg(SET_SERIAL_RATE, rate);
}
@Override
public boolean setServoEventsEnabled(String servoName, boolean enable) {
log.info(String.format("setServoEventsEnabled %s %b", servoName, enable));
if (servos.containsKey(servoName)) {
ServoData sd = servos.get(servoName);
if (enable) {
sendMsg(SET_SERVO_EVENTS_ENABLED, sd.servoIndex, TRUE);
} else {
sendMsg(SET_SERVO_EVENTS_ENABLED, sd.servoIndex, FALSE);
}
return true;
}
return false;
}
@Override
public void setServoSpeed(String servoName, Float speed) {
if (speed == null || speed < 0.0f || speed > 1.0f) {
error("speed %f out of bounds", speed);
return;
}
sendMsg(SET_SERVO_SPEED, servos.get(servoName).servoIndex, (int) (speed * 100));
}
public void setSketch(Sketch sketch) {
this.sketch = sketch;
broadcastState();
}
public void setStepperSpeed(Integer speed) {
// TODO Auto-generated method stub
}
/**
* set a pin trigger where a value will be sampled and an event will be
* signal when the pin turns into a different state.
*
* @param pin
* @param value
* @return
*/
public int setTrigger(int pin, int value) {
return setTrigger(pin, value, 1);
}
/**
* set a pin trigger where a value will be sampled and an event will be
* signal when the pin turns into a different state.
*
* @param pin
* @param value
* @param type
* @return
*/
public int setTrigger(int pin, int value, int type) {
sendMsg(SET_TRIGGER, pin, type);
return pin;
}
/**
* send a reset to Arduino - all polling is stopped and all other counters
* are reset
*
* TODO - reset servos ? motors ? etc. ?
*/
public void softReset() {
sendMsg(SOFT_RESET, 0, 0);
}
@Override
public void startService() {
super.startService();
try {
serial = (Serial) startPeer("serial");
// FIXME - dynamically additive - if codec key has never been used -
// add key
serial.setCodec("arduino");
serial.addByteListener(this);
} catch (Exception e) {
Logging.logError(e);
}
}
public boolean stepperAttach(Stepper stepper) {
String stepperName = stepper.getName();
log.info(String.format("stepperAttach %s", stepperName));
if (!isConnected()){
error("%s must be connected to serial port before attaching stepper", getName());
return false;
}
int index = 0;
if (steppers.containsKey(stepperName)) {
warn("stepper already attach - detach first");
return true;
}
stepper.setController(this);
if (Stepper.STEPPER_TYPE_SIMPLE == stepper.getStepperType()) {
// simple count = index mapping
index = steppers.size();
// attach index pin - FIXME - add number of steps and other paramters - initial speed - pause timings
sendMsg(STEPPER_ATTACH, index, stepper.getStepperType(), stepper.getDirPin(), stepper.getStepPin());
stepper.setIndex(index);
steppers.put(stepperName, stepper);
stepperIndex.put(index, stepper);
log.info(String.format("stepper STEPPER_TYPE_SIMPLE index %d pin direction %d step %d attached ", index, stepper.getDirPin(), stepper.getStepPin()));
} else {
error("unkown type of stepper");
return false;
}
return true;
}
@Override
public boolean stepperAttach(String stepperName) {
Stepper stepper = (Stepper) Runtime.getService(stepperName);
if (stepper == null) {
log.error("Stepper {} not valid", stepperName);
return false;
}
return stepperAttach(stepper);
}
@Override
public boolean stepperDetach(String stepperName) {
Stepper stepper = null;
if (steppers.containsKey(stepperName)){
stepper = steppers.remove(stepperName);
if (stepperIndex.containsKey(stepper.getIndex())){
stepperIndex.remove(stepper.getIndex());
return true;
}
}
return false;
}
public void stepperMoveTo(String name, int newPos, int style) {
if (!steppers.containsKey(name)) {
error("%s stepper not found", name);
return;
}
Stepper stepper = steppers.get(name);
if (Stepper.STEPPER_TYPE_SIMPLE != stepper.getStepperType()) {
error("unknown stepper type");
return;
}
int lsb = newPos & 0xff;
int msb = (newPos >> 8) & 0xff;
sendMsg(STEPPER_MOVE_TO, stepper.getIndex(), msb, lsb, style);
// TODO - call back event - to say arrived ?
// TODO - blocking method
}
@Override
public void stepperReset(String stepperName) {
Stepper stepper = steppers.get(stepperName);
sendMsg(STEPPER_RESET, stepper.getIndex());
}
public void stepperStop(String name) {
Stepper stepper = steppers.get(name);
sendMsg(STEPPER_STOP, stepper.getIndex());
}
@Override
public void stopService() {
super.stopService();
disconnect();
}
@Override
public Status test() {
Status status = Status.info("starting %s %s test", getName(), getType());
try {
// get running reference to self
Arduino arduino = (Arduino) Runtime.start(getName(), "Arduino");
Serial serial = arduino.getSerial();
Serial uart = serial.createVirtualUART();
uart.record();
// set board type
// FIXME - this should be done by MRLComm.ino (compiled in)
status.addInfo("setting board type to %s", BOARD_TYPE_ATMEGA2560);
arduino.setBoard(BOARD_TYPE_ATMEGA2560);
ArrayList<Pin> pinList = getPinList();
status.addInfo("found %d pins", pinList.size());
for (int i = 0; i < pinList.size(); ++i) {
arduino.analogWrite(pinList.get(i).pin, 0);
arduino.analogWrite(pinList.get(i).pin, 128);
arduino.analogWrite(pinList.get(i).pin, 255);
}
for (int i = 0; i < pinList.size(); ++i) {
arduino.digitalWrite(pinList.get(i).pin, 1);
arduino.digitalWrite(pinList.get(i).pin, 0);
}
arduino.disconnect();
// nullModem.close();
for (int i = 0; i < 10; ++i) {
long duration = arduino.pulseIn(7, 8);
log.info("duration {} uS", duration);
}
UltrasonicSensor sr04 = (UltrasonicSensor) Runtime.start("sr04", "UltrasonicSensor");
Runtime.start("gui", "GUIService");
sr04.attach(serial.getPortName(), 7, 8);
sr04.startRanging();
sr04.stopRanging();
} catch (Exception e) {
Logging.logError(e);
}
// TODO - test all functions
// TODO - test digital pin
// getDigitalPins
// getAnalogPins
return status;
}
public static void main(String[] args) {
try {
LoggingFactory.getInstance().configure();
LoggingFactory.getInstance().setLevel(Level.INFO);
Arduino arduino = (Arduino) Runtime.start("arduino", "Arduino");
/*
VirtualDevice virtual = (VirtualDevice) Runtime.start("virtual", "VirtualDevice");
virtual.createVirtualArduino("vport");
arduino.connect("vport");
*/
//arduino.setBoardMega();
//arduino.connect("COM15");
Runtime.start("python", "Python");
Runtime.start("gui", "GUIService");
//Runtime.start("python", "Python");
//Runtime.broadcastStates();
//arduino.analogReadPollingStart(68);
boolean done = true;
if (done) {
return;
}
/*
* Serial serial = arduino.getSerial();
* serial.connectTCP("localhost", 9191);
* arduino.connect(serial.getPortName());
*
*
* arduino.digitalWrite(13, 0); arduino.digitalWrite(13, 1);
* arduino.digitalWrite(13, 0);
*
* arduino.analogReadPollingStart(15);
*
* // arduino.test("COM15");
*
* arduino.setSampleRate(500); arduino.setSampleRate(1000);
* arduino.setSampleRate(5000); arduino.setSampleRate(10000);
*
* arduino.analogReadPollingStop(15);
*/
log.info("here");
} catch (Exception e) {
Logging.logError(e);
}
}
}
| gpl-2.0 |
nvinayshetty/DTOnator | src/test/com/nvinayshetty/DTOnator/fieldRepresentors/DoubleFieldRepresentorShould.java | 1818 | /*
* Copyright (C) 2015 Vinaya Prasad N
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package test.com.nvinayshetty.DTOnator.fieldRepresentors;
import com.nvinayshetty.DTOnator.FieldCreator.AccessModifier;
import com.nvinayshetty.DTOnator.FieldRepresentors.DoubleFieldRepresentor;
import org.junit.Test;
import static junit.framework.TestCase.assertEquals;
/**
* Created by vinay on 1/8/15.
*/
public class DoubleFieldRepresentorShould {
private String fieldName;
@Test
public void CreatePublicFieldWhenAcessModifierIsPublic() {
fieldName = "valid";
String actual = new DoubleFieldRepresentor().getFieldRepresentationFor(AccessModifier.PUBLIC, fieldName);
String expected = "public double " + fieldName + ";";
assertEquals(expected, actual);
}
@Test
public void CreatePrivateFieldWhenAcessModifierIsPrivate() {
fieldName = "valid";
String actual = new DoubleFieldRepresentor().getFieldRepresentationFor(AccessModifier.PRIVATE, fieldName);
String expected = "private double " + fieldName + ";";
assertEquals(expected, actual);
}
}
| gpl-2.0 |
jonasjberg/voltdivx | src/com/jonasjberg/voltdivx/model/SeriesCombination.java | 858 | package com.jonasjberg.voltdivx.model;
/**
* Created by spock on 2015-12-26.
*/
public class SeriesCombination extends ResistorCombination
{
// private LinkedList<Resistance> members = new LinkedList<>();
public SeriesCombination(Resistor... newMembers)
{
add(newMembers);
}
// public void add(Resistance newMember)
// {
// if (members == null)
// return;
// else if (newMember == null)
// return;
//
// members.add(newMember);
// }
public double getTotalResistance()
{
double total = 0;
for (Resistor r : members) {
if (r == null)
continue;
total += r.getValue();
}
return total;
}
public Resistor simplifyToResistor()
{
return new Resistor(getTotalResistance());
}
}
| gpl-2.0 |
bramalingam/bioformats | components/formats-bsd/src/loci/formats/codec/BitWriter.java | 6285 | /*
* #%L
* BSD implementations of Bio-Formats readers and writers
* %%
* Copyright (C) 2005 - 2016 Open Microscopy Environment:
* - Board of Regents of the University of Wisconsin-Madison
* - Glencoe Software, Inc.
* - University of Dundee
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* #L%
*/
package loci.formats.codec;
import java.util.Random;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* A class for writing arbitrary numbers of bits to a byte array.
*
* @author Curtis Rueden ctrueden at wisc.edu
* @deprecated Use loci.common.RandomAccessOutputStream instead
*/
public class BitWriter {
// -- Constants --
private static final Logger LOGGER = LoggerFactory.getLogger(BitWriter.class);
// -- Fields --
/** Buffer storing all bits written thus far. */
private byte[] buf;
/** Byte index into the buffer. */
private int index;
/** Bit index into current byte of the buffer. */
private int bit;
// -- Constructors --
/** Constructs a new bit writer. */
public BitWriter() { this(10); }
/** Constructs a new bit writer with the given initial buffer size. */
public BitWriter(int size) { buf = new byte[size]; }
// -- BitWriter API methods --
/** Writes the given value using the given number of bits. */
public void write(int value, int numBits) {
if (numBits <= 0) return;
byte[] bits = new byte[numBits];
for (int i=0; i<numBits; i++) {
bits[i] = (byte) (value & 0x0001);
value >>= 1;
}
for (int i=numBits-1; i>=0; i--) {
int b = bits[i] << (7 - bit);
buf[index] |= b;
bit++;
if (bit > 7) {
bit = 0;
index++;
if (index >= buf.length) {
// buffer is full; increase the size
byte[] newBuf = new byte[buf.length * 2];
System.arraycopy(buf, 0, newBuf, 0, buf.length);
buf = newBuf;
}
}
}
}
/**
* Writes the bits represented by a bit string to the buffer.
*
* @throws IllegalArgumentException If any characters other than
* '0' and '1' appear in the string.
*/
public void write(String bitString) {
if (bitString == null)
throw new IllegalArgumentException("The string cannot be null.");
for (int i = 0; i < bitString.length(); i++) {
if ('1' == bitString.charAt(i)) {
int b = 1 << (7 - bit);
buf[index] |= b;
}
else if ('0' != bitString.charAt(i)) {
throw new IllegalArgumentException(bitString.charAt(i) +
"found at character " + i +
"; 0 or 1 expected. Write only partially completed.");
}
bit++;
if (bit > 7) {
bit = 0;
index++;
if (index >= buf.length) {
// buffer is full; increase the size
byte[] newBuf = new byte[buf.length * 2];
System.arraycopy(buf, 0, newBuf, 0, buf.length);
buf = newBuf;
}
}
}
}
/** Gets an array containing all bits written thus far. */
public byte[] toByteArray() {
int size = index;
if (bit > 0) size++;
byte[] b = new byte[size];
System.arraycopy(buf, 0, b, 0, size);
return b;
}
// -- Main method --
/** Tests the BitWriter class. */
public static void main(String[] args) {
int max = 50000;
// randomize values
LOGGER.info("Generating random list of {} values", max);
int[] values = new int[max];
int[] bits = new int[max];
double log2 = Math.log(2);
for (int i=0; i<values.length; i++) {
values[i] = (int) (50000 * Math.random()) + 1;
int minBits = (int) Math.ceil(Math.log(values[i] + 1) / log2);
bits[i] = (int) (10 * Math.random()) + minBits;
}
// write values out
LOGGER.info("Writing values to byte array");
BitWriter out = new BitWriter();
for (int i=0; i<values.length; i++) out.write(values[i], bits[i]);
// read values back in
LOGGER.info("Reading values from byte array");
BitBuffer bb = new BitBuffer(out.toByteArray());
for (int i=0; i<values.length; i++) {
int value = bb.getBits(bits[i]);
if (value != values[i]) {
LOGGER.info("Value #{} does not match (got {}; expected {}; {} bits)",
new Object[] {i, value, values[i], bits[i]});
}
}
// Testing string functionality
Random r = new Random();
LOGGER.info("Generating 5000 random bits for String test");
final StringBuilder sb = new StringBuilder(5000);
for (int i = 0; i < 5000; i++) {
sb.append(r.nextInt(2));
}
out = new BitWriter();
LOGGER.info("Writing values to byte array");
out.write(sb.toString());
LOGGER.info("Reading values from byte array");
bb = new BitBuffer(out.toByteArray());
for (int i = 0; i < 5000; i++) {
int value = bb.getBits(1);
int expected = (sb.charAt(i) == '1') ? 1 : 0;
if (value != expected) {
LOGGER.info("Bit #{} does not match (got {}; expected {}.",
new Object[] {i, value, expected});
}
}
}
}
| gpl-2.0 |
iammyr/Benchmark | src/main/java/org/owasp/benchmark/testcode/BenchmarkTest16249.java | 1976 | /**
* OWASP Benchmark Project v1.1
*
* This file is part of the Open Web Application Security Project (OWASP)
* Benchmark Project. For details, please see
* <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>.
*
* The Benchmark is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation, version 2.
*
* The Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* @author Nick Sanidas <a href="https://www.aspectsecurity.com">Aspect Security</a>
* @created 2015
*/
package org.owasp.benchmark.testcode;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/BenchmarkTest16249")
public class BenchmarkTest16249 extends HttpServlet {
private static final long serialVersionUID = 1L;
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String param = "";
java.util.Enumeration<String> headers = request.getHeaders("foo");
if (headers.hasMoreElements()) {
param = headers.nextElement(); // just grab first element
}
String bar = doSomething(param);
Object[] obj = { "a", "b"};
response.getWriter().printf(bar,obj);
} // end doPost
private static String doSomething(String param) throws ServletException, IOException {
String bar = param.split(" ")[0];
return bar;
}
}
| gpl-2.0 |
GoldBigDragon/GoldBigDragonRPG | [Spigot 1.12.2]/src.main.java.io.github.goldbigdragon.goldbigdragonrpg.advanced/customitem/gui/ApplyToolGui.java | 4092 | package customitem.gui;
import java.text.DecimalFormat;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import util.GuiUtil;
import util.PlayerUtil;
public class ApplyToolGui extends GuiUtil{
private String uniqueCode = "¡×0¡×0¡×3¡×0¡×7¡×r";
public void applyToolGui(Player player, ItemStack item)
{
Inventory inv = Bukkit.createInventory(null, 9, uniqueCode + "¡×0°³Á¶ÇÒ ¾ÆÀÌÅÛ ¼±ÅÃ");
inv.setItem(4, item);
player.openInventory(inv);
}
public void applyToolClick(InventoryClickEvent event)
{
Player player = (Player) event.getWhoClicked();
ItemStack toolItem = event.getInventory().getItem(4);
int maxDurability = 0;
int proficiency = 0;
for(int counter = 0; counter < toolItem.getItemMeta().getLore().size();counter++)
{
String nowlore=ChatColor.stripColor(toolItem.getItemMeta().getLore().get(counter));
if(nowlore.contains(" : "))
{
if(nowlore.contains("ÃÖ´ë ³»±¸µµ Áõ°¡"))
maxDurability = Integer.parseInt(nowlore.split(" : ")[1]);
else if(nowlore.contains("¼÷·Ãµµ Áõ°¡"))
proficiency = Integer.parseInt(nowlore.split(" : ")[1]);
}
}
Inventory inv = event.getClickedInventory();
event.setCancelled(true);
if(inv.getType() == InventoryType.PLAYER)
{
ItemStack item = event.getCurrentItem();
if(item != null && item.hasItemMeta())
{
ItemMeta im = item.getItemMeta();
if(im.hasLore())
{
List<String> lore = im.getLore();
String loreToString = lore.toString();
if(loreToString.contains("³»±¸µµ") || loreToString.contains("¼÷·Ãµµ"))
{
if(!(loreToString.contains("[ÁÖ¹®¼]")||loreToString.contains("[·é]")||loreToString.contains("[¼Òºñ]")||loreToString.contains("[°ø±¸]")))
{
for(int count = 0; count < lore.size(); count++)
{
String nowlore = ChatColor.stripColor(lore.get(count));
if(nowlore.contains(" : "))
{
if(nowlore.contains("³»±¸µµ") && nowlore.contains(" / "))
{
String[] stat = ChatColor.stripColor(im.getLore().get(count)).split(" : ");
String[] subLore = stat[1].split(" / ");
lore.set(count,"¡×f"+ stat[0] + " : "+ subLore[0] +" / "+ (Integer.parseInt(subLore[1])+maxDurability));
im.setLore(lore);
item.setItemMeta(im);
}
else if(nowlore.contains("¼÷·Ãµµ"))
{
String[] stat = ChatColor.stripColor(nowlore).split(" : ");
String[] subLore = stat[1].split("%");
DecimalFormat format = new DecimalFormat(".##");
String str = format.format((Float.parseFloat(subLore[0])+proficiency));
if(str.charAt(0)=='.')
str = "0"+str;
if((Float.parseFloat(subLore[0])+proficiency) >= 100.0F)
lore.set(count,"¡×f"+ stat[0] + " : "+ 100.0 +"%¡×f");
else
lore.set(count,"¡×f"+ stat[0] + " : "+ str +"%¡×f");
im.setLore(lore);
item.setItemMeta(im);
}
}
}
event.setCurrentItem(null);
new PlayerUtil().giveItemDrop(player, item, player.getLocation());
player.getOpenInventory().getTopInventory().setItem(4, null);
effect.SoundEffect.playSound(player, Sound.BLOCK_ANVIL_USE, 0.9F, 1.4F);
player.closeInventory();
return;
}
}
}
}
effect.SoundEffect.playSound(player, Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 0.8F, 1.8F);
player.sendMessage("¡×c[ X ] ÇØ´ç ¾ÆÀÌÅÛ¿¡´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù!");
}
}
public void applyToolClose(InventoryCloseEvent event)
{
ItemStack item = event.getInventory().getItem(4);
if(item != null)
{
Player player = (Player)event.getPlayer();
new PlayerUtil().giveItemDrop(player, item, player.getLocation());
}
}
}
| gpl-2.0 |
camposer/curso_in_java | Basico/src/formacion/java/holamundo/Contrato.java | 1013 | package formacion.java.holamundo;
public class Contrato {
private int numero = 99;
private String nombreCto = "N/D";
private int duracion; // en días
public Contrato() {
this(0);
numero = 90;
}
public Contrato(int duracion) {
this(99, "N/D", duracion); // Llamada al constructor de abajo
}
public Contrato(int numero, String nombreCto,
int duracion) {
this.numero = numero;
this.nombreCto = nombreCto;
this.duracion = duracion;
}
public int getNumero() {
return numero;
}
public void setNumero(int numero) {
this.numero = numero;
}
public String getNombreCto() {
return nombreCto;
}
public void setNombreCto(String nombreCto) {
this.nombreCto = nombreCto;
}
public int getDuracion() {
return duracion;
}
public void setDuracion(int duracion) {
this.duracion = duracion;
}
public void imprimirDetalles() {
System.out.println("Número: " + numero);
System.out.println("Nombre: " + nombreCto);
System.out.println("Duración: " + duracion);
}
}
| gpl-2.0 |
timmattison/brick-rope | src/main/java/com/timmattison/cryptocurrency/bitcoin/words/bitwiselogic/OpEqual.java | 2158 | package com.timmattison.cryptocurrency.bitcoin.words.bitwiselogic;
import com.timmattison.cryptocurrency.bitcoin.StateMachine;
import com.timmattison.cryptocurrency.helpers.ByteArrayHelper;
import java.util.Arrays;
/**
* Created with IntelliJ IDEA.
* User: timmattison
* Date: 4/11/13
* Time: 11:57 AM
* To change this template use File | Settings | File Templates.
*/
public class OpEqual extends BitwiseOp {
private static final String word = "OP_EQUAL";
private static final Byte opcode = (byte) 0x87;
@Override
public Byte getOpcode() {
return opcode;
}
@Override
public String getName() {
return word;
}
@Override
public void execute(StateMachine stateMachine) {
// Pop the top two items off of the stack so we can compare them
Object item1 = stateMachine.pop();
Object item2 = stateMachine.pop();
Boolean result = null;
// Is item1 an array of java.lang.Byte?
if (item1 instanceof Byte[]) {
// Yes, convert it to a regular byte array
item1 = ByteArrayHelper.convertByteArray((Byte[]) item1);
}
// Is item2 an array of java.lang.Byte?
if (item2 instanceof Byte[]) {
// Yes, convert it to a regular byte array
item2 = ByteArrayHelper.convertByteArray((Byte[]) item2);
}
// Are both items byte arrays?
if ((item1 instanceof byte[]) && (item2 instanceof byte[])) {
// Yes, compare them with Array.equals
result = Arrays.equals((byte[]) item1, (byte[]) item2);
} else {
// No, just use the equals operator to see if they are equal
// XXX - This will probably not work in most cases
result = item1.equals(item2);
}
// Did we get a result?
if (result == null) {
// No, throw an exception
throw new UnsupportedOperationException("No comparison found for the top two items on the stack");
}
// Push the result onto the stack
int intResult = result ? 1 : 0;
stateMachine.push(intResult);
}
}
| gpl-2.0 |
AcademicTorrents/AcademicTorrents-Downloader | vuze/org/bouncycastle/x509/AttributeCertificateHolder.java | 12402 | package org.bouncycastle.x509;
import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.DERInteger;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
import org.bouncycastle.asn1.x509.GeneralName;
import org.bouncycastle.asn1.x509.GeneralNames;
import org.bouncycastle.asn1.x509.Holder;
import org.bouncycastle.asn1.x509.IssuerSerial;
import org.bouncycastle.asn1.x509.ObjectDigestInfo;
import org.bouncycastle.jce.PrincipalUtil;
import org.bouncycastle.jce.X509Principal;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.util.Arrays;
import org.bouncycastle.util.Selector;
import javax.security.auth.x500.X500Principal;
import java.io.IOException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.Principal;
import java.security.cert.CertSelector;
import java.security.cert.Certificate;
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateParsingException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;
/**
* The Holder object.
*
* <pre>
* Holder ::= SEQUENCE {
* baseCertificateID [0] IssuerSerial OPTIONAL,
* -- the issuer and serial number of
* -- the holder's Public Key Certificate
* entityName [1] GeneralNames OPTIONAL,
* -- the name of the claimant or role
* objectDigestInfo [2] ObjectDigestInfo OPTIONAL
* -- used to directly authenticate the holder,
* -- for example, an executable
* }
* </pre>
*
*/
public class AttributeCertificateHolder
implements CertSelector, Selector
{
final Holder holder;
AttributeCertificateHolder(ASN1Sequence seq)
{
holder = Holder.getInstance(seq);
}
public AttributeCertificateHolder(X509Principal issuerName,
BigInteger serialNumber)
{
holder = new org.bouncycastle.asn1.x509.Holder(new IssuerSerial(
new GeneralNames(new DERSequence(new GeneralName(issuerName))),
new DERInteger(serialNumber)));
}
public AttributeCertificateHolder(X500Principal issuerName,
BigInteger serialNumber)
{
this(X509Util.convertPrincipal(issuerName), serialNumber);
}
public AttributeCertificateHolder(X509Certificate cert)
throws CertificateParsingException
{
X509Principal name;
try
{
name = PrincipalUtil.getIssuerX509Principal(cert);
}
catch (Exception e)
{
throw new CertificateParsingException(e.getMessage());
}
holder = new Holder(new IssuerSerial(generateGeneralNames(name),
new DERInteger(cert.getSerialNumber())));
}
public AttributeCertificateHolder(X509Principal principal)
{
holder = new Holder(generateGeneralNames(principal));
}
public AttributeCertificateHolder(X500Principal principal)
{
this(X509Util.convertPrincipal(principal));
}
/**
* Constructs a holder for v2 attribute certificates with a hash value for
* some type of object.
* <p>
* <code>digestedObjectType</code> can be one of the following:
* <ul>
* <li>0 - publicKey - A hash of the public key of the holder must be
* passed.
* <li>1 - publicKeyCert - A hash of the public key certificate of the
* holder must be passed.
* <li>2 - otherObjectDigest - A hash of some other object type must be
* passed. <code>otherObjectTypeID</code> must not be empty.
* </ul>
* <p>
* This cannot be used if a v1 attribute certificate is used.
*
* @param digestedObjectType The digest object type.
* @param digestAlgorithm The algorithm identifier for the hash.
* @param otherObjectTypeID The object type ID if
* <code>digestedObjectType</code> is
* <code>otherObjectDigest</code>.
* @param objectDigest The hash value.
*/
public AttributeCertificateHolder(int digestedObjectType,
String digestAlgorithm, String otherObjectTypeID, byte[] objectDigest)
{
holder = new Holder(new ObjectDigestInfo(digestedObjectType,
otherObjectTypeID, new AlgorithmIdentifier(digestAlgorithm), Arrays
.clone(objectDigest)));
}
/**
* Returns the digest object type if an object digest info is used.
* <p>
* <ul>
* <li>0 - publicKey - A hash of the public key of the holder must be
* passed.
* <li>1 - publicKeyCert - A hash of the public key certificate of the
* holder must be passed.
* <li>2 - otherObjectDigest - A hash of some other object type must be
* passed. <code>otherObjectTypeID</code> must not be empty.
* </ul>
*
* @return The digest object type or -1 if no object digest info is set.
*/
public int getDigestedObjectType()
{
if (holder.getObjectDigestInfo() != null)
{
return holder.getObjectDigestInfo().getDigestedObjectType()
.getValue().intValue();
}
return -1;
}
/**
* Returns the other object type ID if an object digest info is used.
*
* @return The other object type ID or <code>null</code> if no object
* digest info is set.
*/
public String getDigestAlgorithm()
{
if (holder.getObjectDigestInfo() != null)
{
holder.getObjectDigestInfo().getDigestAlgorithm().getObjectId()
.getId();
}
return null;
}
/**
* Returns the hash if an object digest info is used.
*
* @return The hash or <code>null</code> if no object digest info is set.
*/
public byte[] getObjectDigest()
{
if (holder.getObjectDigestInfo() != null)
{
holder.getObjectDigestInfo().getObjectDigest().getBytes();
}
return null;
}
/**
* Returns the digest algorithm ID if an object digest info is used.
*
* @return The digest algorithm ID or <code>null</code> if no object
* digest info is set.
*/
public String getOtherObjectTypeID()
{
if (holder.getObjectDigestInfo() != null)
{
holder.getObjectDigestInfo().getOtherObjectTypeID().getId();
}
return null;
}
private GeneralNames generateGeneralNames(X509Principal principal)
{
return new GeneralNames(new DERSequence(new GeneralName(principal)));
}
private boolean matchesDN(X509Principal subject, GeneralNames targets)
{
GeneralName[] names = targets.getNames();
for (int i = 0; i != names.length; i++)
{
GeneralName gn = names[i];
if (gn.getTagNo() == GeneralName.directoryName)
{
try
{
if (new X509Principal(((ASN1Encodable)gn.getName())
.getEncoded()).equals(subject))
{
return true;
}
}
catch (IOException e)
{
}
}
}
return false;
}
private Object[] getNames(GeneralName[] names)
{
List l = new ArrayList(names.length);
for (int i = 0; i != names.length; i++)
{
if (names[i].getTagNo() == GeneralName.directoryName)
{
try
{
l.add(new X500Principal(
((ASN1Encodable)names[i].getName()).getEncoded()));
}
catch (IOException e)
{
throw new RuntimeException("badly formed Name object");
}
}
}
return l.toArray(new Object[l.size()]);
}
private Principal[] getPrincipals(GeneralNames names)
{
Object[] p = this.getNames(names.getNames());
List l = new ArrayList();
for (int i = 0; i != p.length; i++)
{
if (p[i] instanceof Principal)
{
l.add(p[i]);
}
}
return (Principal[])l.toArray(new Principal[l.size()]);
}
/**
* Return any principal objects inside the attribute certificate holder
* entity names field.
*
* @return an array of Principal objects (usually X500Principal), null if no
* entity names field is set.
*/
public Principal[] getEntityNames()
{
if (holder.getEntityName() != null)
{
return getPrincipals(holder.getEntityName());
}
return null;
}
/**
* Return the principals associated with the issuer attached to this holder
*
* @return an array of principals, null if no BaseCertificateID is set.
*/
public Principal[] getIssuer()
{
if (holder.getBaseCertificateID() != null)
{
return getPrincipals(holder.getBaseCertificateID().getIssuer());
}
return null;
}
/**
* Return the serial number associated with the issuer attached to this
* holder.
*
* @return the certificate serial number, null if no BaseCertificateID is
* set.
*/
public BigInteger getSerialNumber()
{
if (holder.getBaseCertificateID() != null)
{
return holder.getBaseCertificateID().getSerial().getValue();
}
return null;
}
public Object clone()
{
return new AttributeCertificateHolder((ASN1Sequence)holder
.toASN1Object());
}
public boolean match(Certificate cert)
{
if (!(cert instanceof X509Certificate))
{
return false;
}
X509Certificate x509Cert = (X509Certificate)cert;
try
{
if (holder.getBaseCertificateID() != null)
{
return holder.getBaseCertificateID().getSerial().getValue().equals(x509Cert.getSerialNumber())
&& matchesDN(PrincipalUtil.getIssuerX509Principal(x509Cert), holder.getBaseCertificateID().getIssuer());
}
if (holder.getEntityName() != null)
{
if (matchesDN(PrincipalUtil.getSubjectX509Principal(x509Cert),
holder.getEntityName()))
{
return true;
}
}
if (holder.getObjectDigestInfo() != null)
{
MessageDigest md = null;
try
{
md = MessageDigest.getInstance(getDigestAlgorithm(), BouncyCastleProvider.PROVIDER_NAME);
}
catch (Exception e)
{
return false;
}
switch (getDigestedObjectType())
{
case ObjectDigestInfo.publicKey:
// TODO: DSA Dss-parms
md.update(cert.getPublicKey().getEncoded());
break;
case ObjectDigestInfo.publicKeyCert:
md.update(cert.getEncoded());
break;
}
if (!Arrays.areEqual(md.digest(), getObjectDigest()))
{
return false;
}
}
}
catch (CertificateEncodingException e)
{
return false;
}
return false;
}
public boolean equals(Object obj)
{
if (obj == this)
{
return true;
}
if (!(obj instanceof AttributeCertificateHolder))
{
return false;
}
AttributeCertificateHolder other = (AttributeCertificateHolder)obj;
return this.holder.equals(other.holder);
}
public int hashCode()
{
return this.holder.hashCode();
}
public boolean match(Object obj)
{
if (!(obj instanceof X509Certificate))
{
return false;
}
return match((Certificate)obj);
}
}
| gpl-2.0 |
megion/blinds | megion-blindsweb/src/main/java/com/megion/site/blinds/setup/MegionSiteModule.java | 791 | package com.megion.site.blinds.setup;
import info.magnolia.module.ModuleLifecycle;
import info.magnolia.module.ModuleLifecycleContext;
import info.magnolia.module.blossom.module.BlossomModuleSupport;
/**
* Module class that starts and stops Spring when called by Magnolia.
*/
public class MegionSiteModule extends BlossomModuleSupport implements ModuleLifecycle {
@Override
public void start(ModuleLifecycleContext moduleLifecycleContext) {
initRootWebApplicationContext("classpath:/applicationContext.xml");
initBlossomDispatcherServlet("blossom", "classpath:/blossom-servlet.xml");
}
@Override
public void stop(ModuleLifecycleContext moduleLifecycleContext) {
destroyDispatcherServlets();
closeRootWebApplicationContext();
}
}
| gpl-2.0 |
sdecri/SetMp3Tags | src/progetto/Start.java | 632 | package progetto;
import java.io.File;
public class Start {
public static void main(String[]args) {
//elimino prima i log delle interruzioni precedenti
File []fileInDirectory=getNamesFile(System.getProperty("user.dir"));//file della cartella in cui si trova il programma
for(int i=0;i<fileInDirectory.length;i++)
if(fileInDirectory[i].getName().startsWith("hs_err_pid"))
fileInDirectory[i].delete();
new WindowTypeSetting();
}
//cartella = directory absolute path
private static File[] getNamesFile(String path) {
File cartella = new File(path);
return cartella.listFiles();
}
}
| gpl-2.0 |
h3xstream/Benchmark | src/main/java/org/owasp/benchmark/testcode/BenchmarkTest01748.java | 3490 | /**
* OWASP Benchmark Project v1.2
*
* This file is part of the Open Web Application Security Project (OWASP)
* Benchmark Project. For details, please see
* <a href="https://owasp.org/www-project-benchmark/">https://owasp.org/www-project-benchmark/</a>.
*
* The OWASP Benchmark is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation, version 2.
*
* The OWASP Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* @author Dave Wichers
* @created 2015
*/
package org.owasp.benchmark.testcode;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(value="/pathtraver-02/BenchmarkTest01748")
public class BenchmarkTest01748 extends HttpServlet {
private static final long serialVersionUID = 1L;
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
org.owasp.benchmark.helpers.SeparateClassRequest scr = new org.owasp.benchmark.helpers.SeparateClassRequest( request );
String param = scr.getTheValue("BenchmarkTest01748");
String bar = new Test().doSomething(request, param);
String fileName = null;
java.io.FileInputStream fis = null;
try {
fileName = org.owasp.benchmark.helpers.Utils.TESTFILES_DIR + bar;
fis = new java.io.FileInputStream(new java.io.File(fileName));
byte[] b = new byte[1000];
int size = fis.read(b);
response.getWriter().println(
"The beginning of file: '" + org.owasp.esapi.ESAPI.encoder().encodeForHTML(fileName)
+ "' is:\n\n" + org.owasp.esapi.ESAPI.encoder().encodeForHTML(new String(b,0,size))
);
} catch (Exception e) {
System.out.println("Couldn't open FileInputStream on file: '" + fileName + "'");
response.getWriter().println(
"Problem getting FileInputStream: "
+ org.owasp.esapi.ESAPI.encoder().encodeForHTML(e.getMessage())
);
} finally {
if (fis != null) {
try {
fis.close();
fis = null;
} catch (Exception e) {
// we tried...
}
}
}
} // end doPost
private class Test {
public String doSomething(HttpServletRequest request, String param) throws ServletException, IOException {
String bar = "alsosafe";
if (param != null) {
java.util.List<String> valuesList = new java.util.ArrayList<String>( );
valuesList.add("safe");
valuesList.add( param );
valuesList.add( "moresafe" );
valuesList.remove(0); // remove the 1st safe value
bar = valuesList.get(1); // get the last 'safe' value
}
return bar;
}
} // end innerclass Test
} // end DataflowThruInnerClass
| gpl-2.0 |
Motwin/ContextAwareLibrary | Android/ContextAwareAndroidLib/com.motwin.android.contextaware/src/main/java/com/motwin/android/context/collector/impl/MobileNetworkCodeCollector.java | 2876 | /**
*
*/
package com.motwin.android.context.collector.impl;
import android.content.Context;
import android.telephony.TelephonyManager;
import com.google.common.base.Preconditions;
import com.motwin.android.context.ContextAware;
import com.motwin.android.context.collector.AbstractOneShotCollector;
import com.motwin.android.context.model.ContextElement;
import com.motwin.android.network.clientchannel.ClientChannel;
/**
* Mobile network code one shot collector
*
*/
public class MobileNetworkCodeCollector extends AbstractOneShotCollector<String> {
private final TelephonyManager telephonyManager;
/**
* Constructor
*
* @param aClientChannel
* The ClientChannel that will be used to send context elements
* @param aApplicationContext
* The application context
*/
public MobileNetworkCodeCollector(ClientChannel aClientChannel, Context aApplicationContext) {
this(aClientChannel, aApplicationContext, (TelephonyManager) aApplicationContext
.getSystemService(Context.TELEPHONY_SERVICE));
}
/**
* Constructor
*
* @param aClientChannel
* The ClientChannel that will be used to send context elements
* @param aApplicationContext
* The application context
* @param aTelephonyManager
* The telephony manager
*
*/
protected MobileNetworkCodeCollector(ClientChannel aClientChannel, Context aApplicationContext,
TelephonyManager aTelephonyManager) {
super(aClientChannel, aApplicationContext);
telephonyManager = Preconditions
.checkNotNull(
aTelephonyManager,
"aTelephonyManager cannot be null. Check that permission \"android.permission.READ_PHONE_STATE\" is declared in your AndroidManifest.xml");
}
@Override
public ContextElement<String> collect() {
/**
* networkCode cann be null if the SIM state is not SIM_STATE_READY
*/
String networkOperator = telephonyManager.getSimOperator();
String networkCode = "n.a";
if (networkOperator != null && !(networkOperator.length() == 0)) {
networkCode = retrieveNetworkCode(networkOperator);
}
ContextElement<String> contextElement = new ContextElement<String>(ContextAware.MOBILE_NETWORK_CODE_KEY,
networkCode);
return contextElement;
}
/**
* Retrive the network code from the NetworkOperator which Returns the
* numeric name (MCC+MNC) of current registered operator.
*
* @param aNetworkOperator
* @return the network Code
*/
private String retrieveNetworkCode(String aNetworkOperator) {
String networkCode = aNetworkOperator.substring(3);
return networkCode;
}
}
| gpl-2.0 |
Simon-Kaz/AppiumSauce | src/main/java/utils/WebViewUtil.java | 630 | package utils;
import io.appium.java_client.AppiumDriver;
import java.util.Set;
public class WebViewUtil {
private AppiumDriver driver;
public WebViewUtil(AppiumDriver driver) {
this.driver = driver;
}
public void switchToWebView() {
Set<String> listOfViews = driver.getContextHandles();
listOfViews.stream().filter(view -> view.contains("WEBVIEW")).forEach(driver::context);
}
public void switchToNativeView() {
Set<String> listOfViews = driver.getContextHandles();
listOfViews.stream().filter(view -> view.contains("NATIVE")).forEach(driver::context);
}
} | gpl-2.0 |
joefresna/PlosONE-Reina2015 | src/utils/XORShiftRandom.java | 503 | package utils;
import java.util.Random;
/**
* A subclass of java.util.random that implements the
* Xorshift random number generator
*/
public class XORShiftRandom extends Random {
private static final long serialVersionUID = 4571537475330642112L;
private long seed;
public XORShiftRandom(long seed) {
this.seed = seed;
}
protected int next(int nbits) {
long x = seed;
x ^= (x << 21);
x ^= (x >>> 35);
x ^= (x << 4);
seed = x;
x &= ((1L << nbits) - 1);
return (int) x;
}
}
| gpl-2.0 |
jjfumero/fastr | com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/ObjectSizeFactory.java | 2105 | /*
* Copyright (c) 2016, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.truffle.r.runtime.data;
import com.oracle.truffle.r.runtime.data.RObjectSize.IgnoreObjectHandler;
import com.oracle.truffle.r.runtime.data.RObjectSize.TypeCustomizer;
public abstract class ObjectSizeFactory {
static {
final String prop = System.getProperty("fastr.objectsize.factory.class", "com.oracle.truffle.r.runtime.data.AgentObjectSizeFactory");
try {
theInstance = (ObjectSizeFactory) Class.forName(prop).newInstance();
} catch (Exception ex) {
// CheckStyle: stop system..print check
System.err.println("Failed to instantiate class: " + prop);
}
}
private static ObjectSizeFactory theInstance;
public static ObjectSizeFactory getInstance() {
return theInstance;
}
/**
* See {@link RObjectSize#getObjectSize}.
*/
public abstract long getObjectSize(Object obj, IgnoreObjectHandler ignoreObjectHandler);
public abstract void registerTypeCustomizer(Class<?> klass, TypeCustomizer typeCustomizer);
}
| gpl-2.0 |
christianchristensen/resin | modules/resin/src/com/caucho/server/rewrite/FilterChainMapper.java | 1278 | /*
* Copyright (c) 1998-2010 Caucho Technology -- all rights reserved
*
* This file is part of Resin(R) Open Source
*
* Each copy or derived work must preserve the copyright notice and this
* notice unmodified.
*
* Resin Open Source is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Resin Open Source is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
* of NON-INFRINGEMENT. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with Resin Open Source; if not, write to the
*
* Free Software Foundation, Inc.
* 59 Temple Place, Suite 330
* Boston, MA 02111-1307 USA
*
* @author Sam
*/
package com.caucho.server.rewrite;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
public interface FilterChainMapper
{
public FilterChain map(String uri, String queryString, FilterChain accept)
throws ServletException;
}
| gpl-2.0 |
Tallefer/bombus-qd | src/Client/ActiveContacts.java | 9372 | /*
* ActiveContacts.java
*
* Created on 20.01.2005, 21:20
* Copyright (c) 2005-2008, Eugene Stahov (evgs), http://bombus-im.org
* Copyright (c) 2009, Alexej Kotov (aqent), http://bombusmod-qd.wen.ru
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* You can also redistribute and/or modify this program under the
* terms of the Psi License, specified in the accompanied COPYING
* file, as published by the Psi Project; either dated January 1st,
* 2005, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package Client;
import java.util.Enumeration;
import java.util.Vector;
//#ifndef MENU_LISTENER
//# import javax.microedition.lcdui.CommandListener;
//# import javax.microedition.lcdui.Command;
//#else
import Menu.MenuListener;
import Menu.Command;
import Menu.MyMenu;
//#endif
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import locale.SR;
import ui.MainBar;
import ui.VirtualElement;
import ui.VirtualList;
//#ifdef GRAPHICS_MENU
//# import ui.GMenu;
//# import ui.GMenuConfig;
//#endif
import Conference.ConferenceGroup;
/**
*
* @author EvgS,aqent
*/
public final class ActiveContacts
extends VirtualList
implements
//#ifndef MENU_LISTENER
//# CommandListener
//#else
MenuListener
//#endif
{
Vector activeContacts = new Vector(0);
private Display display;
private MainBar mainbar;
private Displayable parentView;
private int sortType = -1;
public static boolean isActive = false;
public void initCommands(){
cmdCancel=new Command(SR.get(SR.MS_BACK), Command.BACK, 99);
cmdOk=new Command(SR.get(SR.MS_SELECT), Command.SCREEN, 1);
cmdCreateMultiMessage=new Command(SR.get(SR.MS_MULTI_MESSAGE), Command.SCREEN, 3);
cmdSortType=new Command(SR.get(SR.MS_SORT_TYPE), Command.SCREEN, 4);
cmdSortDefault=new Command(SR.get(SR.MS_SORT_TYPE_DEF), Command.SCREEN, 5);
cmdSortByStatus=new Command(SR.get(SR.MS_SORT_TYPE_STATUS), Command.SCREEN, 6);
cmdSortByMsgsCount=new Command(SR.get(SR.MS_SORT_TYPE_MSGS), Command.SCREEN, 7);
cmdClearAllMessages=new Command(SR.get(SR.MS_CLEAN_ALL_MESSAGES), Command.SCREEN, 35);
}
private Command cmdCancel;
private Command cmdOk;
private Command cmdCreateMultiMessage;
private Command cmdSortType;
private Command cmdSortDefault;
private Command cmdSortByStatus;
private Command cmdSortByMsgsCount;
private Command cmdClearAllMessages;
private long lasttime = 0;
private long current = 0;
private Contact opened;
public void sort(){
current = System.currentTimeMillis();
if(lasttime==0) lasttime = System.currentTimeMillis() + 10000;
//System.out.println( (current - lasttime) );
if( (current - lasttime) < 500 ) { //0.5sec
lasttime = current;
return;
}
switch(sortType) {
case -1: break;
case 0: sort(activeContacts, 0, 0); break;//byStatus
case 1: sort(activeContacts, 0, 1); break;//byMsgsCount
}
lasttime = current;
}
public boolean setActiveContacts(Displayable pView, Contact current){
this.parentView=pView;
this.opened = current;
commandState();
activeContacts = new Vector(0);
Contact c = null;
Vector hContacts = midlet.BombusQD.sd.roster.getHContacts();
int size=hContacts.size();
for(int i=0;i<size;i++){
c=(Contact)hContacts.elementAt(i);
if (c.active()) activeContacts.addElement(c);
}
if (getItemCount()==0) return false;
//System.out.println(activeContacts.toString());
isActive = true;
sort();
mainbar.setElementAt( Integer.toString(getItemCount()) , 0 );
try {
focusToContact(current);
hContacts = null;
} catch (Exception e) { }
return true;
}
/** Creates a new instance of ActiveContacts */
public ActiveContacts(Display display, Displayable pView) {
//super();
this.display = display;
mainbar=new MainBar(2, String.valueOf(getItemCount()), " ", false);
mainbar.addElement(SR.get(SR.MS_ACTIVE_CONTACTS));
setMainBarItem(mainbar);
}
public void commandState() {
//#ifdef MENU_LISTENER
menuCommands.removeAllElements();
cmdfirstList.removeAllElements();
//#endif
if(cmdOk == null) initCommands();
addCommand(cmdOk); cmdOk.setImg(0x43);
addCommand(cmdCreateMultiMessage); cmdCreateMultiMessage.setImg(0x81);
addCommand(cmdSortType); cmdSortType.setImg(0x64);
addInCommand(1,cmdSortDefault); cmdSortDefault.setImg(0x64);
addInCommand(1,cmdSortByStatus); cmdSortByStatus.setImg(0x64);
addInCommand(1,cmdSortByMsgsCount); cmdSortByMsgsCount.setImg(0x64);
addCommand(cmdClearAllMessages); cmdClearAllMessages.setImg(0x41);
}
//#ifdef MENU_LISTENER
//#ifdef GRAPHICS_MENU
//# public int showGraphicsMenu() {
//# menuItem = new GMenu(display, parentView, this, null, menuCommands, cmdfirstList, null, null);
//# GMenuConfig.getInstance().itemGrMenu = GMenu.ACTIVE_CONTACTS;
//# return GMenu.ACTIVE_CONTACTS;
//# }
//#else
public void showMenu() { eventOk();}
//#endif
//#endif
protected int getItemCount() {
if(activeContacts==null) return 0;
return activeContacts.size();
}
protected VirtualElement getItemRef(int index) {
return (VirtualElement) activeContacts.elementAt(index);
}
public void eventOk() {
Contact c=(Contact)getFocusedObject();
isActive = false;
if(Config.getInstance().module_classicchat)
new SimpleItemChat(display,midlet.BombusQD.sd.roster,(Contact)c);
else
display.setCurrent(c.getMessageList());
}
public void commandAction(Command c, Displayable d) {
if (c==cmdCancel) destroyView();
if (c==cmdOk) eventOk();
if (c==cmdCreateMultiMessage) {
isActive = false;
midlet.BombusQD.sd.roster.createMultiMessage(this,activeContacts);
}
if (c==cmdClearAllMessages) {
midlet.BombusQD.sd.roster.cmdCleanAllMessages();
}
if (c==cmdSortDefault) {
sortType = -1;
//sort(activeContacts);
}
if (c==cmdSortByStatus) {
sortType = 0;
sort();
}
if (c==cmdSortByMsgsCount) {
sortType = 1;
sort();
}
}
public void keyPressed(int keyCode) {
kHold=0;
//#ifdef POPUPS
VirtualList.popup.next();
//#endif
sort();
if (keyCode==KEY_NUM3) {
destroyView();
} else if (keyCode==KEY_NUM0) {
if (getItemCount()<1)
return;
Contact c=(Contact)getFocusedObject();
Enumeration i=activeContacts.elements();
int pass=0;
while (pass<2) {
if (!i.hasMoreElements()) i=activeContacts.elements();
Contact p=(Contact)i.nextElement();
if (pass==1)
if (p.getNewMsgsCount()>0) {
focusToContact(p);
setRotator();
break;
}
if (p==c) pass++;
}
return;
} else super.keyPressed(keyCode);
}
private void focusToContact(final Contact c) {
int index=activeContacts.indexOf(c);
if (index>=0)
moveCursorTo(index);
}
protected void keyGreen(){
eventOk();
}
protected void keyClear () {
Contact c = (Contact)getFocusedObject();
try{
c.purge();
activeContacts.removeElementAt(cursor);
mainbar.setElementAt(Integer.toString(getItemCount()), 0);
c = null;
} catch (Exception e){
//#ifdef CONSOLE
//# if(midlet.BombusQD.cf.debug) midlet.BombusQD.debug.add("::ActiveContacts->Exception->"+c,10);
//#endif
}
}
public void destroyView() {
isActive = false;
midlet.BombusQD.sd.roster.reEnumRoster();
if(null == parentView || !activeContacts.contains(opened) ) midlet.BombusQD.sd.roster.showRoster();
else display.setCurrent(parentView);
}
//#ifdef MENU_LISTENER
public String touchLeftCommand(){ return SR.get(SR.MS_SELECT); }
public String touchRightCommand(){ return SR.get(SR.MS_BACK); }
//#endif
}
| gpl-2.0 |
tuomount/JHeroes | src/org/jheroes/game/storyscreen/Screens.java | 7642 | package org.jheroes.game.storyscreen;
import java.net.URL;
/**
*
* JHeroes CRPG Engine and Game
* Copyright (C) 2014 Tuomo Untinen
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see http://www.gnu.org/licenses/
*
*
*
* Contains url/paths to certain screen to be used in story screens
*
*/
public class Screens {
/**
* Screen used in Start screen demo as screen 1
*/
public static final URL START_SCREEN_1 = Screens.class.getResource("/res/images/main.png");
/**
* Screen used in Start screen demo as screen 2
*/
public static final URL CROWN_IMAGE = Screens.class.getResource("/res/images/crown.png");
/**
* Screen used in End story Throne room
*/
public static final URL THRONE_ROOM_IMAGE = Screens.class.getResource("/res/images/throneroom.png");
/**
* Screen used in End story good party
*/
public static final URL GOOD_PARTY_IMAGE = Screens.class.getResource("/res/images/goodparty.png");
/**
* Screen used in End story good party in cave
*/
public static final URL GOOD_PARTY_CAVE_IMAGE = Screens.class.getResource("/res/images/goodpartycave.png");
/**
* Screen used in End story evil party
*/
public static final URL EVIL_PARTY_IMAGE = Screens.class.getResource("/res/images/evilparty.png");
/**
* Screen used in End story good party in cave
*/
public static final URL EVIL_PARTY_CAVE_IMAGE = Screens.class.getResource("/res/images/evilpartycave.png");
/**
* Screen used in End story when farm makes an excellent year
*/
public static final URL FARM_CARTS_IMAGE = Screens.class.getResource("/res/images/carts.png");
/**
* Screen used in End story when farm dies
*/
public static final URL FARM_GONE_IMAGE = Screens.class.getResource("/res/images/FarmGone.png");
/**
* Screen used in End story Well of death
*/
public static final URL WELL_OF_DEATH_IMAGE = Screens.class.getResource("/res/images/wellOfDeath.png");
/**
* Screen used in End story Fresh Well
*/
public static final URL FRESH_WELL_IMAGE = Screens.class.getResource("/res/images/freshwell.png");
/**
* Screen used in End story LonelyInnSuccess
*/
public static final URL LONELY_INN_SUCCESS_IMAGE = Screens.class.getResource("/res/images/lonelyInnSuccess.png");
/**
* Screen used in End story LonelyInnNoMore
*/
public static final URL LONELY_INN_NO_MORE_IMAGE = Screens.class.getResource("/res/images/lonelyInnNoMore.png");
/**
* Screen used in End story Necromancer Tower
*/
public static final URL NECROMANCER_TOWER_IMAGE = Screens.class.getResource("/res/images/NecromancerTower.png");
/**
* Screen used in End story Hobgoblin Cave 1
*/
public static final URL HOBGOBLIN_CAVE_1_IMAGE = Screens.class.getResource("/res/images/hobgoblincave1.png");
/**
* Screen used in End story Hobgoblin Cave 2
*/
public static final URL HOBGOBLIN_CAVE_2_IMAGE = Screens.class.getResource("/res/images/hobgoblincave2.png");
/**
* Screen used in End story Kerry Silverblade
*/
public static final URL KERRY_SILVERBLADE_IMAGE = Screens.class.getResource("/res/images/kerrysilverblade.png");
/**
* Screen used in End story Orphan Kids
*/
public static final URL ORPHAN_KIDS_IMAGE = Screens.class.getResource("/res/images/orphankids.png");
/**
* Screen used in End story Witches
*/
public static final URL WITCHES_IMAGE = Screens.class.getResource("/res/images/witches.png");
/**
* Screen used in End story Mage guild fire
*/
public static final URL MAGE_GUILD_FIRE_IMAGE = Screens.class.getResource("/res/images/mageguildfire.png");
/**
* Screen used in End story Thieves guild destruction
*/
public static final URL THIEVES_GUILD_DESTRUCTION_IMAGE = Screens.class.getResource("/res/images/thievesguilddestruction.png");
/**
* Screen used in End story Heroon take over
*/
public static final URL HEROON_TAKE_OVER_IMAGE = Screens.class.getResource("/res/images/heroontakeover.png");
/**
* Screen used in End story Temple
*/
public static final URL TEMPLE_IMAGE = Screens.class.getResource("/res/images/temple.png");
/**
* Screen used in End Temple broke
*/
public static final URL TEMPLE_BROKE_IMAGE = Screens.class.getResource("/res/images/templebroke.png");
/**
* Screen used in End Temple Pilgrims
*/
public static final URL TEMPLE_PILGRIMS_IMAGE = Screens.class.getResource("/res/images/templePilgrims.png");
/**
* Screen used in End story dead dog
*/
public static final URL DEAD_DOG_IMAGE = Screens.class.getResource("/res/images/skeletonAndDog.png");
/**
* Screen used in End story lottery
*/
public static final URL LOTTERY_IMAGE = Screens.class.getResource("/res/images/lotterwin.png");
/**
* Screen used in End story marriage
*/
public static final URL MARRIAGE_IMAGE = Screens.class.getResource("/res/images/marriage.png");
/**
* Screen used in End story grave
*/
public static final URL GRAVE_IMAGE = Screens.class.getResource("/res/images/grave.png");
/**
* Screen used in End story Larek Fisherman
*/
public static final URL LAREK_FISHERMAN_IMAGE = Screens.class.getResource("/res/images/LarekFisherman.png");
/**
* Screen used in End story Larek drown
*/
public static final URL LAREK_DROWN_IMAGE = Screens.class.getResource("/res/images/fisherman.png");
/**
* Screen used in End story Riverton occupied
*/
public static final URL RIVERTON_OCCUPIED_IMAGE = Screens.class.getResource("/res/images/rivertonOccupied.png");
/**
* Screen used in End story Riverton
*/
public static final URL RIVERTON_IMAGE = Screens.class.getResource("/res/images/riverton.png");
/**
* Screen used in End story Ghost Ship
*/
public static final URL GHOST_SHIP_IMAGE = Screens.class.getResource("/res/images/ghostship.png");
/**
* Screen used in End story Treasure chest
*/
public static final URL TREASURE_CHEST_IMAGE = Screens.class.getResource("/res/images/treasure-chest.png");
/**
* Screen used in End story lost island
*/
public static final URL LOST_ISLAND_IMAGE = Screens.class.getResource("/res/images/lostisland.png");
/**
* Screen used in End story Crystal lake neutral
*/
public static final URL CRYSTAL_LAKE_NEUTRAL_IMAGE = Screens.class.getResource("/res/images/crystallake_neutral.png");
/**
* Screen used in End story Crystal lake evil
*/
public static final URL CRYSTAL_LAKE_EVIL_IMAGE = Screens.class.getResource("/res/images/crystallake_evil.png");
/**
* Screen used in End story Crystal lake good
*/
public static final URL CRYSTAL_LAKE_GOOD_IMAGE = Screens.class.getResource("/res/images/crystallake_good.png");
/**
* Screen used in End story drunken safe
*/
public static final URL DRUNKENMAN_IMAGE = Screens.class.getResource("/res/images/drunkenman.png");
/**
* Screen used in End story drunken man snatcher
*/
public static final URL DRUNKENMAN_SNATCHER_IMAGE = Screens.class.getResource("/res/images/drunkenmansnatcher.png");
}
| gpl-2.0 |
jeffgdotorg/opennms | smoke-test/src/test/java/org/opennms/smoketest/graph/GraphMLGraphProviderIT.java | 3604 | /*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2016-2017 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2017 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
*
* OpenNMS(R) is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* OpenNMS(R) is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with OpenNMS(R). If not, see:
* http://www.gnu.org/licenses/
*
* For more information contact:
* OpenNMS(R) Licensing <license@opennms.org>
* http://www.opennms.org/
* http://www.opennms.com/
*******************************************************************************/
package org.opennms.smoketest.graph;
import java.io.IOException;
import org.junit.After;
import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
import org.opennms.smoketest.OpenNMSSeleniumIT;
import org.opennms.smoketest.graphml.GraphmlDocument;
import org.opennms.smoketest.utils.KarafShell;
import org.opennms.smoketest.utils.RestClient;
/**
* Tests the 'GraphML' Topology Provider
*
* @author mvrueden
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class GraphMLGraphProviderIT extends OpenNMSSeleniumIT {
private static final String LABEL = "GraphML Topology Provider (test-graph)";
private final RestClient restClient = stack.opennms().getRestClient();
private final GraphmlDocument graphmlDocument = new GraphmlDocument("test-graph", "/topology/graphml/test-topology.xml");
private KarafShell karafShell = new KarafShell(stack.opennms().getSshAddress());
@Before
public void setUp() throws IOException, InterruptedException {
// Sometimes a previous run did not clean up properly,
// so we do that before we import a graph
if (existsGraph()) {
deleteGraph();
}
}
@After
public void tearDown() throws IOException, InterruptedException {
if (existsGraph()) {
deleteGraph();
}
}
@Test
public void canExposeGraphML() throws InterruptedException {
karafShell.runCommand("opennms:graph-list", output -> output.contains("4 registered Graph Container(s)"));
importGraph();
karafShell.runCommand("opennms:graph-list -a", output -> output.contains("5 registered Graph Container(s)")
&& output.contains("6 registered Graph(s)")
&& output.contains(LABEL));
}
private boolean existsGraph() {
return graphmlDocument.exists(restClient);
}
private void importGraph() throws InterruptedException {
graphmlDocument.create(restClient);
// We wait to give the GraphMLMetaTopologyFactory the chance to initialize the new Topology
Thread.sleep(20000);
}
private void deleteGraph() throws InterruptedException {
graphmlDocument.delete(restClient);
// We wait to give the GraphMLMetaTopologyFactory the chance to clean up afterwards
Thread.sleep(20000);
}
}
| gpl-2.0 |
guod08/druid | indexing-service/src/main/java/io/druid/indexing/common/index/ChatHandlerProvider.java | 1115 | /*
* Druid - a distributed column store.
* Copyright (C) 2012, 2013 Metamarkets Group Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package io.druid.indexing.common.index;
import com.google.common.base.Optional;
/**
*/
public interface ChatHandlerProvider
{
public void register(final String key, ChatHandler handler);
public void unregister(final String key);
public Optional<ChatHandler> get(final String key);
}
| gpl-2.0 |
OrangeDugongo/UNI-Java | src/FigureGeometriche/ConfrontoPerimetro.java | 293 | public class ConfrontoPerimetro implements Confrontatore{
public boolean confronto(Object ob1, Object ob2){
FiguraGeometrica fg1 = (FiguraGeometrica) ob1;
FiguraGeometrica fg2 = (FiguraGeometrica) ob2;
return fg1.calcolaPerimetro()>fg2.calcolaPerimetro();
}
} | gpl-2.0 |
stelfrich/openmicroscopy | components/server/src/ome/services/graphs/RenderingDefGraphSpec.java | 2363 | /*
* Copyright (C) 2012 Glencoe Software, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package ome.services.graphs;
import java.util.List;
import ome.system.EventContext;
import ome.tools.hibernate.QueryBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* {@link AbstractHierarchyGraphSpec} specialized for processing light sources.
*
* @author Josh Moore, josh at glencoesoftware.com
* @since 4.4.4
* @deprecated will be removed in OMERO 5.2, so use the
* <a href="http://www.openmicroscopy.org/site/support/omero5.1/developers/Server/ObjectGraphs.html">new graphs implementation</a>
*/
@Deprecated
@SuppressWarnings("deprecation")
public class RenderingDefGraphSpec extends BaseGraphSpec {
private final static Logger log = LoggerFactory
.getLogger(RenderingDefGraphSpec.class);
//
// Initialization-time values
//
/**
* Creates a new instance.
*
* @param entries
* The entries to handle.
*/
public RenderingDefGraphSpec(List<String> entries) {
super(entries);
}
/**
* Uses direct SQL in order to workaround any security filters
* which may be in place since rdefs are considered outside of
* the security system.
*/
@Override
public QueryBuilder deleteQuery(EventContext ec, String table, GraphOpts opts) {
// Copied from BaseGraphSpec
final QueryBuilder qb = new QueryBuilder(true); // SQL QUERY #9496
qb.delete(table);
qb.where();
qb.and("id = :id");
if (!opts.isForce()) {
permissionsClause(ec, qb, true);
}
return qb;
}
}
| gpl-2.0 |
gstiebler/codemap | GraphGenerator/src/gvpl/clang/ClangSizeof.java | 625 | package gvpl.clang;
import org.eclipse.cdt.core.dom.ast.IASTExpression;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IType;
public class ClangSizeof extends ASTNode implements IASTExpression {
IASTExpression _expr;
public ClangSizeof(Cursor cursor, IASTNode parent) {
super(cursor.getLine(), parent);
cursor.nextLine();
_expr = ASTExpression.loadExpression(cursor.getSubCursor(), this);
}
@Override
public String toString() {
return "sizeof(" + _expr + ")";
}
@Override
public IType getExpressionType() {
logger.error("not implemented");
return null;
}
}
| gpl-2.0 |
myieye/german-verbs | app/src/main/java/com/timhaasdyk/german_verbs/util/Base64.java | 24273 | // Portions copyright 2002, Google, 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 com.timhaasdyk.german_verbs.util;
// This code was converted from code at http://iharder.sourceforge.net/base64/
// Lots of extraneous features were removed.
/* The original code said:
* <p>
* I am placing this code in the Public Domain. Do with it as you will.
* This software comes with no guarantees or warranties but with
* plenty of well-wishing instead!
* Please visit
* <a href="http://iharder.net/xmlizable">http://iharder.net/xmlizable</a>
* periodically to check for updates or to contribute improvements.
* </p>
*
* @author Robert Harder
* @author rharder@usa.net
* @version 1.3
*/
/**
* Base64 converter class. This code is not a complete MIME encoder;
* it simply converts binary data to base64 data and back.
*
* <p>Note {@link CharBase64} is a GWT-compatible implementation of this
* class.
*/
public class Base64 {
/** Specify encoding (value is {@code true}). */
public final static boolean ENCODE = true;
/** Specify decoding (value is {@code false}). */
public final static boolean DECODE = false;
/** The equals sign (=) as a byte. */
private final static byte EQUALS_SIGN = (byte) '=';
/** The new line character (\n) as a byte. */
private final static byte NEW_LINE = (byte) '\n';
/**
* The 64 valid Base64 values.
*/
private final static byte[] ALPHABET =
{(byte) 'A', (byte) 'B', (byte) 'C', (byte) 'D', (byte) 'E', (byte) 'F',
(byte) 'G', (byte) 'H', (byte) 'I', (byte) 'J', (byte) 'K',
(byte) 'L', (byte) 'M', (byte) 'N', (byte) 'O', (byte) 'P',
(byte) 'Q', (byte) 'R', (byte) 'S', (byte) 'T', (byte) 'U',
(byte) 'V', (byte) 'W', (byte) 'X', (byte) 'Y', (byte) 'Z',
(byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e',
(byte) 'f', (byte) 'g', (byte) 'h', (byte) 'i', (byte) 'j',
(byte) 'k', (byte) 'l', (byte) 'm', (byte) 'n', (byte) 'o',
(byte) 'p', (byte) 'q', (byte) 'r', (byte) 's', (byte) 't',
(byte) 'u', (byte) 'v', (byte) 'w', (byte) 'x', (byte) 'y',
(byte) 'z', (byte) '0', (byte) '1', (byte) '2', (byte) '3',
(byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8',
(byte) '9', (byte) '+', (byte) '/'};
/**
* The 64 valid web safe Base64 values.
*/
private final static byte[] WEBSAFE_ALPHABET =
{(byte) 'A', (byte) 'B', (byte) 'C', (byte) 'D', (byte) 'E', (byte) 'F',
(byte) 'G', (byte) 'H', (byte) 'I', (byte) 'J', (byte) 'K',
(byte) 'L', (byte) 'M', (byte) 'N', (byte) 'O', (byte) 'P',
(byte) 'Q', (byte) 'R', (byte) 'S', (byte) 'T', (byte) 'U',
(byte) 'V', (byte) 'W', (byte) 'X', (byte) 'Y', (byte) 'Z',
(byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e',
(byte) 'f', (byte) 'g', (byte) 'h', (byte) 'i', (byte) 'j',
(byte) 'k', (byte) 'l', (byte) 'm', (byte) 'n', (byte) 'o',
(byte) 'p', (byte) 'q', (byte) 'r', (byte) 's', (byte) 't',
(byte) 'u', (byte) 'v', (byte) 'w', (byte) 'x', (byte) 'y',
(byte) 'z', (byte) '0', (byte) '1', (byte) '2', (byte) '3',
(byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8',
(byte) '9', (byte) '-', (byte) '_'};
/**
* Translates a Base64 value to either its 6-bit reconstruction value
* or a negative number indicating some other meaning.
**/
private final static byte[] DECODABET = {-9, -9, -9, -9, -9, -9, -9, -9, -9, // Decimal 0 - 8
-5, -5, // Whitespace: Tab and Linefeed
-9, -9, // Decimal 11 - 12
-5, // Whitespace: Carriage Return
-9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, // Decimal 14 - 26
-9, -9, -9, -9, -9, // Decimal 27 - 31
-5, // Whitespace: Space
-9, -9, -9, -9, -9, -9, -9, -9, -9, -9, // Decimal 33 - 42
62, // Plus sign at decimal 43
-9, -9, -9, // Decimal 44 - 46
63, // Slash at decimal 47
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, // Numbers zero through nine
-9, -9, -9, // Decimal 58 - 60
-1, // Equals sign at decimal 61
-9, -9, -9, // Decimal 62 - 64
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, // Letters 'A' through 'N'
14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, // Letters 'O' through 'Z'
-9, -9, -9, -9, -9, -9, // Decimal 91 - 96
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, // Letters 'a' through 'm'
39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, // Letters 'n' through 'z'
-9, -9, -9, -9, -9 // Decimal 123 - 127
/* ,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 128 - 139
-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 140 - 152
-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 153 - 165
-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 166 - 178
-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 179 - 191
-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 192 - 204
-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 205 - 217
-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 218 - 230
-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 231 - 243
-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9 // Decimal 244 - 255 */
};
/** The web safe decodabet */
private final static byte[] WEBSAFE_DECODABET =
{-9, -9, -9, -9, -9, -9, -9, -9, -9, // Decimal 0 - 8
-5, -5, // Whitespace: Tab and Linefeed
-9, -9, // Decimal 11 - 12
-5, // Whitespace: Carriage Return
-9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, // Decimal 14 - 26
-9, -9, -9, -9, -9, // Decimal 27 - 31
-5, // Whitespace: Space
-9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, // Decimal 33 - 44
62, // Dash '-' sign at decimal 45
-9, -9, // Decimal 46-47
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, // Numbers zero through nine
-9, -9, -9, // Decimal 58 - 60
-1, // Equals sign at decimal 61
-9, -9, -9, // Decimal 62 - 64
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, // Letters 'A' through 'N'
14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, // Letters 'O' through 'Z'
-9, -9, -9, -9, // Decimal 91-94
63, // Underscore '_' at decimal 95
-9, // Decimal 96
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, // Letters 'a' through 'm'
39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, // Letters 'n' through 'z'
-9, -9, -9, -9, -9 // Decimal 123 - 127
/* ,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 128 - 139
-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 140 - 152
-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 153 - 165
-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 166 - 178
-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 179 - 191
-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 192 - 204
-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 205 - 217
-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 218 - 230
-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 231 - 243
-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9 // Decimal 244 - 255 */
};
// Indicates white space in encoding
private final static byte WHITE_SPACE_ENC = -5;
// Indicates equals sign in encoding
private final static byte EQUALS_SIGN_ENC = -1;
/** Defeats instantiation. */
private Base64() {
}
/* ******** E N C O D I N G M E T H O D S ******** */
/**
* Encodes up to three bytes of the array <var>source</var>
* and writes the resulting four Base64 bytes to <var>destination</var>.
* The source and destination arrays can be manipulated
* anywhere along their length by specifying
* <var>srcOffset</var> and <var>destOffset</var>.
* This method does not check to make sure your arrays
* are large enough to accommodate <var>srcOffset</var> + 3 for
* the <var>source</var> array or <var>destOffset</var> + 4 for
* the <var>destination</var> array.
* The actual number of significant bytes in your array is
* given by <var>numSigBytes</var>.
*
* @param source the array to convert
* @param srcOffset the index where conversion begins
* @param numSigBytes the number of significant bytes in your array
* @param destination the array to hold the conversion
* @param destOffset the index where output will be put
* @param alphabet is the encoding alphabet
* @return the <var>destination</var> array
* @since 1.3
*/
private static byte[] encode3to4(byte[] source, int srcOffset,
int numSigBytes, byte[] destination, int destOffset, byte[] alphabet) {
// 1 2 3
// 01234567890123456789012345678901 Bit position
// --------000000001111111122222222 Array position from threeBytes
// --------| || || || | Six bit groups to index alphabet
// >>18 >>12 >> 6 >> 0 Right shift necessary
// 0x3f 0x3f 0x3f Additional AND
// Create buffer with zero-padding if there are only one or two
// significant bytes passed in the array.
// We have to shift left 24 in order to flush out the 1's that appear
// when Java treats a value as negative that is cast from a byte to an int.
int inBuff =
(numSigBytes > 0 ? ((source[srcOffset] << 24) >>> 8) : 0)
| (numSigBytes > 1 ? ((source[srcOffset + 1] << 24) >>> 16) : 0)
| (numSigBytes > 2 ? ((source[srcOffset + 2] << 24) >>> 24) : 0);
switch (numSigBytes) {
case 3:
destination[destOffset] = alphabet[(inBuff >>> 18)];
destination[destOffset + 1] = alphabet[(inBuff >>> 12) & 0x3f];
destination[destOffset + 2] = alphabet[(inBuff >>> 6) & 0x3f];
destination[destOffset + 3] = alphabet[(inBuff) & 0x3f];
return destination;
case 2:
destination[destOffset] = alphabet[(inBuff >>> 18)];
destination[destOffset + 1] = alphabet[(inBuff >>> 12) & 0x3f];
destination[destOffset + 2] = alphabet[(inBuff >>> 6) & 0x3f];
destination[destOffset + 3] = EQUALS_SIGN;
return destination;
case 1:
destination[destOffset] = alphabet[(inBuff >>> 18)];
destination[destOffset + 1] = alphabet[(inBuff >>> 12) & 0x3f];
destination[destOffset + 2] = EQUALS_SIGN;
destination[destOffset + 3] = EQUALS_SIGN;
return destination;
default:
return destination;
} // end switch
} // end encode3to4
/**
* Encodes a byte array into Base64 notation.
* Equivalent to calling
* {@code encodeBytes(source, 0, source.length)}
*
* @param source The data to convert
* @since 1.4
*/
public static String encode(byte[] source) {
return encode(source, 0, source.length, ALPHABET, true);
}
/**
* Encodes a byte array into web safe Base64 notation.
*
* @param source The data to convert
* @param doPadding is {@code true} to pad result with '=' chars
* if it does not fall on 3 byte boundaries
*/
public static String encodeWebSafe(byte[] source, boolean doPadding) {
return encode(source, 0, source.length, WEBSAFE_ALPHABET, doPadding);
}
/**
* Encodes a byte array into Base64 notation.
*
* @param source the data to convert
* @param off offset in array where conversion should begin
* @param len length of data to convert
* @param alphabet the encoding alphabet
* @param doPadding is {@code true} to pad result with '=' chars
* if it does not fall on 3 byte boundaries
* @since 1.4
*/
public static String encode(byte[] source, int off, int len, byte[] alphabet,
boolean doPadding) {
byte[] outBuff = encode(source, off, len, alphabet, Integer.MAX_VALUE);
int outLen = outBuff.length;
// If doPadding is false, set length to truncate '='
// padding characters
while (doPadding == false && outLen > 0) {
if (outBuff[outLen - 1] != '=') {
break;
}
outLen -= 1;
}
return new String(outBuff, 0, outLen);
}
/**
* Encodes a byte array into Base64 notation.
*
* @param source the data to convert
* @param off offset in array where conversion should begin
* @param len length of data to convert
* @param alphabet is the encoding alphabet
* @param maxLineLength maximum length of one line.
* @return the BASE64-encoded byte array
*/
public static byte[] encode(byte[] source, int off, int len, byte[] alphabet,
int maxLineLength) {
int lenDiv3 = (len + 2) / 3; // ceil(len / 3)
int len43 = lenDiv3 * 4;
byte[] outBuff = new byte[len43 // Main 4:3
+ (len43 / maxLineLength)]; // New lines
int d = 0;
int e = 0;
int len2 = len - 2;
int lineLength = 0;
for (; d < len2; d += 3, e += 4) {
// The following block of code is the same as
// encode3to4( source, d + off, 3, outBuff, e, alphabet );
// but inlined for faster encoding (~20% improvement)
int inBuff =
((source[d + off] << 24) >>> 8)
| ((source[d + 1 + off] << 24) >>> 16)
| ((source[d + 2 + off] << 24) >>> 24);
outBuff[e] = alphabet[(inBuff >>> 18)];
outBuff[e + 1] = alphabet[(inBuff >>> 12) & 0x3f];
outBuff[e + 2] = alphabet[(inBuff >>> 6) & 0x3f];
outBuff[e + 3] = alphabet[(inBuff) & 0x3f];
lineLength += 4;
if (lineLength == maxLineLength) {
outBuff[e + 4] = NEW_LINE;
e++;
lineLength = 0;
} // end if: end of line
} // end for: each piece of array
if (d < len) {
encode3to4(source, d + off, len - d, outBuff, e, alphabet);
lineLength += 4;
if (lineLength == maxLineLength) {
// Add a last newline
outBuff[e + 4] = NEW_LINE;
e++;
}
e += 4;
}
assert (e == outBuff.length);
return outBuff;
}
/* ******** D E C O D I N G M E T H O D S ******** */
/**
* Decodes four bytes from array <var>source</var>
* and writes the resulting bytes (up to three of them)
* to <var>destination</var>.
* The source and destination arrays can be manipulated
* anywhere along their length by specifying
* <var>srcOffset</var> and <var>destOffset</var>.
* This method does not check to make sure your arrays
* are large enough to accommodate <var>srcOffset</var> + 4 for
* the <var>source</var> array or <var>destOffset</var> + 3 for
* the <var>destination</var> array.
* This method returns the actual number of bytes that
* were converted from the Base64 encoding.
*
*
* @param source the array to convert
* @param srcOffset the index where conversion begins
* @param destination the array to hold the conversion
* @param destOffset the index where output will be put
* @param decodabet the decodabet for decoding Base64 content
* @return the number of decoded bytes converted
* @since 1.3
*/
private static int decode4to3(byte[] source, int srcOffset,
byte[] destination, int destOffset, byte[] decodabet) {
// Example: Dk==
if (source[srcOffset + 2] == EQUALS_SIGN) {
int outBuff =
((decodabet[source[srcOffset]] << 24) >>> 6)
| ((decodabet[source[srcOffset + 1]] << 24) >>> 12);
destination[destOffset] = (byte) (outBuff >>> 16);
return 1;
} else if (source[srcOffset + 3] == EQUALS_SIGN) {
// Example: DkL=
int outBuff =
((decodabet[source[srcOffset]] << 24) >>> 6)
| ((decodabet[source[srcOffset + 1]] << 24) >>> 12)
| ((decodabet[source[srcOffset + 2]] << 24) >>> 18);
destination[destOffset] = (byte) (outBuff >>> 16);
destination[destOffset + 1] = (byte) (outBuff >>> 8);
return 2;
} else {
// Example: DkLE
int outBuff =
((decodabet[source[srcOffset]] << 24) >>> 6)
| ((decodabet[source[srcOffset + 1]] << 24) >>> 12)
| ((decodabet[source[srcOffset + 2]] << 24) >>> 18)
| ((decodabet[source[srcOffset + 3]] << 24) >>> 24);
destination[destOffset] = (byte) (outBuff >> 16);
destination[destOffset + 1] = (byte) (outBuff >> 8);
destination[destOffset + 2] = (byte) (outBuff);
return 3;
}
} // end decodeToBytes
/**
* Decodes data from Base64 notation.
*
* @param s the string to decode (decoded in default encoding)
* @return the decoded data
* @since 1.4
*/
public static byte[] decode(String s) throws Base64DecoderException {
byte[] bytes = s.getBytes();
return decode(bytes, 0, bytes.length);
}
/**
* Decodes data from web safe Base64 notation.
* Web safe encoding uses '-' instead of '+', '_' instead of '/'
*
* @param s the string to decode (decoded in default encoding)
* @return the decoded data
*/
public static byte[] decodeWebSafe(String s) throws Base64DecoderException {
byte[] bytes = s.getBytes();
return decodeWebSafe(bytes, 0, bytes.length);
}
/**
* Decodes Base64 content in byte array format and returns
* the decoded byte array.
*
* @param source The Base64 encoded data
* @return decoded data
* @since 1.3
* @throws Base64DecoderException
*/
public static byte[] decode(byte[] source) throws Base64DecoderException {
return decode(source, 0, source.length);
}
/**
* Decodes web safe Base64 content in byte array format and returns
* the decoded data.
* Web safe encoding uses '-' instead of '+', '_' instead of '/'
*
* @param source the string to decode (decoded in default encoding)
* @return the decoded data
*/
public static byte[] decodeWebSafe(byte[] source)
throws Base64DecoderException {
return decodeWebSafe(source, 0, source.length);
}
/**
* Decodes Base64 content in byte array format and returns
* the decoded byte array.
*
* @param source the Base64 encoded data
* @param off the offset of where to begin decoding
* @param len the length of characters to decode
* @return decoded data
* @since 1.3
* @throws Base64DecoderException
*/
public static byte[] decode(byte[] source, int off, int len)
throws Base64DecoderException {
return decode(source, off, len, DECODABET);
}
/**
* Decodes web safe Base64 content in byte array format and returns
* the decoded byte array.
* Web safe encoding uses '-' instead of '+', '_' instead of '/'
*
* @param source the Base64 encoded data
* @param off the offset of where to begin decoding
* @param len the length of characters to decode
* @return decoded data
*/
public static byte[] decodeWebSafe(byte[] source, int off, int len)
throws Base64DecoderException {
return decode(source, off, len, WEBSAFE_DECODABET);
}
/**
* Decodes Base64 content using the supplied decodabet and returns
* the decoded byte array.
*
* @param source the Base64 encoded data
* @param off the offset of where to begin decoding
* @param len the length of characters to decode
* @param decodabet the decodabet for decoding Base64 content
* @return decoded data
*/
public static byte[] decode(byte[] source, int off, int len, byte[] decodabet)
throws Base64DecoderException {
int len34 = len * 3 / 4;
byte[] outBuff = new byte[2 + len34]; // Upper limit on size of output
int outBuffPosn = 0;
byte[] b4 = new byte[4];
int b4Posn = 0;
int i = 0;
byte sbiCrop = 0;
byte sbiDecode = 0;
for (i = 0; i < len; i++) {
sbiCrop = (byte) (source[i + off] & 0x7f); // Only the low seven bits
sbiDecode = decodabet[sbiCrop];
if (sbiDecode >= WHITE_SPACE_ENC) { // White space Equals sign or better
if (sbiDecode >= EQUALS_SIGN_ENC) {
// An equals sign (for padding) must not occur at position 0 or 1
// and must be the last byte[s] in the encoded value
if (sbiCrop == EQUALS_SIGN) {
int bytesLeft = len - i;
byte lastByte = (byte) (source[len - 1 + off] & 0x7f);
if (b4Posn == 0 || b4Posn == 1) {
throw new Base64DecoderException(
"invalid padding byte '=' at byte offset " + i);
} else if ((b4Posn == 3 && bytesLeft > 2)
|| (b4Posn == 4 && bytesLeft > 1)) {
throw new Base64DecoderException(
"padding byte '=' falsely signals end of encoded value "
+ "at offset " + i);
} else if (lastByte != EQUALS_SIGN && lastByte != NEW_LINE) {
throw new Base64DecoderException(
"encoded value has invalid trailing byte");
}
break;
}
b4[b4Posn++] = sbiCrop;
if (b4Posn == 4) {
outBuffPosn += decode4to3(b4, 0, outBuff, outBuffPosn, decodabet);
b4Posn = 0;
}
}
} else {
throw new Base64DecoderException("Bad Base64 input character at " + i
+ ": " + source[i + off] + "(decimal)");
}
}
// Because web safe encoding allows non padding base64 encodes, we
// need to pad the rest of the b4 buffer with equal signs when
// b4Posn != 0. There can be at most 2 equal signs at the end of
// four characters, so the b4 buffer must have two or three
// characters. This also catches the case where the input is
// padded with EQUALS_SIGN
if (b4Posn != 0) {
if (b4Posn == 1) {
throw new Base64DecoderException("single trailing character at offset "
+ (len - 1));
}
b4[b4Posn++] = EQUALS_SIGN;
outBuffPosn += decode4to3(b4, 0, outBuff, outBuffPosn, decodabet);
}
byte[] out = new byte[outBuffPosn];
System.arraycopy(outBuff, 0, out, 0, outBuffPosn);
return out;
}
}
| gpl-2.0 |
satansin/compath | client_android/Compath/src/com/satansin/android/compath/socket/GroupPicServiceSocketImpl.java | 1357 | package com.satansin.android.compath.socket;
import java.util.ArrayList;
import java.util.List;
import com.satansin.android.compath.logic.GroupPicService;
import com.satansin.android.compath.logic.NetworkTimeoutException;
import com.satansin.android.compath.logic.UnknownErrorException;
public class GroupPicServiceSocketImpl implements GroupPicService {
@Override
public List<String> getGroupPics(int groupId) throws NetworkTimeoutException, UnknownErrorException {
ArrayList<String> resultList = new ArrayList<String>();
SocketMsg msg = new SocketMsg(SocketMsg.ASK_FOR_GROUP_PICS);
msg.putInt(SocketMsg.PARAM_GROUP_ID, groupId);
SocketConnector connector = new SocketConnector();
SocketMsg result = connector.send(msg, 8000);
if (result == null) {
throw new NetworkTimeoutException();
}
if (result.getMsgType() == SocketMsg.RE_GROUP_PICS) {
int error = result.getMsgError();
switch (error) {
case SocketMsg.ERROR_UNKNOWN:
throw new UnknownErrorException();
default:
break;
}
SocketMsg[] contents = result.getArrayMsgContents(SocketMsg.PARAM_URLS);
for (SocketMsg content : contents) {
resultList.add(content.getStringMsgContent(SocketMsg.PARAM_URL));
}
} else {
throw new UnknownErrorException();
}
return resultList;
}
}
| gpl-2.0 |
gerhard2202/Culinaromancy | src/main/java/gerhard2202/culinaromancy/item/ItemPowerkraut.java | 1045 | package gerhard2202.culinaromancy.item;
import gerhard2202.culinaromancy.buff.permanent.BuffPowerkraut;
import gerhard2202.culinaromancy.handler.PlayerDataHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemPowerkraut extends ItemCulinaromancyFood
{
public ItemPowerkraut()
{
super("powerkraut", 5, 7.2F, false);
this.setMaxStackSize(1);
this.setAlwaysEdible();
}
@Override
public int getMaxItemUseDuration(ItemStack stack)
{
return 48;
}
@Override
public EnumRarity getRarity(ItemStack stack)
{
return EnumRarity.UNCOMMON;
}
@Override
public void onFoodEaten(ItemStack stack, World world, EntityPlayer player)
{
player.inventory.addItemStackToInventory(new ItemStack(Items.BOWL, 1));
PlayerDataHandler.get(player).addPermanentBuff(new BuffPowerkraut());
}
}
| gpl-2.0 |
kuenishi/vHut | src/vHut_server/vhut_v/vhut_server_java/src/main/java/jp/co/ntts/vhut/exception/NoReleasedApplicationRuntimeException.java | 3043 | /*
* Copyright 2011 NTT Software Corporation.
* All Rights Reserved.
*/
package jp.co.ntts.vhut.exception;
/**
* <p>アプリケーションインスタンス作成時に参照するアプリケーションに一つもリリースがない場合に発生する例外です.
* <br>
*
* @version 1.0.0
* @author NTT Software Corporation.
*
* <!--
* $Date: 2011-11-28 19:50:40 +0900 (月, 28 11 2011) $
* $Revision: 949 $
* $Author: NTT Software Corporation. $
* -->
*/
public class NoReleasedApplicationRuntimeException extends AbstractVhutRuntimeException {
/**
* シリアル.
*/
private static final long serialVersionUID = 6197885134767756490L;
private static final String MESSAGE_CODE = "ESRVT2021";
private Long applicationId;
private Long applicationInstanceGroupId;
/**
* コンストラクタ.
* @param applicationId 対象のアプリケーションのID
* @param applicationInstanceGroupId 影響を受けたアプリケーションインスタンスグループのID
*/
public NoReleasedApplicationRuntimeException(Long applicationId, Long applicationInstanceGroupId) {
super(MESSAGE_CODE, new Object[]{ applicationId, applicationInstanceGroupId });
this.applicationId = applicationId;
this.applicationInstanceGroupId = applicationInstanceGroupId;
}
/**
* @return 対象のアプリケーションのID
*/
public Long getApplicationId() {
return applicationId;
}
/**
* @return 影響を受けたアプリケーションインスタンスグループのID
*/
public Long getApplicationInstanceGroupId() {
return applicationInstanceGroupId;
}
/**
* @param applicationId the applicationId to set
*/
public void setApplicationId(Long applicationId) {
this.applicationId = applicationId;
}
/**
* @param applicationInstanceGroupId the applicationInstanceGroupId to set
*/
public void setApplicationInstanceGroupId(Long applicationInstanceGroupId) {
this.applicationInstanceGroupId = applicationInstanceGroupId;
}
}
/**
* =====================================================================
*
* Copyright 2011 NTT Sofware Corporation
*
* 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.
*
* =====================================================================
*/
| gpl-2.0 |
deallas/PoradnikPiwny-Android | gen/pl/poradnikpiwny/R.java | 10768 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package pl.poradnikpiwny;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int arrow=0x7f020000;
public static final int gradient_bg=0x7f020001;
public static final int gradient_bg_hover=0x7f020002;
public static final int ic_launcher=0x7f020003;
public static final int image_bg=0x7f020004;
public static final int list_selector=0x7f020005;
public static final int photo=0x7f020006;
public static final int plus=0x7f020007;
public static final int plus_tab=0x7f020008;
public static final int search=0x7f020009;
public static final int search_tab=0x7f02000a;
public static final int star=0x7f02000b;
public static final int star_tab=0x7f02000c;
}
public static final class id {
public static final int BeerInfo=0x7f070003;
public static final int BeerInfoHeader=0x7f070005;
public static final int BeerInfoHeaderData=0x7f070008;
public static final int BeerInfoHeaderThumbnail=0x7f070006;
public static final int BeerInfoLoader=0x7f070004;
public static final int ShowBeerImage=0x7f070007;
public static final int TextViewBeerDate=0x7f07003d;
public static final int TextViewBeerName=0x7f070039;
public static final int TextViewBeerRating=0x7f07003b;
public static final int TextViewBeerStars=0x7f07003c;
public static final int TextViewManufacturer=0x7f07003a;
public static final int eBeerSearch=0x7f070001;
public static final int lBeerAlcohol=0x7f070012;
public static final int lBeerDescription=0x7f070010;
public static final int lBeerExtract=0x7f070015;
public static final int lBeerFamily=0x7f07001b;
public static final int lBeerFiltered=0x7f070021;
public static final int lBeerFlavored=0x7f070027;
public static final int lBeerInfoDetailed=0x7f07000f;
public static final int lBeerInfoHeaderRanking=0x7f070009;
public static final int lBeerMalt=0x7f070018;
public static final int lBeerPasteurized=0x7f070024;
public static final int lBeerPlaceofbrew=0x7f07002a;
public static final int lBeerType=0x7f07001e;
public static final int lCity=0x7f070033;
public static final int lCountry=0x7f07002d;
public static final int lRegion=0x7f070030;
public static final int list_image=0x7f070038;
public static final int menu_settings=0x7f07003e;
public static final int realtabcontent=0x7f070002;
public static final int relativeLayout=0x7f070000;
public static final int tBeerAlcoholLabel=0x7f070013;
public static final int tBeerAlcoholValue=0x7f070014;
public static final int tBeerDate=0x7f07000e;
public static final int tBeerDescription=0x7f070011;
public static final int tBeerExtractLabel=0x7f070016;
public static final int tBeerExtractValue=0x7f070017;
public static final int tBeerFamilyLabel=0x7f07001c;
public static final int tBeerFamilyValue=0x7f07001d;
public static final int tBeerFilteredLabel=0x7f070022;
public static final int tBeerFilteredValue=0x7f070023;
public static final int tBeerFlavoredLabel=0x7f070028;
public static final int tBeerFlavoredValue=0x7f070029;
public static final int tBeerMaltLabel=0x7f070019;
public static final int tBeerMaltValue=0x7f07001a;
public static final int tBeerManufacturer=0x7f07000d;
public static final int tBeerName=0x7f07000c;
public static final int tBeerPasteurizedLabel=0x7f070025;
public static final int tBeerPasteurizedValue=0x7f070026;
public static final int tBeerPlaceofbrewLabel=0x7f07002b;
public static final int tBeerPlaceofbrewValue=0x7f07002c;
public static final int tBeerRating=0x7f07000a;
public static final int tBeerStars=0x7f07000b;
public static final int tBeerTypeLabel=0x7f07001f;
public static final int tBeerTypeValue=0x7f070020;
public static final int tCityLabel=0x7f070034;
public static final int tCityValue=0x7f070035;
public static final int tCountryLabel=0x7f07002e;
public static final int tCountryValue=0x7f07002f;
public static final int tHTTPError=0x7f070036;
public static final int tRegionLabel=0x7f070031;
public static final int tRegionValue=0x7f070032;
public static final int thumbnail=0x7f070037;
}
public static final class layout {
public static final int activity_main=0x7f030000;
public static final int activity_show_beer=0x7f030001;
public static final int beerlist=0x7f030002;
public static final int list_row=0x7f030003;
}
public static final class menu {
public static final int activity_beer_review=0x7f060000;
public static final int activity_main=0x7f060001;
public static final int activity_show_beer=0x7f060002;
}
public static final class string {
public static final int app_name=0x7f040000;
public static final int beer_alcohol_example=0x7f040018;
public static final int beer_alcohol_label=0x7f040005;
public static final int beer_city_example=0x7f040026;
public static final int beer_city_label=0x7f040025;
public static final int beer_country_example=0x7f040022;
public static final int beer_country_label=0x7f040021;
public static final int beer_dateadded_example=0x7f040016;
public static final int beer_dateadded_label=0x7f04000e;
public static final int beer_description_example=0x7f040035;
public static final int beer_distributor_notfound=0x7f04003f;
public static final int beer_error_internalservererror=0x7f04003a;
public static final int beer_error_noresponse=0x7f040039;
public static final int beer_extract_example=0x7f040019;
public static final int beer_extract_label=0x7f040006;
public static final int beer_family_example=0x7f040028;
public static final int beer_family_label=0x7f040027;
public static final int beer_family_notfound=0x7f04003e;
public static final int beer_filtered_example=0x7f04001c;
public static final int beer_filtered_label=0x7f040009;
public static final int beer_flavored_example=0x7f04001e;
public static final int beer_flavored_label=0x7f04000b;
public static final int beer_image_example=0x7f040020;
public static final int beer_image_notfound=0x7f04003c;
public static final int beer_imageneightbornotfound=0x7f04003d;
public static final int beer_malt_example=0x7f04001a;
public static final int beer_malt_inny=0x7f04002d;
public static final int beer_malt_jeczmienny=0x7f04002b;
public static final int beer_malt_label=0x7f040007;
public static final int beer_malt_pszenny=0x7f04002c;
public static final int beer_manufacturer_name_example=0x7f040015;
public static final int beer_manufacturer_notfound=0x7f040040;
public static final int beer_name_example=0x7f040014;
public static final int beer_name_label=0x7f040004;
public static final int beer_notfound=0x7f04003b;
public static final int beer_pasteurized_example=0x7f04001d;
public static final int beer_pasteurized_label=0x7f04000a;
public static final int beer_placeofbrew_browar=0x7f04002e;
public static final int beer_placeofbrew_dom=0x7f040030;
public static final int beer_placeofbrew_example=0x7f04001f;
public static final int beer_placeofbrew_label=0x7f04000c;
public static final int beer_placeofbrew_restauracja=0x7f04002f;
public static final int beer_ranking_example=0x7f040017;
public static final int beer_rankingavg_label=0x7f04000d;
public static final int beer_region_example=0x7f040024;
public static final int beer_region_label=0x7f040023;
public static final int beer_review_select=0x7f040002;
public static final int beer_search_hint=0x7f04000f;
public static final int beer_search_invalidformvalues=0x7f040036;
public static final int beer_search_notfound=0x7f040013;
public static final int beer_search_nullpointer=0x7f040037;
public static final int beer_search_resultnotfound=0x7f040038;
public static final int beer_type_bezalkoholowe=0x7f040031;
public static final int beer_type_example=0x7f04001b;
public static final int beer_type_label=0x7f040008;
public static final int beer_type_lekkie=0x7f040032;
public static final int beer_type_mocne=0x7f040034;
public static final int beer_type_pelne=0x7f040033;
public static final int city_notfound=0x7f040043;
public static final int country_notfound=0x7f040041;
public static final int lastadded_tab=0x7f040011;
public static final int menu_settings=0x7f040001;
public static final int nie=0x7f04002a;
public static final int region_notfound=0x7f040042;
public static final int search_tab=0x7f040012;
public static final int tak=0x7f040029;
public static final int title_activity_show_beer=0x7f040003;
public static final int topranking_tab=0x7f040010;
}
public static final class style {
/**
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
API 11 theme customizations can go here.
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
API 14 theme customizations can go here.
*/
public static final int AppBaseTheme=0x7f050000;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f050001;
}
}
| gpl-2.0 |
RogerKang/test | QB-webapp/src/main/java/com/oocl/euc/ita/training/repository/PlanDao.java | 594 | package com.oocl.euc.ita.training.repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import com.oocl.euc.ita.core.persistence.BaseRepository;
import com.oocl.euc.ita.training.entity.Plan;
public interface PlanDao extends BaseRepository<Plan, Long> {
@Query("select p from Plan p where p.status = ?1")
Page<Plan> findByStatus(String state, Pageable pageable);
@Query("select p from Plan p where p.course.id = ?1")
Page<Plan> findByCourse(Long courseId, Pageable pageable);
}
| gpl-2.0 |
edlangley/virtual-puzzle | src/EditUserDialog.java | 2675 | import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.FileDialog;
import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.Label;
import java.awt.Panel;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class EditUserDialog extends BaseDialog implements ActionListener
{
VirtualPuzzleApp parentVPuzzle;
ChooseUserDialog parentUserChooseDlg;
Label firstNameLabel = new Label("First Name:");
TextField firstNameText = new TextField(20);
Label lastNameLabel = new Label("Last Name:");
TextField lastNameText = new TextField(20);
Button okButton = new Button("OK");
Button cancelButton = new Button("Cancel");
public EditUserDialog(VirtualPuzzleApp parent, ChooseUserDialog parentDlg)
{
super(parent);
parentVPuzzle = parent;
parentUserChooseDlg = parentDlg;
okButton.addActionListener(this);
cancelButton.addActionListener(this);
setSize(480, 300);
Panel namesPanel = new Panel();
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints constraints = new GridBagConstraints();
namesPanel.setLayout(gridbag);
constraints.insets = new Insets(5, 5, 5, 5);
gridbag.setConstraints(firstNameLabel, constraints);
namesPanel.add(firstNameLabel);
constraints.gridwidth = GridBagConstraints.REMAINDER; //end row
gridbag.setConstraints(firstNameText, constraints);
namesPanel.add(firstNameText);
constraints.gridwidth = 1;
gridbag.setConstraints(lastNameLabel, constraints);
namesPanel.add(lastNameLabel);
gridbag.setConstraints(lastNameText, constraints);
namesPanel.add(lastNameText);
main.add(namesPanel);
bottom.setLayout(new FlowLayout(FlowLayout.RIGHT));
bottom.add(okButton);
bottom.add(cancelButton);
add(main,BorderLayout.CENTER);
add(bottom,BorderLayout.SOUTH);
}
public void actionPerformed(ActionEvent e)
{
if(e.getActionCommand().equals("OK"))
{
UsersFileRec newUserRec = new UsersFileRec();
newUserRec.fName = firstNameText.getText();
newUserRec.lName = lastNameText.getText();
setVisible(false);
parentUserChooseDlg.addNewUser(newUserRec);
}
else if(e.getActionCommand().equals("Cancel"))
{
setVisible(false);
}
}
}
| gpl-2.0 |
koutheir/incinerator-hotspot | nashorn/src/jdk/nashorn/internal/runtime/regexp/joni/ast/StringNode.java | 5615 | /*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package jdk.nashorn.internal.runtime.regexp.joni.ast;
import jdk.nashorn.internal.runtime.regexp.joni.EncodingHelper;
import jdk.nashorn.internal.runtime.regexp.joni.constants.StringType;
public final class StringNode extends Node implements StringType {
private static final int NODE_STR_MARGIN = 16;
private static final int NODE_STR_BUF_SIZE = 24;
public static final StringNode EMPTY = new StringNode(null, Integer.MAX_VALUE, Integer.MAX_VALUE);
public char[] chars;
public int p;
public int end;
public int flag;
public StringNode() {
this.chars = new char[NODE_STR_BUF_SIZE];
}
public StringNode(final char[] chars, final int p, final int end) {
this.chars = chars;
this.p = p;
this.end = end;
setShared();
}
public StringNode(final char c) {
this();
chars[end++] = c;
}
/* Ensure there is ahead bytes available in node's buffer
* (assumes that the node is not shared)
*/
public void ensure(final int ahead) {
final int len = (end - p) + ahead;
if (len >= chars.length) {
final char[] tmp = new char[len + NODE_STR_MARGIN];
System.arraycopy(chars, p, tmp, 0, end - p);
chars = tmp;
}
}
/* COW and/or ensure there is ahead bytes available in node's buffer
*/
private void modifyEnsure(final int ahead) {
if (isShared()) {
final int len = (end - p) + ahead;
final char[] tmp = new char[len + NODE_STR_MARGIN];
System.arraycopy(chars, p, tmp, 0, end - p);
chars = tmp;
end = end - p;
p = 0;
clearShared();
} else {
ensure(ahead);
}
}
@Override
public int getType() {
return STR;
}
@Override
public String getName() {
return "String";
}
@Override
public String toString(final int level) {
final StringBuilder value = new StringBuilder();
value.append("\n bytes: '");
for (int i=p; i<end; i++) {
if (chars[i] >= 0x20 && chars[i] < 0x7f) {
value.append(chars[i]);
} else {
value.append(String.format("[0x%04x]", (int)chars[i]));
}
}
value.append("'");
return value.toString();
}
public int length() {
return end - p;
}
public StringNode splitLastChar() {
StringNode n = null;
if (end > p) {
final int prev = EncodingHelper.prevCharHead(p, end);
if (prev != -1 && prev > p) { /* can be splitted. */
n = new StringNode(chars, prev, end);
if (isRaw()) n.setRaw();
end = prev;
}
}
return n;
}
public boolean canBeSplit() {
return end > p && 1 < (end - p);
}
public void set(final char[] chars, final int p, final int end) {
this.chars = chars;
this.p = p;
this.end = end;
setShared();
}
public void cat(final char[] cat, final int catP, final int catEnd) {
final int len = catEnd - catP;
modifyEnsure(len);
System.arraycopy(cat, catP, chars, end, len);
end += len;
}
public void cat(final char c) {
modifyEnsure(1);
chars[end++] = c;
}
public void catCode(final int code) {
cat((char)code);
}
public void clear() {
if (chars.length > NODE_STR_BUF_SIZE) chars = new char[NODE_STR_BUF_SIZE];
flag = 0;
p = end = 0;
}
public void setRaw() {
flag |= NSTR_RAW;
}
public void clearRaw() {
flag &= ~NSTR_RAW;
}
public boolean isRaw() {
return (flag & NSTR_RAW) != 0;
}
public void setAmbig() {
flag |= NSTR_AMBIG;
}
public void clearAmbig() {
flag &= ~NSTR_AMBIG;
}
public boolean isAmbig() {
return (flag & NSTR_AMBIG) != 0;
}
public void setDontGetOptInfo() {
flag |= NSTR_DONT_GET_OPT_INFO;
}
public void clearDontGetOptInfo() {
flag &= ~NSTR_DONT_GET_OPT_INFO;
}
public boolean isDontGetOptInfo() {
return (flag & NSTR_DONT_GET_OPT_INFO) != 0;
}
public void setShared() {
flag |= NSTR_SHARED;
}
public void clearShared() {
flag &= ~NSTR_SHARED;
}
public boolean isShared() {
return (flag & NSTR_SHARED) != 0;
}
}
| gpl-2.0 |
szgflex/JM | src/com/jm/launcher/DragController.java | 27906 | package com.jm.launcher;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.graphics.PointF;
import android.graphics.Rect;
import android.os.Handler;
import android.os.IBinder;
import android.util.Log;
import android.view.HapticFeedbackConstants;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.inputmethod.InputMethodManager;
import com.jm.launcher.R;
import java.util.ArrayList;
/**
* Class for initiating a drag within a view or across multiple views.
*/
public class DragController {
private static final String TAG = "Launcher.DragController";
/** Indicates the drag is a move. */
public static int DRAG_ACTION_MOVE = 0;
/** Indicates the drag is a copy. */
public static int DRAG_ACTION_COPY = 1;
private static final int SCROLL_DELAY = 500;
private static final int RESCROLL_DELAY = PagedView.PAGE_SNAP_ANIMATION_DURATION + 150;
private static final boolean PROFILE_DRAWING_DURING_DRAG = false;
private static final int SCROLL_OUTSIDE_ZONE = 0;
private static final int SCROLL_WAITING_IN_ZONE = 1;
static final int SCROLL_NONE = -1;
static final int SCROLL_LEFT = 0;
static final int SCROLL_RIGHT = 1;
private static final float MAX_FLING_DEGREES = 35f;
private Launcher mLauncher;
private Handler mHandler;
// temporaries to avoid gc thrash
private Rect mRectTemp = new Rect();
private final int[] mCoordinatesTemp = new int[2];
/** Whether or not we're dragging. */
private boolean mDragging;
/** X coordinate of the down event. */
private int mMotionDownX;
/** Y coordinate of the down event. */
private int mMotionDownY;
/** the area at the edge of the screen that makes the workspace go left
* or right while you're dragging.
*/
private int mScrollZone;
private DropTarget.DragObject mDragObject;
/** Who can receive drop events */
private ArrayList<DropTarget> mDropTargets = new ArrayList<DropTarget>();
private ArrayList<DragListener> mListeners = new ArrayList<DragListener>();
private DropTarget mFlingToDeleteDropTarget;
/** The window token used as the parent for the DragView. */
private IBinder mWindowToken;
/** The view that will be scrolled when dragging to the left and right edges of the screen. */
private View mScrollView;
private View mMoveTarget;
private DragScroller mDragScroller;
private int mScrollState = SCROLL_OUTSIDE_ZONE;
private ScrollRunnable mScrollRunnable = new ScrollRunnable();
private DropTarget mLastDropTarget;
private InputMethodManager mInputMethodManager;
private int mLastTouch[] = new int[2];
private long mLastTouchUpTime = -1;
private int mDistanceSinceScroll = 0;
private int mTmpPoint[] = new int[2];
private Rect mDragLayerRect = new Rect();
protected int mFlingToDeleteThresholdVelocity;
private VelocityTracker mVelocityTracker;
/**
* Interface to receive notifications when a drag starts or stops
*/
interface DragListener {
/**
* A drag has begun
*
* @param source An object representing where the drag originated
* @param info The data associated with the object that is being dragged
* @param dragAction The drag action: either {@link DragController#DRAG_ACTION_MOVE}
* or {@link DragController#DRAG_ACTION_COPY}
*/
void onDragStart(DragSource source, Object info, int dragAction);
/**
* The drag has ended
*/
void onDragEnd();
}
/**
* Used to create a new DragLayer from XML.
*
* @param context The application's context.
*/
public DragController(Launcher launcher) {
Resources r = launcher.getResources();
mLauncher = launcher;
mHandler = new Handler();
mScrollZone = r.getDimensionPixelSize(R.dimen.scroll_zone);
mVelocityTracker = VelocityTracker.obtain();
float density = r.getDisplayMetrics().density;
mFlingToDeleteThresholdVelocity =
(int) (r.getInteger(R.integer.config_flingToDeleteMinVelocity) * density);
}
public boolean dragging() {
return mDragging;
}
/**
* Starts a drag.
*
* @param v The view that is being dragged
* @param bmp The bitmap that represents the view being dragged
* @param source An object representing where the drag originated
* @param dragInfo The data associated with the object that is being dragged
* @param dragAction The drag action: either {@link #DRAG_ACTION_MOVE} or
* {@link #DRAG_ACTION_COPY}
* @param dragRegion Coordinates within the bitmap b for the position of item being dragged.
* Makes dragging feel more precise, e.g. you can clip out a transparent border
*/
public void startDrag(View v, Bitmap bmp, DragSource source, Object dragInfo, int dragAction,
Point extraPadding, float initialDragViewScale) {
int[] loc = mCoordinatesTemp;
mLauncher.getDragLayer().getLocationInDragLayer(v, loc);
int viewExtraPaddingLeft = extraPadding != null ? extraPadding.x : 0;
int viewExtraPaddingTop = extraPadding != null ? extraPadding.y : 0;
int dragLayerX = loc[0] + v.getPaddingLeft() + viewExtraPaddingLeft +
(int) ((initialDragViewScale * bmp.getWidth() - bmp.getWidth()) / 2);
int dragLayerY = loc[1] + v.getPaddingTop() + viewExtraPaddingTop +
(int) ((initialDragViewScale * bmp.getHeight() - bmp.getHeight()) / 2);
startDrag(bmp, dragLayerX, dragLayerY, source, dragInfo, dragAction, null,
null, initialDragViewScale);
if (dragAction == DRAG_ACTION_MOVE) {
v.setVisibility(View.GONE);
}
}
/**
* Starts a drag.
*
* @param b The bitmap to display as the drag image. It will be re-scaled to the
* enlarged size.
* @param dragLayerX The x position in the DragLayer of the left-top of the bitmap.
* @param dragLayerY The y position in the DragLayer of the left-top of the bitmap.
* @param source An object representing where the drag originated
* @param dragInfo The data associated with the object that is being dragged
* @param dragAction The drag action: either {@link #DRAG_ACTION_MOVE} or
* {@link #DRAG_ACTION_COPY}
* @param dragRegion Coordinates within the bitmap b for the position of item being dragged.
* Makes dragging feel more precise, e.g. you can clip out a transparent border
*/
public void startDrag(Bitmap b, int dragLayerX, int dragLayerY,
DragSource source, Object dragInfo, int dragAction, Point dragOffset, Rect dragRegion,
float initialDragViewScale) {
if (PROFILE_DRAWING_DURING_DRAG) {
android.os.Debug.startMethodTracing("Launcher");
}
// Hide soft keyboard, if visible
if (mInputMethodManager == null) {
mInputMethodManager = (InputMethodManager)
mLauncher.getSystemService(Context.INPUT_METHOD_SERVICE);
}
mInputMethodManager.hideSoftInputFromWindow(mWindowToken, 0);
for (DragListener listener : mListeners) {
listener.onDragStart(source, dragInfo, dragAction);
}
final int registrationX = mMotionDownX - dragLayerX;
final int registrationY = mMotionDownY - dragLayerY;
final int dragRegionLeft = dragRegion == null ? 0 : dragRegion.left;
final int dragRegionTop = dragRegion == null ? 0 : dragRegion.top;
mDragging = true;
mDragObject = new DropTarget.DragObject();
mDragObject.dragComplete = false;
mDragObject.xOffset = mMotionDownX - (dragLayerX + dragRegionLeft);
mDragObject.yOffset = mMotionDownY - (dragLayerY + dragRegionTop);
mDragObject.dragSource = source;
mDragObject.dragInfo = dragInfo;
final DragView dragView = mDragObject.dragView = new DragView(mLauncher, b, registrationX,
registrationY, 0, 0, b.getWidth(), b.getHeight(), initialDragViewScale);
if (dragOffset != null) {
dragView.setDragVisualizeOffset(new Point(dragOffset));
}
if (dragRegion != null) {
dragView.setDragRegion(new Rect(dragRegion));
}
mLauncher.getDragLayer().performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
dragView.show(mMotionDownX, mMotionDownY);
handleMoveEvent(mMotionDownX, mMotionDownY);
}
/**
* Draw the view into a bitmap.
*/
Bitmap getViewBitmap(View v) {
v.clearFocus();
v.setPressed(false);
boolean willNotCache = v.willNotCacheDrawing();
v.setWillNotCacheDrawing(false);
// Reset the drawing cache background color to fully transparent
// for the duration of this operation
int color = v.getDrawingCacheBackgroundColor();
v.setDrawingCacheBackgroundColor(0);
float alpha = v.getAlpha();
v.setAlpha(1.0f);
if (color != 0) {
v.destroyDrawingCache();
}
v.buildDrawingCache();
Bitmap cacheBitmap = v.getDrawingCache();
if (cacheBitmap == null) {
Log.e(TAG, "failed getViewBitmap(" + v + ")", new RuntimeException());
return null;
}
Bitmap bitmap = Bitmap.createBitmap(cacheBitmap);
// Restore the view
v.destroyDrawingCache();
v.setAlpha(alpha);
v.setWillNotCacheDrawing(willNotCache);
v.setDrawingCacheBackgroundColor(color);
return bitmap;
}
/**
* Call this from a drag source view like this:
*
* <pre>
* @Override
* public boolean dispatchKeyEvent(KeyEvent event) {
* return mDragController.dispatchKeyEvent(this, event)
* || super.dispatchKeyEvent(event);
* </pre>
*/
public boolean dispatchKeyEvent(KeyEvent event) {
return mDragging;
}
public boolean isDragging() {
return mDragging;
}
/**
* Stop dragging without dropping.
*/
public void cancelDrag() {
if (mDragging) {
if (mLastDropTarget != null) {
mLastDropTarget.onDragExit(mDragObject);
}
mDragObject.deferDragViewCleanupPostAnimation = false;
mDragObject.cancelled = true;
mDragObject.dragComplete = true;
mDragObject.dragSource.onDropCompleted(null, mDragObject, false, false);
}
endDrag();
}
public void onAppsRemoved(ArrayList<AppInfo> appInfos, Context context) {
// Cancel the current drag if we are removing an app that we are dragging
if (mDragObject != null) {
Object rawDragInfo = mDragObject.dragInfo;
if (rawDragInfo instanceof ShortcutInfo) {
ShortcutInfo dragInfo = (ShortcutInfo) rawDragInfo;
for (AppInfo info : appInfos) {
// Added null checks to prevent NPE we've seen in the wild
if (dragInfo != null &&
dragInfo.intent != null) {
boolean isSameComponent =
dragInfo.intent.getComponent().equals(info.componentName);
if (isSameComponent) {
cancelDrag();
return;
}
}
}
}
}
}
private void endDrag() {
if (mDragging) {
mDragging = false;
clearScrollRunnable();
boolean isDeferred = false;
if (mDragObject.dragView != null) {
isDeferred = mDragObject.deferDragViewCleanupPostAnimation;
if (!isDeferred) {
mDragObject.dragView.remove();
}
mDragObject.dragView = null;
}
// Only end the drag if we are not deferred
if (!isDeferred) {
for (DragListener listener : mListeners) {
listener.onDragEnd();
}
}
}
releaseVelocityTracker();
}
/**
* This only gets called as a result of drag view cleanup being deferred in endDrag();
*/
void onDeferredEndDrag(DragView dragView) {
dragView.remove();
if (mDragObject.deferDragViewCleanupPostAnimation) {
// If we skipped calling onDragEnd() before, do it now
for (DragListener listener : mListeners) {
listener.onDragEnd();
}
}
}
void onDeferredEndFling(DropTarget.DragObject d) {
d.dragSource.onFlingToDeleteCompleted();
}
/**
* Clamps the position to the drag layer bounds.
*/
private int[] getClampedDragLayerPos(float x, float y) {
mLauncher.getDragLayer().getLocalVisibleRect(mDragLayerRect);
mTmpPoint[0] = (int) Math.max(mDragLayerRect.left, Math.min(x, mDragLayerRect.right - 1));
mTmpPoint[1] = (int) Math.max(mDragLayerRect.top, Math.min(y, mDragLayerRect.bottom - 1));
return mTmpPoint;
}
long getLastGestureUpTime() {
if (mDragging) {
return System.currentTimeMillis();
} else {
return mLastTouchUpTime;
}
}
void resetLastGestureUpTime() {
mLastTouchUpTime = -1;
}
/**
* Call this from a drag source view.
*/
public boolean onInterceptTouchEvent(MotionEvent ev) {
@SuppressWarnings("all") // suppress dead code warning
final boolean debug = false;
if (debug) {
Log.d(Launcher.TAG, "DragController.onInterceptTouchEvent " + ev + " mDragging="
+ mDragging);
}
// Update the velocity tracker
acquireVelocityTrackerAndAddMovement(ev);
final int action = ev.getAction();
final int[] dragLayerPos = getClampedDragLayerPos(ev.getX(), ev.getY());
final int dragLayerX = dragLayerPos[0];
final int dragLayerY = dragLayerPos[1];
switch (action) {
case MotionEvent.ACTION_MOVE:
break;
case MotionEvent.ACTION_DOWN:
// Remember location of down touch
mMotionDownX = dragLayerX;
mMotionDownY = dragLayerY;
mLastDropTarget = null;
break;
case MotionEvent.ACTION_UP:
mLastTouchUpTime = System.currentTimeMillis();
if (mDragging) {
PointF vec = isFlingingToDelete(mDragObject.dragSource);
if (!DeleteDropTarget.willAcceptDrop(mDragObject.dragInfo)) {
vec = null;
}
if (vec != null) {
dropOnFlingToDeleteTarget(dragLayerX, dragLayerY, vec);
} else {
drop(dragLayerX, dragLayerY);
}
}
endDrag();
break;
case MotionEvent.ACTION_CANCEL:
cancelDrag();
break;
}
return mDragging;
}
/**
* Sets the view that should handle move events.
*/
void setMoveTarget(View view) {
mMoveTarget = view;
}
public boolean dispatchUnhandledMove(View focused, int direction) {
return mMoveTarget != null && mMoveTarget.dispatchUnhandledMove(focused, direction);
}
private void clearScrollRunnable() {
mHandler.removeCallbacks(mScrollRunnable);
if (mScrollState == SCROLL_WAITING_IN_ZONE) {
mScrollState = SCROLL_OUTSIDE_ZONE;
mScrollRunnable.setDirection(SCROLL_RIGHT);
mDragScroller.onExitScrollArea();
mLauncher.getDragLayer().onExitScrollArea();
}
}
private void handleMoveEvent(int x, int y) {
mDragObject.dragView.move(x, y);
// Drop on someone?
final int[] coordinates = mCoordinatesTemp;
DropTarget dropTarget = findDropTarget(x, y, coordinates);
mDragObject.x = coordinates[0];
mDragObject.y = coordinates[1];
checkTouchMove(dropTarget);
// Check if we are hovering over the scroll areas
mDistanceSinceScroll +=
Math.sqrt(Math.pow(mLastTouch[0] - x, 2) + Math.pow(mLastTouch[1] - y, 2));
mLastTouch[0] = x;
mLastTouch[1] = y;
checkScrollState(x, y);
}
public void forceTouchMove() {
int[] dummyCoordinates = mCoordinatesTemp;
DropTarget dropTarget = findDropTarget(mLastTouch[0], mLastTouch[1], dummyCoordinates);
mDragObject.x = dummyCoordinates[0];
mDragObject.y = dummyCoordinates[1];
checkTouchMove(dropTarget);
}
private void checkTouchMove(DropTarget dropTarget) {
if (dropTarget != null) {
if (mLastDropTarget != dropTarget) {
if (mLastDropTarget != null) {
mLastDropTarget.onDragExit(mDragObject);
}
dropTarget.onDragEnter(mDragObject);
}
dropTarget.onDragOver(mDragObject);
} else {
if (mLastDropTarget != null) {
mLastDropTarget.onDragExit(mDragObject);
}
}
mLastDropTarget = dropTarget;
}
private void checkScrollState(int x, int y) {
final int slop = ViewConfiguration.get(mLauncher).getScaledWindowTouchSlop();
final int delay = mDistanceSinceScroll < slop ? RESCROLL_DELAY : SCROLL_DELAY;
final DragLayer dragLayer = mLauncher.getDragLayer();
final boolean isRtl = (dragLayer.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL);
final int forwardDirection = isRtl ? SCROLL_RIGHT : SCROLL_LEFT;
final int backwardsDirection = isRtl ? SCROLL_LEFT : SCROLL_RIGHT;
if (x < mScrollZone) {
if (mScrollState == SCROLL_OUTSIDE_ZONE) {
mScrollState = SCROLL_WAITING_IN_ZONE;
if (mDragScroller.onEnterScrollArea(x, y, forwardDirection)) {
dragLayer.onEnterScrollArea(forwardDirection);
mScrollRunnable.setDirection(forwardDirection);
mHandler.postDelayed(mScrollRunnable, delay);
}
}
} else if (x > mScrollView.getWidth() - mScrollZone) {
if (mScrollState == SCROLL_OUTSIDE_ZONE) {
mScrollState = SCROLL_WAITING_IN_ZONE;
if (mDragScroller.onEnterScrollArea(x, y, backwardsDirection)) {
dragLayer.onEnterScrollArea(backwardsDirection);
mScrollRunnable.setDirection(backwardsDirection);
mHandler.postDelayed(mScrollRunnable, delay);
}
}
} else {
clearScrollRunnable();
}
}
/**
* Call this from a drag source view.
*/
public boolean onTouchEvent(MotionEvent ev) {
if (!mDragging) {
return false;
}
// Update the velocity tracker
acquireVelocityTrackerAndAddMovement(ev);
final int action = ev.getAction();
final int[] dragLayerPos = getClampedDragLayerPos(ev.getX(), ev.getY());
final int dragLayerX = dragLayerPos[0];
final int dragLayerY = dragLayerPos[1];
switch (action) {
case MotionEvent.ACTION_DOWN:
// Remember where the motion event started
mMotionDownX = dragLayerX;
mMotionDownY = dragLayerY;
if ((dragLayerX < mScrollZone) || (dragLayerX > mScrollView.getWidth() - mScrollZone)) {
mScrollState = SCROLL_WAITING_IN_ZONE;
mHandler.postDelayed(mScrollRunnable, SCROLL_DELAY);
} else {
mScrollState = SCROLL_OUTSIDE_ZONE;
}
handleMoveEvent(dragLayerX, dragLayerY);
break;
case MotionEvent.ACTION_MOVE:
handleMoveEvent(dragLayerX, dragLayerY);
break;
case MotionEvent.ACTION_UP:
// Ensure that we've processed a move event at the current pointer location.
handleMoveEvent(dragLayerX, dragLayerY);
mHandler.removeCallbacks(mScrollRunnable);
if (mDragging) {
PointF vec = isFlingingToDelete(mDragObject.dragSource);
if (!DeleteDropTarget.willAcceptDrop(mDragObject.dragInfo)) {
vec = null;
}
if (vec != null) {
dropOnFlingToDeleteTarget(dragLayerX, dragLayerY, vec);
} else {
drop(dragLayerX, dragLayerY);
}
}
endDrag();
break;
case MotionEvent.ACTION_CANCEL:
mHandler.removeCallbacks(mScrollRunnable);
cancelDrag();
break;
}
return true;
}
/**
* Determines whether the user flung the current item to delete it.
*
* @return the vector at which the item was flung, or null if no fling was detected.
*/
private PointF isFlingingToDelete(DragSource source) {
if (mFlingToDeleteDropTarget == null) return null;
if (!source.supportsFlingToDelete()) return null;
ViewConfiguration config = ViewConfiguration.get(mLauncher);
mVelocityTracker.computeCurrentVelocity(1000, config.getScaledMaximumFlingVelocity());
if (mVelocityTracker.getYVelocity() < mFlingToDeleteThresholdVelocity) {
// Do a quick dot product test to ensure that we are flinging upwards
PointF vel = new PointF(mVelocityTracker.getXVelocity(),
mVelocityTracker.getYVelocity());
PointF upVec = new PointF(0f, -1f);
float theta = (float) Math.acos(((vel.x * upVec.x) + (vel.y * upVec.y)) /
(vel.length() * upVec.length()));
if (theta <= Math.toRadians(MAX_FLING_DEGREES)) {
return vel;
}
}
return null;
}
private void dropOnFlingToDeleteTarget(float x, float y, PointF vel) {
final int[] coordinates = mCoordinatesTemp;
mDragObject.x = coordinates[0];
mDragObject.y = coordinates[1];
// Clean up dragging on the target if it's not the current fling delete target otherwise,
// start dragging to it.
if (mLastDropTarget != null && mFlingToDeleteDropTarget != mLastDropTarget) {
mLastDropTarget.onDragExit(mDragObject);
}
// Drop onto the fling-to-delete target
boolean accepted = false;
mFlingToDeleteDropTarget.onDragEnter(mDragObject);
// We must set dragComplete to true _only_ after we "enter" the fling-to-delete target for
// "drop"
mDragObject.dragComplete = true;
mFlingToDeleteDropTarget.onDragExit(mDragObject);
if (mFlingToDeleteDropTarget.acceptDrop(mDragObject)) {
mFlingToDeleteDropTarget.onFlingToDelete(mDragObject, mDragObject.x, mDragObject.y,
vel);
accepted = true;
}
mDragObject.dragSource.onDropCompleted((View) mFlingToDeleteDropTarget, mDragObject, true,
accepted);
}
private void drop(float x, float y) {
final int[] coordinates = mCoordinatesTemp;
final DropTarget dropTarget = findDropTarget((int) x, (int) y, coordinates);
mDragObject.x = coordinates[0];
mDragObject.y = coordinates[1];
boolean accepted = false;
if (dropTarget != null) {
mDragObject.dragComplete = true;
dropTarget.onDragExit(mDragObject);
if (dropTarget.acceptDrop(mDragObject)) {
dropTarget.onDrop(mDragObject);
accepted = true;
}
}
mDragObject.dragSource.onDropCompleted((View) dropTarget, mDragObject, false, accepted);
}
private DropTarget findDropTarget(int x, int y, int[] dropCoordinates) {
final Rect r = mRectTemp;
final ArrayList<DropTarget> dropTargets = mDropTargets;
final int count = dropTargets.size();
for (int i=count-1; i>=0; i--) {
DropTarget target = dropTargets.get(i);
if (!target.isDropEnabled())
continue;
target.getHitRectRelativeToDragLayer(r);
mDragObject.x = x;
mDragObject.y = y;
if (r.contains(x, y)) {
dropCoordinates[0] = x;
dropCoordinates[1] = y;
mLauncher.getDragLayer().mapCoordInSelfToDescendent((View) target, dropCoordinates);
return target;
}
}
return null;
}
public void setDragScoller(DragScroller scroller) {
mDragScroller = scroller;
}
public void setWindowToken(IBinder token) {
mWindowToken = token;
}
/**
* Sets the drag listner which will be notified when a drag starts or ends.
*/
public void addDragListener(DragListener l) {
mListeners.add(l);
}
/**
* Remove a previously installed drag listener.
*/
public void removeDragListener(DragListener l) {
mListeners.remove(l);
}
/**
* Add a DropTarget to the list of potential places to receive drop events.
*/
public void addDropTarget(DropTarget target) {
mDropTargets.add(target);
}
/**
* Don't send drop events to <em>target</em> any more.
*/
public void removeDropTarget(DropTarget target) {
mDropTargets.remove(target);
}
/**
* Sets the current fling-to-delete drop target.
*/
public void setFlingToDeleteDropTarget(DropTarget target) {
mFlingToDeleteDropTarget = target;
}
private void acquireVelocityTrackerAndAddMovement(MotionEvent ev) {
if (mVelocityTracker == null) {
mVelocityTracker = VelocityTracker.obtain();
}
mVelocityTracker.addMovement(ev);
}
private void releaseVelocityTracker() {
if (mVelocityTracker != null) {
mVelocityTracker.recycle();
mVelocityTracker = null;
}
}
/**
* Set which view scrolls for touch events near the edge of the screen.
*/
public void setScrollView(View v) {
mScrollView = v;
}
DragView getDragView() {
return mDragObject.dragView;
}
private class ScrollRunnable implements Runnable {
private int mDirection;
ScrollRunnable() {
}
public void run() {
if (mDragScroller != null) {
if (mDirection == SCROLL_LEFT) {
mDragScroller.scrollLeft();
} else {
mDragScroller.scrollRight();
}
mScrollState = SCROLL_OUTSIDE_ZONE;
mDistanceSinceScroll = 0;
mDragScroller.onExitScrollArea();
mLauncher.getDragLayer().onExitScrollArea();
if (isDragging()) {
// Check the scroll again so that we can requeue the scroller if necessary
checkScrollState(mLastTouch[0], mLastTouch[1]);
}
}
}
void setDirection(int direction) {
mDirection = direction;
}
}
}
| gpl-2.0 |
liuyufu/appproject | web/src/main/java/com/companyName/appName/requestVo/AppErrorQueryByPageRequest.java | 1022 | package com.companyName.appName.requestVo;
/**
* Created by peter on 2016/1/29.
*/
public class AppErrorQueryByPageRequest extends QueryByPage{
private String seId;
private String span;
private String applyExceptionResult;
public String getSeId() {
return seId;
}
public void setSeId(String seId) {
this.seId = seId;
}
public String getApplyExceptionResult() {
return applyExceptionResult;
}
public void setApplyExceptionResult(String applyExceptionResult) {
this.applyExceptionResult = applyExceptionResult;
}
public String getSpan() {
return span;
}
public void setSpan(String span) {
this.span = span;
}
@Override
public String toString() {
return "AppErrorQueryByPageRequest{" +
"seId='" + seId + '\'' +
", span='" + span + '\'' +
", applyExceptionResult='" + applyExceptionResult + '\'' +
'}'+super.toString();
}
}
| gpl-2.0 |
LICEF/lompad | src/main/java/ca/licef/lompad/OrCompositeComponent.java | 10165 | /*
* Copyright (C) 2005 Alexis Miara (alexis.miara@licef.ca)
*
* This file is part of LomPad.
*
* LomPad is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* LomPad is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LomPad; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
package ca.licef.lompad;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import javax.swing.*;
import java.awt.*;
import java.util.List;
import licef.CommonNamespaceContext;
class OrCompositeComponent extends FormComponent {
JPanel jPanelWrapperGauche;
JPanel jPanelWrapperDroite;
JPanel jPanelOrCompGauche;
JPanel jPanelOrCompDroite;
LocalizeJLabel jLabelType;
LocalizeJLabel jLabelName;
LocalizeJLabel jLabelMinVer;
LocalizeJLabel jLabelMaxVer;
JComboBox jComboBoxType;
JComboBox jComboBoxName;
JTextFieldPopup jTextFieldMinVer;
JTextFieldPopup jTextFieldMaxVer;
String[] typeValues = {"4.4.1.1-1", "4.4.1.1-2"};
public OrCompositeComponent() {
super(null);
jPanelWrapperGauche = new JPanel();
jPanelWrapperGauche.setOpaque(false);
jPanelWrapperDroite = new JPanel();
jPanelWrapperDroite.setOpaque(false);
jPanelOrCompGauche = new JPanel();
jPanelOrCompGauche.setOpaque(false);
jPanelOrCompDroite = new JPanel();
jPanelOrCompDroite.setOpaque(false);
jLabelType = new LocalizeJLabel("4.4.1.1");
jLabelType.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN, 12));
jLabelName = new LocalizeJLabel("4.4.1.2");
jLabelName.setFont(jLabelType.getFont());
jLabelMinVer = new LocalizeJLabel("4.4.1.3");
jLabelMinVer.setFont(jLabelType.getFont());
jLabelMaxVer = new LocalizeJLabel("4.4.1.4");
jLabelMaxVer.setFont(jLabelType.getFont());
jComboBoxName = new JComboBox();
jComboBoxName.setFont(new Font("Dialog", Font.PLAIN, 11));
jComboBoxType = new JComboBox();
jComboBoxType.setFont(jComboBoxName.getFont());
jComboBoxType.addActionListener(new SymAction());
jComboBoxType.addItem(null);
jComboBoxType.addItem(new OrderedValue(typeValues[0], 1, true));
jComboBoxType.addItem(new OrderedValue(typeValues[1], 2, true));
jTextFieldMinVer = new JTextFieldPopup();
jTextFieldMaxVer = new JTextFieldPopup();
jPanelWrapperGauche.setLayout(new CardLayout(5, 0));
jPanelWrapperDroite.setLayout(new CardLayout(5, 0));
jPanelOrCompGauche.setLayout(new GridLayout(4, 1, 0, 2));
jPanelOrCompDroite.setLayout(new GridLayout(4, 1, 0, 2));
jPanelOrCompGauche.add(jLabelType);
jPanelOrCompDroite.add(jComboBoxType);
jPanelOrCompGauche.add(jLabelName);
jPanelOrCompDroite.add(jComboBoxName);
jPanelOrCompGauche.add(jLabelMinVer);
jPanelOrCompDroite.add(jTextFieldMinVer);
jPanelOrCompGauche.add(jLabelMaxVer);
jPanelOrCompDroite.add(jTextFieldMaxVer);
jPanelWrapperGauche.add("g", jPanelOrCompGauche);
jPanelWrapperDroite.add("d", jPanelOrCompDroite);
jPanelGauche.add(BorderLayout.WEST, jPanelWrapperGauche);
jPanelGauche.add(BorderLayout.CENTER, jPanelWrapperDroite);
}
boolean isFilled() {
return !(jComboBoxName.getSelectedItem() == null &&
jTextFieldMinVer.getText().trim().equals("") &&
jTextFieldMaxVer.getText().trim().equals(""));
}
public void setEnabled(boolean b) {
jComboBoxType.setEnabled(b);
jComboBoxName.setEnabled(b);
jTextFieldMinVer.setEditable(b);
jTextFieldMinVer.setBackground(Color.white);
jTextFieldMaxVer.setEditable(b);
jTextFieldMaxVer.setBackground(Color.white);
}
class SymAction implements java.awt.event.ActionListener {
public void actionPerformed(java.awt.event.ActionEvent event) {
Object object = event.getSource();
if (object == jComboBoxType) {
jComboBoxName.removeAllItems();
int index = jComboBoxType.getSelectedIndex();
if( index == 1 )
jComboBoxName.setModel( getOSComboBoxModel() );
else if( index ==2 )
jComboBoxName.setModel( getBrowserComboBoxModel() );
}
}
}
//XML
String toXML(String key) {
String xml = "";
if (jComboBoxName.getSelectedItem() != null) {
xml += "<" + Util.getTag(key + ".1") + ">" +
"<source>LOMv1.0</source>\n" +
"<value>" +
Util.getXMLVocabulary(((OrderedValue) jComboBoxType.getSelectedItem()).value.toString()) +
"</value>\n" +
"</" + Util.getTag(key + ".1") + ">\n";
xml += "<" + Util.getTag(key + ".2") + ">" +
"<source>LOMv1.0</source>\n" +
"<value>" +
Util.getXMLVocabulary(((OrderedValue) jComboBoxName.getSelectedItem()).value.toString()) +
"</value>\n" +
"</" + Util.getTag(key + ".2") + ">\n";
}
if (!jTextFieldMinVer.getText().trim().equals(""))
xml += "<" + Util.getTag(key + ".3") + ">" +
Util.convertSpecialCharactersForXML(jTextFieldMinVer.getText().trim()) +
"</" + Util.getTag(key + ".3") + ">\n";
if (!jTextFieldMaxVer.getText().trim().equals(""))
xml += "<" + Util.getTag(key + ".4") + ">" +
Util.convertSpecialCharactersForXML(jTextFieldMaxVer.getText().trim()) +
"</" + Util.getTag(key + ".4") + ">\n";
if (xml.equals("")) xml = null;
return xml;
}
void fromXML(String path, Element e, List<String> observations) {
NodeList list = e.getChildNodes();
for (int i = 0; i < list.getLength(); i++) {
Node node = list.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
Element child = (Element) node;
try {
int pos = Util.getPosTag(path + "/" + child.getTagName().toLowerCase());
if (pos == 1) {
NodeList nl = child.getElementsByTagNameNS(CommonNamespaceContext.lomNSURI,"value");
if (nl.getLength() != 0) {
Element val = (Element) nl.item(0);
if (val.getFirstChild() != null) {
String key = val.getFirstChild().getNodeValue().trim();
int index = Util.getPosVocabulary(key, false);
jComboBoxType.setSelectedIndex(index);
}
}
}
if (pos == 2) {
NodeList nl = child.getElementsByTagNameNS(CommonNamespaceContext.lomNSURI,"value");
if (nl.getLength() != 0) {
Element val = (Element) nl.item(0);
if (val.getFirstChild() != null) {
String key = val.getFirstChild().getNodeValue().trim();
int index = Util.getPosVocabulary(key, false);
jComboBoxName.setSelectedIndex(index);
}
}
}
if (pos == 3) {
if (child.getFirstChild() != null)
jTextFieldMinVer.setText(child.getFirstChild().getNodeValue());
}
if (pos == 4) {
if (child.getFirstChild() != null)
jTextFieldMaxVer.setText(child.getFirstChild().getNodeValue());
}
} catch (IllegalTagException ite) {
}
}
}
}
//HTML
String toHTML(String key) {
String html = "";
if (jComboBoxName.getSelectedItem() != null) {
html += Util.getVocabulary(((OrderedValue) jComboBoxType.getSelectedItem()).value.toString()) + " : " +
jComboBoxName.getSelectedItem() + "<br>";
}
if (!jTextFieldMinVer.getText().trim().equals(""))
html += Util.getLabel(key + ".1.3") + " : " + jTextFieldMinVer.getText().trim() + "<br>";
if (!jTextFieldMaxVer.getText().trim().equals(""))
html += Util.getLabel(key + ".1.4") + " : " + jTextFieldMaxVer.getText().trim() + "<br>";
if (html.equals("")) html = null;
return html;
}
private Object[] getOSValues() {
return( Util.initVocabularyValues( "4.4.1.2.os", false ) );
}
private Object[] getBrowserValues() {
return( Util.initVocabularyValues( "4.4.1.2.browser", false ) );
}
private DefaultComboBoxModel getOSComboBoxModel() {
DefaultComboBoxModel model = new DefaultComboBoxModel();
Object[] values = getOSValues();
for( int i = 0; i < values.length; i++ )
model.addElement( new OrderedValue( values[ i ], i, true ) );
return( model );
}
private DefaultComboBoxModel getBrowserComboBoxModel() {
DefaultComboBoxModel model = new DefaultComboBoxModel();
Object[] values = getBrowserValues();
for( int i = 0; i < values.length; i++ )
model.addElement( new OrderedValue( values[ i ], i, true ) );
return( model );
}
}
| gpl-2.0 |
alessandrocolantoni/mandragora | src/main/java/it/aco/mandragora/bd/impl/SLSB/SLSBManagerBD.java | 418236 | /**
* Creation 03/02/2005
* Last Modification 04/11/2006
* @author Alessandro Colantoni
*/
/* ====================================================================
* GNU GENERAL PUBLIC LICENSE
* Version 2, June 1991
*
* Copyright (C) 1989, 1991 Free Software Foundation, Inc.
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*
* Preamble
*
* The licenses for most software are designed to take away your
* freedom to share and change it. By contrast, the GNU General Public
* License is intended to guarantee your freedom to share and change free
* software--to make sure the software is free for all its users. This
* General Public License applies to most of the Free Software
* Foundation's software and to any other program whose authors commit to
* using it. (Some other Free Software Foundation software is covered by
* the GNU Library General Public License instead.) You can apply it to
* your programs, too.
*
* When we speak of free software, we are referring to freedom, not
* price. Our General Public Licenses are designed to make sure that you
* have the freedom to distribute copies of free software (and charge for
* this service if you wish), that you receive source code or can get it
* if you want it, that you can change the software or use pieces of it
* in new free programs; and that you know you can do these things.
*
* To protect your rights, we need to make restrictions that forbid
* anyone to deny you these rights or to ask you to surrender the rights.
* These restrictions translate to certain responsibilities for you if you
* distribute copies of the software, or if you modify it.
*
* For example, if you distribute copies of such a program, whether
* gratis or for a fee, you must give the recipients all the rights that
* you have. You must make sure that they, too, receive or can get the
* source code. And you must show them these terms so they know their
* rights.
*
* We protect your rights with two steps: (1) copyright the software, and
* (2) offer you this license which gives you legal permission to copy,
* distribute and/or modify the software.
*
* Also, for each author's protection and ours, we want to make certain
* that everyone understands that there is no warranty for this free
* software. If the software is modified by someone else and passed on, we
* want its recipients to know that what they have is not the original, so
* that any problems introduced by others will not reflect on the original
* authors' reputations.
*
* Finally, any free program is threatened constantly by software
* patents. We wish to avoid the danger that redistributors of a free
* program will individually obtain patent licenses, in effect making the
* program proprietary. To prevent this, we have made it clear that any
* patent must be licensed for everyone's free use or not licensed at all.
*
* The precise terms and conditions for copying, distribution and
* modification follow.
*
* GNU GENERAL PUBLIC LICENSE
* TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
*
* 0. This License applies to any program or other work which contains
* a notice placed by the copyright holder saying it may be distributed
* under the terms of this General Public License. The "Program", below,
* refers to any such program or work, and a "work based on the Program"
* means either the Program or any derivative work under copyright law:
* that is to say, a work containing the Program or a portion of it,
* either verbatim or with modifications and/or translated into another
* language. (Hereinafter, translation is included without limitation in
* the term "modification".) Each licensee is addressed as "you".
*
* Activities other than copying, distribution and modification are not
* covered by this License; they are outside its scope. The act of
* running the Program is not restricted, and the output from the Program
* is covered only if its contents constitute a work based on the
* Program (independent of having been made by running the Program).
* Whether that is true depends on what the Program does.
*
* 1. You may copy and distribute verbatim copies of the Program's
* source code as you receive it, in any medium, provided that you
* conspicuously and appropriately publish on each copy an appropriate
* copyright notice and disclaimer of warranty; keep intact all the
* notices that refer to this License and to the absence of any warranty;
* and give any other recipients of the Program a copy of this License
* along with the Program.
*
* You may charge a fee for the physical act of transferring a copy, and
* you may at your option offer warranty protection in exchange for a fee.
*
* 2. You may modify your copy or copies of the Program or any portion
* of it, thus forming a work based on the Program, and copy and
* distribute such modifications or work under the terms of Section 1
* above, provided that you also meet all of these conditions:
*
* a) You must cause the modified files to carry prominent notices
* stating that you changed the files and the date of any change.
*
* b) You must cause any work that you distribute or publish, that in
* whole or in part contains or is derived from the Program or any
* part thereof, to be licensed as a whole at no charge to all third
* parties under the terms of this License.
*
* c) If the modified program normally reads commands interactively
* when run, you must cause it, when started running for such
* interactive use in the most ordinary way, to print or display an
* announcement including an appropriate copyright notice and a
* notice that there is no warranty (or else, saying that you provide
* a warranty) and that users may redistribute the program under
* these conditions, and telling the user how to view a copy of this
* License. (Exception: if the Program itself is interactive but
* does not normally print such an announcement, your work based on
* the Program is not required to print an announcement.)
*
* These requirements apply to the modified work as a whole. If
* identifiable sections of that work are not derived from the Program,
* and can be reasonably considered independent and separate works in
* themselves, then this License, and its terms, do not apply to those
* sections when you distribute them as separate works. But when you
* distribute the same sections as part of a whole which is a work based
* on the Program, the distribution of the whole must be on the terms of
* this License, whose permissions for other licensees extend to the
* entire whole, and thus to each and every part regardless of who wrote it.
*
* Thus, it is not the intent of this section to claim rights or contest
* your rights to work written entirely by you; rather, the intent is to
* exercise the right to control the distribution of derivative or
* collective works based on the Program.
*
* In addition, mere aggregation of another work not based on the Program
* with the Program (or with a work based on the Program) on a volume of
* a storage or distribution medium does not bring the other work under
* the scope of this License.
*
* 3. You may copy and distribute the Program (or a work based on it,
* under Section 2) in object code or executable form under the terms of
* Sections 1 and 2 above provided that you also do one of the following:
*
* a) Accompany it with the complete corresponding machine-readable
* source code, which must be distributed under the terms of Sections
* 1 and 2 above on a medium customarily used for software interchange; or,
*
* b) Accompany it with a written offer, valid for at least three
* years, to give any third party, for a charge no more than your
* cost of physically performing source distribution, a complete
* machine-readable copy of the corresponding source code, to be
* distributed under the terms of Sections 1 and 2 above on a medium
* customarily used for software interchange; or,
*
* c) Accompany it with the information you received as to the offer
* to distribute corresponding source code. (This alternative is
* allowed only for noncommercial distribution and only if you
* received the program in object code or executable form with such
* an offer, in accord with Subsection b above.)
*
* The source code for a work means the preferred form of the work for
* making modifications to it. For an executable work, complete source
* code means all the source code for all modules it contains, plus any
* associated interface definition files, plus the scripts used to
* control compilation and installation of the executable. However, as a
* special exception, the source code distributed need not include
* anything that is normally distributed (in either source or binary
* form) with the major components (compiler, kernel, and so on) of the
* operating system on which the executable runs, unless that component
* itself accompanies the executable.
*
* If distribution of executable or object code is made by offering
* access to copy from a designated place, then offering equivalent
* access to copy the source code from the same place counts as
* distribution of the source code, even though third parties are not
* compelled to copy the source along with the object code.
*
* 4. You may not copy, modify, sublicense, or distribute the Program
* except as expressly provided under this License. Any attempt
* otherwise to copy, modify, sublicense or distribute the Program is
* void, and will automatically terminate your rights under this License.
* However, parties who have received copies, or rights, from you under
* this License will not have their licenses terminated so long as such
* parties remain in full compliance.
*
* 5. You are not required to accept this License, since you have not
* signed it. However, nothing else grants you permission to modify or
* distribute the Program or its derivative works. These actions are
* prohibited by law if you do not accept this License. Therefore, by
* modifying or distributing the Program (or any work based on the
* Program), you indicate your acceptance of this License to do so, and
* all its terms and conditions for copying, distributing or modifying
* the Program or works based on it.
*
* 6. Each time you redistribute the Program (or any work based on the
* Program), the recipient automatically receives a license from the
* original licensor to copy, distribute or modify the Program subject to
* these terms and conditions. You may not impose any further
* restrictions on the recipients' exercise of the rights granted herein.
* You are not responsible for enforcing compliance by third parties to
* this License.
*
* 7. If, as a consequence of a court judgment or allegation of patent
* infringement or for any other reason (not limited to patent issues),
* conditions are imposed on you (whether by court order, agreement or
* otherwise) that contradict the conditions of this License, they do not
* excuse you from the conditions of this License. If you cannot
* distribute so as to satisfy simultaneously your obligations under this
* License and any other pertinent obligations, then as a consequence you
* may not distribute the Program at all. For example, if a patent
* license would not permit royalty-free redistribution of the Program by
* all those who receive copies directly or indirectly through you, then
* the only way you could satisfy both it and this License would be to
* refrain entirely from distribution of the Program.
* If any portion of this section is held invalid or unenforceable under
* any particular circumstance, the balance of the section is intended to
* apply and the section as a whole is intended to apply in other
* circumstances.
* It is not the purpose of this section to induce you to infringe any
* patents or other property right claims or to contest validity of any
* such claims; this section has the sole purpose of protecting the
* integrity of the free software distribution system, which is
* implemented by public license practices. Many people have made
* generous contributions to the wide range of software distributed
* through that system in reliance on consistent application of that
* system; it is up to the author/donor to decide if he or she is willing
* to distribute software through any other system and a licensee cannot
* impose that choice.
* This section is intended to make thoroughly clear what is believed to
* be a consequence of the rest of this License.
*
* 8. If the distribution and/or use of the Program is restricted in
* certain countries either by patents or by copyrighted interfaces, the
* original copyright holder who places the Program under this License
* may add an explicit geographical distribution limitation excluding
* those countries, so that distribution is permitted only in or among
* countries not thus excluded. In such case, this License incorporates
* the limitation as if written in the body of this License.
*
* 9. The Free Software Foundation may publish revised and/or new versions
* of the General Public License from time to time. Such new versions will
* be similar in spirit to the present version, but may differ in detail to
* address new problems or concerns.
*
* Each version is given a distinguishing version number. If the Program
* specifies a version number of this License which applies to it and "any
* later version", you have the option of following the terms and conditions
* either of that version or of any later version published by the Free
* Software Foundation. If the Program does not specify a version number of
* this License, you may choose any version ever published by the Free Software
* Foundation.
* 10. If you wish to incorporate parts of the Program into other free
* programs whose distribution conditions are different, write to the author
* to ask for permission. For software which is copyrighted by the Free
* Software Foundation, write to the Free Software Foundation; we sometimes
* make exceptions for this. Our decision will be guided by the two goals
* vof preserving the free status of all derivatives of our free software and
* of promoting the sharing and reuse of software generally.
*
* NO WARRANTY
*
* 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
* FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
* OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
* PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
* OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
* TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
* PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
* REPAIR OR CORRECTION.
*
* 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
* WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
* REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
* INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
* OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
* TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
* YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
* PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* END OF TERMS AND CONDITIONS
*
* How to Apply These Terms to Your New Programs
* If you develop a new program, and you want it to be of the greatest
* possible use to the public, the best way to achieve this is to make it
* free software which everyone can redistribute and change under these terms.
*
* To do so, attach the following notices to the program. It is safest
* to attach them to the start of each source file to most effectively
* convey the exclusion of warranty; and each file should have at least
* the "copyright" line and a pointer to where the full notice is found.
*
* <one line to give the program's name and a brief idea of what it does.>
* Copyright (C) <year> <name of author>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*
* Also add information on how to contact you by electronic and paper mail.
*
* If the program is interactive, make it output a short notice like this
* when it starts in an interactive mode:
*
* Gnomovision version 69, Copyright (C) year name of author
* Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
* This is free software, and you are welcome to redistribute it
* under certain conditions; type `show c' for details.
*
* The hypothetical commands `show w' and `show c' should show the appropriate
* parts of the General Public License. Of course, the commands you use may
* be called something other than `show w' and `show c'; they could even be
* mouse-clicks or menu items--whatever suits your program.
*
* You should also get your employer (if you work as a programmer) or your
* school, if any, to sign a "copyright disclaimer" for the program, if
* necessary. Here is a sample; alter the names:
*
* Yoyodyne, Inc., hereby disclaims all copyright interest in the program
* `Gnomovision' (which makes passes at compilers) written by James Hacker.
*
* <signature of Ty Coon>, 1 April 1989
* Ty Coon, President of Vice
* This General Public License does not permit incorporating your program into
* proprietary programs. If your program is a subroutine library, you may
* consider it more useful to permit linking proprietary applications with the
* library. If this is what you want to do, use the GNU Library General
* Public License instead of this License.
*/
package it.aco.mandragora.bd.impl.SLSB;
import it.aco.mandragora.serviceFacade.sessionFacade.remoteFacade.SLSB.business.BusinessSLSBFacadeHome;
import it.aco.mandragora.serviceFacade.sessionFacade.remoteFacade.SLSB.business.BusinessSLSBFacade;
import it.aco.mandragora.serviceFacade.sessionFacade.remoteFacade.SLSB.crud.CrudSLSBFacadeHome;
import it.aco.mandragora.serviceFacade.sessionFacade.remoteFacade.SLSB.crud.CrudSLSBFacade;
import it.aco.mandragora.exception.ApplicationException;
import it.aco.mandragora.exception.ServiceLocatorException;
import it.aco.mandragora.common.ServiceLocator;
import it.aco.mandragora.common.Utils;
import it.aco.mandragora.query.LogicCondition;
import it.aco.mandragora.bd.BD;
import javax.ejb.CreateException;
import javax.ejb.EJBException;
import java.rmi.RemoteException;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.HashMap;
public class SLSBManagerBD implements BD {
static private org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(SLSBManagerBD.class.getName());
//private BusinessSLSBFacadeHome businessSLSBFacadeHome; changed at protected on 17-04-2009
protected BusinessSLSBFacadeHome businessSLSBFacadeHome;
//private CrudSLSBFacadeHome crudSLSBFacadeHome; changed at protected on 17-04-2009
protected CrudSLSBFacadeHome crudSLSBFacadeHome;
protected static SLSBManagerBD sLSBManagerBD = null;
static {
try{
if (sLSBManagerBD!=null) throw new ApplicationException("thrown in the static block of SLSBManagerBD: static instance is already set");//added by alessandro on 24/09/2007
sLSBManagerBD = new SLSBManagerBD();
} catch(ApplicationException e){
e.printStackTrace();
log.error("ERROR in static of SLSBManagerBD "+e);
}
}
protected SLSBManagerBD() throws ApplicationException{
try{
ServiceLocator serviceLocator = ServiceLocator.getInstance();
businessSLSBFacadeHome = (BusinessSLSBFacadeHome)serviceLocator.getEJBHome(Utils.getStringFromMandragoraProperties("SLSBManagerBD.businessManager"));
//business = businessHome.create();
crudSLSBFacadeHome = (CrudSLSBFacadeHome)serviceLocator.getEJBHome(Utils.getStringFromMandragoraProperties("SLSBManagerBD.crudManager"));
//crud = crudHome.create();
} catch(ServiceLocatorException e){
throw new ApplicationException("ServiceLocator Exception en el constructor de SLSBManagerBD "+ e.toString());
} catch(Exception e){
e.printStackTrace();
log.error("ERROR in Constructor SLSBManagerBD "+e);
throw new ApplicationException("Error in SLSBManagerBD "+ e.toString());
}
}
public static SLSBManagerBD getInstance() {
return sLSBManagerBD;
}
/***********************R E A D start******************/
public Object findByPrimaryKey(Class realClass,Object[] pkValues) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.findByPrimaryKey(realClass,pkValues);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.findByPrimaryKey(Class realClass,Object[] pkValues): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findByPrimaryKey(Class realClass,Object[] pkValues)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.findByPrimaryKey(Class realClass,Object[] pkValues): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findByPrimaryKey(Class realClass,Object[] pkValues)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.findByPrimaryKey(Class realClass,Object[] pkValues): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findByPrimaryKey(Class realClass,Object[] pkValues)" + e.toString(),e);
}
}
public Object findByPrimaryKey(Class realClass,String[] pkFieldNames, Object[] pkValues) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.findByPrimaryKey( realClass, pkFieldNames, pkValues);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.findByPrimaryKey(Class realClass,String[] pkFieldNames, Object[] pkValues): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findByPrimaryKey(Class realClass,String[] pkFieldNames, Object[] pkValues)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.findByPrimaryKey(Class realClass,String[] pkFieldNames, Object[] pkValues): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findByPrimaryKey(Class realClass,String[] pkFieldNames, Object[] pkValues)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.findByPrimaryKey(Class realClass,String[] pkFieldNames, Object[] pkValues): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findByPrimaryKey(Class realClass,String[] pkFieldNames, Object[] pkValues)" + e.toString(),e);
}
}
public Object findByPrimaryKey(Class realClass, Object pkValue) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.findByPrimaryKey( realClass, pkValue);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.findByPrimaryKey(Class realClass, Object pkValue): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findByPrimaryKey(Class realClass, Object pkValue)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.findByPrimaryKey(Class realClass, Object pkValue): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findByPrimaryKey(Class realClass, Object pkValue)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.findByPrimaryKey(Class realClass, Object pkValue): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findByPrimaryKey(Class realClass, Object pkValue)" + e.toString(),e);
}
}
public Object findObjectByTemplate(Object templateVO) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.findObjectByTemplate( templateVO);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.findObjectByTemplate(Object templateVO): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findObjectByTemplate(Object templateVO)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.findObjectByTemplate(Object templateVO): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findObjectByTemplate(Object templateVO)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.findObjectByTemplate(Object templateVO): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findObjectByTemplate(Object templateVO)" + e.toString(),e);
}
}
public Collection findCollectionByTemplate(Object templateVO) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.findCollectionByTemplate( templateVO);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.findCollectionByTemplate(Object templateVO): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByTemplate(Object templateVO)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.findCollectionByTemplate(Object templateVO): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByTemplate(Object templateVO)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.findCollectionByTemplate(Object templateVO): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByTemplate(Object templateVO)" + e.toString(),e);
}
}
public Collection findCollectionByTemplate(Object templateVO, String orderingField, Boolean asc) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.findCollectionByTemplate( templateVO, orderingField, asc);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.findCollectionByTemplate(Object templateVO, String orderingField, Boolean asc): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByTemplate(Object templateVO, String orderingField, Boolean asc)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.findCollectionByTemplate(Object templateVO, String orderingField, Boolean asc): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByTemplate(Object templateVO, String orderingField, Boolean asc)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.findCollectionByTemplate(Object templateVO, String orderingField, Boolean asc): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByTemplate(Object templateVO, String orderingField, Boolean asc)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #findCollectionByTemplate(Object templateVO, String orderingField, Boolean asc)}
*/
public Collection findOrderedCollectionByTemplate(Object templateVO, String orderingField, boolean asc) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.findCollectionByTemplate(templateVO,orderingField,new Boolean(asc));
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.findOrderedCollectionByTemplate(Object templateVO, String orderingField, boolean asc): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findOrderedCollectionByTemplate(Object templateVO, String orderingField, boolean asc)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.findOrderedCollectionByTemplate(Object templateVO, String orderingField, boolean asc): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findOrderedCollectionByTemplate(Object templateVO, String orderingField, boolean asc)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.findOrderedCollectionByTemplate(Object templateVO, String orderingField, boolean asc): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findOrderedCollectionByTemplate(Object templateVO, String orderingField, boolean asc)" + e.toString(),e);
}
}
public Collection findCollectionByNullFields(Class realClass, String[] nullFields) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.findCollectionByNullFields(realClass, nullFields);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.findCollectionByNullFields(Class realClass, String[] nullFields): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByNullFields(Class realClass, String[] nullFields) " + e.toString(),e);
} catch (CreateException e) {
log.error("RemoteException caught in SLSBManagerBD.findCollectionByNullFields(Class realClass, String[] nullFields): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByNullFields(Class realClass, String[] nullFields) " + e.toString(),e);
} catch (EJBException e) {
log.error("RemoteException caught in SLSBManagerBD.findCollectionByNullFields(Class realClass, String[] nullFields): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByNullFields(Class realClass, String[] nullFields) " + e.toString(),e);
}
}
public Collection findCollectionByLogicCondition(Class realClass, LogicCondition logicCondition) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.findCollectionByLogicCondition(realClass, logicCondition);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.findCollectionByLogicCondition(Class realClass,LogicCondition logicCondition): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByLogicCondition(Class realClass,LogicCondition logicCondition) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.findCollectionByLogicCondition(Class realClass,LogicCondition logicCondition): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByLogicCondition(Class realClass,LogicCondition logicCondition) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.findCollectionByLogicCondition(Class realClass,LogicCondition logicCondition): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByLogicCondition(Class realClass,LogicCondition logicCondition) " + e.toString(),e);
}
}
/**
* @deprecated use {@link #findCollectionByLogicCondition(Class realClass,LogicCondition logicCondition,String orderingField, Boolean asc,Integer startAtIndex, Integer endAtIndex)}
*/
public Collection findLimitedOrderedCollectionByLogicCondition(Class realClass,LogicCondition logicCondition,String orderingField, boolean asc,int startAtIndex, int endAtIndex) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.findCollectionByLogicCondition(realClass,logicCondition,orderingField, new Boolean(asc), new Integer(startAtIndex), new Integer(endAtIndex));
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.findLimitedOrderedCollectionByLogicCondition(Class realClass,LogicCondition logicCondition,String orderingField, boolean asc,int startAtIndex, int endAtIndex): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findLimitedOrderedCollectionByLogicCondition(Class realClass,LogicCondition logicCondition,String orderingField, boolean asc,int startAtIndex, int endAtIndex)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.findLimitedOrderedCollectionByLogicCondition(Class realClass,LogicCondition logicCondition,String orderingField, boolean asc,int startAtIndex, int endAtIndex): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findLimitedOrderedCollectionByLogicCondition(Class realClass,LogicCondition logicCondition,String orderingField, boolean asc,int startAtIndex, int endAtIndex)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.findLimitedOrderedCollectionByLogicCondition(Class realClass,LogicCondition logicCondition,String orderingField, boolean asc,int startAtIndex, int endAtIndex): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findLimitedOrderedCollectionByLogicCondition(Class realClass,LogicCondition logicCondition,String orderingField, boolean asc,int startAtIndex, int endAtIndex)" + e.toString(),e);
}
}
public Collection findCollectionByLogicCondition(Class realClass,LogicCondition logicCondition,String orderingField, Boolean asc,Integer startAtIndex, Integer endAtIndex) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.findCollectionByLogicCondition( realClass, logicCondition, orderingField, asc, startAtIndex, endAtIndex);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.findCollectionByLogicCondition(Class realClass,LogicCondition logicCondition,String orderingField, Boolean asc,Integer startAtIndex, Integer endAtIndex): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByLogicCondition(Class realClass,LogicCondition logicCondition,String orderingField, Boolean asc,Integer startAtIndex, Integer endAtIndex)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.findCollectionByLogicCondition(Class realClass,LogicCondition logicCondition,String orderingField, Boolean asc,Integer startAtIndex, Integer endAtIndex): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByLogicCondition(Class realClass,LogicCondition logicCondition,String orderingField, Boolean asc,Integer startAtIndex, Integer endAtIndex)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.findCollectionByLogicCondition(Class realClass,LogicCondition logicCondition,String orderingField, Boolean asc,Integer startAtIndex, Integer endAtIndex): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByLogicCondition(Class realClass,LogicCondition logicCondition,String orderingField, Boolean asc,Integer startAtIndex, Integer endAtIndex)" + e.toString(),e);
}
}
public Collection findCollectionByOrValues(Class realClass,String pAttributeName,Collection valuesCollection) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.findCollectionByOrValues( realClass, pAttributeName, valuesCollection);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.findCollectionByOrValues(Class realClass,String pAttributeName,Collection valuesCollection): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByOrValues(Class realClass,String pAttributeName,Collection valuesCollection)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.findCollectionByOrValues(Class realClass,String pAttributeName,Collection valuesCollection): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByOrValues(Class realClass,String pAttributeName,Collection valuesCollection)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.findCollectionByOrValues(Class realClass,String pAttributeName,Collection valuesCollection): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByOrValues(Class realClass,String pAttributeName,Collection valuesCollection)" + e.toString(),e);
}
}
public Collection findCollectionByAndFieldsOperatorValues(Class realClass,String[] pAttributeNames, String[] operators,Object[] valuesArray) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.findCollectionByAndFieldsOperatorValues(realClass, pAttributeNames, operators, valuesArray);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.findCollectionByAndFieldsOperatorValues(Class realClass,String[] pAttributeNames, String[] operators,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByAndFieldsOperatorValues(Class realClass,String[] pAttributeNames, String[] operators,Object[] valuesArray)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.findCollectionByAndFieldsOperatorValues(Class realClass,String[] pAttributeNames, String[] operators,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByAndFieldsOperatorValues(Class realClass,String[] pAttributeNames, String[] operators,Object[] valuesArray)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.findCollectionByAndFieldsOperatorValues(Class realClass,String[] pAttributeNames, String[] operators,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByAndFieldsOperatorValues(Class realClass,String[] pAttributeNames, String[] operators,Object[] valuesArray)" + e.toString(),e);
}
}
public Collection findCollectionByArrayOfFieldsOperatorsMatrixAndOrValues(Class realClass,String[] pAttributeNames, String[] operators,Object[][] valuesMatrix) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.findCollectionByArrayOfFieldsOperatorsMatrixAndOrValues(realClass, pAttributeNames, operators, valuesMatrix);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.findCollectionByArrayOfFieldsOperatorsMatrixAndOrValues(Class realClass,String[] pAttributeNames, String[] operators,Object[][] valuesMatrix): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByArrayOfFieldsOperatorsMatrixAndOrValues(Class realClass,String[] pAttributeNames, String[] operators,Object[][] valuesMatrix)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.findCollectionByArrayOfFieldsOperatorsMatrixAndOrValues(Class realClass,String[] pAttributeNames, String[] operators,Object[][] valuesMatrix): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByArrayOfFieldsOperatorsMatrixAndOrValues(Class realClass,String[] pAttributeNames, String[] operators,Object[][] valuesMatrix)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.findCollectionByArrayOfFieldsOperatorsMatrixAndOrValues(Class realClass,String[] pAttributeNames, String[] operators,Object[][] valuesMatrix): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByArrayOfFieldsOperatorsMatrixAndOrValues(Class realClass,String[] pAttributeNames, String[] operators,Object[][] valuesMatrix)" + e.toString(),e);
}
}
public Collection findCollectionByFieldsNotEqualsToValues(Class realClass,String[] pAttributeNames,Object[] valuesArray) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.findCollectionByFieldsNotEqualsToValues(realClass, pAttributeNames, valuesArray) ;
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.findCollectionByFieldsNotEqualsToValues(Class realClass,String[] pAttributeNames,Object[] valuesArray) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByFieldsNotEqualsToValues(Class realClass,String[] pAttributeNames,Object[] valuesArray) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.findCollectionByFieldsNotEqualsToValues(Class realClass,String[] pAttributeNames,Object[] valuesArray) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByFieldsNotEqualsToValues(Class realClass,String[] pAttributeNames,Object[] valuesArray) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.findCollectionByFieldsNotEqualsToValues(Class realClass,String[] pAttributeNames,Object[] valuesArray) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByFieldsNotEqualsToValues(Class realClass,String[] pAttributeNames,Object[] valuesArray) " + e.toString(),e);
}
}
public Collection findCollectionByFieldInCollection(Class realClass,String pAttributeName, Collection valuesCollection) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.findCollectionByFieldInCollection(realClass, pAttributeName, valuesCollection);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.findCollectionByFieldInCollection(Class realClass,String pAttributeName, Collection valuesCollection) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByFieldInCollection(Class realClass,String pAttributeName, Collection valuesCollection) " + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.findCollectionByFieldInCollection(Class realClass,String pAttributeName, Collection valuesCollection) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByFieldInCollection(Class realClass,String pAttributeName, Collection valuesCollection) " + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.findCollectionByFieldInCollection(Class realClass,String pAttributeName, Collection valuesCollection) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.findCollectionByFieldInCollection(Class realClass,String pAttributeName, Collection valuesCollection) " + e.toString(),e);
}
}
public Collection searchValueInFields(Class realClass,String[] pAttributeNames,Object value) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.searchValueInFields(realClass, pAttributeNames, value) ;
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.searchValueInFields(Class realClass,String[] pAttributeNames,Object value) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.searchValueInFields(Class realClass,String[] pAttributeNames,Object value) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.searchValueInFields(Class realClass,String[] pAttributeNames,Object value) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.searchValueInFields(Class realClass,String[] pAttributeNames,Object value) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.searchValueInFields(Class realClass,String[] pAttributeNames,Object value) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.searchValueInFields(Class realClass,String[] pAttributeNames,Object value) " + e.toString(),e);
}
}
public Collection getCollectionOfStoredItemsNotInBean(Object pInstance, String pAttributeName) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.getCollectionOfStoredItemsNotInBean( pInstance, pAttributeName);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.getCollectionOfStoredItemsNotInBean(Object pInstance, String pAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.getCollectionOfStoredItemsNotInBean(Object pInstance, String pAttributeName) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.getCollectionOfStoredItemsNotInBean(Object pInstance, String pAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.getCollectionOfStoredItemsNotInBean(Object pInstance, String pAttributeName) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.getCollectionOfStoredItemsNotInBean(Object pInstance, String pAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.getCollectionOfStoredItemsNotInBean(Object pInstance, String pAttributeName) " + e.toString(),e);
}
}
public Collection getStoredCollection(Object pInstance, String pAttributeName) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.getStoredCollection(pInstance, pAttributeName);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.getStoredCollection(Object pInstance, String pAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.getStoredCollection(Object pInstance, String pAttributeName) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.getStoredCollection(Object pInstance, String pAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.getStoredCollection(Object pInstance, String pAttributeName) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.getStoredCollection(Object pInstance, String pAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.getStoredCollection(Object pInstance, String pAttributeName) " + e.toString(),e);
}
}
public Iterator getReportQueryIterator(Class realClass,LogicCondition logicCondition, String[] pAttributeNames, String[] groupBy) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.getReportQueryIterator(realClass, logicCondition, pAttributeNames, groupBy);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.getReportQueryIterator(Class realClass,LogicCondition logicCondition, String[] pAttributeNames, String[] groupBy): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.getReportQueryIterator(Class realClass,LogicCondition logicCondition, String[] pAttributeNames, String[] groupBy) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.getReportQueryIterator(Class realClass,LogicCondition logicCondition, String[] pAttributeNames, String[] groupBy): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.getReportQueryIterator(Class realClass,LogicCondition logicCondition, String[] pAttributeNames, String[] groupBy) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.getReportQueryIterator(Class realClass,LogicCondition logicCondition, String[] pAttributeNames, String[] groupBy): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.getReportQueryIterator(Class realClass,LogicCondition logicCondition, String[] pAttributeNames, String[] groupBy) " + e.toString(),e);
}
}
public void retrieveReference(Object pInstance, String pAttributeName) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.retrieveReference( pInstance, pAttributeName) ;
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.retrieveReference(Object pInstance, String pAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveReference(Object pInstance, String pAttributeName) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.retrieveReference(Object pInstance, String pAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveReference(Object pInstance, String pAttributeName) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.retrieveReference(Object pInstance, String pAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveReference(Object pInstance, String pAttributeName) " + e.toString(),e);
}
}
public void retrieveAllReferences(Object pInstance) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.retrieveAllReferences( pInstance) ;
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.retrieveAllReferences(Object pInstance) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveAllReferences(Object pInstance) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.retrieveAllReferences(Object pInstance) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveAllReferences(Object pInstance) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.retrieveAllReferences(Object pInstance) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveAllReferences(Object pInstance) " + e.toString(),e);
}
}
public void retrieveAllReferencesInCollection(Collection valueObjectsCollection) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.retrieveAllReferencesInCollection(valueObjectsCollection) ;
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.retrieveAllReferencesInCollection(Collection valueObjectsCollection) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveAllReferencesInCollection(Collection valueObjectsCollection) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.retrieveAllReferencesInCollection(Collection valueObjectsCollection) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveAllReferencesInCollection(Collection valueObjectsCollection) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.retrieveAllReferencesInCollection(Collection valueObjectsCollection) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveAllReferencesInCollection(Collection valueObjectsCollection) " + e.toString(),e);
}
}
public void retrieveReferenceInCollection(Collection valueObjectsCollection, String pAttributeName) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.retrieveReferenceInCollection(valueObjectsCollection, pAttributeName);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.retrieveReferenceInCollection(Collection valueObjectsCollection, String pAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveReferenceInCollection(Collection valueObjectsCollection, String pAttributeName) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.retrieveReferenceInCollection(Collection valueObjectsCollection, String pAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveReferenceInCollection(Collection valueObjectsCollection, String pAttributeName) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.retrieveReferenceInCollection(Collection valueObjectsCollection, String pAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveReferenceInCollection(Collection valueObjectsCollection, String pAttributeName) " + e.toString(),e);
}
}
public void retrievePathReference(Object valueobjectOrCollection, String path) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.retrievePathReference( valueobjectOrCollection, path);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.retrievePathReference(Object valueobjectOrCollection, String path) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrievePathReference(Object valueobjectOrCollection, String path) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.retrievePathReference(Object valueobjectOrCollection, String path) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrievePathReference(Object valueobjectOrCollection, String path) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.retrievePathReference(Object valueobjectOrCollection, String path) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrievePathReference(Object valueobjectOrCollection, String path) " + e.toString(),e);
}
}
public void retrieveNullPathReference(Object valueobjectOrCollection, String path) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.retrieveNullPathReference(valueobjectOrCollection, path);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.retrieveNullPathReference(Object valueobjectOrCollection, String path) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveNullPathReference(Object valueobjectOrCollection, String path) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.retrieveNullPathReference(Object valueobjectOrCollection, String path) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveNullPathReference(Object valueobjectOrCollection, String path) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.retrieveNullPathReference(Object valueobjectOrCollection, String path) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveNullPathReference(Object valueobjectOrCollection, String path) " + e.toString(),e);
}
}
public void retrieveNullReference(Object pInstance, String pAttributeName) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.retrieveNullReference( pInstance, pAttributeName);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.retrieveNullReference(Object pInstance, String pAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveNullReference(Object pInstance, String pAttributeName) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.retrieveNullReference(Object pInstance, String pAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveNullReference(Object pInstance, String pAttributeName) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.retrieveNullReference(Object pInstance, String pAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveNullReference(Object pInstance, String pAttributeName) " + e.toString(),e);
}
}
public void retrieveAllNullReferences(Object pInstance) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.retrieveAllNullReferences( pInstance);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.retrieveAllNullReferences(Object pInstance) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveAllNullReferences(Object pInstance) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.retrieveAllNullReferences(Object pInstance) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveAllNullReferences(Object pInstance) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.retrieveAllNullReferences(Object pInstance) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveAllNullReferences(Object pInstance) " + e.toString(),e);
}
}
/***********************R E A D end ******************/
/*********************** D E L E T E start******************/
public void delete(Object deleteVO) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.delete( deleteVO);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.delete(Object deleteVO): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.delete(Object deleteVO) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.delete(Object deleteVO): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.delete(Object deleteVO) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.delete(Object deleteVO): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.delete(Object deleteVO) " + e.toString(),e);
}
}
public void deleteCollection(Collection deleteVOs) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.deleteCollection(deleteVOs);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.deleteCollection(Collection deleteVOs): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deleteCollection(Collection deleteVOs) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.deleteCollection(Collection deleteVOs): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deleteCollection(Collection deleteVOs) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.deleteCollection(Collection deleteVOs): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deleteCollection(Collection deleteVOs) " + e.toString(),e);
}
}
public void deleteMToNRelationshipCollection(Object left, String leftFieldName, Collection rightCollection) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.deleteMToNRelationshipCollection(left, leftFieldName, rightCollection) ;
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.deleteMToNRelationshipCollection(Object left, String leftFieldName, Collection rightCollection) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deleteMToNRelationshipCollection(Object left, String leftFieldName, Collection rightCollection) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.deleteMToNRelationshipCollection(Object left, String leftFieldName, Collection rightCollection) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deleteMToNRelationshipCollection(Object left, String leftFieldName, Collection rightCollection) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.deleteMToNRelationshipCollection(Object left, String leftFieldName, Collection rightCollection) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deleteMToNRelationshipCollection(Object left, String leftFieldName, Collection rightCollection) " + e.toString(),e);
}
}
public void deleteItemsNotInCollectionsInPath(Object rootVO, String path, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.deleteItemsNotInCollectionsInPath(rootVO, path, applyDeletePathCascade, ifM2NDeleteOnlyRelationship, deleteOneToOne) ;
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.deleteItemsNotInCollectionsInPath(Object rootVO, String path, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deleteItemsNotInCollectionsInPath(Object rootVO, String path, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.deleteItemsNotInCollectionsInPath(Object rootVO, String path, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deleteItemsNotInCollectionsInPath(Object rootVO, String path, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.deleteItemsNotInCollectionsInPath(Object rootVO, String path, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deleteItemsNotInCollectionsInPath(Object rootVO, String path, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne) " + e.toString(),e);
}
}
public void deleteItemsNotInCollectionsInPath(Object rootVO, String path) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.deleteItemsNotInCollectionsInPath(rootVO, path);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.deleteItemsNotInCollectionsInPath(Object rootVO, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deleteItemsNotInCollectionsInPath(Object rootVO, String path)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.deleteItemsNotInCollectionsInPath(Object rootVO, String path) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deleteItemsNotInCollectionsInPath(Object rootVO, String path)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.deleteItemsNotInCollectionsInPath(Object rootVO, String path) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deleteItemsNotInCollectionsInPath(Object rootVO, String path) " + e.toString(),e);
}
}
public void deleteItemsNotInCollectionsInPath(Object rootVO, String path,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.deleteItemsNotInCollectionsInPath(rootVO, path, ifM2NDeleteOnlyRelationship, deleteOneToOne);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.deleteItemsNotInCollectionsInPath(Object rootVO, String path,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deleteItemsNotInCollectionsInPath(Object rootVO, String path,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.deleteItemsNotInCollectionsInPath(Object rootVO, String path,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deleteItemsNotInCollectionsInPath(Object rootVO, String path,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.deleteItemsNotInCollectionsInPath(Object rootVO, String path,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deleteItemsNotInCollectionsInPath(Object rootVO, String path,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne) " + e.toString(),e);
}
}
public void deleteItemsNotInCollectionsInPaths(Object rootVO, Collection paths, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.deleteItemsNotInCollectionsInPaths(rootVO, paths, applyDeletePathCascade, ifM2NDeleteOnlyRelationship, deleteOneToOne);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.deleteItemsNotInCollectionsInPaths(Object rootVO, Collection paths, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deleteItemsNotInCollectionsInPaths(Object rootVO, Collection paths, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.deleteItemsNotInCollectionsInPaths(Object rootVO, Collection paths, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deleteItemsNotInCollectionsInPaths(Object rootVO, Collection paths, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.deleteItemsNotInCollectionsInPaths(Object rootVO, Collection paths, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deleteItemsNotInCollectionsInPaths(Object rootVO, Collection paths, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne)" + e.toString(),e);
}
}
public void deletePathCascade(Object parentVO,String path,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.deletePathCascade(parentVO, path, ifM2NDeleteOnlyRelationship, deleteOneToOne);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.deletePathCascade(Object parentVO,String path,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deletePathCascade(Object parentVO,String path,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.deletePathCascade(Object parentVO,String path,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deletePathCascade(Object parentVO,String path,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.deletePathCascade(Object parentVO,String path,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deletePathCascade(Object parentVO,String path,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne)" + e.toString(),e);
}
}
public void deletePathsCascade(Object parentVO,Collection paths,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.deletePathsCascade(parentVO, paths, ifM2NDeleteOnlyRelationship, deleteOneToOne);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.deletePathsCascade(Object parentVO,Collection paths,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deletePathsCascade(Object parentVO,Collection paths,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.deletePathsCascade(Object parentVO,Collection paths,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deletePathsCascade(Object parentVO,Collection paths,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.deletePathsCascade(Object parentVO,Collection paths,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.deletePathsCascade(Object parentVO,Collection paths,Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne)" + e.toString(),e);
}
}
/*********************** D E L E T E end******************/
/*********************** C R E A T E start******************/
public Object insert(Object storeVO) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.insert(storeVO);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.insert(Object storeVO) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.insert(Object storeVO) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.insert(Object storeVO) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.insert(Object storeVO) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.insert(Object storeVO) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.insert(Object storeVO) " + e.toString(),e);
}
}
/*********************** C R E A T E end******************/
/*********************** U P D A T E start******************/
public Object update(Object storeVO) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.update(storeVO);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.update(Object storeVO) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.update(Object storeVO) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.update(Object storeVO) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.update(Object storeVO) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.update(Object storeVO) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.update(Object storeVO) " + e.toString(),e);
}
}
public void updateCollection(Collection storeVOs) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.updateCollection(storeVOs);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.updateCollection(Collection storeVOs) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollection(Collection storeVOs) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.updateCollection(Collection storeVOs) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollection(Collection storeVOs) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.updateCollection(Collection storeVOs) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollection(Collection storeVOs) " + e.toString(),e);
}
}
public Object updateCollectionReference(Object storeVO, String pAttributeName)throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.updateCollectionReference(storeVO, pAttributeName);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.updateCollectionReference(Object storeVO, String pAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollectionReference(Object storeVO, String pAttributeName) " + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.updateCollectionReference(Object storeVO, String pAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollectionReference(Object storeVO, String pAttributeName) " + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.updateCollectionReference(Object storeVO, String pAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollectionReference(Object storeVO, String pAttributeName) " + e.toString(),e);
}
}
public Object updateCollectionReferences(Object storeVO) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.updateCollectionReferences(storeVO);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.updateCollectionReferences(Object storeVO): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollectionReferences(Object storeVO) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.updateCollectionReferences(Object storeVO): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollectionReferences(Object storeVO) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.updateCollectionReferences(Object storeVO): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollectionReferences(Object storeVO) " + e.toString(),e);
}
}
public void storePathCascade(Object storeVO,String path) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.storePathCascade(storeVO, path);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.storePathCascade(Object storeVO,String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.storePathCascade(Object storeVO,String path) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.sstorePathCascade(Object storeVO,String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.storePathCascade(Object storeVO,String path) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.storePathCascade(Object storeVO,String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.storePathCascade(Object storeVO,String path) " + e.toString(),e);
}
}
public void storePathsCascade(Object storeVO,Collection paths, Boolean pathsHasToBeSorted, Boolean storeVOHasToBeStored) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
crudSLSBFacade.storePathsCascade(storeVO, paths, pathsHasToBeSorted, storeVOHasToBeStored);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.storePathsCascade(Object storeVO,Collection paths, Boolean pathsHasToBeSorted, Boolean storeVOHasToBeStored): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.storePathsCascade(Object storeVO,Collection paths, Boolean pathsHasToBeSorted, Boolean storeVOHasToBeStored) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.storePathsCascade(storeVO, paths, pathsHasToBeSorted, storeVOHasToBeStored): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.storePathsCascade(storeVO, paths, pathsHasToBeSorted, storeVOHasToBeStored) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.storePathsCascade(storeVO, paths, pathsHasToBeSorted, storeVOHasToBeStored): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.storePathsCascade(storeVO, paths, pathsHasToBeSorted, storeVOHasToBeStored) " + e.toString(),e);
}
}
/**
*
* @deprecated use {@link #updateCreateTrees(Object storeVO, Collection trees, Boolean storeVOHasToBeUpdated)}
*/
public Object updateCreateTrees(Object storeVO, Collection trees, boolean storeVOHasToBeUpdated) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.updateCreateTrees( storeVO, trees, new Boolean(storeVOHasToBeUpdated));
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.updateCreateTrees(Object storeVO, Collection trees, boolean storeVOHasToBeUpdated) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCreateTrees(Object storeVO, Collection trees, boolean storeVOHasToBeUpdated) " + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.updateCreateTrees(Object storeVO, Collection trees, boolean storeVOHasToBeUpdated) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCreateTrees(Object storeVO, Collection trees, boolean storeVOHasToBeUpdated) " + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.updateCreateTrees(Object storeVO, Collection trees, boolean storeVOHasToBeUpdated) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCreateTrees(Object storeVO, Collection trees, boolean storeVOHasToBeUpdated) " + e.toString(),e);
}
}
public Object updateCreateTrees(Object storeVO,Collection trees, Boolean storeVOHasToBeUpdated, Boolean deleteChangedOneToOne, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.updateCreateTrees( storeVO, trees, storeVOHasToBeUpdated , deleteChangedOneToOne, applyDeletePathCascade, ifM2NDeleteOnlyRelationship, deleteOneToOne);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.updateCreateTrees(Object storeVO,Collection trees, Boolean storeVOHasToBeUpdated, Boolean deleteChangedOneToOne, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCreateTrees(Object storeVO,Collection trees, Boolean storeVOHasToBeUpdated, Boolean deleteChangedOneToOne, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne) " + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.updateCreateTrees(Object storeVO,Collection trees, Boolean storeVOHasToBeUpdated, Boolean deleteChangedOneToOne, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCreateTrees(Object storeVO,Collection trees, Boolean storeVOHasToBeUpdated, Boolean deleteChangedOneToOne, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne) " + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.updateCreateTrees(Object storeVO,Collection trees, Boolean storeVOHasToBeUpdated, Boolean deleteChangedOneToOne, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCreateTrees(Object storeVO,Collection trees, Boolean storeVOHasToBeUpdated, Boolean deleteChangedOneToOne, Boolean applyDeletePathCascade, Boolean ifM2NDeleteOnlyRelationship, Boolean deleteOneToOne) " + e.toString(),e);
}
}
public Object updateCreateTrees(Object storeVO, Collection trees, Boolean storeVOHasToBeUpdated) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.updateCreateTrees( storeVO, trees, storeVOHasToBeUpdated);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.updateCreateTrees(Object storeVO, Collection trees, Boolean storeVOHasToBeUpdated): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCreateTrees(Object storeVO, Collection trees, Boolean storeVOHasToBeUpdated) " + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.updateCreateTrees(Object storeVO, Collection trees, Boolean storeVOHasToBeUpdated): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCreateTrees(Object storeVO, Collection trees, Boolean storeVOHasToBeUpdated) " + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.updateCreateTrees(Object storeVO, Collection trees, Boolean storeVOHasToBeUpdated): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCreateTrees(Object storeVO, Collection trees, Boolean storeVOHasToBeUpdated) " + e.toString(),e);
}
}
public Object updateCreateTrees(Object storeVO,Collection trees) throws ApplicationException{
try {
CrudSLSBFacade crudSLSBFacade= crudSLSBFacadeHome.create();
return crudSLSBFacade.updateCreateTrees( storeVO, trees) ;
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.updateCreateTrees(Object storeVO,Collection trees) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCreateTrees(Object storeVO,Collection trees) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.updateCreateTrees(Object storeVO,Collection trees) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCreateTrees(Object storeVO,Collection trees) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.updateCreateTrees(Object storeVO,Collection trees) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCreateTrees(Object storeVO,Collection trees) " + e.toString(),e);
}
}
/*********************** U P D A T E end******************/
/*********************** B U S I N E S S start******************/
public Map buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass) throws ApplicationException{
try {
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName, isValueObjectKeyAttributeNameToSet, valueObjectValueAttributeName, mapValueClassAttributeToSetName, mapValueClass);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass)}
*/
public HashMap buildHashMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass) throws ApplicationException{
try {
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return (HashMap) businessSLSBFacade.buildMap( pInstance, pAttributeName, valueObjectKeyAttributeName,new Boolean(isValueObjectKeyAttributeNameToSet), valueObjectValueAttributeName, mapValueClass);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildHashMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildHashMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildHashMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildHashMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildHashMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildHashMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}
}
public Map buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass) throws ApplicationException{
try {
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName, isValueObjectKeyAttributeNameToSet, valueObjectValueAttributeName,mapValueClass);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}
}
public Map buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass) throws ApplicationException{
try {
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName, isValueObjectKeyAttributeNameToSet, mapValueClass);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName)}
*/
public HashMap buildHashMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName) throws ApplicationException{
try {
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return (HashMap) businessSLSBFacade.buildMap(pInstance,pAttributeName,valueObjectKeyAttributeName, new Boolean(isValueObjectKeyAttributeNameToSet),valueObjectValueAttributeName);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildHashMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildHashMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildHashMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildHashMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildHashMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildHashMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName)" + e.toString(),e);
}
}
public Map buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName) throws ApplicationException{
try {
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(pInstance,pAttributeName,valueObjectKeyAttributeName,isValueObjectKeyAttributeNameToSet,valueObjectValueAttributeName);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName)" + e.toString(),e);
}
}
public Map buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet) throws ApplicationException{
try {
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(pInstance,pAttributeName,valueObjectKeyAttributeName,isValueObjectKeyAttributeNameToSet);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet)" + e.toString(),e);
}
}
public Map buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass) throws ApplicationException{
try {
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName, valueObjectValueAttributeName, mapValueClassAttributeToSetName,mapValueClass);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass)" + e.toString(),e);
}
}
public Map buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, String valueObjectValueAttributeName,Class mapValueClass) throws ApplicationException{
try {
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName, valueObjectValueAttributeName, mapValueClass);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, Class mapValueClass)" + e.toString(),e);
}
}
public Map buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Class mapValueClass) throws ApplicationException{
try {
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName, mapValueClass);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, Class mapValueClass)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, String valueObjectValueAttributeName)}
*/
public HashMap buildHashMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName,String valueObjectValueAttributeName) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return (HashMap) businessSLSBFacade.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName, valueObjectValueAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildHashMap(pInstance, pAttributeName, valueObjectKeyAttributeName, valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildHashMap(pInstance, pAttributeName, valueObjectKeyAttributeName, valueObjectValueAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildHashMap(pInstance, pAttributeName, valueObjectKeyAttributeName, valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildHashMap(pInstance, pAttributeName, valueObjectKeyAttributeName, valueObjectValueAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildHashMap(pInstance, pAttributeName, valueObjectKeyAttributeName, valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildHashMap(pInstance, pAttributeName, valueObjectKeyAttributeName, valueObjectValueAttributeName)" + e.toString(),e);
}
}
public Map buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName, String valueObjectValueAttributeName) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName, valueObjectValueAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName, valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName, valueObjectValueAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName, valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName, valueObjectValueAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName, valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName, valueObjectValueAttributeName)" + e.toString(),e);
}
}
public Map buildMap(Object pInstance, String pAttributeName, String valueObjectKeyAttributeName) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(pInstance, pAttributeName, valueObjectKeyAttributeName)" + e.toString(),e);
}
}
public Map buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(valueObjectsCollection, valueObjectKeyAttributeName, isValueObjectKeyAttributeNameToSet, valueObjectValueAttributeName, mapValueClassAttributeToSetName, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass)" + e.toString(),e);
}
}
/**
* @deprecated see{@link #buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass)}
*/
public HashMap buildHashMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return (HashMap) businessSLSBFacade.buildMap(valueObjectsCollection, valueObjectKeyAttributeName, new Boolean(isValueObjectKeyAttributeNameToSet), valueObjectValueAttributeName, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildHashMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildHashMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildHashMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildHashMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildHashMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildHashMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass)" + e.toString(),e);
}
}
public Map buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(valueObjectsCollection, valueObjectKeyAttributeName, isValueObjectKeyAttributeNameToSet, valueObjectValueAttributeName, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass)" + e.toString(),e);
}
}
public Map buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(valueObjectsCollection, valueObjectKeyAttributeName, isValueObjectKeyAttributeNameToSet, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass)" + e.toString(),e);
}
}
public Map buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(valueObjectsCollection, valueObjectKeyAttributeName, isValueObjectKeyAttributeNameToSet, valueObjectValueAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName)" + e.toString(),e);
}
}
public Map buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(valueObjectsCollection, valueObjectKeyAttributeName, isValueObjectKeyAttributeNameToSet);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet)" + e.toString(),e);
}
}
public Map buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(valueObjectsCollection, valueObjectKeyAttributeName, valueObjectValueAttributeName, mapValueClassAttributeToSetName, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass)" + e.toString(),e);
}
}
public Map buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, String valueObjectValueAttributeName,Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(valueObjectsCollection, valueObjectKeyAttributeName, valueObjectValueAttributeName, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, Class mapValueClass)" + e.toString(),e);
}
}
public Map buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(valueObjectsCollection, valueObjectKeyAttributeName, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, Class mapValueClass)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,String valueObjectValueAttributeName)}
*/
public HashMap buildHashMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName, String valueObjectValueAttributeName) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return (HashMap) businessSLSBFacade.buildMap(valueObjectsCollection, valueObjectKeyAttributeName, valueObjectValueAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildHashMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildHashMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,String valueObjectValueAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildHashMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildHashMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,String valueObjectValueAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildHashMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildHashMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,String valueObjectValueAttributeName)" + e.toString(),e);
}
}
public Map buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,String valueObjectValueAttributeName) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(valueObjectsCollection, valueObjectKeyAttributeName, valueObjectValueAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,String valueObjectValueAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,String valueObjectValueAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName,String valueObjectValueAttributeName)" + e.toString(),e);
}
}
public Map buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.buildMap(valueObjectsCollection, valueObjectKeyAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.buildMap(Collection valueObjectsCollection, String valueObjectKeyAttributeName)" + e.toString(),e);
}
}
public Map addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap(pInstance, pAttributeName, map, valueObjectKeyAttributeName, isValueObjectKeyAttributeNameToSet, valueObjectValueAttributeName, mapValueClassAttributeToSetName, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass) }
*/
public HashMap addToHashMap(Object pInstance, HashMap map, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return (HashMap) businessSLSBFacade.addToMap(pInstance, pAttributeName, map, valueObjectKeyAttributeName, new Boolean(isValueObjectKeyAttributeNameToSet), valueObjectValueAttributeName, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToHashMap(Object pInstance, HashMap map, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToHashMap(Object pInstance, HashMap map, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToHashMap(Object pInstance, HashMap map, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToHashMap(Object pInstance, HashMap map, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToHashMap(Object pInstance, HashMap map, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToHashMap(Object pInstance, HashMap map, String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}
}
public Map addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap(pInstance, pAttributeName, map, valueObjectKeyAttributeName, isValueObjectKeyAttributeNameToSet, valueObjectValueAttributeName, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, Class mapValueClass)" + e.toString(),e);
}
}
public Map addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap(pInstance, pAttributeName, map, valueObjectKeyAttributeName, isValueObjectKeyAttributeNameToSet, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName)}
*/
public HashMap addToHashMap(Object pInstance,HashMap map,String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return (HashMap) businessSLSBFacade.addToMap(pInstance, pAttributeName, map, valueObjectKeyAttributeName, new Boolean(isValueObjectKeyAttributeNameToSet), valueObjectValueAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToHashMap(Object pInstance,HashMap map,String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToHashMap(Object pInstance,HashMap map,String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName) " + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToHashMap(Object pInstance,HashMap map,String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToHashMap(Object pInstance,HashMap map,String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName) " + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToHashMap(Object pInstance,HashMap map,String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToHashMap(Object pInstance,HashMap map,String pAttributeName, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName) " + e.toString(),e);
}
}
public Map addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap(pInstance, pAttributeName, map, valueObjectKeyAttributeName, isValueObjectKeyAttributeNameToSet, valueObjectValueAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName)" + e.toString(),e);
}
}
public Map addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap(pInstance, pAttributeName, map, valueObjectKeyAttributeName,isValueObjectKeyAttributeNameToSet) ;
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet) : " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet) " + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet) : " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet) " + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet) : " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet) " + e.toString(),e);
}
}
public Map addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap(pInstance, pAttributeName, map, valueObjectKeyAttributeName, valueObjectValueAttributeName, mapValueClassAttributeToSetName, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass)" + e.toString(),e);
}
}
public Map addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName,Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap(pInstance, pAttributeName, map, valueObjectKeyAttributeName, valueObjectValueAttributeName, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}
}
public Map addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap(pInstance, pAttributeName, map, valueObjectKeyAttributeName, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, Class mapValueClass)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #addToMap(Object pInstance,String pAttributeName, Map map, String valueObjectKeyAttributeName,String valueObjectValueAttributeName)}
*/
public HashMap addToHashMap(Object pInstance,HashMap map,String pAttributeName, String valueObjectKeyAttributeName,String valueObjectValueAttributeName) throws ApplicationException{
try {
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return (HashMap) businessSLSBFacade.addToMap(pInstance, pAttributeName, map, valueObjectKeyAttributeName, valueObjectValueAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToHashMap(Object pInstance,HashMap map,String pAttributeName, String valueObjectKeyAttributeName,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToHashMap(Object pInstance,HashMap map,String pAttributeName, String valueObjectKeyAttributeName,String valueObjectValueAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToHashMap(Object pInstance,HashMap map,String pAttributeName, String valueObjectKeyAttributeName,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToHashMap(Object pInstance,HashMap map,String pAttributeName, String valueObjectKeyAttributeName,String valueObjectValueAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToHashMap(Object pInstance,HashMap map,String pAttributeName, String valueObjectKeyAttributeName,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToHashMap(Object pInstance,HashMap map,String pAttributeName, String valueObjectKeyAttributeName,String valueObjectValueAttributeName)" + e.toString(),e);
}
}
public Map addToMap(Object pInstance,String pAttributeName, Map map, String valueObjectKeyAttributeName,String valueObjectValueAttributeName) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap(pInstance, pAttributeName, map, valueObjectKeyAttributeName, valueObjectValueAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Object pInstance,String pAttributeName, Map map, String valueObjectKeyAttributeName,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance,String pAttributeName, Map map, String valueObjectKeyAttributeName,String valueObjectValueAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Object pInstance,String pAttributeName, Map map, String valueObjectKeyAttributeName,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance,String pAttributeName, Map map, String valueObjectKeyAttributeName,String valueObjectValueAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Object pInstance,String pAttributeName, Map map, String valueObjectKeyAttributeName,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance,String pAttributeName, Map map, String valueObjectKeyAttributeName,String valueObjectValueAttributeName)" + e.toString(),e);
}
}
public Map addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap(pInstance, pAttributeName, map, valueObjectKeyAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName)" + e.toString(),e);
}
}
public Map addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap(valueObjectsCollection, map, valueObjectKeyAttributeName, isValueObjectKeyAttributeNameToSet, valueObjectValueAttributeName, mapValueClassAttributeToSetName, mapValueClass) ;
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass) : " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass) " + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass) : " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass) " + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass) : " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName, Class mapValueClass) " + e.toString(),e);
}
}
/**
* @deprecated use {@link #addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass)}
*/
public HashMap addToHashMap(Collection valueObjectsCollection, HashMap map, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return (HashMap) businessSLSBFacade.addToMap(valueObjectsCollection, map, valueObjectKeyAttributeName, new Boolean(isValueObjectKeyAttributeNameToSet), valueObjectValueAttributeName, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToHashMap(Collection valueObjectsCollection, HashMap map, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToHashMap(Collection valueObjectsCollection, HashMap map, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToHashMap(Collection valueObjectsCollection, HashMap map, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToHashMap(Collection valueObjectsCollection, HashMap map, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToHashMap(Collection valueObjectsCollection, HashMap map, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToHashMap(Collection valueObjectsCollection, HashMap map, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}
}
public Map addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap(valueObjectsCollection, map, valueObjectKeyAttributeName, isValueObjectKeyAttributeNameToSet, valueObjectValueAttributeName, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}
}
public Map addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap(valueObjectsCollection, map, valueObjectKeyAttributeName, isValueObjectKeyAttributeNameToSet, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Boolean isValueObjectKeyAttributeNameToSet, Class mapValueClass)" + e.toString(),e);
}
}
/**
*
* @deprecated use {@link #addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName)}
*
*/
public HashMap addToHashMap(Collection valueObjectsCollection,HashMap map, String valueObjectKeyAttributeName,boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return (HashMap) businessSLSBFacade.addToMap(valueObjectsCollection, map, valueObjectKeyAttributeName, new Boolean(isValueObjectKeyAttributeNameToSet), valueObjectValueAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName)" + e.toString(),e);
}
}
public Map addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap(valueObjectsCollection, map, valueObjectKeyAttributeName, isValueObjectKeyAttributeNameToSet, valueObjectValueAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet,String valueObjectValueAttributeName)" + e.toString(),e);
}
}
public Map addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap(valueObjectsCollection, map, valueObjectKeyAttributeName,isValueObjectKeyAttributeNameToSet);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName,Boolean isValueObjectKeyAttributeNameToSet)" + e.toString(),e);
}
}
public Map addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap(valueObjectsCollection, map, valueObjectKeyAttributeName, valueObjectValueAttributeName, mapValueClassAttributeToSetName, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName, String mapValueClassAttributeToSetName,Class mapValueClass)" + e.toString(),e);
}
}
public Map addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName,Class mapValueClass)throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap(valueObjectsCollection, map, valueObjectKeyAttributeName, valueObjectValueAttributeName, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName,Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName,Class mapValueClass)" + e.toString(),e);
}
}
public Map addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Class mapValueClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap(valueObjectsCollection, map, valueObjectKeyAttributeName, mapValueClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Class mapValueClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Class mapValueClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Class mapValueClass): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, Class mapValueClass)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #addToMap(Collection valueObjectsCollection ,Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName)}
*/
public HashMap addToHashMap(Collection valueObjectsCollection ,HashMap map, String valueObjectKeyAttributeName,String valueObjectValueAttributeName) throws ApplicationException{
try {
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return (HashMap) businessSLSBFacade.addToMap(valueObjectsCollection, map, valueObjectKeyAttributeName, valueObjectValueAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToHashMap(Collection valueObjectsCollection ,HashMap map, String valueObjectKeyAttributeName,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToHashMap(Collection valueObjectsCollection ,HashMap map, String valueObjectKeyAttributeName,String valueObjectValueAttributeName) " + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToHashMap(Collection valueObjectsCollection ,HashMap map, String valueObjectKeyAttributeName,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToHashMap(Collection valueObjectsCollection ,HashMap map, String valueObjectKeyAttributeName,String valueObjectValueAttributeName) " + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToHashMap(Collection valueObjectsCollection ,HashMap map, String valueObjectKeyAttributeName,String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToHashMap(Collection valueObjectsCollection ,HashMap map, String valueObjectKeyAttributeName,String valueObjectValueAttributeName) " + e.toString(),e);
}
}
public Map addToMap(Collection valueObjectsCollection ,Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap(valueObjectsCollection, map, valueObjectKeyAttributeName, valueObjectValueAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection ,Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection ,Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName) " + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection ,Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection ,Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName) " + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection ,Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection ,Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName) " + e.toString(),e);
}
}
public Map addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToMap( valueObjectsCollection, map, valueObjectKeyAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName) : " + e.toString());
throw new ApplicationException("ApplicationExceptionthrown thrown in SLSBManagerBD.addToMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName)" + e.toString(),e);
}
}
public void updateCollectionWithMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName)throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.updateCollectionWithMap(pInstance, pAttributeName, map, valueObjectKeyAttributeName, valueObjectValueAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.updateCollectionWithMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollectionWithMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.updateCollectionWithMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollectionWithMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.updateCollectionWithMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollectionWithMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName)" + e.toString(),e);
}
}
public void updateCollectionWithMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName)throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.updateCollectionWithMap(pInstance, pAttributeName, map, valueObjectKeyAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.updateCollectionWithMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollectionWithMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.updateCollectionWithMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollectionWithMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.updateCollectionWithMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollectionWithMap(Object pInstance, String pAttributeName, Map map, String valueObjectKeyAttributeName)" + e.toString(),e);
}
}
public void updateCollectionWithMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName)throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.updateCollectionWithMap(valueObjectsCollection, map, valueObjectKeyAttributeName, valueObjectValueAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.updateCollectionWithMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollectionWithMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.updateCollectionWithMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollectionWithMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.updateCollectionWithMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollectionWithMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName, String valueObjectValueAttributeName)" + e.toString(),e);
}
}
public void updateCollectionWithMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName)throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.updateCollectionWithMap(valueObjectsCollection, map, valueObjectKeyAttributeName);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.updateCollectionWithMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollectionWithMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.updateCollectionWithMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollectionWithMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.updateCollectionWithMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.updateCollectionWithMap(Collection valueObjectsCollection, Map map, String valueObjectKeyAttributeName)" + e.toString(),e);
}
}
/**
* @deprecated use {@link it.aco.mandragora.common.utils.BeanCollectionUtils#getTreeLeaves(Object valueobjectOrCollection, String path)}
* @param valueobjectOrCollection
* @param path
* @return
* @throws ApplicationException
*/
public Collection getTreeLeaves(Object valueobjectOrCollection, String path) throws ApplicationException {
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.getTreeLeaves( valueobjectOrCollection, path);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.getTreeLeaves(Object valueobjectOrCollection, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.getTreeLeaves(Object valueobjectOrCollection, String path)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.getTreeLeaves(Object valueobjectOrCollection, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.getTreeLeaves(Object valueobjectOrCollection, String path)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.getTreeLeaves(Object valueobjectOrCollection, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.getTreeLeaves(Object valueobjectOrCollection, String path)" + e.toString(),e);
}
}
public Collection retrieveTreeLeaves(Object valueobjectOrCollection, String path) throws ApplicationException {
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.retrieveTreeLeaves( valueobjectOrCollection, path);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.retrieveTreeLeaves(Object valueobjectOrCollection, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveTreeLeaves(Object valueobjectOrCollection, String path)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.retrieveTreeLeaves(Object valueobjectOrCollection, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveTreeLeaves(Object valueobjectOrCollection, String path)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.retrieveTreeLeaves(Object valueobjectOrCollection, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveTreeLeaves(Object valueobjectOrCollection, String path)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #retrieveTreeLeaves(Object valueobjectOrCollection, String path)}
*/
public Collection getCollectionOfRelatedMToNElements(Object pInstance, String collectionName, String pAttributeName) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.retrieveTreeLeaves( pInstance, "collectionName.pAttributeName");
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.getCollectionOfRelatedMToNElements(Object pInstance, String collectionName, String pAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.getCollectionOfRelatedMToNElements(Object pInstance, String collectionName, String pAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.getCollectionOfRelatedMToNElements(Object pInstance, String collectionName, String pAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.getCollectionOfRelatedMToNElements(Object pInstance, String collectionName, String pAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.getCollectionOfRelatedMToNElements(Object pInstance, String collectionName, String pAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.getCollectionOfRelatedMToNElements(Object pInstance, String collectionName, String pAttributeName)" + e.toString(),e);
}
}
public Collection retrieveNullPathTreeLeaves(Object valueobjectOrCollection, String path) throws ApplicationException {
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.retrieveNullPathTreeLeaves( valueobjectOrCollection, path);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.retrieveNullPathTreeLeaves(Object valueobjectOrCollection, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveNullPathTreeLeaves(Object valueobjectOrCollection, String path)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.retrieveNullPathTreeLeaves(Object valueobjectOrCollection, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveNullPathTreeLeaves(Object valueobjectOrCollection, String path)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.retrieveNullPathTreeLeaves(Object valueobjectOrCollection, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retrieveNullPathTreeLeaves(Object valueobjectOrCollection, String path)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String[] attributesComparator, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames,Object[] valuesArray, String[] pAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeLeaves(pInstance, pAttributeName,attributesComparator, path, sourcePAttributeNames, targetPAttributeNames, valuesArray, pAttributeNames);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames,Object[] valuesArray, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames,Object[] valuesArray, String[] pAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames,Object[] valuesArray, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames,Object[] valuesArray, String[] pAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames,Object[] valuesArray, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames,Object[] valuesArray, String[] pAttributeNames)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeLeaves(pInstance, pAttributeName,attributesComparator, path, sourcePAttributeNames, targetPAttributeNames, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeLeaves(pInstance, pAttributeName,attributesComparator, path, sourcePAttributeNames, sourcePAttributeNames, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String[] attributesComparator, String path) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeLeaves(pInstance, pAttributeName,attributesComparator, path, null, null, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,Object[] valuesArray, String[] pAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeLeaves(pInstance, pAttributeName,attributesComparator, path, sourcePAttributeNames, sourcePAttributeNames, valuesArray, pAttributeNames);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,Object[] valuesArray, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,Object[] valuesArray, String[] pAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,Object[] valuesArray, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,Object[] valuesArray, String[] pAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,Object[] valuesArray, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, String[] sourcePAttributeNames,Object[] valuesArray, String[] pAttributeNames)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path,Object[] valuesArray, String[] pAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeLeaves(pInstance, pAttributeName,attributesComparator, path, null, null, valuesArray, pAttributeNames);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, Object[] valuesArray, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, Object[] valuesArray, String[] pAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, Object[] valuesArray, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, Object[] valuesArray, String[] pAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, Object[] valuesArray, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName,String[] attributesComparator, String path, Object[] valuesArray, String[] pAttributeNames)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames,Object[] valuesArray, String[] pAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeLeaves(pInstance, pAttributeName,null, path, sourcePAttributeNames, targetPAttributeNames, valuesArray, pAttributeNames);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames,Object[] valuesArray, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames,Object[] valuesArray, String[] pAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames,Object[] valuesArray, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames,Object[] valuesArray, String[] pAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames,Object[] valuesArray, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames,Object[] valuesArray, String[] pAttributeNames)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeLeaves(pInstance, pAttributeName,null, path, sourcePAttributeNames, targetPAttributeNames, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeLeaves(pInstance, pAttributeName,null, path, sourcePAttributeNames, sourcePAttributeNames, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeLeaves(pInstance, pAttributeName,null, path, null, null, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,Object[] valuesArray, String[] pAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeLeaves(pInstance, pAttributeName,null, path, sourcePAttributeNames, sourcePAttributeNames, valuesArray, pAttributeNames);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,Object[] valuesArray, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,Object[] valuesArray, String[] pAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,Object[] valuesArray, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,Object[] valuesArray, String[] pAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,Object[] valuesArray, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, String[] sourcePAttributeNames,Object[] valuesArray, String[] pAttributeNames)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path,Object[] valuesArray, String[] pAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeLeaves(pInstance, pAttributeName,null, path, null, null, valuesArray, pAttributeNames);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, Object[] valuesArray, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, Object[] valuesArray, String[] pAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, Object[] valuesArray, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, Object[] valuesArray, String[] pAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, Object[] valuesArray, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeLeaves(Object pInstance, String pAttributeName, String path, Object[] valuesArray, String[] pAttributeNames)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[] pAttributeNames,Object[] valuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeNodes(pInstance, pAttributeName, pkNames, path, nodeSourcePAttributeNames, nodeTargetPAttributeNames, pAttributeNames,valuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeNodes(pInstance, pAttributeName, pkNames, path, nodeSourcePAttributeNames, nodeTargetPAttributeNames, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeNodes(pInstance, pAttributeName, pkNames, path, nodeSourcePAttributeNames, nodeSourcePAttributeNames, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeNodes(pInstance, pAttributeName, pkNames, path, null, null, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeNodes(pInstance, pAttributeName, null, path, null, null, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeNodes(pInstance, pAttributeName, null, path, nodeSourcePAttributeNames, nodeTargetPAttributeNames, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeNodes(pInstance, pAttributeName, null, path, nodeSourcePAttributeNames, nodeSourcePAttributeNames, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[] pAttributeNames,Object[] valuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeNodes(pInstance, pAttributeName, pkNames, path, nodeSourcePAttributeNames, nodeSourcePAttributeNames, pAttributeNames,valuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[] pAttributeNames,Object[] valuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeNodes(pInstance, pAttributeName, pkNames, path, null, null, pAttributeNames,valuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[] pAttributeNames,Object[] valuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeNodes(pInstance, pAttributeName, null, path, null, null, pAttributeNames,valuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[] pAttributeNames,Object[] valuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeNodes(pInstance, pAttributeName, null, path, nodeSourcePAttributeNames, nodeTargetPAttributeNames, pAttributeNames,valuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}
}
public void addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[] pAttributeNames,Object[] valuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollectionTreeNodes(pInstance, pAttributeName, null, path, nodeSourcePAttributeNames, nodeSourcePAttributeNames, pAttributeNames,valuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String[] pkNames, String path, String[][] nodeSourcePAttributeNames, String[] pAttributeNames,Object[] valuesArray)}
*/
public void align(Object pInstance, String pAttributeName, String[] treePathCollectionSource,String[] pkNames, String[] pAttributeNames, Object[] valuesArray,String[] sourcePAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
String path ="";
String[][] nodeSourcePAttributeNames = null;
if (treePathCollectionSource!=null&&treePathCollectionSource.length>0){
nodeSourcePAttributeNames = new String[treePathCollectionSource.length][];
for (int i=0; i<treePathCollectionSource.length-1;i++) {
nodeSourcePAttributeNames[i] = sourcePAttributeNames;
path=path+treePathCollectionSource[i]+".";
}
path=path+treePathCollectionSource[treePathCollectionSource.length-1];
nodeSourcePAttributeNames[treePathCollectionSource.length-1] = sourcePAttributeNames;
}
//businessSLSBFacade.addToRetainInCollectionTreeLeaves(pInstance, pAttributeName, attributesComparator, path, sourcePAttributeNames, sourcePAttributeNames, valuesArray, pAttributeNames);
businessSLSBFacade.addToRetainInCollectionTreeNodes(pInstance, pAttributeName, pkNames, path, nodeSourcePAttributeNames, nodeSourcePAttributeNames, pAttributeNames, valuesArray) ;
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.align(Object pInstance, String pAttributeName, String[] treePathCollectionSource,String[] pkNames, String[] pAttributeNames, Object[] valuesArray,String[] sourcePAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.align(Object pInstance, String pAttributeName, String[] treePathCollectionSource,String[] pkNames, String[] pAttributeNames, Object[] valuesArray,String[] sourcePAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.align(Object pInstance, String pAttributeName, String[] treePathCollectionSource,String[] pkNames, String[] pAttributeNames, Object[] valuesArray,String[] sourcePAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.align(Object pInstance, String pAttributeName, String[] treePathCollectionSource,String[] pkNames, String[] pAttributeNames, Object[] valuesArray,String[] sourcePAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.align(Object pInstance, String pAttributeName, String[] treePathCollectionSource,String[] pkNames, String[] pAttributeNames, Object[] valuesArray,String[] sourcePAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.align(Object pInstance, String pAttributeName, String[] treePathCollectionSource,String[] pkNames, String[] pAttributeNames, Object[] valuesArray,String[] sourcePAttributeNames)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #addToRetainInCollectionTreeNodes(Object pInstance, String pAttributeName, String path, String[][] nodeSourcePAttributeNames, String[] pAttributeNames,Object[] valuesArray)}
*/
public void align(Object pInstance, String pAttributeName, String[] treePathCollectionSource, String[] pAttributeNames, Object[] valuesArray,String[] sourcePAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
String path ="";
String[][] nodeSourcePAttributeNames = null;
if (treePathCollectionSource!=null&&treePathCollectionSource.length>0){
nodeSourcePAttributeNames = new String[treePathCollectionSource.length][];
for (int i=0; i<treePathCollectionSource.length-1;i++) {
nodeSourcePAttributeNames[i] = sourcePAttributeNames;
path=path+treePathCollectionSource[i]+".";
}
path=path+treePathCollectionSource[treePathCollectionSource.length-1];
nodeSourcePAttributeNames[treePathCollectionSource.length-1] = sourcePAttributeNames;
}
//businessSLSBFacade.addToRetainInCollectionTreeLeaves(pInstance, pAttributeName, null,path, sourcePAttributeNames, sourcePAttributeNames, valuesArray, pAttributeNames);
businessSLSBFacade.addToRetainInCollectionTreeNodes(pInstance, pAttributeName, null, path, nodeSourcePAttributeNames, nodeSourcePAttributeNames, pAttributeNames, valuesArray) ;
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.align(Object pInstance, String pAttributeName, String[] treePathCollectionSource, String[] pAttributeNames, Object[] valuesArray,String[] sourcePAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.align(Object pInstance, String pAttributeName, String[] treePathCollectionSource, String[] pAttributeNames, Object[] valuesArray,String[] sourcePAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.align(Object pInstance, String pAttributeName, String[] treePathCollectionSource, String[] pAttributeNames, Object[] valuesArray,String[] sourcePAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.align(Object pInstance, String pAttributeName, String[] treePathCollectionSource, String[] pAttributeNames, Object[] valuesArray,String[] sourcePAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.align(Object pInstance, String pAttributeName, String[] treePathCollectionSource, String[] pAttributeNames, Object[] valuesArray,String[] sourcePAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.align(Object pInstance, String pAttributeName, String[] treePathCollectionSource, String[] pAttributeNames, Object[] valuesArray,String[] sourcePAttributeNames)" + e.toString(),e);
}
}
public void createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.createValueObjectsTreeWithCollection(pInstance, pAttributeName , path, groupedPkNames, nodePAttributeNames, nodeValuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}
}
public void createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.createValueObjectsTreeWithCollection(pInstance, pAttributeName , path, groupedPkNames, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames)" + e.toString(),e);
}
}
public void createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.createValueObjectsTreeWithCollection(pInstance, pAttributeName , path, null, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path)" + e.toString(),e);
}
}
public void createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.createValueObjectsTreeWithCollection(pInstance, pAttributeName , path, null, nodePAttributeNames, nodeValuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}
}
public void createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.createValueObjectsTreeWithCollection( valueObjectsCollection, pInstance, path, groupedPkNames, nodePAttributeNames, nodeValuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}
}
public void createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.createValueObjectsTreeWithCollection( valueObjectsCollection, pInstance, path, groupedPkNames, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames)" + e.toString(),e);
}
}
public void createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.createValueObjectsTreeWithCollection( valueObjectsCollection, pInstance, path, null, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path)" + e.toString(),e);
}
}
public void createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.createValueObjectsTreeWithCollection( valueObjectsCollection, pInstance, path, null, nodePAttributeNames, nodeValuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}
}
public void addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToValueObjectsTreeWithCollection(pInstance, pAttributeName , path, groupedPkNames, nodePAttributeNames, nodeValuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}
}
public void addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToValueObjectsTreeWithCollection(pInstance, pAttributeName , path, groupedPkNames, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] groupedPkNames)" + e.toString(),e);
}
}
public void addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToValueObjectsTreeWithCollection(pInstance, pAttributeName , path, null, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path)" + e.toString(),e);
}
}
public void addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToValueObjectsTreeWithCollection(pInstance, pAttributeName , path, null, nodePAttributeNames, nodeValuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Object pInstance, String pAttributeName ,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}
}
public void addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
//businessSLSBFacade.createValueObjectsTreeWithCollection( valueObjectsCollection, pInstance, path, groupedPkNames, nodePAttributeNames, nodeValuesArray);
businessSLSBFacade.addToValueObjectsTreeWithCollection( valueObjectsCollection, pInstance, path, groupedPkNames, nodePAttributeNames, nodeValuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}
}
public void addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
//businessSLSBFacade.createValueObjectsTreeWithCollection( valueObjectsCollection, pInstance, path, groupedPkNames, null, null);
businessSLSBFacade.addToValueObjectsTreeWithCollection( valueObjectsCollection, pInstance, path, groupedPkNames, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] groupedPkNames)" + e.toString(),e);
}
}
public void addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
//businessSLSBFacade.createValueObjectsTreeWithCollection( valueObjectsCollection, pInstance, path, null, null, null);
businessSLSBFacade.addToValueObjectsTreeWithCollection( valueObjectsCollection, pInstance, path, null, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path)" + e.toString(),e);
}
}
public void addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
//businessSLSBFacade.createValueObjectsTreeWithCollection( valueObjectsCollection, pInstance, path, null, nodePAttributeNames, nodeValuesArray);
businessSLSBFacade.addToValueObjectsTreeWithCollection( valueObjectsCollection, pInstance, path, null, nodePAttributeNames, nodeValuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToValueObjectsTreeWithCollection(Collection valueObjectsCollection, Object pInstance,String path, String[][] nodePAttributeNames,Object[][] nodeValuesArray)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames,Object[] valuesArray)}
*/
public void createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames,Object[] valuesArray)throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRelationshipCollectionMissingElements( pInstance, collectionName, pAttributeName, null, pAttributeNames, valuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName)}
*/
public void createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName)throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRelationshipCollectionMissingElements( pInstance, collectionName, pAttributeName, null, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection)}
*/
public void createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection)throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRelationshipCollectionMissingElements( pInstance, collectionName, pAttributeName, valueObjectsCollection, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray)}
*/
public void createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray)throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRelationshipCollectionMissingElements( pInstance, collectionName, pAttributeName, valueObjectsCollection, pAttributeNames, valuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}
}
public void addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames,Object[] valuesArray)throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRelationshipCollectionMissingElements( pInstance, collectionName, pAttributeName, null, pAttributeNames, valuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}
}
public void addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName)throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRelationshipCollectionMissingElements( pInstance, collectionName, pAttributeName, null, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName)" + e.toString(),e);
}
}
public void addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection)throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRelationshipCollectionMissingElements( pInstance, collectionName, pAttributeName, valueObjectsCollection, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection)" + e.toString(),e);
}
}
public void addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRelationshipCollectionMissingElements( pInstance, collectionName, pAttributeName, valueObjectsCollection, pAttributeNames, valuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRelationshipCollectionMissingElements(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createMissingRelationshipElement(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}
}
public void createRelationshipCollection(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.createRelationshipCollection( pInstance, collectionName, pAttributeName, valueObjectsCollection, pAttributeNames, valuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createRelationshipCollection(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createRelationshipCollection(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createRelationshipCollection(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createRelationshipCollection(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createRelationshipCollection(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createRelationshipCollection(Object pInstance, String collectionName, String pAttributeName, Collection valueObjectsCollection, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}
}
public void createRelationshipCollectionByOrValues(Object pInstance, String collectionName, String pAttributeName, String orPAttributeName, Collection valuesCollection, String[] pAttributeNames,Object[] valuesArray)throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.createRelationshipCollectionByOrValues( pInstance, collectionName, pAttributeName, orPAttributeName, valuesCollection, pAttributeNames, valuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createRelationshipCollectionByOrValues(Object pInstance, String collectionName, String pAttributeName, String orPAttributeName, Collection valuesCollection, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createRelationshipCollectionByOrValues(Object pInstance, String collectionName, String pAttributeName, String orPAttributeName, Collection valuesCollection, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createRelationshipCollectionByOrValues(Object pInstance, String collectionName, String pAttributeName, String orPAttributeName, Collection valuesCollection, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createRelationshipCollectionByOrValues(Object pInstance, String collectionName, String pAttributeName, String orPAttributeName, Collection valuesCollection, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createRelationshipCollectionByOrValues(Object pInstance, String collectionName, String pAttributeName, String orPAttributeName, Collection valuesCollection, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createRelationshipCollectionByOrValues(Object pInstance, String collectionName, String pAttributeName, String orPAttributeName, Collection valuesCollection, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}
}
/**
*
* @deprecated use {@link #createRelationshipCollectionByOrValues(Object pInstance, String collectionName, String pAttributeName, String orPAttributeName, Collection valuesCollection, String[] pAttributeNames,Object[] valuesArray)}
*/
public void setRelationshipElementWithQueryByOrValues(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames, Object[] valuesArray, String orPAttributeName,Collection valuesCollection)throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.createRelationshipCollectionByOrValues( pInstance, collectionName, pAttributeName, orPAttributeName, valuesCollection, pAttributeNames, valuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.setRelationshipElementWithQueryByOrValues(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames, Object[] valuesArray, String orPAttributeName,Collection valuesCollection): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.setRelationshipElementWithQueryByOrValues(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames, Object[] valuesArray, String orPAttributeName,Collection valuesCollection)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.setRelationshipElementWithQueryByOrValues(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames, Object[] valuesArray, String orPAttributeName,Collection valuesCollection): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.setRelationshipElementWithQueryByOrValues(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames, Object[] valuesArray, String orPAttributeName,Collection valuesCollection)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.setRelationshipElementWithQueryByOrValues(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames, Object[] valuesArray, String orPAttributeName,Collection valuesCollection): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.setRelationshipElementWithQueryByOrValues(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames, Object[] valuesArray, String orPAttributeName,Collection valuesCollection)" + e.toString(),e);
}
}
public void createRelationshipCollectionBySearchValueInFields(Object pInstance, String collectionName, String pAttributeName, String[] toSearchInPAttributeNames, Object value, String[] pAttributeNames,Object[] valuesArray)throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.createRelationshipCollectionBySearchValueInFields( pInstance, collectionName, pAttributeName, toSearchInPAttributeNames, value, pAttributeNames, valuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createRelationshipCollectionBySearchValueInFields(Object pInstance, String collectionName, String pAttributeName, String[] toSearchInPAttributeNames, Object value, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createRelationshipCollectionBySearchValueInFields(Object pInstance, String collectionName, String pAttributeName, String[] toSearchInPAttributeNames, Object value, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createRelationshipCollectionBySearchValueInFields(Object pInstance, String collectionName, String pAttributeName, String[] toSearchInPAttributeNames, Object value, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createRelationshipCollectionBySearchValueInFields(Object pInstance, String collectionName, String pAttributeName, String[] toSearchInPAttributeNames, Object value, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createRelationshipCollectionBySearchValueInFields(Object pInstance, String collectionName, String pAttributeName, String[] toSearchInPAttributeNames, Object value, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createRelationshipCollectionBySearchValueInFields(Object pInstance, String collectionName, String pAttributeName, String[] toSearchInPAttributeNames, Object value, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}
}
/**
*
* @deprecated use {@link #createRelationshipCollectionBySearchValueInFields(Object pInstance, String collectionName, String pAttributeName, String[] toSearchInPAttributeNames, Object value, String[] pAttributeNames,Object[] valuesArray)}
*/
public void setRelationshipElementWithQueryBySearchValueInFields(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames, Object[] valuesArray, String[] toSearchInPAttributeNames,Object value)throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.createRelationshipCollectionBySearchValueInFields( pInstance, collectionName, pAttributeName, toSearchInPAttributeNames, value, pAttributeNames, valuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.setRelationshipElementWithQueryBySearchValueInFields(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames, Object[] valuesArray, String[] toSearchInPAttributeNames,Object value): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.setRelationshipElementWithQueryBySearchValueInFields(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames, Object[] valuesArray, String[] toSearchInPAttributeNames,Object value)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.setRelationshipElementWithQueryBySearchValueInFields(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames, Object[] valuesArray, String[] toSearchInPAttributeNames,Object value): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.setRelationshipElementWithQueryBySearchValueInFields(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames, Object[] valuesArray, String[] toSearchInPAttributeNames,Object value)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.setRelationshipElementWithQueryBySearchValueInFields(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames, Object[] valuesArray, String[] toSearchInPAttributeNames,Object value): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.setRelationshipElementWithQueryBySearchValueInFields(Object pInstance, String collectionName, String pAttributeName, String[] pAttributeNames, Object[] valuesArray, String[] toSearchInPAttributeNames,Object value)" + e.toString(),e);
}
}
public boolean addToCollection(Object pInstance, String pAttributeName, Object toAddPInstance) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToCollection(pInstance, pAttributeName, toAddPInstance) ;
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToCollection(Object pInstance, String pAttributeName, Object toAddPInstance): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToCollection(Object pInstance, String pAttributeName, Object toAddPInstance)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToCollection(Object pInstance, String pAttributeName, Object toAddPInstance): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToCollection(Object pInstance, String pAttributeName, Object toAddPInstance)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToCollection(Object pInstance, String pAttributeName, Object toAddPInstance): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToCollection(Object pInstance, String pAttributeName, Object toAddPInstance)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #addToCollection(Object pInstance, String pAttributeName, Object toAddPInstance)}
*/
public boolean addElementToCollectionReference(Object pInstance, String pAttributeName, Object toAddPInstance) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToCollection(pInstance, pAttributeName, toAddPInstance) ;
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addElementToCollectionReference(Object pInstance, String pAttributeName, Object toAddPInstance): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addElementToCollectionReference(Object pInstance, String pAttributeName, Object toAddPInstance)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addElementToCollectionReference(Object pInstance, String pAttributeName, Object toAddPInstance): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addElementToCollectionReference(Object pInstance, String pAttributeName, Object toAddPInstance)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addElementToCollectionReference(Object pInstance, String pAttributeName, Object toAddPInstance): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addElementToCollectionReference(Object pInstance, String pAttributeName, Object toAddPInstance)" + e.toString(),e);
}
}
public boolean addAllToCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAdd) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addAllToCollection(pInstance, pAttributeName, valueObjectsCollectionToAdd) ;
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addAllToCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAdd): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addAllToCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAdd)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addAllToCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAdd): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addAllToCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAdd)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addAllToCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAdd): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addAllToCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAdd)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #addAllToCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAdd)}
*/
public Object addCollectionToCollectionReference(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAdd) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addAllToCollection(pInstance, pAttributeName, valueObjectsCollectionToAdd) ;
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addCollectionToCollectionReference(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAdd): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addCollectionToCollectionReference(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAdd)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addCollectionToCollectionReference(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAdd): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addCollectionToCollectionReference(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAdd)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addCollectionToCollectionReference(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAdd): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addCollectionToCollectionReference(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAdd)" + e.toString(),e);
}
return pInstance;
}
public boolean addAllToCollection(Class targetRealClass, Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd,String[] sourcePAttributeNames,String[] targetPAttributeNames, String[] pAttributeNames,Object[] valuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addAllToCollection( targetRealClass, valueObjectsCollection, valueObjectsCollectionToAdd, sourcePAttributeNames, targetPAttributeNames, pAttributeNames, valuesArray) ;
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addAllToCollection(Class targetRealClass, Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd,String[] sourcePAttributeNames,String[] targetPAttributeNames, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addAllToCollection(Class targetRealClass, Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd,String[] sourcePAttributeNames,String[] targetPAttributeNames, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addAllToCollection(Class targetRealClass, Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd,String[] sourcePAttributeNames,String[] targetPAttributeNames, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addAllToCollection(Class targetRealClass, Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd,String[] sourcePAttributeNames,String[] targetPAttributeNames, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addAllToCollection(Class targetRealClass, Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd,String[] sourcePAttributeNames,String[] targetPAttributeNames, String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addAllToCollection(Class targetRealClass, Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd,String[] sourcePAttributeNames,String[] targetPAttributeNames, String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #addAllToCollection(Class targetRealClass, Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd,String[] sourcePAttributeNames,String[] targetPAttributeNames, String[] pAttributeNames,Object[] valuesArray)}
*/
public Collection addCollectionFromCollection(Class targetRealClass, Collection valueObjectsCollectionToAdd, Collection valueObjectsCollection, String[] sourcePAttributeNames,String[] targetPAttributeNames, String[] pAttributeNames, Object[] valuesArray ) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addAllToCollection( targetRealClass, valueObjectsCollection, valueObjectsCollectionToAdd, sourcePAttributeNames, targetPAttributeNames, pAttributeNames, valuesArray) ;
return valueObjectsCollection;
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD. addCollectionFromCollection(Class targetRealClass, Collection valueObjectsCollectionToAdd, Collection valueObjectsCollection, String[] sourcePAttributeNames,String[] targetPAttributeNames, String[] pAttributeNames, Object[] valuesArray ) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD. addCollectionFromCollection(Class targetRealClass, Collection valueObjectsCollectionToAdd, Collection valueObjectsCollection, String[] sourcePAttributeNames,String[] targetPAttributeNames, String[] pAttributeNames, Object[] valuesArray )" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD. addCollectionFromCollection(Class targetRealClass, Collection valueObjectsCollectionToAdd, Collection valueObjectsCollection, String[] sourcePAttributeNames,String[] targetPAttributeNames, String[] pAttributeNames, Object[] valuesArray ) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD. addCollectionFromCollection(Class targetRealClass, Collection valueObjectsCollectionToAdd, Collection valueObjectsCollection, String[] sourcePAttributeNames,String[] targetPAttributeNames, String[] pAttributeNames, Object[] valuesArray )" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD. addCollectionFromCollection(Class targetRealClass, Collection valueObjectsCollectionToAdd, Collection valueObjectsCollection, String[] sourcePAttributeNames,String[] targetPAttributeNames, String[] pAttributeNames, Object[] valuesArray ) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD. addCollectionFromCollection(Class targetRealClass, Collection valueObjectsCollectionToAdd, Collection valueObjectsCollection, String[] sourcePAttributeNames,String[] targetPAttributeNames, String[] pAttributeNames, Object[] valuesArray )" + e.toString(),e);
}
}
/**
* @deprecated use {@link #addAllToCollection(Class targetRealClass, Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd,String[] sourcePAttributeNames,String[] targetPAttributeNames)}
*/
public Collection addCollectionFromCollection(Class targetRealClass, Collection valueObjectsCollectionToAdd, Collection valueObjectsCollection,String[] sourcePAttributeNames,String[] targetPAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addAllToCollection( targetRealClass, valueObjectsCollection, valueObjectsCollectionToAdd, sourcePAttributeNames, targetPAttributeNames, null, null) ;
return valueObjectsCollection;
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addCollectionFromCollection(Class targetRealClass, Collection valueObjectsCollectionToAdd, Collection valueObjectsCollection,String[] sourcePAttributeNames,String[] targetPAttributeNames) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addCollectionFromCollection(Class targetRealClass, Collection valueObjectsCollectionToAdd, Collection valueObjectsCollection,String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addCollectionFromCollection(Class targetRealClass, Collection valueObjectsCollectionToAdd, Collection valueObjectsCollection,String[] sourcePAttributeNames,String[] targetPAttributeNames) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addCollectionFromCollection(Class targetRealClass, Collection valueObjectsCollectionToAdd, Collection valueObjectsCollection,String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addCollectionFromCollection(Class targetRealClass, Collection valueObjectsCollectionToAdd, Collection valueObjectsCollection,String[] sourcePAttributeNames,String[] targetPAttributeNames) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addCollectionFromCollection(Class targetRealClass, Collection valueObjectsCollectionToAdd, Collection valueObjectsCollection,String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
}
}
public boolean addAllToCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, String[] pAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addAllToCollection(valueObjectsCollection, valueObjectsCollectionToAdd, pAttributeNames);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addAllToCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addAllToCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, String[] pAttributeNames): " + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addAllToCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addAllToCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, String[] pAttributeNames): " + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addAllToCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, String[] pAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addAllToCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, String[] pAttributeNames): " + e.toString(),e);
}
}
public boolean addAllToCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, Class realClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addAllToCollection( valueObjectsCollection, valueObjectsCollectionToAdd, realClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addAllToCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, Class realClass): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addAllToCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, Class realClass): " + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addAllToCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, Class realClass): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addAllToCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, Class realClass): " + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addAllToCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, Class realClass): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addAllToCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, Class realClass): " + e.toString(),e);
}
}
/**
* @deprecated use {@link #addAllToCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, Class realClass)}
*/
public Collection mergeTwoCollections(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, Class realClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addAllToCollection( valueObjectsCollection, valueObjectsCollectionToAdd, realClass);
return valueObjectsCollection;
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.mergeTwoCollections(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, Class realClass): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.mergeTwoCollections(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, Class realClass): " + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.mergeTwoCollections(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, Class realClass): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.mergeTwoCollections(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, Class realClass): " + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.mergeTwoCollections(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, Class realClass): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.mergeTwoCollections(Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd, Class realClass): " + e.toString(),e);
}
}
public boolean addAllToCollection(Class targetRealClass, Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd,String[] sourcePAttributeNames,String[] targetPAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addAllToCollection( targetRealClass, valueObjectsCollection, valueObjectsCollectionToAdd, sourcePAttributeNames, targetPAttributeNames, null, null) ;
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addAllToCollection(Class targetRealClass, Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd,String[] sourcePAttributeNames,String[] targetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addAllToCollection(Class targetRealClass, Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd,String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addAllToCollection(Class targetRealClass, Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd,String[] sourcePAttributeNames,String[] targetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addAllToCollection(Class targetRealClass, Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd,String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addAllToCollection(Class targetRealClass, Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd,String[] sourcePAttributeNames,String[] targetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addAllToCollection(Class targetRealClass, Collection valueObjectsCollection, Collection valueObjectsCollectionToAdd,String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
}
}
public boolean addAllToCollection(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAdd, String pAttributeNameMapKey) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addAllToCollection(valueObjectsCollection, map, valueObjectsCollectionToAdd, pAttributeNameMapKey) ;
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addAllToCollection(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAdd, String pAttributeNameMapKey) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addAllToCollection(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAdd, String pAttributeNameMapKey) " + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addAllToCollection(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAdd, String pAttributeNameMapKey) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addAllToCollection(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAdd, String pAttributeNameMapKey) " + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addAllToCollection(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAdd, String pAttributeNameMapKey) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addAllToCollection(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAdd, String pAttributeNameMapKey) " + e.toString(),e);
}
}
public boolean retainAllInCollection(Object pInstance, String pAttributeName, Collection toRetainValueObjectsCollection) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.retainAllInCollection( pInstance, pAttributeName, toRetainValueObjectsCollection);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.retainAllInCollection(Object pInstance, String pAttributeName, Collection toRetainValueObjectsCollection): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retainAllInCollection(Object pInstance, String pAttributeName, Collection toRetainValueObjectsCollection)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.retainAllInCollection(Object pInstance, String pAttributeName, Collection toRetainValueObjectsCollection): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retainAllInCollection(Object pInstance, String pAttributeName, Collection toRetainValueObjectsCollection)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.retainAllInCollection(Object pInstance, String pAttributeName, Collection toRetainValueObjectsCollection): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retainAllInCollection(Object pInstance, String pAttributeName, Collection toRetainValueObjectsCollection)" + e.toString(),e);
}
}
public boolean retainAllInCollection(Collection valueObjectsCollection, Collection toRetainValueObjectsCollection, Class realClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.retainAllInCollection( valueObjectsCollection, toRetainValueObjectsCollection, realClass);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.retainAllInCollection(Collection valueObjectsCollection, Collection toRetainValueObjectsCollection, Class realClass): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retainAllInCollection(Collection valueObjectsCollection, Collection toRetainValueObjectsCollection, Class realClass)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.retainAllInCollection(Collection valueObjectsCollection, Collection toRetainValueObjectsCollection, Class realClass): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retainAllInCollection(Collection valueObjectsCollection, Collection toRetainValueObjectsCollection, Class realClass)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.retainAllInCollection(Collection valueObjectsCollection, Collection toRetainValueObjectsCollection, Class realClass): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retainAllInCollection(Collection valueObjectsCollection, Collection toRetainValueObjectsCollection, Class realClass)" + e.toString(),e);
}
}
public boolean retainAllInCollection(Collection valueObjectsCollection, Collection toRetainValueObjectsCollection, String[] pAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.retainAllInCollection( valueObjectsCollection, toRetainValueObjectsCollection, pAttributeNames);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.retainAllInCollection(Collection valueObjectsCollection, Collection toRetainValueObjectsCollection, String[] pAttributeNames) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retainAllInCollection(Collection valueObjectsCollection, Collection toRetainValueObjectsCollection, String[] pAttributeNames)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.retainAllInCollection(Collection valueObjectsCollection, Collection toRetainValueObjectsCollection, String[] pAttributeNames) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retainAllInCollection(Collection valueObjectsCollection, Collection toRetainValueObjectsCollection, String[] pAttributeNames)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.retainAllInCollection(Collection valueObjectsCollection, Collection toRetainValueObjectsCollection, String[] pAttributeNames) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retainAllInCollection(Collection valueObjectsCollection, Collection toRetainValueObjectsCollection, String[] pAttributeNames)" + e.toString(),e);
}
}
public boolean retainAllInCollection(Collection valueObjectsCollection, Map map, String pAttributeNameMapKey) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.retainAllInCollection(valueObjectsCollection, map, pAttributeNameMapKey);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.retainAllInCollection(Collection valueObjectsCollection, Map map, String pAttributeNameMapKey) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retainAllInCollection(Collection valueObjectsCollection, Map map, String pAttributeNameMapKey)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.retainAllInCollection(Collection valueObjectsCollection, Map map, String pAttributeNameMapKey) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retainAllInCollection(Collection valueObjectsCollection, Map map, String pAttributeNameMapKey)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.retainAllInCollection(Collection valueObjectsCollection, Map map, String pAttributeNameMapKey) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.retainAllInCollection(Collection valueObjectsCollection, Map map, String pAttributeNameMapKey)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #retainAllInCollection(Collection valueObjectsCollection, Map map, String pAttributeNameMapKey)}
*/
public void removeFromCollectionElementsNotInMap(Collection valueObjectsCollection, HashMap map, String pAttributeNameMapKey) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.retainAllInCollection(valueObjectsCollection, map, pAttributeNameMapKey);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.removeFromCollectionElementsNotInMap(Collection valueObjectsCollection, HashMap map, String pAttributeNameMapKey) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.removeFromCollectionElementsNotInMap(Collection valueObjectsCollection, HashMap map, String pAttributeNameMapKey)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.removeFromCollectionElementsNotInMap(Collection valueObjectsCollection, HashMap map, String pAttributeNameMapKey) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.removeFromCollectionElementsNotInMap(Collection valueObjectsCollection, HashMap map, String pAttributeNameMapKey)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.removeFromCollectionElementsNotInMap(Collection valueObjectsCollection, HashMap map, String pAttributeNameMapKey) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.removeFromCollectionElementsNotInMap(Collection valueObjectsCollection, HashMap map, String pAttributeNameMapKey)" + e.toString(),e);
}
}
public boolean addToRetainInCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAddAndRetain)throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToRetainInCollection( pInstance, pAttributeName, valueObjectsCollectionToAddAndRetain);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAddAndRetain) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAddAndRetain) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAddAndRetain) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAddAndRetain) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAddAndRetain) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToAddAndRetain) " + e.toString(),e);
}
}
public boolean addToRetainInCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAddAndRetain, Class realClass) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToRetainInCollection( valueObjectsCollection, valueObjectsCollectionToAddAndRetain, realClass);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAddAndRetain, Class realClass) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAddAndRetain, Class realClass) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAddAndRetain, Class realClass) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAddAndRetain, Class realClass) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAddAndRetain, Class realClass) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAddAndRetain, Class realClass) " + e.toString(),e);
}
}
public boolean addToRetainInCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAddAndRetain, String[] pAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToRetainInCollection( valueObjectsCollection, valueObjectsCollectionToAddAndRetain, pAttributeNames);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAddAndRetain, String[] pAttributeNames) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAddAndRetain, String[] pAttributeNames) " + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAddAndRetain, String[] pAttributeNames) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAddAndRetain, String[] pAttributeNames) " + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAddAndRetain, String[] pAttributeNames) " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollection(Collection valueObjectsCollection, Collection valueObjectsCollectionToAddAndRetain, String[] pAttributeNames) " + e.toString(),e);
}
}
public boolean addToRetainInCollection(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAddAndRetain, String pAttributeNameMapKey)throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addToRetainInCollection( valueObjectsCollection, map, valueObjectsCollectionToAddAndRetain, pAttributeNameMapKey);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addToRetainInCollection(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAddAndRetain, String pAttributeNameMapKey)" + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollection(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAddAndRetain, String pAttributeNameMapKey)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addToRetainInCollection(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAddAndRetain, String pAttributeNameMapKey)" + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollection(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAddAndRetain, String pAttributeNameMapKey)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addToRetainInCollection(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAddAndRetain, String pAttributeNameMapKey)" + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addToRetainInCollection(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAddAndRetain, String pAttributeNameMapKey)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #addToRetainInCollection(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAddAndRetain, String pAttributeNameMapKey)}
*
*/
public void refreshCollectionWithOtherCollectionUsingMapAsRelation(Collection valueObjectsCollection, HashMap map, Collection valueObjectsCollectionToAddAndRetain, String pAttributeNameMapKey) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addToRetainInCollection( valueObjectsCollection, map, valueObjectsCollectionToAddAndRetain, pAttributeNameMapKey);
} catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.refreshCollectionWithOtherCollectionUsingMapAsRelation(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAddAndRetain, String pAttributeNameMapKey)" + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.refreshCollectionWithOtherCollectionUsingMapAsRelation(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAddAndRetain, String pAttributeNameMapKey)" + e.toString(),e);
} catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.refreshCollectionWithOtherCollectionUsingMapAsRelation(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAddAndRetain, String pAttributeNameMapKey)" + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.refreshCollectionWithOtherCollectionUsingMapAsRelation(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAddAndRetain, String pAttributeNameMapKey)" + e.toString(),e);
} catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.refreshCollectionWithOtherCollectionUsingMapAsRelation(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAddAndRetain, String pAttributeNameMapKey)" + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.refreshCollectionWithOtherCollectionUsingMapAsRelation(Collection valueObjectsCollection, Map map, Collection valueObjectsCollectionToAddAndRetain, String pAttributeNameMapKey)" + e.toString(),e);
}
}
public boolean removeFromCollection(Object pInstance, String pAttributeName, Object toRemovePInstance) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.removeFromCollection(pInstance, pAttributeName, toRemovePInstance) ;
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.removeFromCollection(Object pInstance, String pAttributeName, Object toRemovePInstance) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.removeFromCollection(Object pInstance, String pAttributeName, Object toRemovePInstance) " + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.removeFromCollection(Object pInstance, String pAttributeName, Object toRemovePInstance) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.removeFromCollection(Object pInstance, String pAttributeName, Object toRemovePInstance) " + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.removeFromCollection(Object pInstance, String pAttributeName, Object toRemovePInstance) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.removeFromCollection(Object pInstance, String pAttributeName, Object toRemovePInstance) " + e.toString(),e);
}
}
public boolean removeFromCollection(Collection valueObjectsCollection, Object toRemovePInstance) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.removeFromCollection(valueObjectsCollection, toRemovePInstance);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.removeFromCollection(Collection valueObjectsCollection, Object toRemovePInstance): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.removeFromCollection(Collection valueObjectsCollection, Object toRemovePInstance)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.removeFromCollection(Collection valueObjectsCollection, Object toRemovePInstance): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.removeFromCollection(Collection valueObjectsCollection, Object toRemovePInstance)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.removeFromCollection(Collection valueObjectsCollection, Object toRemovePInstance): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.removeFromCollection(Collection valueObjectsCollection, Object toRemovePInstance)" + e.toString(),e);
}
}
/**
* @deprecated use {@link #removeFromCollection(Object pInstance, String pAttributeName, Object toRemovePInstance)}
*/
public boolean removeElementFromCollectionReference(Object pInstance, String pAttributeName, Object toRemovePInstance) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.removeFromCollection(pInstance, pAttributeName, toRemovePInstance) ;
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.removeFromCollectionReference(Object pInstance, String pAttributeName, Object toRemovePInstance): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.removeFromCollectionReference(Object pInstance, String pAttributeName, Object toRemovePInstance)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.removeFromCollectionReference(Object pInstance, String pAttributeName, Object toRemovePInstance): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.removeFromCollectionReference(Object pInstance, String pAttributeName, Object toRemovePInstance)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.removeFromCollectionReference(Object pInstance, String pAttributeName, Object toRemovePInstance): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.removeFromCollectionReference(Object pInstance, String pAttributeName, Object toRemovePInstance)" + e.toString(),e);
}
}
public boolean removeAllFromCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToRemove) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.removeAllFromCollection( pInstance, pAttributeName, valueObjectsCollectionToRemove);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.removeAllFromCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToRemove) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.removeAllFromCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToRemove) " + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.removeAllFromCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToRemove) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.removeAllFromCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToRemove) " + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.removeAllFromCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToRemove) : " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.removeAllFromCollection(Object pInstance, String pAttributeName, Collection valueObjectsCollectionToRemove) " + e.toString(),e);
}
}
public Object createVOfromVO(Class sourceRealClass,String[] pkFieldNames, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.createVOfromVO(sourceRealClass, pkFieldNames, pkValues, targetRealClass, sourcePAttributeNames, targetPAttributeNames, pAttributeNames, valuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createVOfromVO(Class sourceRealClass,String[] pkFieldNames, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createVOfromVO(Class sourceRealClass,String[] pkFieldNames, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createVOfromVO(Class sourceRealClass,String[] pkFieldNames, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createVOfromVO(Class sourceRealClass,String[] pkFieldNames, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createVOfromVO(Class sourceRealClass,String[] pkFieldNames, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createVOfromVO(Class sourceRealClass,String[] pkFieldNames, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}
}
public Object createVOfromVO(Class sourceRealClass,String[] pkFieldNames, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.createVOfromVO(sourceRealClass, pkFieldNames, pkValues, targetRealClass, sourcePAttributeNames, targetPAttributeNames, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createVOfromVO(Class sourceRealClass,String[] pkFieldNames, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createVOfromVO(Class sourceRealClass,String[] pkFieldNames, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createVOfromVO(Class sourceRealClass,String[] pkFieldNames, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createVOfromVO(Class sourceRealClass,String[] pkFieldNames, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createVOfromVO(Class sourceRealClass,String[] pkFieldNames, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createVOfromVO(Class sourceRealClass,String[] pkFieldNames, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
}
}
public Object createVOfromVO(Class sourceRealClass, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.createVOfromVO(sourceRealClass, pkValues, targetRealClass, sourcePAttributeNames, targetPAttributeNames, pAttributeNames, valuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createVOfromVO(Class sourceRealClass, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createVOfromVO(Class sourceRealClass, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createVOfromVO(Class sourceRealClass, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createVOfromVO(Class sourceRealClass, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createVOfromVO(Class sourceRealClass, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createVOfromVO(Class sourceRealClass, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}
}
public Object createVOfromVO(Class sourceRealClass, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.createVOfromVO(sourceRealClass, pkValues, targetRealClass, sourcePAttributeNames, targetPAttributeNames, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createVOfromVO(Class sourceRealClass, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createVOfromVO(Class sourceRealClass, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createVOfromVO(Class sourceRealClass, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createVOfromVO(Class sourceRealClass, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createVOfromVO(Class sourceRealClass, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createVOfromVO(Class sourceRealClass, Object[] pkValues, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
}
}
public Object createVOfromVO(Object sourcePInstance, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.createVOfromVO(sourcePInstance, targetRealClass, sourcePAttributeNames,targetPAttributeNames, pAttributeNames, valuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createVOfromVO(Object sourcePInstance, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createVOfromVO(Object sourcePInstance, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createVOfromVO(Object sourcePInstance, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createVOfromVO(Object sourcePInstance, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createVOfromVO(Object sourcePInstance, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createVOfromVO(Object sourcePInstance, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames,String[] pAttributeNames,Object[] valuesArray)" + e.toString(),e);
}
}
public Object createVOfromVO(Object sourcePInstance, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.createVOfromVO(sourcePInstance, targetRealClass, sourcePAttributeNames,targetPAttributeNames, null, null);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.createVOfromVO(Object sourcePInstance, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createVOfromVO(Object sourcePInstance, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.createVOfromVO(Object sourcePInstance, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createVOfromVO(Object sourcePInstance, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.createVOfromVO(Object sourcePInstance, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.createVOfromVO(Object sourcePInstance, Class targetRealClass, String[] sourcePAttributeNames,String[] targetPAttributeNames)" + e.toString(),e);
}
}
public boolean addTreeToTree(Object sourceRootVO, Object targetRootVO,Collection sourceTreePaths,Collection targetTreePaths, Collection treeNodeSourcePAttributeNames, Collection treeNodeTargetPAttributeNames, Collection treeNodePAttributeNames, Collection treeNodeValuesArray ) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addTreeToTree( sourceRootVO, targetRootVO, sourceTreePaths, targetTreePaths, treeNodeSourcePAttributeNames, treeNodeTargetPAttributeNames, treeNodePAttributeNames, treeNodeValuesArray );
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addTreeToTree(Object sourceRootVO, Object targetRootVO,Collection sourceTreePaths,Collection targetTreePaths, Collection treeNodeSourcePAttributeNames, Collection treeNodeTargetPAttributeNames, Collection treeNodePAttributeNames, Collection treeNodeValuesArray ): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addTreeToTree(Object sourceRootVO, Object targetRootVO,Collection sourceTreePaths,Collection targetTreePaths, Collection treeNodeSourcePAttributeNames, Collection treeNodeTargetPAttributeNames, Collection treeNodePAttributeNames, Collection treeNodeValuesArray ):" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addTreeToTree(Object sourceRootVO, Object targetRootVO,Collection sourceTreePaths,Collection targetTreePaths, Collection treeNodeSourcePAttributeNames, Collection treeNodeTargetPAttributeNames, Collection treeNodePAttributeNames, Collection treeNodeValuesArray ): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addTreeToTree(Object sourceRootVO, Object targetRootVO,Collection sourceTreePaths,Collection targetTreePaths, Collection treeNodeSourcePAttributeNames, Collection treeNodeTargetPAttributeNames, Collection treeNodePAttributeNames, Collection treeNodeValuesArray ):" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addTreeToTree(Object sourceRootVO, Object targetRootVO,Collection sourceTreePaths,Collection targetTreePaths, Collection treeNodeSourcePAttributeNames, Collection treeNodeTargetPAttributeNames, Collection treeNodePAttributeNames, Collection treeNodeValuesArray ): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addTreeToTree(Object sourceRootVO, Object targetRootVO,Collection sourceTreePaths,Collection targetTreePaths, Collection treeNodeSourcePAttributeNames, Collection treeNodeTargetPAttributeNames, Collection treeNodePAttributeNames, Collection treeNodeValuesArray ):" + e.toString(),e);
}
}
/**
* @deprecated use {@link #addTreeToTree(Object sourceRootVO, Object targetRootVO,Collection sourceTreePaths,Collection targetTreePaths, Collection treeNodeSourcePAttributeNames, Collection treeNodeTargetPAttributeNames, Collection treeNodePAttributeNames, Collection treeNodeValuesArray )}
* */
public Object addTreesToTrees(Object sourceRootVO, Object targetRootVO,Collection sourceTreePaths,Collection targetTreePaths, Collection treeNodeSourcePAttributeNames,Collection treeNodeTargetPAttributeNames, Collection treeNodePAttributeNames, Collection treeNodeValuesArray ) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
businessSLSBFacade.addTreeToTree( sourceRootVO, targetRootVO, sourceTreePaths, targetTreePaths, treeNodeSourcePAttributeNames, treeNodeTargetPAttributeNames, treeNodePAttributeNames, treeNodeValuesArray );
return targetRootVO;
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addTreesToTrees(Object sourceRootVO, Object targetRootVO,Collection sourceTreePaths,Collection targetTreePaths, Collection treeNodeSourcePAttributeNames, Collection treeNodeTargetPAttributeNames, Collection treeNodePAttributeNames, Collection treeNodeValuesArray ): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addTreesToTrees(Object sourceRootVO, Object targetRootVO,Collection sourceTreePaths,Collection targetTreePaths, Collection treeNodeSourcePAttributeNames, Collection treeNodeTargetPAttributeNames, Collection treeNodePAttributeNames, Collection treeNodeValuesArray ):" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addTreesToTrees(Object sourceRootVO, Object targetRootVO,Collection sourceTreePaths,Collection targetTreePaths, Collection treeNodeSourcePAttributeNames, Collection treeNodeTargetPAttributeNames, Collection treeNodePAttributeNames, Collection treeNodeValuesArray ): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addTreesToTrees(Object sourceRootVO, Object targetRootVO,Collection sourceTreePaths,Collection targetTreePaths, Collection treeNodeSourcePAttributeNames, Collection treeNodeTargetPAttributeNames, Collection treeNodePAttributeNames, Collection treeNodeValuesArray ):" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addTreesToTrees(Object sourceRootVO, Object targetRootVO,Collection sourceTreePaths,Collection targetTreePaths, Collection treeNodeSourcePAttributeNames, Collection treeNodeTargetPAttributeNames, Collection treeNodePAttributeNames, Collection treeNodeValuesArray ): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addTreesToTrees(Object sourceRootVO, Object targetRootVO,Collection sourceTreePaths,Collection targetTreePaths, Collection treeNodeSourcePAttributeNames, Collection treeNodeTargetPAttributeNames, Collection treeNodePAttributeNames, Collection treeNodeValuesArray ):" + e.toString(),e);
}
}
public boolean addTreeToTree(Object sourceRootVO, Object targetRootVO, String sourceTreePath, String targetTreePath, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[][] nodePAttributeNames, Object[][] nodeValuesArray)throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addTreeToTree( sourceRootVO, targetRootVO, sourceTreePath, targetTreePath, nodeSourcePAttributeNames, nodeTargetPAttributeNames, nodePAttributeNames, nodeValuesArray);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.addTreeToTree(Object sourceRootVO, Object targetRootVO, String sourceTreePath, String targetTreePath, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[][] nodePAttributeNames, Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addTreeToTree(Object sourceRootVO, Object targetRootVO, String sourceTreePath, String targetTreePath, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[][] nodePAttributeNames, Object[][] nodeValuesArray)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.addTreeToTree(Object sourceRootVO, Object targetRootVO, String sourceTreePath, String targetTreePath, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[][] nodePAttributeNames, Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addTreeToTree(Object sourceRootVO, Object targetRootVO, String sourceTreePath, String targetTreePath, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[][] nodePAttributeNames, Object[][] nodeValuesArray)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.addTreeToTree(Object sourceRootVO, Object targetRootVO, String sourceTreePath, String targetTreePath, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[][] nodePAttributeNames, Object[][] nodeValuesArray): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.addTreeToTree(Object sourceRootVO, Object targetRootVO, String sourceTreePath, String targetTreePath, String[][] nodeSourcePAttributeNames, String[][] nodeTargetPAttributeNames, String[][] nodePAttributeNames, Object[][] nodeValuesArray)" + e.toString(),e);
}
}
public boolean addTreeToTree(Object sourceRootVO, Object targetRootVO, String sourceTreePath, String targetTreePath, Collection nodeSourcePAttributeNamesCollection, Collection nodeTargetPAttributeNamesCollection, Collection nodePAttributeNamesCollection, Collection nodeValuesArrayCollection) throws ApplicationException{
try{
BusinessSLSBFacade businessSLSBFacade= businessSLSBFacadeHome.create();
return businessSLSBFacade.addTreeToTree( sourceRootVO, targetRootVO, sourceTreePath, targetTreePath, nodeSourcePAttributeNamesCollection, nodeTargetPAttributeNamesCollection, nodePAttributeNamesCollection, nodeValuesArrayCollection);
}catch (RemoteException e) {
log.error("RemoteException caught in SLSBManagerBD.ddTreeToTree(Object sourceRootVO, Object targetRootVO, String sourceTreePath, String targetTreePath, Collection nodeSourcePAttributeNamesCollection, Collection nodeTargetPAttributeNamesCollection, Collection nodePAttributeNamesCollection, Collection nodeValuesArrayCollection): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.ddTreeToTree(Object sourceRootVO, Object targetRootVO, String sourceTreePath, String targetTreePath, Collection nodeSourcePAttributeNamesCollection, Collection nodeTargetPAttributeNamesCollection, Collection nodePAttributeNamesCollection, Collection nodeValuesArrayCollection)" + e.toString(),e);
}catch (CreateException e) {
log.error("CreateException caught in SLSBManagerBD.ddTreeToTree(Object sourceRootVO, Object targetRootVO, String sourceTreePath, String targetTreePath, Collection nodeSourcePAttributeNamesCollection, Collection nodeTargetPAttributeNamesCollection, Collection nodePAttributeNamesCollection, Collection nodeValuesArrayCollection): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.ddTreeToTree(Object sourceRootVO, Object targetRootVO, String sourceTreePath, String targetTreePath, Collection nodeSourcePAttributeNamesCollection, Collection nodeTargetPAttributeNamesCollection, Collection nodePAttributeNamesCollection, Collection nodeValuesArrayCollection)" + e.toString(),e);
}catch (EJBException e) {
log.error("EJBException caught in SLSBManagerBD.ddTreeToTree(Object sourceRootVO, Object targetRootVO, String sourceTreePath, String targetTreePath, Collection nodeSourcePAttributeNamesCollection, Collection nodeTargetPAttributeNamesCollection, Collection nodePAttributeNamesCollection, Collection nodeValuesArrayCollection): " + e.toString());
throw new ApplicationException("ApplicationException thrown in SLSBManagerBD.ddTreeToTree(Object sourceRootVO, Object targetRootVO, String sourceTreePath, String targetTreePath, Collection nodeSourcePAttributeNamesCollection, Collection nodeTargetPAttributeNamesCollection, Collection nodePAttributeNamesCollection, Collection nodeValuesArrayCollection)" + e.toString(),e);
}
}
public Object findObjectByLogicCondition(Class realClass,
LogicCondition logicCondition) throws ApplicationException {
throw new UnsupportedOperationException("not yet implemented");
}
public Object findObjectByLogicCondition(String[] selectFields,
Class realClass, LogicCondition logicCondition)
throws ApplicationException {
throw new UnsupportedOperationException("not yet implemented");
}
public Object findObjectByLogicCondition(String[] selectFields,
Class realClass, LogicCondition logicCondition, String orderBy)
throws ApplicationException {
throw new UnsupportedOperationException("not yet implemented");
}
public Object findObjectByLogicCondition(Class realClass,
LogicCondition logicCondition, String orderBy)
throws ApplicationException {
throw new UnsupportedOperationException("not yet implemented");
}
/*********************** B U S I N E S S end******************/
}
| gpl-2.0 |
koshamo/Fastmail | src/main/java/com/github/koshamo/fastmail/mail/FolderSynchronizerTask.java | 4976 | /*
* Copyright (C) 2017 Dr. Jochen Raßler
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package com.github.koshamo.fastmail.mail;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.ResourceBundle;
import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.MessagingException;
import com.github.koshamo.fastmail.util.MessageItem;
import com.github.koshamo.fastmail.util.MessageMarket;
import com.github.koshamo.fastmail.util.SerializeManager;
import javafx.application.Platform;
import javafx.collections.ObservableList;
import javafx.concurrent.Task;
/**
* The FolderSynchronizerTask synchs the mails of a given Folder.
* <p>
* Used standalone in a thread, this task runs once to synch the given folder,
* e.g. for local folders, when we know a change has been made and we
* want to force an update.
* <p>
* The class can be used in a Scheduled Service, as it is implemented in
* FolderSynchronizer, that uses this Task to poll the update of a given
* folder. Main use for polling the inbox to check, if any mails have arrived
* or been deleted using another device / client.
*
* @author jochen
*
*/
public class FolderSynchronizerTask extends Task<Void> {
private final Folder folder;
private final ObservableList<EmailTableData> mailList;
private boolean stop = false;
private final ResourceBundle i18n;
/**
* The constructor builds the context of this task, which is the folder
* on the server to check and the local list of mails to update.
*
* @param folder the folder on the server to check
* @param mailList the local observable list of mails to update
*/
public FolderSynchronizerTask(final Folder folder,
final ObservableList<EmailTableData> mailList) {
this.folder = folder;
this.mailList = mailList;
i18n = SerializeManager.getLocaleMessageBundle();
}
/**
* stops the execution of the thread
* <p>
*/
public void stop() {
stop = true;
}
/* (non-Javadoc)
* @see javafx.concurrent.Task#call()
*/
@Override
protected Void call() throws Exception {
try {
if (stop) return null; // check if thread needs to be stopped
// get mail count in local end
int count = mailList.size();
if (!folder.isOpen())
folder.open(Folder.READ_WRITE);
Message[] messages = folder.getMessages();
List<EmailTableData> serverList = new ArrayList<>();
/*
* first step: add mails, if there really are more mails
* on server than on the local end
*/
if (messages != null) {
for (Message msg : messages) {
if (stop) return null; // check if thread needs to be stopped
// check, if message has been deleted meanwhile
if (msg.isExpunged())
continue;
EmailTableData etd = new EmailTableData(msg);
if (!mailList.contains(etd))
// TODO: this may cause a NullPointerException. Why?
Platform.runLater(()-> mailList.add(etd));
// prepare for step two
if (count > 0)
serverList.add(etd);
}
}
/*
* if local end had no mails, we do not need to check, if any
* mails need to be deleted.
* This is always true, if we read a folder for the first time
*/
if (count > 0) {
/*
* second step: if there are more mails on the local end,
* which should be true, whenever mails are added in the first
* step or mails have been deleted from another source,
* delete all excessive mails
*/
if (mailList.size() != serverList.size()) {
// prevent ConcurrentModificationException
Collection<EmailTableData> toBeRemoved = new ArrayList<>();
for (EmailTableData etd : mailList) {
if (!serverList.contains(etd))
toBeRemoved.add(etd);
}
mailList.removeAll(toBeRemoved);
}
}
// sort the list in the natural order
// TODO: verify this solves the ArrayIndexOutOfBoundsException
// FIXME: does not!!
Platform.runLater(()-> mailList.sort(null));
} catch (MessagingException e) {
MessageItem mItem = new MessageItem(
MessageFormat.format(i18n.getString("exception.mailaccess"), //$NON-NLS-1$
e.getMessage()),
0.0, MessageItem.MessageType.EXCEPTION);
MessageMarket.getInstance().produceMessage(mItem);
}
return null;
}
}
| gpl-2.0 |
kjunias/ApressProSpringMVC | bookstore-shared/src/main/java/com/apress/prospringmvc/bookstore/repository/JpaBookRepository.java | 3030 | package com.apress.prospringmvc.bookstore.repository;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import org.springframework.stereotype.Repository;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import com.apress.prospringmvc.bookstore.domain.Book;
import com.apress.prospringmvc.bookstore.domain.BookSearchCriteria;
import com.apress.prospringmvc.bookstore.domain.Category;
/**
* JPA implementation for the {@link BookRepository}.
*
* @author Marten Deinum
* @author Koen Serneels
*
*/
@Repository("bookRepository")
public class JpaBookRepository implements BookRepository {
@PersistenceContext
private EntityManager entityManager;
@Override
public Book findById(long id) {
return this.entityManager.find(Book.class, id);
}
@Override
public List<Book> findByCategory(Category category) {
String hql = "select b from Book b where b.category=:category";
TypedQuery<Book> query = this.entityManager.createQuery(hql, Book.class);
query.setParameter("category", category);
return query.getResultList();
}
@Override
public List<Book> findRandom(int count) {
String hql = "select b from Book b order by rand()";
TypedQuery<Book> query = this.entityManager.createQuery(hql, Book.class);
query.setMaxResults(count);
return query.getResultList();
}
@Override
public List<Book> findBooks(BookSearchCriteria bookSearchCriteria) {
Assert.notNull(bookSearchCriteria, "Search Criteria are required!");
CriteriaBuilder builder = this.entityManager.getCriteriaBuilder();
CriteriaQuery<Book> query = builder.createQuery(Book.class);
Root<Book> book = query.from(Book.class);
List<Predicate> predicates = new ArrayList<Predicate>();
if (StringUtils.hasText(bookSearchCriteria.getTitle())) {
String title = bookSearchCriteria.getTitle().toUpperCase();
predicates.add(builder.like(builder.upper(book.<String> get("title")), "%" + title + "%"));
}
if (bookSearchCriteria.getCategory() != null) {
Category category = this.entityManager.find(Category.class, bookSearchCriteria.getCategory().getId());
predicates.add(builder.equal(book.<Category> get("category"), category));
}
if (!predicates.isEmpty()) {
query.where(predicates.toArray(new Predicate[predicates.size()]));
}
query.orderBy(builder.asc(book.get("title")));
return this.entityManager.createQuery(query).getResultList();
}
@Override
public void storeBook(Book book) {
this.entityManager.merge(book);
}
}
| gpl-2.0 |
cat-in-the-dark/old48_30_game | core/src/com/catinthedark/game/Constants.java | 1874 | package com.catinthedark.game;
import com.badlogic.gdx.math.Vector2;
public class Constants {
public static final int EASY = 1;
public static final int MEDIUM = 2;
public static final int HARD = 3;
public static final int tileSize = 32;
public static final float PLAYER_WIDTH = 2.0f;
public static final float PLAYER_HEIGHT = 2.0f;
public static final float CRAB_WIDTH = 2.0f;
public static final float CRAB_HEIGHT = 2.0f;
public static final float MUSHROOMED_CRAB_WIDTH = 2.0f;
public static final float MUSHROOMED_CRAB_HEIGHT = 2.0f;
public static final float BLOCK_WIDTH = 1.0f;
public static final float BLOCK_HEIGHT = 1.0f;
public static final int WORLD_GRAVITY = -30;
public static final Vector2 JUMP_IMPULSE = new Vector2(0f, 3.0f);
public static final float WALKING_FORCE = 1.0f;
public static final float BULLET_FORCE = 3.0f;
public static final int FRICTION = 1;
public static final Vector2 WALKING_FORCE_RIGHT = new Vector2(
WALKING_FORCE, 0f);
public static final Vector2 WALKING_FORCE_LEFT = new Vector2(-1
* WALKING_FORCE, 0f);
public static final Vector2 BULLET_FORCE_LEFT = new Vector2(-1
* BULLET_FORCE, 0f);
public static final Vector2 BULLET_FORCE_RIGHT = new Vector2(-1
* BULLET_FORCE, 0f);
public static final float ANIMATION_SPEED = 0.1f;
public static final int CABLE_STEPS = 100;
public static final int CABLE_THICK = 5;
public static final float MUSHROOMED_CRAB_SHUT_DELAY = 1f;
public static final float MUSHROOMED_CRAB_SHUT_TIME = 0.5f;
public static final int START_HEALTH = 20;
public static float MAX_DISTANCE_CAMERA_AHEAD = 4.0f;
public static float BACK_CAMERA_SPEED = 0.05f;
public static float MAIN_CAMERA_SPEED = 6.0f;
public static final int DISTANCE_MAX_EASY = 10000;
public static final float BOT_DEATH_ANIMATION_TIME = 0.5f;
public static final int CRAB_SCORE = 100;
}
| gpl-2.0 |
nologic/nabs | client/trunk/modules/NABFlowCollector/src/eunomia/module/receptor/coll/nabFlowCollector/Main.java | 3433 | /*
* Main.java
*
* Created on December 27, 2006, 8:14 PM
*
*/
package eunomia.module.receptor.coll.nabFlowCollector;
import eunomia.data.Database;
import com.vivic.eunomia.filter.Filter;
import com.vivic.eunomia.module.flow.Flow;
import com.vivic.eunomia.module.receptor.FlowProcessor;
import eunomia.plugin.interfaces.CollectionModule;
import eunomia.receptor.module.NABFlow.NABFlow;
import com.vivic.eunomia.module.flow.FlowModule;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.concurrent.Semaphore;
import org.apache.log4j.Logger;
/**
*
* @author Mikhail Sosonkin
*/
public class Main implements CollectionModule, FlowProcessor, Runnable {
private Statement stmt;
private StringBuilder b;
private int bufferSize;
private boolean firstFlow;
private String table;
private Thread thread;
private Semaphore sem;
private Object copyLock;
private boolean doQuit;
private Database db;
private static Logger logger;
static {
logger = Logger.getLogger(Main.class);
}
public Main() {
}
public void setDatabase(Database db) throws SQLException {
this.db = db;
doQuit = false;
copyLock = new Object();
sem = new Semaphore(1);
stmt = db.getNewStatement();
table = db.getMainTable();
bufferSize = 768*1024 - 2048;
b = new StringBuilder(bufferSize + 1024);
resetBuffer();
thread = new Thread(this);
thread.start();
thread.setName("Inserter");
}
public void run() {
while(!doQuit){
try{
Thread.sleep(1000);
} catch(Exception e){
}
if(db.isConnected()) {
dump();
}
}
}
public void quit(){
doQuit = true;
}
private void dump(){
String query = null;
synchronized(copyLock){
if(!firstFlow){
query = b.toString();
resetBuffer();
}
}
sem.release();
try {
if(query != null){
stmt.executeUpdate(query);
}
} catch(SQLException e){
logger.error("Unable to insert into database: " + e.getMessage());
}
}
private void resetBuffer(){
b.delete(0, b.length());
firstFlow = true;
b.append("INSERT INTO ");
b.append(table);
b.append(" VALUES ");
}
public void newFlow(Flow flow) {
synchronized(copyLock){
if(!firstFlow) {
b.append(",");
}
firstFlow = false;
b.append(flow.getSpecificInfo(null));
}
if(b.length() > bufferSize){
thread.interrupt();
sem.acquireUninterruptibly();
}
}
public void setFilter(Filter filter) {
}
public Filter getFilter() {
return null;
}
public boolean accept(FlowModule module) {
Flow flow = module.getNewFlowInstance();
return flow instanceof NABFlow;
}
public void destroy() {
}
public FlowProcessor getFlowProcessor() {
return this;
}
} | gpl-2.0 |
adini121/WebDriver | src/main/java/org/sayem/webdriver/basics/webdriver/examples/CheckBoxTest.java | 1452 | package org.sayem.webdriver.basics.webdriver.examples;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class CheckBoxTest {
private static WebDriver driver;
@Before
public void setUp() {
driver = new FirefoxDriver();
driver.get("http://dl.dropbox.com/u/55228056/Config.html");
}
@Test
public void testCheckBox() {
//Get the Checkbox as WebElement using it's value attribute
WebElement airbags = driver.findElement(By.xpath("//input[@value='Airbags']"));
//Check if its already selected? otherwise select the Checkbox
//by_class calling click() method
if (!airbags.isSelected())
airbags.click();
//Verify Checkbox is Selected
assertTrue(airbags.isSelected());
//Check Checkbox if selected? If yes, deselect it
//by_class calling click() method
if (airbags.isSelected())
airbags.click();
//Verify Checkbox is Deselected
assertFalse(airbags.isSelected());
}
@After
public void tearDown() {
driver.close();
driver.quit();
}
} | gpl-2.0 |
vectorman1/EVEStats | api/src/main/java/com/tlabs/eve/api/character/CharacterTrainingQueueRequest.java | 349 | package com.tlabs.eve.api.character;
public class CharacterTrainingQueueRequest extends CharacterRequest<CharacterTrainingQueueResponse> {
public static final int MASK = 262144;
public CharacterTrainingQueueRequest(String charID) {
super(CharacterTrainingQueueResponse.class, "/char/SkillQueue.xml.aspx", MASK, charID);
}
}
| gpl-2.0 |
williamgrosset/OSCAR-ConCert | src/main/java/oscar/login/jaas/BaseLoginModule.java | 9058 | /**
* Copyright (c) 2001-2002. Department of Family Medicine, McMaster University. All Rights Reserved.
* This software is published under the GPL GNU General Public License.
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* This software was written for the
* Department of Family Medicine
* McMaster University
* Hamilton
* Ontario, Canada
*/
package oscar.login.jaas;
import java.io.IOException;
import java.security.Principal;
import java.security.acl.Group;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.security.auth.Subject;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.NameCallback;
import javax.security.auth.callback.PasswordCallback;
import javax.security.auth.callback.UnsupportedCallbackException;
import javax.security.auth.login.LoginException;
import javax.security.auth.spi.LoginModule;
import org.apache.log4j.Logger;
/**
* Common base for a login module.
*/
public class BaseLoginModule implements LoginModule {
/**
* Option key for the authorization.
*/
public static final String OPTION_ATN_ENABLED = "authorizationEnabled";
private static Logger logger = Logger.getLogger(BaseLoginModule.class);
private Subject subject;
private Map<String, ?> sharedState;
private Map<String, ?> options;
private CallbackHandler callbackHandler;
private OscarPrincipal principal;
private Group rolesGroup;
private Group callerPrincipal;
private Group authPrincipal;
private boolean authorizationEnabled = false;
private List<String> defaultRoles = new ArrayList<String>();
/**
* Sets parameters for further user.
*
* @see javax.security.auth.spi.LoginModule#initialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map, java.util.Map)
*/
@Override
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) {
setSharedState(sharedState);
setSubject(subject);
setCallbackHandler(callbackHandler);
setOptions(options);
setAuthorizationEnabled(Boolean.parseBoolean("" + options.get(OPTION_ATN_ENABLED)));
}
/**
* Carries out the login process.
*
* @see javax.security.auth.spi.LoginModule#login()
*/
@Override
public boolean login() throws LoginException {
if (logger.isDebugEnabled()) {
logger.debug("Initiating login for " + this);
}
NameCallback nameCallback = new NameCallback("Username");
PasswordCallback passwordCallback = new PasswordCallback("Password", false);
try {
getCallbackHandler().handle(new Callback[] { nameCallback, passwordCallback });
} catch (IOException e1) {
throw new LoginException("Unable to retrieve user name or password");
} catch (UnsupportedCallbackException e1) {
throw new LoginException("Invalid callbacks for retrieving user name or password");
}
String loginName = nameCallback.getName();
char[] password = null;
// since password is an array, getting a shared instance won't fly - copy it
char[] tempPassword = passwordCallback.getPassword();
if (tempPassword != null) {
password = new char[tempPassword.length];
System.arraycopy(tempPassword, 0, password, 0, tempPassword.length);
passwordCallback.clearPassword();
}
passwordCallback.clearPassword();
if (logger.isDebugEnabled()) {
logger.debug("Started authentication for " + loginName);
}
long loginDuration = System.currentTimeMillis();
try {
// carry out authentication
OscarPrincipal principal = authenticate(loginName, password);
if (principal == null) throw new LoginException("Invalid login name or password");
loginDuration = System.currentTimeMillis() - loginDuration;
Arrays.fill(password, ' ');// clear password
setPrincipal(principal);
if (logger.isInfoEnabled()) {
logger.info("Authenticated user as: " + principal);
}
} catch (LoginException e) {
throw e;
} catch (Exception e) {
logger.error("Unable to complete authentication", e);
throw new LoginException("Unable to authenticate: " + e.getMessage());
}
if (logger.isDebugEnabled()) {
logger.debug("Logged in " + loginName + " successfully in {1} ms" + loginDuration);
}
if (isAuthorizationEnabled()) {
// CallerPrincipal group is necessary for making custom principal as the
// principal returned by the getUserPrincipal() methods in web apps
OscarGroup callerPrincipal = new OscarGroup("CallerPrincipal");
callerPrincipal.addMember(getPrincipal());
setCallerPrincipal(callerPrincipal);
OscarGroup authPrincipal = new OscarGroup("AuthPrincipal");
authPrincipal.addMember(getPrincipal());
setAuthPrincipal(authPrincipal);
Group rolesGroup = new OscarGroup("Roles");
for (OscarRole role : getRoles(loginName)) {
rolesGroup.addMember(role);
}
setRolesGroup(rolesGroup);
}
if (logger.isDebugEnabled()) {
logger.debug("Completed login for " + this);
}
return true;
}
@SuppressWarnings("unused")
protected List<OscarRole> getRoles(String loginName) {
return new ArrayList<OscarRole>();
}
@SuppressWarnings("unused")
protected OscarPrincipal authenticate(String loginName, char[] password) throws Exception, LoginException {
if (loginName == null) throw new LoginException("Empty login or password");
return null;
}
public OscarPrincipal getPrincipal() {
return principal;
}
public void setPrincipal(OscarPrincipal principal) {
this.principal = principal;
}
private Principal[] getPrincipals() {
return new Principal[] { getPrincipal(), getRolesGroup(), getCallerPrincipal(), getAuthPrincipal() };
}
@Override
public boolean commit() throws LoginException {
Set<Principal> principals = getSubject().getPrincipals();
for (Principal principal : getPrincipals()) {
if (principal != null) {
principals.add(principal);
}
}
if (logger.isDebugEnabled()) {
logger.debug("Completed commit for " + this);
}
return true;
}
@Override
public boolean abort() throws LoginException {
setSubject(null);
setCallbackHandler(null);
setPrincipal(null);
setRolesGroup(null);
setCallerPrincipal(null);
setAuthPrincipal(null);
if (logger.isDebugEnabled()) {
logger.debug("Completed abort for " + this);
}
return true;
}
@Override
public boolean logout() throws LoginException {
Set<Principal> principals = getSubject().getPrincipals();
for (Principal principal : getPrincipals())
principals.remove(principal);
if (logger.isDebugEnabled()) {
logger.debug("Completed logout for " + this);
}
return true;
}
private Subject getSubject() {
return subject;
}
private void setSubject(Subject subject) {
this.subject = subject;
}
private CallbackHandler getCallbackHandler() {
return callbackHandler;
}
private void setCallbackHandler(CallbackHandler callbackHandler) {
this.callbackHandler = callbackHandler;
}
public List<String> getDefaultRoles() {
return defaultRoles;
}
public void setDefaultRoles(List<String> defaultRoles) {
this.defaultRoles = defaultRoles;
}
public Map<String, ?> getSharedState() {
return sharedState;
}
public void setSharedState(Map<String, ?> sharedState) {
this.sharedState = sharedState;
}
public Group getRolesGroup() {
return rolesGroup;
}
public void setRolesGroup(Group rolesGroup) {
this.rolesGroup = rolesGroup;
}
public Group getCallerPrincipal() {
return callerPrincipal;
}
public void setCallerPrincipal(Group callerPrincipal) {
this.callerPrincipal = callerPrincipal;
}
public Group getAuthPrincipal() {
return authPrincipal;
}
public void setAuthPrincipal(Group authPrincipal) {
this.authPrincipal = authPrincipal;
}
public Map<String, ?> getOptions() {
return options;
}
public void setOptions(Map<String, ?> options) {
this.options = options;
}
/**
* Checks if this login module should provide authorization information
* after successful authentication is complete.
*
* @return
* Returns true if role and group information should be populated and false otherwise.
*/
public boolean isAuthorizationEnabled() {
return authorizationEnabled;
}
public void setAuthorizationEnabled(boolean authorizationEnabled) {
this.authorizationEnabled = authorizationEnabled;
}
}
| gpl-2.0 |
TheTypoMaster/Scaper | openjdk/jdk/src/share/classes/com/sun/jmx/snmp/IPAcl/JDMHostTrap.java | 1653 | /*
* Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/* Generated By:JJTree: Do not edit this line. JDMHostTrap.java */
package com.sun.jmx.snmp.IPAcl;
class JDMHostTrap extends SimpleNode {
protected String name= "";
JDMHostTrap(int id) {
super(id);
}
JDMHostTrap(Parser p, int id) {
super(p, id);
}
public static Node jjtCreate(int id) {
return new JDMHostTrap(id);
}
public static Node jjtCreate(Parser p, int id) {
return new JDMHostTrap(p, id);
}
}
| gpl-2.0 |
pawelpikus/Kakao_Project | src/kakao/Kakao.java | 1798 | /*
* KAKAO System Planowania Wysylek
* by Pawel Pikus, Tomasz Pudlo
*/
package kakao;
import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
/**
*
* @author Lusiotron2015
*/
public class Kakao {
public static String tablicaArtykulow[][];
public static void initLoginPage() throws Exception{
LoginPage loginPage = new LoginPage();
loginPage.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
loginPage.setSize(400,400);
loginPage.pack();
loginPage.setVisible(true);
KakaoDb kakaoDb = new KakaoDb("org.sqlite.JDBC", "jdbc:sqlite:Cocoa_v2.db");
kakaoDb.getConnection();
}
public static void main(String[] args) throws Exception {
try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (Exception e) {
// If Nimbus is not available, you can set the GUI to another look and feel.
}
initLoginPage();
/*
ReadCSV obj = new ReadCSV();
obj.czysc_tabele("Kraje");
obj.uzupelnij_tabele(6, 6, "Kraje");
ReadCSV.czysc_tabele("Artykuly");
obj.uzupelnij_tabele(2, 3, "Artykuly");
ReadFromDb odczyt = new ReadFromDb();
String[] nazwy_kolumn_artykuly = {"numer_artykulu", "nazwa_artykulu", "ilosc_paletowa"};
odczyt.pelny_odczyt("Artykuly", 3, nazwy_kolumn_artykuly);
*/
}
}
| gpl-2.0 |
MindWithCake/AppLoud | AppLoud/src/com/ilariosanseverino/apploud/ui/PlayPauseActivity.java | 1452 | package com.ilariosanseverino.apploud.ui;
import android.app.Activity;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.ilariosanseverino.apploud.R;
import com.ilariosanseverino.apploud.service.BackgroundService;
public class PlayPauseActivity extends Activity {
private boolean play;
private SharedPreferences pref;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_start_stop);
pref = PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext());
play = pref.getBoolean(BackgroundService.THREAD_PREF_KEY, true);
setButtonIcon();
}
public void changeServiceState(View view){
play = !play;
pref.edit().putBoolean(BackgroundService.THREAD_PREF_KEY, play).commit();
setButtonIcon();
}
private void setButtonIcon(){
Button button = (Button)findViewById(R.id.play_button);
int element = play? R.drawable.ic_action_pause : R.drawable.ic_action_play;
button.setCompoundDrawablesWithIntrinsicBounds(element, 0, 0, 0);
element = play? R.string.stop_menu_title : R.string.start_menu_title;
button.setText(element);
element = play? R.string.status_on : R.string.status_off;
((TextView)findViewById(R.id.status_label_2)).setText(element);
}
}
| gpl-2.0 |
specify/specify6 | src/edu/ku/brc/specify/plugins/ipadexporter/ProgressDelegate.java | 6747 | /* Copyright (C) 2022, Specify Collections Consortium
*
* Specify Collections Consortium, Biodiversity Institute, University of Kansas,
* 1345 Jayhawk Boulevard, Lawrence, Kansas, 66045, USA, support@specifysoftware.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package edu.ku.brc.specify.plugins.ipadexporter;
import javax.swing.SwingUtilities;
import edu.ku.brc.ui.ProgressDialog;
import edu.ku.brc.ui.UIRegistry;
import edu.ku.brc.ui.dnd.SimpleGlassPane;
/**
* @author rods
*
* @code_status Alpha
*
* May 4, 2012
*
*/
public class ProgressDelegate
{
private ProgressDialog progressDlg = null;
private SimpleGlassPane glassPane = null;
//private int val = 0;
//private int min = 0;
private int max = 0;
/**
* @param doDlg
*/
public ProgressDelegate(final boolean doDlg)
{
super();
if (doDlg)
{
progressDlg = new ProgressDialog("iPad Exporter", true, false);
} else
{
//glassPane = UIRegistry.writeSimpleGlassPaneMsg(getResourceString("NEW_INTER_LOADING_PREP"), 24);
glassPane = UIRegistry.writeSimpleGlassPaneMsg("iPad Exporter", 24);
}
}
/**
*
*/
public void incOverall()
{
SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
if (progressDlg != null)
{
progressDlg.processDone();
} else
{
//int v = (int)(((double)val / (double)max) * 100.0);
//glassPane.setProgress(v);
}
}
});
}
/**
* @param min
* @param max
*/
public void setOverall(final int min, final int max)
{
SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
if (progressDlg != null)
{
progressDlg.setOverall(min, max);
} else
{
//this.min = min;
//this.max = max;
//glassPane.setProgress(0);
}
}
});
}
/**
* @param value
*/
public void setOverall(final int value)
{
SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
if (progressDlg != null)
{
progressDlg.setOverall(value);
} else
{
//int v = (int)(((double)value / (double)max) * 100.0);
//glassPane.setProgress(v);
}
}
});
}
/**
* @param min
* @param max
*/
public void setProcess(final int min, final int max)
{
SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
if (progressDlg != null)
{
progressDlg.processDone();
} else
{
ProgressDelegate.this.max = max;
setProcess(0);
}
}
});
}
/**
* @param value
*/
public void setProcess(final int value)
{
SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
if (progressDlg != null)
{
progressDlg.processDone();
} else
{
int v = (int)(((double)value / (double)max) * 100.0);
glassPane.setProgress(v);
}
}
});
}
/**
* @param text
*/
public void setDesc(final String text)
{
SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
if (progressDlg != null)
{
progressDlg.setDesc(text);
} else
{
UIRegistry.writeSimpleGlassPaneMsg(text, 24);
}
}
});
}
/**
*
*/
public void processDone()
{
SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
if (progressDlg != null)
{
progressDlg.processDone();
} else
{
setProcess(100);
}
}
});
}
/**
*
*/
public void shutdown()
{
SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
if (progressDlg != null)
{
progressDlg.setVisible(false);
progressDlg.dispose();
progressDlg = null;
} else
{
SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
UIRegistry.clearSimpleGlassPaneMsg();
}
});
}
}
});
}
/**
*
*/
public void showAndFront()
{
SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
if (progressDlg != null)
{
progressDlg.setVisible(true);
progressDlg.toFront();
}
}
});
}
}
| gpl-2.0 |
ebourg/infonode | src/net/infonode/gui/componentpainter/SolidColorComponentPainter.java | 2582 | /*
* Copyright (C) 2004 NNL Technology AB
* Visit www.infonode.net for information about InfoNode(R)
* products and how to contact NNL Technology AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*/
// $Id: SolidColorComponentPainter.java,v 1.9 2005/02/16 11:28:11 jesper Exp $
package net.infonode.gui.componentpainter;
import net.infonode.gui.colorprovider.BackgroundColorProvider;
import net.infonode.gui.colorprovider.ColorProvider;
import net.infonode.util.Direction;
import java.awt.*;
/**
* Paints an area with a solid color.
*
* @author $Author: jesper $
* @version $Revision: 1.9 $
*/
public class SolidColorComponentPainter extends AbstractComponentPainter {
private static final long serialVersionUID = 1;
/**
* Paints a component using the background color set in the component.
*/
public static final SolidColorComponentPainter BACKGROUND_COLOR_PAINTER =
new SolidColorComponentPainter(BackgroundColorProvider.INSTANCE);
private ColorProvider colorProvider;
/**
* Constructor.
*
* @param colorProvider the color provider
*/
public SolidColorComponentPainter(ColorProvider colorProvider) {
this.colorProvider = colorProvider;
}
public void paint(Component component,
Graphics g,
int x,
int y,
int width,
int height,
Direction direction,
boolean horizontalFlip,
boolean verticalFlip) {
g.setColor(colorProvider.getColor(component));
g.fillRect(x, y, width, height);
}
public boolean isOpaque(Component component) {
return colorProvider.getColor(component).getAlpha() == 255;
}
public Color getColor(Component component) {
return colorProvider.getColor(component);
}
}
| gpl-2.0 |
durilka/MeditationTracker | Jpandroid/src/com/meditationtracker/persistence/jpa/Entity.java | 2464 | package com.meditationtracker.persistence.jpa;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import com.meditationtracker.persistence.helpers.ReflectionHelper;
import doo.util.functional.Collection;
import doo.util.functional.Folder;
public class Entity {
private String hash;
private Class<?> clazz = null;
private Map<String, Field> columns;
public Entity(Class<?> clazz) {
this.clazz = clazz;
hash = buildHash(clazz);
}
@SuppressWarnings("unchecked")
public <T> T createInstance(ResultSet row) throws IllegalArgumentException, SecurityException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, SQLException {
if (clazz == null)
throw new IllegalArgumentException("Entity was initialized without a class, cannot create one.");
return fillObject((T)clazz.getConstructor((Class[])null).newInstance(), row);
}
private <T> T fillObject(T obj, ResultSet row) throws SQLException, IllegalArgumentException, IllegalAccessException {
ResultSetMetaData metaData = row.getMetaData();
for (int x=0; x<metaData.getColumnCount(); x++) {
Field f = columns.get(metaData.getColumnLabel(x));
f.setAccessible(true);
f.set(obj, row.getObject(x));
}
return obj;
}
@Override
public int hashCode() {
return hash.hashCode();
}
public static String buildHash(ResultSet row) throws SQLException {
List<String> columns = new ArrayList<String>();
ResultSetMetaData rowMetaData = row.getMetaData();
for(int x = 0; x<rowMetaData.getColumnCount(); x++) {
columns.add(rowMetaData.getColumnName(x));
}
return sortAndJoinForHash(columns);
}
public String buildHash(Class<?> clazz) {
columns = ReflectionHelper.getPersistenceColumnNamesForClass(clazz);
List<String> colNames = new ArrayList<String>(columns.keySet());
return sortAndJoinForHash(colNames);
}
private static String sortAndJoinForHash(List<String> list) {
Collections.sort(list);
return Collection.fold(list, "|", new Folder<String, String>() {
public String fold(String accumulator, String current) {
return accumulator += current + "|";
}
});
}
}
| gpl-2.0 |
carvalhomb/tsmells | sample/argouml/argouml/org/argouml/uml/diagram/ui/ActionVisibilityPublic.java | 2783 | // $Id: ActionVisibilityPublic.java 9364 2005-11-13 11:01:34Z linus $
// Copyright (c) 2005 The Regents of the University of California. All
// Rights Reserved. Permission to use, copy, modify, and distribute this
// software and its documentation without fee, and without a written
// agreement is hereby granted, provided that the above copyright notice
// and this paragraph appear in all copies. This software program and
// documentation are copyrighted by The Regents of the University of
// California. The software program and documentation are supplied "AS
// IS", without any accompanying services from The Regents. The Regents
// does not warrant that the operation of the program will be
// uninterrupted or error-free. The end-user understands that the program
// was developed for research purposes and is advised not to rely
// exclusively on the program for any reason. IN NO EVENT SHALL THE
// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
package org.argouml.uml.diagram.ui;
import org.argouml.model.Model;
class ActionVisibilityPublic extends AbstractActionRadioMenuItem {
/**
* The constructor.
*
* @param o the target
* @param element TODO:
*/
public ActionVisibilityPublic(Object o) {
super("checkbox.visibility.public-uc", NO_ICON);
putValue("SELECTED", new Boolean(
Model.getVisibilityKind().getPublic()
.equals(valueOfTarget(o))));
}
/**
* @see org.argouml.uml.diagram.ui.FigNodeModelElement.AbstractActionRadioMenuItem#toggleValueOfTarget(java.lang.Object)
*/
void toggleValueOfTarget(Object t) {
Model.getCoreHelper().setVisibility(t,
Model.getVisibilityKind().getPublic());
}
/**
* Make use of the default visibility, which is public...
* TODO: centralise this knowledge.
*
* @see org.argouml.uml.diagram.ui.FigNodeModelElement.AbstractActionRadioMenuItem#valueOfTarget(java.lang.Object)
*/
Object valueOfTarget(Object t) {
Object v = Model.getFacade().getVisibility(t);
return v == null ? Model.getVisibilityKind().getPublic() : v;
}
}
| gpl-2.0 |
Crigges/3DScanner.RaspberryPi | core/src/de/rami/client/FileListener.java | 3538 | package de.rami.client;
import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE;
import static java.nio.file.StandardWatchEventKinds.ENTRY_DELETE;
import java.io.File;
import java.io.IOException;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.WatchEvent;
import java.nio.file.WatchKey;
import java.nio.file.WatchService;
public class FileListener {
Client cl = null;
/**
*Der FileListener "schaut" permanent nach neuen Files in dem angegebenen Pfad und schickt diese an den Server.
* @param path
* @param ip
*/
public FileListener(String path, String ip){
try {
cl = new Client(ip, 1234);
WatchService watcher = FileSystems.getDefault().newWatchService();
Path dir = Paths.get(path);
dir.register(watcher, ENTRY_CREATE, ENTRY_DELETE);
System.out.println("Watch Service registered for dir: " + dir.getFileName());
while (true) {
WatchKey key;
try {
key = watcher.take();
} catch (InterruptedException ex) {
return;
}
/**
* Falls eines der WatchEvents eingetreten ist(Create, Delete) wird das erkannte File mit einem 1 Sekunden Delay zum Server geschickt.
*/
for (WatchEvent<?> event : key.pollEvents()) {
WatchEvent.Kind<?> kind = event.kind();
@SuppressWarnings("unchecked")
WatchEvent<Path> ev = (WatchEvent<Path>) event;
Path fileName = ev.context();
try {
Thread.sleep(1000);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
File f = new File(path + "/" + fileName);
if(f.exists()){
try {
cl.sendFile(f);
System.out.println("hello");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
System.out.println("thirdPrint" + kind.name() + ": " + fileName);
System.out.println(fileName.getFileName().toString());
System.out.println(""+ (Bilderstellung.fotosAnzahl-1) + ".jpg");
if(fileName.getFileName().toString().equals((""+ (Bilderstellung.fotosAnzahl-1) + ".jpg"))){
System.out.println("knapp vor close");
this.close();
//return;
}
}
boolean valid = key.reset();
if (!valid) {
break;
}
}
} catch (IOException ex) {
System.err.println(ex);
}
}
/**
* Sorgt dafür, dass der Client dem Server bescheid gibt, dass alle Bilder gesendet wurden. Daraufhin wird der FileListener Prozess beendet.
* @throws IOException
*/
public void close() throws IOException{
System.out.println("davor close");
cl.close();
System.out.println("danach close");
System.exit(-1);
}
// public static void main(String[] args){
// FileListener l = new FileListener("C:\\Users\\Ramor\\Desktop\\1", "192.168.1.14");
// }
} | gpl-2.0 |
kumait/HXFj | src/main/java/hxf/ws/runtime/InterfaceConfiguration.java | 1088 | package hxf.ws.runtime;
/**
* Created by kumait on 12/3/14.
*/
public class InterfaceConfiguration {
private String name;
private String description;
private RuntimeInfo runtimeInfo;
public InterfaceConfiguration(String name, String description, RuntimeInfo runtimeInfo) {
this.name = name;
this.description = description;
this.runtimeInfo = runtimeInfo;
}
public InterfaceConfiguration(String name, RuntimeInfo runtimeInfo) {
this(name, null, runtimeInfo);
}
public InterfaceConfiguration() {
this(null, null, null);
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public RuntimeInfo getRuntimeInfo() {
return runtimeInfo;
}
public void setRuntimeInfo(RuntimeInfo runtimeInfo) {
this.runtimeInfo = runtimeInfo;
}
}
| gpl-2.0 |
prmr/Solitaire | src/ca/mcgill/cs/stg/solitaire/model/Move.java | 1411 | /*******************************************************************************
* Solitaire
*
* Copyright (C) 2016 by Martin P. Robillard
*
* See: https://github.com/prmr/Solitaire
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*******************************************************************************/
package ca.mcgill.cs.stg.solitaire.model;
/**
* Represents one possible action in the game.
*/
public interface Move
{
/**
* Performs the move.
* @pre The move is legal
*/
void perform();
/**
* Undoes the move by reversing
* its effect.
*/
void undo();
/**
* @return True if the move is not a move that
* advances the game. False by default.
*/
default boolean isNull()
{ return false; }
}
| gpl-2.0 |
KiyoungKim/Nabee | source/com.nabsys.nabeeplus/src/com/nabsys/nabeeplus/widgets/window/SearchWindow.java | 7671 | package com.nabsys.nabeeplus.widgets.window;
import java.util.HashMap;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow;
import com.nabsys.nabeeplus.Activator;
import com.nabsys.nabeeplus.common.IMessageBox;
import com.nabsys.nabeeplus.common.ResourceFactory;
import com.nabsys.nabeeplus.common.label.NBLabel;
import com.nabsys.nabeeplus.listener.NBModifiedListener;
import com.nabsys.nabeeplus.widgets.NCheckBox;
import com.nabsys.nabeeplus.widgets.NRadio;
import com.nabsys.nabeeplus.widgets.NStyledText;
import com.nabsys.nabeeplus.widgets.PopupWindow;
public class SearchWindow extends PopupWindow{
public SearchWindow(Shell parent)
{
super(parent);
}
public void setTitle(String title)
{
shell.setText(title);
}
public void setImage(String path)
{
shell.setImage(Activator.getImageDescriptor(path).createImage(shell.getDisplay()));
}
public HashMap<String, String> open(IWorkbenchWindow window)
{
shell.setSize(new Point(400, 350));
GridLayout layout = new GridLayout();
layout.numColumns = 1;
layout.verticalSpacing = 0;
layout.horizontalSpacing = 0;
layout.marginWidth = 0;
layout.marginHeight = 0;
shell.setLayout(layout);
int width = window.getShell().getSize().x;
int height = window.getShell().getSize().y;
int x = window.getShell().getLocation().x;
int y = window.getShell().getLocation().y;
shell.setLocation((width / 2) + x - (400 / 2), (height / 2) + y - (250 / 2));
final HashMap<String, String> params = new HashMap<String, String>();
NBModifiedListener mdfListener = new NBModifiedListener(){
public void modified(String name, String value) {
params.put(name, value);
}
};
Composite schBack = new Composite(shell, SWT.NULL);
schBack.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
layout = new GridLayout();
layout.numColumns = 1;
layout.marginLeft = 20;
layout.marginRight = 20;
layout.marginTop = 15;
layout.marginBottom = 2;
layout.marginWidth = 0;
layout.marginHeight = 0;
schBack.setLayout(layout);
GridData layoutData = new GridData(GridData.FILL, GridData.FILL, true, false);
layoutData.heightHint = 140;
layoutData.verticalAlignment = SWT.TOP;
Group schGroup = new Group(schBack, SWT.NONE);
schGroup.setLayout(layout);
schGroup.setLayoutData(layoutData);
schGroup.setText("SQL Search");
layoutData = new GridData(GridData.FILL, GridData.FILL, true, false);
layoutData.heightHint = 18;
CLabel label = new CLabel(schGroup, SWT.NONE);
label.setLayoutData(layoutData);
label.setText(NBLabel.get(0x0249));
final NStyledText txtSch = new NStyledText(schGroup, "SCH_KEY", SWT.BORDER);
txtSch.setLayoutData(layoutData);
txtSch.addNBModifiedListener(mdfListener);
txtSch.setText(ResourceFactory.getSearchKey());
params.put("SCH_KEY", ResourceFactory.getSearchKey());
NCheckBox chkFolder = new NCheckBox(schGroup, "FLDR", NBLabel.get(0x024A), NBLabel.get(0x024A), SWT.NONE);
chkFolder.setLayoutData(layoutData);
chkFolder.addNBModifiedListener(mdfListener);
chkFolder.setSelection(ResourceFactory.isSearchFolder());
params.put("FLDR", String.valueOf(ResourceFactory.isSearchFolder()));
NCheckBox chkContents = new NCheckBox(schGroup, "CNTS", NBLabel.get(0x024B), NBLabel.get(0x024B), SWT.NONE);
chkContents.setLayoutData(layoutData);
chkContents.addNBModifiedListener(mdfListener);
chkContents.setSelection(ResourceFactory.isSearchContents());
params.put("CNTS", String.valueOf(ResourceFactory.isSearchContents()));
NCheckBox chkCase = new NCheckBox(schGroup, "CASE", NBLabel.get(0x0251), NBLabel.get(0x0251), SWT.NONE);
chkCase.setLayoutData(layoutData);
chkCase.addNBModifiedListener(mdfListener);
chkCase.setSelection(ResourceFactory.isCaseSensitive());
params.put("CASE", String.valueOf(ResourceFactory.isCaseSensitive()));
layoutData = new GridData(GridData.FILL, GridData.FILL, true, false);
layoutData.heightHint = 60;
layoutData.verticalAlignment = SWT.TOP;
Group schemaGroup = new Group(schBack, SWT.NONE);
schemaGroup.setLayout(layout);
schemaGroup.setLayoutData(layoutData);
schemaGroup.setText("Schema");
layoutData = new GridData(GridData.FILL, GridData.FILL, true, false);
layoutData.heightHint = 18;
NRadio rdoFull = new NRadio(schemaGroup, "FUL", NBLabel.get(0x024C), SWT.NONE);
rdoFull.setLayoutData(layoutData);
rdoFull.addNBModifiedListener(mdfListener);
rdoFull.setSelection(ResourceFactory.isSearchSchemaRoot());
params.put("FUL", String.valueOf(ResourceFactory.isSearchSchemaRoot()));
NRadio rdoSel = new NRadio(schemaGroup, "RSC", NBLabel.get(0x024D), SWT.NONE);
rdoSel.setLayoutData(layoutData);
rdoSel.addNBModifiedListener(mdfListener);
rdoSel.setSelection(ResourceFactory.isSearchSchemaSelected());
params.put("RSC", String.valueOf(ResourceFactory.isSearchSchemaSelected()));
Composite btnBack = new Composite(shell, SWT.NULL);
btnBack.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
layout = new GridLayout();
layout.numColumns = 3;
layout.marginRight = 20;
layout.marginTop = 15;
layout.marginBottom = 2;
layout.marginWidth = 5;
layout.marginHeight = 0;
btnBack.setLayout(layout);
layoutData = new GridData(GridData.FILL, GridData.FILL, true, false);
layoutData.heightHint = 25;
Composite dum = new Composite(btnBack, SWT.NONE);
dum.setLayoutData(layoutData);
layoutData = new GridData(GridData.FILL, GridData.FILL, false, false);
layoutData.widthHint = 80;
layoutData.heightHint = 25;
final Button btnSearch = new Button(btnBack, SWT.NONE);
btnSearch.setLayoutData(layoutData);
btnSearch.setText(NBLabel.get(0x0046));
final Button btnCancel = new Button(btnBack, SWT.NONE);
btnCancel.setLayoutData(layoutData);
btnCancel.setText(NBLabel.get(0x0086));
Listener listener = new Listener() {
public void handleEvent(Event e){
switch(e.type)
{
case SWT.Selection :
if(e.widget == btnCancel)
{
params.put("EVENT", "CANCEL");
shell.dispose();
}
else if(e.widget == btnSearch)
{
if(!params.containsKey("SCH_KEY") || params.get("SCH_KEY").equals(""))
{
IMessageBox.Warning(shell, NBLabel.get(0x024E));
txtSch.forceFocus();
return;
}
ResourceFactory.setCaseSensitive(params.get("CASE").equals("true"));
ResourceFactory.setSearchContents(params.get("CNTS").equals("true"));
ResourceFactory.setSearchFolder(params.get("FLDR").equals("true"));
ResourceFactory.setSearchKey(params.get("SCH_KEY"));
ResourceFactory.setSearchSchemaRoot(params.get("FUL").equals("true"));
ResourceFactory.setSearchSchemaSelected(params.get("RSC").equals("true"));
params.put("EVENT", "SEARCH");
shell.dispose();
}
break;
}
}
};
btnSearch.addListener(SWT.Selection, listener);
btnCancel.addListener(SWT.Selection, listener);
openWindow();
shell.setDefaultButton(btnSearch);
while (!shell.isDisposed()) {
if (!shell.getDisplay().readAndDispatch())
{
shell.getDisplay().sleep();
}
}
return params;
}
}
| gpl-2.0 |
lx4j/yose | src/test/e2e/test/support/HTMLDocument.java | 677 | package test.support;
import org.cyberneko.html.parsers.DOMParser;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import java.io.IOException;
import java.io.InputStream;
/**
* Created by L.x on 15-5-28.
*/
public class HTMLDocument {
public static Element toElement(InputStream html) throws SAXException, IOException {
return from(html).getDocumentElement();
}
public static Document from(InputStream html) throws SAXException, IOException {
DOMParser parser = new DOMParser();
parser.parse(new InputSource(html));
return parser.getDocument();
}
}
| gpl-2.0 |
TechMiX/DANTE-simulator | src/es/ladyr/simulator/timer/SimulatorTimer.java | 5257 | /*
* Copyright 2007 Luis Rodero Merino. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Luis Rodero Merino if you need additional information or
* have any questions. Contact information:
* Email: lrodero AT gsyc.es
* Webpage: http://gsyc.es/~lrodero
* Phone: +34 91 488 8107; Fax: +34 91 +34 91 664 7494
* Postal address: Desp. 121, Departamental II,
* Universidad Rey Juan Carlos
* C/Tulipán s/n, 28933, Móstoles, Spain
*
*/
package es.ladyr.simulator.timer;
import es.ladyr.simulator.Event;
import es.ladyr.simulator.EventHandler;
import es.ladyr.simulator.Simulator;
public class SimulatorTimer implements EventHandler {
protected TimerEvent timerEvent = null;
protected TimeEventsWaiter eventsWaiter = null;
protected long period = 0;
protected boolean waitingForTimeEvent = false;
public void scheduleTimeEvent(TimeEventsWaiter eventsWaiter, long time){
scheduleTimeEvent(eventsWaiter, time, TimerEvent.DEFAULT_TIMER_EVENT_PRIORITY);
}
public void scheduleTimeEvent(TimeEventsWaiter eventsWaiter, long time, int eventPriority){
if(time < Simulator.simulator().getSimulationTime())
throw new Error("Can not program a time event before present simulation time");
// Registering who waits for time events
this.eventsWaiter = eventsWaiter;
// Suspending any already scheduled time event
suspendTimeEvent();
// Now, programming new Timer event
if(timerEvent == null)
timerEvent = new TimerEvent(time, this, eventPriority);
else
timerEvent.recicleTimerEvent(time, this, eventPriority);
Simulator.simulator().registerEvent(timerEvent);
waitingForTimeEvent = true;
}
public void schedulePeriodicalTimeEvent(TimeEventsWaiter eventsWaiter, long startingTime, long period){
schedulePeriodicalTimeEvent(eventsWaiter, startingTime, period, TimerEvent.DEFAULT_TIMER_EVENT_PRIORITY);
}
public void schedulePeriodicalTimeEvent(TimeEventsWaiter eventsWaiter, long startingTime, long period, int eventPriority){
scheduleTimeEvent(eventsWaiter, startingTime, eventPriority);
this.period = period;
}
public boolean eventScheduled(){
//return (timerEvent != null);
return waitingForTimeEvent;
}
public long eventSchedulingTime(){
return (!waitingForTimeEvent ? -1 : timerEvent.getFiringTime());
}
public long timeToEvent(){
return (!waitingForTimeEvent ? -1 : timerEvent.getFiringTime() - Simulator.simulator().getSimulationTime());
}
public long period(){
return period;
}
public void updatePeriod(long newPeriod){
if(period <= 0)
throw new Error("Not periodical events programmed");
period = newPeriod;
}
public void suspendTimeEvent(){
// Suspending any already scheduled time event
if(waitingForTimeEvent)
Simulator.simulator().suspendEvent(timerEvent);
waitingForTimeEvent = false;
// Suspending periodical timing of events too.
period = 0;
}
public void processEvent(Event event) {
if(event != timerEvent)
throw new Error("Unexpected event");
if(!waitingForTimeEvent)
throw new Error("Timer was not expecting a time event");
// If event is periodical, must be programmed again.
if(period > 0){
timerEvent.recicleTimerEvent(Simulator.simulator().getSimulationTime() + period, this, timerEvent.getPriority());
Simulator.simulator().registerEvent(timerEvent);
} else
waitingForTimeEvent = false;
eventsWaiter.timeExpired(Simulator.simulator().getSimulationTime());
}
}
class TimerEvent extends Event {
public static final int DEFAULT_TIMER_EVENT_PRIORITY = MINIMUM_EVENT_PRIORITY;
public TimerEvent(long time, EventHandler eventHandler, int priority){
super(time, eventHandler, priority);
}
public void recicleTimerEvent(long time, EventHandler eventHandler, int priority){
recicleEvent(time, eventHandler, priority);
}
} | gpl-2.0 |
sencko/NALB | nalb2013/src/org/apache/fontbox/cff/encoding/CFFExpertEncoding.java | 9522 | /*
* 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.fontbox.cff.encoding;
/**
* This is specialized CFFEncoding. It's used if the EncodingId of a font is set to 1.
*
* @author Villu Ruusmann
* @version $Revision$
*/
public class CFFExpertEncoding extends CFFEncoding {
private CFFExpertEncoding() {
}
/**
* Returns an instance of the CFFExportEncoding class.
*
* @return an instance of CFFExportEncoding
*/
public static CFFExpertEncoding getInstance() {
return CFFExpertEncoding.INSTANCE;
}
private static final CFFExpertEncoding INSTANCE = new CFFExpertEncoding();
static {
INSTANCE.register(0, 0);
INSTANCE.register(1, 0);
INSTANCE.register(2, 0);
INSTANCE.register(3, 0);
INSTANCE.register(4, 0);
INSTANCE.register(5, 0);
INSTANCE.register(6, 0);
INSTANCE.register(7, 0);
INSTANCE.register(8, 0);
INSTANCE.register(9, 0);
INSTANCE.register(10, 0);
INSTANCE.register(11, 0);
INSTANCE.register(12, 0);
INSTANCE.register(13, 0);
INSTANCE.register(14, 0);
INSTANCE.register(15, 0);
INSTANCE.register(16, 0);
INSTANCE.register(17, 0);
INSTANCE.register(18, 0);
INSTANCE.register(19, 0);
INSTANCE.register(20, 0);
INSTANCE.register(21, 0);
INSTANCE.register(22, 0);
INSTANCE.register(23, 0);
INSTANCE.register(24, 0);
INSTANCE.register(25, 0);
INSTANCE.register(26, 0);
INSTANCE.register(27, 0);
INSTANCE.register(28, 0);
INSTANCE.register(29, 0);
INSTANCE.register(30, 0);
INSTANCE.register(31, 0);
INSTANCE.register(32, 1);
INSTANCE.register(33, 229);
INSTANCE.register(34, 230);
INSTANCE.register(35, 0);
INSTANCE.register(36, 231);
INSTANCE.register(37, 232);
INSTANCE.register(38, 233);
INSTANCE.register(39, 234);
INSTANCE.register(40, 235);
INSTANCE.register(41, 236);
INSTANCE.register(42, 237);
INSTANCE.register(43, 238);
INSTANCE.register(44, 13);
INSTANCE.register(45, 14);
INSTANCE.register(46, 15);
INSTANCE.register(47, 99);
INSTANCE.register(48, 239);
INSTANCE.register(49, 240);
INSTANCE.register(50, 241);
INSTANCE.register(51, 242);
INSTANCE.register(52, 243);
INSTANCE.register(53, 244);
INSTANCE.register(54, 245);
INSTANCE.register(55, 246);
INSTANCE.register(56, 247);
INSTANCE.register(57, 248);
INSTANCE.register(58, 27);
INSTANCE.register(59, 28);
INSTANCE.register(60, 249);
INSTANCE.register(61, 250);
INSTANCE.register(62, 251);
INSTANCE.register(63, 252);
INSTANCE.register(64, 0);
INSTANCE.register(65, 253);
INSTANCE.register(66, 254);
INSTANCE.register(67, 255);
INSTANCE.register(68, 256);
INSTANCE.register(69, 257);
INSTANCE.register(70, 0);
INSTANCE.register(71, 0);
INSTANCE.register(72, 0);
INSTANCE.register(73, 258);
INSTANCE.register(74, 0);
INSTANCE.register(75, 0);
INSTANCE.register(76, 259);
INSTANCE.register(77, 260);
INSTANCE.register(78, 261);
INSTANCE.register(79, 262);
INSTANCE.register(80, 0);
INSTANCE.register(81, 0);
INSTANCE.register(82, 263);
INSTANCE.register(83, 264);
INSTANCE.register(84, 265);
INSTANCE.register(85, 0);
INSTANCE.register(86, 266);
INSTANCE.register(87, 109);
INSTANCE.register(88, 110);
INSTANCE.register(89, 267);
INSTANCE.register(90, 268);
INSTANCE.register(91, 269);
INSTANCE.register(92, 0);
INSTANCE.register(93, 270);
INSTANCE.register(94, 271);
INSTANCE.register(95, 272);
INSTANCE.register(96, 273);
INSTANCE.register(97, 274);
INSTANCE.register(98, 275);
INSTANCE.register(99, 276);
INSTANCE.register(100, 277);
INSTANCE.register(101, 278);
INSTANCE.register(102, 279);
INSTANCE.register(103, 280);
INSTANCE.register(104, 281);
INSTANCE.register(105, 282);
INSTANCE.register(106, 283);
INSTANCE.register(107, 284);
INSTANCE.register(108, 285);
INSTANCE.register(109, 286);
INSTANCE.register(110, 287);
INSTANCE.register(111, 288);
INSTANCE.register(112, 289);
INSTANCE.register(113, 290);
INSTANCE.register(114, 291);
INSTANCE.register(115, 292);
INSTANCE.register(116, 293);
INSTANCE.register(117, 294);
INSTANCE.register(118, 295);
INSTANCE.register(119, 296);
INSTANCE.register(120, 297);
INSTANCE.register(121, 298);
INSTANCE.register(122, 299);
INSTANCE.register(123, 300);
INSTANCE.register(124, 301);
INSTANCE.register(125, 302);
INSTANCE.register(126, 303);
INSTANCE.register(127, 0);
INSTANCE.register(128, 0);
INSTANCE.register(129, 0);
INSTANCE.register(130, 0);
INSTANCE.register(131, 0);
INSTANCE.register(132, 0);
INSTANCE.register(133, 0);
INSTANCE.register(134, 0);
INSTANCE.register(135, 0);
INSTANCE.register(136, 0);
INSTANCE.register(137, 0);
INSTANCE.register(138, 0);
INSTANCE.register(139, 0);
INSTANCE.register(140, 0);
INSTANCE.register(141, 0);
INSTANCE.register(142, 0);
INSTANCE.register(143, 0);
INSTANCE.register(144, 0);
INSTANCE.register(145, 0);
INSTANCE.register(146, 0);
INSTANCE.register(147, 0);
INSTANCE.register(148, 0);
INSTANCE.register(149, 0);
INSTANCE.register(150, 0);
INSTANCE.register(151, 0);
INSTANCE.register(152, 0);
INSTANCE.register(153, 0);
INSTANCE.register(154, 0);
INSTANCE.register(155, 0);
INSTANCE.register(156, 0);
INSTANCE.register(157, 0);
INSTANCE.register(158, 0);
INSTANCE.register(159, 0);
INSTANCE.register(160, 0);
INSTANCE.register(161, 304);
INSTANCE.register(162, 305);
INSTANCE.register(163, 306);
INSTANCE.register(164, 0);
INSTANCE.register(165, 0);
INSTANCE.register(166, 307);
INSTANCE.register(167, 308);
INSTANCE.register(168, 309);
INSTANCE.register(169, 310);
INSTANCE.register(170, 311);
INSTANCE.register(171, 0);
INSTANCE.register(172, 312);
INSTANCE.register(173, 0);
INSTANCE.register(174, 0);
INSTANCE.register(175, 313);
INSTANCE.register(176, 0);
INSTANCE.register(177, 0);
INSTANCE.register(178, 314);
INSTANCE.register(179, 315);
INSTANCE.register(180, 0);
INSTANCE.register(181, 0);
INSTANCE.register(182, 316);
INSTANCE.register(183, 317);
INSTANCE.register(184, 318);
INSTANCE.register(185, 0);
INSTANCE.register(186, 0);
INSTANCE.register(187, 0);
INSTANCE.register(188, 158);
INSTANCE.register(189, 155);
INSTANCE.register(190, 163);
INSTANCE.register(191, 319);
INSTANCE.register(192, 320);
INSTANCE.register(193, 321);
INSTANCE.register(194, 322);
INSTANCE.register(195, 323);
INSTANCE.register(196, 324);
INSTANCE.register(197, 325);
INSTANCE.register(198, 0);
INSTANCE.register(199, 0);
INSTANCE.register(200, 326);
INSTANCE.register(201, 150);
INSTANCE.register(202, 164);
INSTANCE.register(203, 169);
INSTANCE.register(204, 327);
INSTANCE.register(205, 328);
INSTANCE.register(206, 329);
INSTANCE.register(207, 330);
INSTANCE.register(208, 331);
INSTANCE.register(209, 332);
INSTANCE.register(210, 333);
INSTANCE.register(211, 334);
INSTANCE.register(212, 335);
INSTANCE.register(213, 336);
INSTANCE.register(214, 337);
INSTANCE.register(215, 338);
INSTANCE.register(216, 339);
INSTANCE.register(217, 340);
INSTANCE.register(218, 341);
INSTANCE.register(219, 342);
INSTANCE.register(220, 343);
INSTANCE.register(221, 344);
INSTANCE.register(222, 345);
INSTANCE.register(223, 346);
INSTANCE.register(224, 347);
INSTANCE.register(225, 348);
INSTANCE.register(226, 349);
INSTANCE.register(227, 350);
INSTANCE.register(228, 351);
INSTANCE.register(229, 352);
INSTANCE.register(230, 353);
INSTANCE.register(231, 354);
INSTANCE.register(232, 355);
INSTANCE.register(233, 356);
INSTANCE.register(234, 357);
INSTANCE.register(235, 358);
INSTANCE.register(236, 359);
INSTANCE.register(237, 360);
INSTANCE.register(238, 361);
INSTANCE.register(239, 362);
INSTANCE.register(240, 363);
INSTANCE.register(241, 364);
INSTANCE.register(242, 365);
INSTANCE.register(243, 366);
INSTANCE.register(244, 367);
INSTANCE.register(245, 368);
INSTANCE.register(246, 369);
INSTANCE.register(247, 370);
INSTANCE.register(248, 371);
INSTANCE.register(249, 372);
INSTANCE.register(250, 373);
INSTANCE.register(251, 374);
INSTANCE.register(252, 375);
INSTANCE.register(253, 376);
INSTANCE.register(254, 377);
INSTANCE.register(255, 378);
}
} | gpl-2.0 |
BiglySoftware/BiglyBT | core/src/com/biglybt/core/download/impl/DownloadManagerAvailabilityImpl.java | 16798 | /*
* Created on Jun 16, 2014
* Created by Paul Gardner
*
* Copyright 2014 Azureus Software, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package com.biglybt.core.download.impl;
import java.net.URL;
import java.util.*;
import com.biglybt.core.CoreFactory;
import com.biglybt.core.download.DownloadManagerAvailability;
import com.biglybt.core.networkmanager.NetworkManager;
import com.biglybt.core.networkmanager.impl.tcp.TCPNetworkManager;
import com.biglybt.core.peer.PEPeerSource;
import com.biglybt.core.torrent.TOTorrent;
import com.biglybt.core.torrent.TOTorrentAnnounceURLSet;
import com.biglybt.core.torrent.TOTorrentException;
import com.biglybt.core.tracker.TrackerPeerSource;
import com.biglybt.core.tracker.TrackerPeerSourceAdapter;
import com.biglybt.core.tracker.client.TRTrackerAnnouncer;
import com.biglybt.core.tracker.client.TRTrackerAnnouncerDataProvider;
import com.biglybt.core.tracker.client.TRTrackerAnnouncerFactory;
import com.biglybt.core.util.AENetworkClassifier;
import com.biglybt.core.util.Debug;
import com.biglybt.core.util.HashWrapper;
import com.biglybt.core.util.SystemTime;
import com.biglybt.core.util.TorrentUtils;
import com.biglybt.pif.PluginInterface;
import com.biglybt.pif.ipc.IPCException;
import com.biglybt.pif.ipc.IPCInterface;
import com.biglybt.pif.torrent.Torrent;
import com.biglybt.pifimpl.local.PluginCoreUtils;
import com.biglybt.plugin.extseed.ExternalSeedPlugin;
import com.biglybt.plugin.tracker.dht.DHTTrackerPlugin;
public class
DownloadManagerAvailabilityImpl
implements DownloadManagerAvailability
{
private final List<TrackerPeerSource> peer_sources = new ArrayList<>();
TRTrackerAnnouncer tracker_client;
public
DownloadManagerAvailabilityImpl(
TOTorrent to_torrent,
List<List<String>> updated_trackers,
final String[] _enabled_peer_sources,
final String[] _enabled_networks )
{
if ( to_torrent == null ){
return;
}
final Set<String> enabled_peer_sources = new HashSet<>(Arrays.asList(_enabled_peer_sources));
final Set<String> enabled_networks = new HashSet<>(Arrays.asList(_enabled_networks));
if ( enabled_peer_sources.contains( PEPeerSource.PS_BT_TRACKER)){
TOTorrentAnnounceURLSet[] sets;
if ( updated_trackers == null ){
sets = to_torrent.getAnnounceURLGroup().getAnnounceURLSets();
}else{
sets = TorrentUtils.listToAnnounceSets( updated_trackers, to_torrent );
try{
to_torrent = TorrentUtils.cloneTorrent( to_torrent );
TorrentUtils.setMemoryOnly( to_torrent, true );
to_torrent.getAnnounceURLGroup().setAnnounceURLSets( sets );
}catch( Throwable e ){
Debug.out( e );
}
}
if ( sets.length == 0 ){
sets = new TOTorrentAnnounceURLSet[]{ to_torrent.getAnnounceURLGroup().createAnnounceURLSet( new URL[]{ to_torrent.getAnnounceURL()})};
}
try{
tracker_client =
TRTrackerAnnouncerFactory.create(
to_torrent,
new TRTrackerAnnouncerFactory.DataProvider()
{
@Override
public String[]
getNetworks()
{
return( _enabled_networks );
}
@Override
public HashWrapper
getTorrentHashOverride()
{
return( null );
}
});
final long torrent_size = to_torrent.getSize();
tracker_client.setAnnounceDataProvider(
new TRTrackerAnnouncerDataProvider()
{
@Override
public String
getName()
{
return( "Availability checker" );
}
@Override
public long
getTotalSent()
{
return( 0 );
}
@Override
public long
getTotalReceived()
{
return( 0 );
}
@Override
public long
getRemaining()
{
return( torrent_size );
}
@Override
public long
getFailedHashCheck()
{
return( 0 );
}
@Override
public String
getExtensions()
{
return( null );
}
@Override
public int
getMaxNewConnectionsAllowed( String network )
{
return( 1 ); // num-want -> 1
}
@Override
public int
getPendingConnectionCount()
{
return( 0 );
}
@Override
public int
getConnectedConnectionCount()
{
return( 0 );
}
@Override
public int
getUploadSpeedKBSec(
boolean estimate )
{
return( 0 );
}
public int
getTCPListeningPortNumber()
{
return( TCPNetworkManager.getSingleton().getDefaultTCPListeningPortNumber());
}
@Override
public int
getCryptoLevel()
{
return( NetworkManager.CRYPTO_OVERRIDE_NONE );
}
@Override
public boolean
isPeerSourceEnabled(
String peer_source )
{
return( true );
}
@Override
public void
setPeerSources(
String[] allowed_sources )
{
}
});
tracker_client.update( true );
}catch( Throwable e ){
Debug.out( e );
}
// source per set
for ( final TOTorrentAnnounceURLSet set: sets ){
final URL[] urls = set.getAnnounceURLs();
if ( urls.length == 0 || TorrentUtils.isDecentralised( urls[0] )){
continue;
}
peer_sources.add(
new TrackerPeerSource()
{
private TrackerPeerSource _delegate;
private TRTrackerAnnouncer ta;
private long ta_fixup;
private long last_scrape_fixup_time;
private Object[] last_scrape;
private TrackerPeerSource
fixup()
{
long now = SystemTime.getMonotonousTime();
if ( now - ta_fixup > 1000 ){
TRTrackerAnnouncer current_ta = tracker_client;
if ( current_ta == ta ){
if ( current_ta != null && _delegate == null ){
_delegate = current_ta.getTrackerPeerSource( set );
}
}else{
if ( current_ta == null ){
_delegate = null;
}else{
_delegate = current_ta.getTrackerPeerSource( set );
}
ta = current_ta;
}
ta_fixup = now;
}
return( _delegate );
}
protected Object[]
getScrape()
{
long now = SystemTime.getMonotonousTime();
if ( now - last_scrape_fixup_time > 30*1000 || last_scrape == null ){
last_scrape = new Object[]{ -1, -1, -1, -1, -1, "" };
last_scrape_fixup_time = now;
}
return( last_scrape );
}
@Override
public int
getType()
{
return( TrackerPeerSource.TP_TRACKER );
}
@Override
public String
getName()
{
TrackerPeerSource delegate = fixup();
if ( delegate == null ){
return( urls[0].toExternalForm());
}
return( delegate.getName());
}
@Override
public String
getDetails()
{
TrackerPeerSource delegate = fixup();
if ( delegate == null ){
return( null );
}
return( delegate.getDetails());
}
@Override
public URL
getURL()
{
TrackerPeerSource delegate = fixup();
if ( delegate == null ){
return( urls[0] );
}
return( delegate.getURL());
}
@Override
public int
getStatus()
{
TrackerPeerSource delegate = fixup();
if ( delegate == null ){
return( ST_STOPPED );
}
return( delegate.getStatus());
}
@Override
public String
getStatusString()
{
TrackerPeerSource delegate = fixup();
if ( delegate == null ){
return( (String)getScrape()[5] );
}
return( delegate.getStatusString());
}
@Override
public int
getSeedCount()
{
TrackerPeerSource delegate = fixup();
if ( delegate == null ){
return((Integer)getScrape()[0] );
}
int seeds = delegate.getSeedCount();
if ( seeds < 0 ){
seeds = (Integer)getScrape()[0];
}
return( seeds );
}
@Override
public int
getLeecherCount()
{
TrackerPeerSource delegate = fixup();
if ( delegate == null ){
return( (Integer)getScrape()[1] );
}
int leechers = delegate.getLeecherCount();
if ( leechers < 0 ){
leechers = (Integer)getScrape()[1];
}
return( leechers );
}
@Override
public int
getCompletedCount()
{
TrackerPeerSource delegate = fixup();
if ( delegate == null ){
return( (Integer)getScrape()[4] );
}
int comp = delegate.getCompletedCount();
if ( comp < 0 ){
comp = (Integer)getScrape()[4];
}
return( comp );
}
@Override
public int
getPeers()
{
TrackerPeerSource delegate = fixup();
if ( delegate == null ){
return( -1 );
}
// we only asked for 1 peer so if we have a scrape value then we'll leave this blank
// to avoid confusion
if ( delegate.getSeedCount() > 0 || delegate.getLeecherCount() > 0 ){
return( -1 );
}
return( delegate.getPeers());
}
@Override
public int
getInterval()
{
TrackerPeerSource delegate = fixup();
if ( delegate == null ){
Object[] si = getScrape();
int last = (Integer)si[2];
int next = (Integer)si[3];
if ( last > 0 && next < Integer.MAX_VALUE && last < next ){
return( next - last );
}
return( -1 );
}
return( delegate.getInterval());
}
@Override
public int
getMinInterval()
{
TrackerPeerSource delegate = fixup();
if ( delegate == null ){
return( -1 );
}
return( delegate.getMinInterval());
}
@Override
public boolean
isUpdating()
{
TrackerPeerSource delegate = fixup();
if ( delegate == null ){
return( false );
}
return( delegate.isUpdating());
}
@Override
public int
getLastUpdate()
{
TrackerPeerSource delegate = fixup();
if ( delegate == null ){
return( (Integer)getScrape()[2] );
}
return( delegate.getLastUpdate());
}
@Override
public int
getSecondsToUpdate()
{
TrackerPeerSource delegate = fixup();
if ( delegate == null ){
return( Integer.MIN_VALUE );
}
return( delegate.getSecondsToUpdate());
}
@Override
public boolean
canManuallyUpdate()
{
TrackerPeerSource delegate = fixup();
if ( delegate == null ){
return( false );
}
return( delegate.canManuallyUpdate());
}
@Override
public void
manualUpdate()
{
TrackerPeerSource delegate = fixup();
if ( delegate != null ){
delegate.manualUpdate();
}
}
@Override
public long[]
getReportedStats()
{
TrackerPeerSource delegate = fixup();
if ( delegate == null ){
return( null );
}
return( delegate.getReportedStats());
}
@Override
public boolean
canDelete()
{
return( false );
}
@Override
public void
delete()
{
}
});
}
}
Torrent torrent = PluginCoreUtils.wrap( to_torrent );
// http seeds
try{
ExternalSeedPlugin esp = DownloadManagerController.getExternalSeedPlugin();
if ( esp != null ){
TrackerPeerSource ext_ps = esp.getTrackerPeerSource( torrent );
if ( ext_ps.getSeedCount() > 0 ){
peer_sources.add( ext_ps );
}
}
}catch( Throwable e ){
}
if ( enabled_peer_sources.contains( PEPeerSource.PS_DHT) &&
enabled_networks.contains( AENetworkClassifier.AT_PUBLIC )){
// dht
if ( !torrent.isPrivate()){
try{
PluginInterface dht_pi = CoreFactory.getSingleton().getPluginManager().getPluginInterfaceByClass(DHTTrackerPlugin.class);
if ( dht_pi != null ){
peer_sources.addAll( Arrays.asList(((DHTTrackerPlugin)dht_pi.getPlugin()).getTrackerPeerSources( torrent )));
}
}catch( Throwable e ){
}
}
}
if ( enabled_peer_sources.contains( PEPeerSource.PS_DHT)){
// enabled_networks.contains( AENetworkClassifier.AT_I2P )){
// always do this availability check for the moment
if ( !torrent.isPrivate()){
try{
PluginInterface i2p_pi = CoreFactory.getSingleton().getPluginManager().getPluginInterfaceByID( "azneti2phelper", true );
if ( i2p_pi != null ){
IPCInterface ipc = i2p_pi.getIPC();
Map<String,Object> options = new HashMap<>();
options.put( "peer_networks", _enabled_networks );
final int[] lookup_status = new int[]{ TrackerPeerSource.ST_INITIALISING, -1, -1, -1 };
IPCInterface callback =
new IPCInterface()
{
@Override
public Object
invoke(
String methodName,
Object[] params)
throws IPCException
{
if ( methodName.equals( "statusUpdate" )){
synchronized( lookup_status ){
lookup_status[0] = (Integer)params[0];
if ( params.length >= 4 ){
lookup_status[1] = (Integer)params[1];
lookup_status[2] = (Integer)params[2];
lookup_status[3] = (Integer)params[3];
}
}
}
return( null );
}
@Override
public boolean
canInvoke(
String methodName,
Object[] params )
{
return( true );
}
};
TrackerPeerSource ps = new
TrackerPeerSourceAdapter()
{
@Override
public int
getType()
{
return( TP_DHT );
}
@Override
public String
getName()
{
return( "I2P DHT" );
}
@Override
public int
getStatus()
{
synchronized( lookup_status ){
return( lookup_status[0] );
}
}
@Override
public int
getSeedCount()
{
synchronized( lookup_status ){
int seeds = lookup_status[1];
int peers = lookup_status[3];
if ( seeds == 0 && peers > 0 ){
return( -1 );
}
return( seeds );
}
}
@Override
public int
getLeecherCount()
{
synchronized( lookup_status ){
int leechers = lookup_status[2];
int peers = lookup_status[3];
if ( leechers == 0 && peers > 0 ){
return( -1 );
}
return( leechers );
}
}
@Override
public int
getPeers()
{
synchronized( lookup_status ){
int peers = lookup_status[3];
return( peers==0?-1:peers );
}
}
};
ipc.invoke(
"lookupTorrent",
new Object[]{
"Availability lookup for '" + torrent.getName() + "'",
torrent.getHash(),
options,
callback
});
peer_sources.add( ps );
}
}catch( Throwable e ){
}
}
}
}
@Override
public List<TrackerPeerSource>
getTrackerPeerSources()
{
return( peer_sources );
}
@Override
public void
destroy()
{
if ( tracker_client != null ){
tracker_client.destroy();
}
}
}
| gpl-2.0 |
Creativa3d/box3d | paquetes/src/utiles/config/JDatosGeneralesXML.java | 7528 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package utiles.config;
import java.io.File;
import java.io.Serializable;
import java.util.Enumeration;
import java.util.Properties;
import utiles.xml.dom.Document;
import utiles.xml.dom.Element;
import utiles.xml.dom.JDOMGuardar;
import utiles.xml.dom.SAXBuilder;
public class JDatosGeneralesXML implements Serializable {
private static final long serialVersionUID = 1L;
public static final String mcsParametroRemoto = "Remoto";
public static final String mcsParametroLocal = "Local";
public static final String mcsParametroLocalPruebas = "LocalPruebas";
public static final String mcsCONEXIONDIRECTA= "CONEXIONDIRECTA";
public static final String mcsCONEXIONSERVIDOR = "CONEXIONSERVIDOR";
public static final String mcsCONEXIONES = "CONEXIONES";
public static final String mcsCONEXION = "conexion";
public static final String PARAMETRO_TipoSQL = "SimpleDataSource_TipoSQL";
public static final String PARAMETRO_TipoConexion = "SimpleDataSource_TipoConexion";
public static final String PARAMETRO_DRIVER_CLASS_NAME ="SimpleDataSource_driverClassName";
public static final String PARAMETRO_Conexion ="SimpleDataSource_url";
public static final String PARAMETRO_Usuario = "SimpleDataSource_user";
public static final String PARAMETRO_Password = "SimpleDataSource_password";
public static final String PARAMETRO_ConexionesMaximasSelect = "SimpleDataSource_conexionesMaximasSelect";
public static final String PARAMETRO_ConexionesMaximasEdicion = "SimpleDataSource_conexionesMaximasEdicion";
public static final String mcsLoginPBKDF2 = "mcsLoginPBKDF2";
private String msNombreFicheroSinExtension;
private Document moDocumento;
public JDatosGeneralesXML(final String psNombreFicheroSinExtension){
msNombreFicheroSinExtension=psNombreFicheroSinExtension;
}
public JDatosGeneralesXML(final Document poDocumento){
moDocumento=poDocumento;
}
public String getNombreFicheroSinExtension(){
return msNombreFicheroSinExtension;
}
private File moFile(String psFichero) throws Exception {
File moFile=null;
Class configurationParametersManagerClass = ConfigurationParametersManager.class;
ClassLoader classLoader = configurationParametersManagerClass.getClassLoader();
try {
moFile=new java.io.File(classLoader.getResource(psFichero).getFile());
} catch(Exception e1) {
moFile = new java.io.File(psFichero);
}
return moFile;
}
public void leer() throws Exception{
File loFile = moFile(msNombreFicheroSinExtension + ".xml");
if(!loFile.exists()){
File loFileP = moFile(msNombreFicheroSinExtension + ".properties");
convertirXML(loFileP, loFile);
// System.out.println("Despues convertir XML");
}
SAXBuilder loSax = new SAXBuilder();
//moDocumento = loSax.build(msNombreFicheroSinExtension + ".xml");
moDocumento = loSax.build(loFile.toString());
// System.out.println("Despues loSax.build");
}
public static void convertirXML(final File poFileProperties, final File poFileXML) throws Exception{
Element loRoot = new Element("root");
Document loDoc = new Document(loRoot);
if(poFileProperties.exists()){
convertirXML(poFileProperties, loDoc);
}
JDOMGuardar.guardar(loDoc, poFileXML.getAbsolutePath());
}
public static void convertirXML(File loFile, Document poDoc) throws Exception{
JLectorFicherosParametros loLector = new JLectorFicherosParametros(loFile.getAbsolutePath());
Element loRoot = poDoc.getRootElement();
Properties loPropiedades = loLector.getTodasPropiedades();
for (Enumeration e = loPropiedades.propertyNames(); e.hasMoreElements();) {
String key = (String)e.nextElement();
String val = (String)loPropiedades.get(key);
if(key.equals(PARAMETRO_Conexion.replace('_', '/')) ||
key.equals(PARAMETRO_ConexionesMaximasEdicion.replace('_', '/')) ||
key.equals(PARAMETRO_ConexionesMaximasSelect.replace('_', '/')) ||
key.equals(PARAMETRO_DRIVER_CLASS_NAME.replace('_', '/')) ||
key.equals(PARAMETRO_Password.replace('_', '/')) ||
key.equals(PARAMETRO_TipoSQL.replace('_', '/')) ||
key.equals(PARAMETRO_Usuario.replace('_', '/')) ) {
Element loAux = Element.simpleXPath(loRoot,
loRoot.getName() + "/" + mcsCONEXIONDIRECTA);
if(loAux == null){
loAux = new Element(mcsCONEXIONDIRECTA);
loRoot.addContent(loAux);
}
loAux.addContent(new Element(getSinRaros(key), val));
}else{
if(key.equals(mcsParametroLocal) ||
key.equals(mcsParametroLocalPruebas) ||
key.equals(mcsParametroRemoto)
) {
Element loAux = Element.simpleXPath(loRoot,
loRoot.getName() + "/" + mcsCONEXIONSERVIDOR);
if(loAux == null){
loAux = new Element(mcsCONEXIONSERVIDOR);
loRoot.addContent(loAux);
}
loAux.addContent(new Element(getSinRaros(key), val));
}else{
loRoot.addContent(new Element(getSinRaros(key), val));
}
}
}
}
public String getPropiedad(final String psNombre, final String psValorDefecto){
String lsResult = moDocumento.getPropiedad(psNombre, psValorDefecto);
return lsResult;
}
public Document getDocumento(){
return moDocumento;
}
public Element getElemento(final String psNombre){
return Element.simpleXPath(moDocumento.getRootElement(), moDocumento.getRootElement().getName() + "/" + moDocumento.getSinRarosConBarra(psNombre));
}
public String getPropiedad(final String psNombre){
return getPropiedad(psNombre, "");
}
/**
* Si existe la propiedad no hace nada, si no existe pone el valor pasado por
* parametro
*/
public void setPropiedadDefecto(final String psName, final String psValor){
String lsValor = getPropiedad(psName, psValor);
setPropiedad(psName, lsValor);
}
/**
* Establece el valor en la propiedad
* psnombre simpleXpath
*/
public void setPropiedad(final String psNombre, final String psValor){
moDocumento.setPropiedad(psNombre, psValor);
}
public void guardarFichero() throws Exception{
JDOMGuardar.guardar(moDocumento, msNombreFicheroSinExtension + ".xml");
}
private static String getSinRaros(String psCadena){
StringBuilder loBuffer = new StringBuilder(psCadena.length());
for(int i = 0 ; i < psCadena.length(); i++){
char lc = psCadena.charAt(i);
if( (lc >=0 && lc <= 9 ) ||
(lc >='a' && lc <= 'z' ) ||
(lc >='A' && lc <= 'Z' )
){
loBuffer.append(lc);
}else{
loBuffer.append('_');
}
}
return loBuffer.toString();
}
}
| gpl-2.0 |
TheTypoMaster/Scaper | openjdk/jdk/src/share/classes/javax/xml/crypto/OctetStreamData.java | 3544 | /*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* $Id: OctetStreamData.java,v 1.3 2005/05/10 15:47:42 mullan Exp $
*/
package javax.xml.crypto;
import java.io.InputStream;
/**
* A representation of a <code>Data</code> type containing an octet stream.
*
* @since 1.6
*/
public class OctetStreamData implements Data {
private InputStream octetStream;
private String uri;
private String mimeType;
/**
* Creates a new <code>OctetStreamData</code>.
*
* @param octetStream the input stream containing the octets
* @throws NullPointerException if <code>octetStream</code> is
* <code>null</code>
*/
public OctetStreamData(InputStream octetStream) {
if (octetStream == null) {
throw new NullPointerException("octetStream is null");
}
this.octetStream = octetStream;
}
/**
* Creates a new <code>OctetStreamData</code>.
*
* @param octetStream the input stream containing the octets
* @param uri the URI String identifying the data object (may be
* <code>null</code>)
* @param mimeType the MIME type associated with the data object (may be
* <code>null</code>)
* @throws NullPointerException if <code>octetStream</code> is
* <code>null</code>
*/
public OctetStreamData(InputStream octetStream, String uri,
String mimeType) {
if (octetStream == null) {
throw new NullPointerException("octetStream is null");
}
this.octetStream = octetStream;
this.uri = uri;
this.mimeType = mimeType;
}
/**
* Returns the input stream of this <code>OctetStreamData</code>.
*
* @return the input stream of this <code>OctetStreamData</code>.
*/
public InputStream getOctetStream() {
return octetStream;
}
/**
* Returns the URI String identifying the data object represented by this
* <code>OctetStreamData</code>.
*
* @return the URI String or <code>null</code> if not applicable
*/
public String getURI() {
return uri;
}
/**
* Returns the MIME type associated with the data object represented by this
* <code>OctetStreamData</code>.
*
* @return the MIME type or <code>null</code> if not applicable
*/
public String getMimeType() {
return mimeType;
}
}
| gpl-2.0 |
TheTypoMaster/Scaper | openjdk/jdk/src/share/classes/javax/swing/Autoscroller.java | 5824 | /*
* Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package javax.swing;
import java.awt.*;
import java.awt.event.*;
/**
* Autoscroller is responsible for generating synthetic mouse dragged
* events. It is the responsibility of the Component (or its MouseListeners)
* that receive the events to do the actual scrolling in response to the
* mouse dragged events.
*
* @author Dave Moore
* @author Scott Violet
*/
class Autoscroller implements ActionListener {
/**
* Global Autoscroller.
*/
private static Autoscroller sharedInstance = new Autoscroller();
// As there can only ever be one autoscroller active these fields are
// static. The Timer is recreated as necessary to target the appropriate
// Autoscroller instance.
private static MouseEvent event;
private static Timer timer;
private static JComponent component;
//
// The public API, all methods are cover methods for an instance method
//
/**
* Stops autoscroll events from happening on the specified component.
*/
public static void stop(JComponent c) {
sharedInstance._stop(c);
}
/**
* Stops autoscroll events from happening on the specified component.
*/
public static boolean isRunning(JComponent c) {
return sharedInstance._isRunning(c);
}
/**
* Invoked when a mouse dragged event occurs, will start the autoscroller
* if necessary.
*/
public static void processMouseDragged(MouseEvent e) {
sharedInstance._processMouseDragged(e);
}
Autoscroller() {
}
/**
* Starts the timer targeting the passed in component.
*/
private void start(JComponent c, MouseEvent e) {
Point screenLocation = c.getLocationOnScreen();
if (component != c) {
_stop(component);
}
component = c;
event = new MouseEvent(component, e.getID(), e.getWhen(),
e.getModifiers(), e.getX() + screenLocation.x,
e.getY() + screenLocation.y,
e.getXOnScreen(),
e.getYOnScreen(),
e.getClickCount(), e.isPopupTrigger(),
MouseEvent.NOBUTTON);
if (timer == null) {
timer = new Timer(100, this);
}
if (!timer.isRunning()) {
timer.start();
}
}
//
// Methods mirror the public static API
//
/**
* Stops scrolling for the passed in widget.
*/
private void _stop(JComponent c) {
if (component == c) {
if (timer != null) {
timer.stop();
}
timer = null;
event = null;
component = null;
}
}
/**
* Returns true if autoscrolling is currently running for the specified
* widget.
*/
private boolean _isRunning(JComponent c) {
return (c == component && timer != null && timer.isRunning());
}
/**
* MouseListener method, invokes start/stop as necessary.
*/
private void _processMouseDragged(MouseEvent e) {
JComponent component = (JComponent)e.getComponent();
boolean stop = true;
if (component.isShowing()) {
Rectangle visibleRect = component.getVisibleRect();
stop = visibleRect.contains(e.getX(), e.getY());
}
if (stop) {
_stop(component);
} else {
start(component, e);
}
}
//
// ActionListener
//
/**
* ActionListener method. Invoked when the Timer fires. This will scroll
* if necessary.
*/
public void actionPerformed(ActionEvent x) {
JComponent component = Autoscroller.component;
if (component == null || !component.isShowing() || (event == null)) {
_stop(component);
return;
}
Point screenLocation = component.getLocationOnScreen();
MouseEvent e = new MouseEvent(component, event.getID(),
event.getWhen(), event.getModifiers(),
event.getX() - screenLocation.x,
event.getY() - screenLocation.y,
event.getXOnScreen(),
event.getYOnScreen(),
event.getClickCount(),
event.isPopupTrigger(),
MouseEvent.NOBUTTON);
component.superProcessMouseMotionEvent(e);
}
}
| gpl-2.0 |
11hks11/sy | src/main/java/com/key/dwsurvey/dao/SysSendEmailDao.java | 195 | package com.key.dwsurvey.dao;
import com.key.common.dao.BaseDao;
import com.key.dwsurvey.entity.SysSendEmail;
public interface SysSendEmailDao extends BaseDao<SysSendEmail, String>{
}
| gpl-2.0 |
IvanSantiago/retopublico | MiMappir/src/mx/gob/sct/utic/mimappir/db/postgreSQL/dao/IIMAGENES_DAO.java | 363 | package mx.gob.sct.utic.mimappir.db.postgreSQL.dao;
import java.util.List;
import mx.gob.sct.utic.mimappir.db.postgreSQL.model.MMIMAGENES;
import mx.gob.sct.utic.mimappir.db.postgreSQL.model.pk.ICVEIMAGEN_PK;
public interface IIMAGENES_DAO {
List<MMIMAGENES> getList();
void delete(ICVEIMAGEN_PK id);
MMIMAGENES save(MMIMAGENES x);
}
| gpl-2.0 |
patbeagan1/AcerArchDev | c/LCS/cls.java | 331 | import java.io.*
public void read(File file) throws IOException{
Scanner scanner = new Scanner(file);
while(scanner.hasNext()){
String[] tokens = scanner.nextLine().split(";");
String last = tokens[tokens.length - 1];
System.out.println(last);
}
}
public static void main(String args[]){
}
| gpl-2.0 |
lclsdu/CS | jspxcms/src/com/jspxcms/ext/listener/QuestionDeleteListener.java | 187 | package com.jspxcms.ext.listener;
/**
* QuestionDeleteListener
*
* @author liufang
*
*/
public interface QuestionDeleteListener {
public void preQuestionDelete(Integer[] ids);
}
| gpl-2.0 |
OceanAtlas/JOA | ndEdit/Pointer.java | 1720 | /*
* $Id: Pointer.java,v 1.4 2005/02/15 18:31:10 oz Exp $
*
* This software is provided by NOAA for full, free and open release. It is
* understood by the recipient/user that NOAA assumes no liability for any
* errors contained in the code. Although this software is released without
* conditions or restrictions in its use, it is expected that appropriate
* credit be given to its author and to the National Oceanic and Atmospheric
* Administration should the software be included by the recipient as an
* element in other product development.
*/
package ndEdit;
/**
*
*
* @author Chris Windsor
* @version 1.0 01/13/00
*
* @note The data object containing the master data upon which filtering
* will be performed. It contains "standard" variables, latRange,
* lonRange, timeRange, depthRange, and variables. Also could
* contain a non-standard set of add-on variables.
*/
public class Pointer {
private double[] latRange = new double[2];
private double[] lonRange = new double[2];
private double[] depthRange = new double[2];
private long[] timeRange = new long[2];
private String[] standardVariables;
private String URD;
private String[] additionalFields;
public Pointer( double latStart,
double latStop,
double lonStart,
double lonStop,
double depthStart,
double depthStop,
long timeStart,
long timeStop,
String URD) {
latRange[0] = latStart;
latRange[1] = latStop;
lonRange[0] = lonStart;
lonRange[1] = lonStop;
depthRange[0] = depthStart;
depthRange[1] = depthStop;
timeRange[0] = timeStart;
timeRange[1] = timeStop;
this.URD = URD;
}
}
| gpl-2.0 |
smarr/Truffle | compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotHashCodeSnippets.java | 3340 | /*
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package org.graalvm.compiler.hotspot.replacements;
import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG;
import static org.graalvm.compiler.hotspot.meta.HotSpotForeignCallsProviderImpl.IDENTITY_HASHCODE;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.biasedLockMaskInPlace;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.identityHashCode;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.identityHashCodeShift;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.loadWordFromObject;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.markOffset;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.uninitializedIdentityHashCodeValue;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.unlockedMask;
import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.FAST_PATH_PROBABILITY;
import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.probability;
import org.graalvm.compiler.replacements.IdentityHashCodeSnippets;
import org.graalvm.compiler.word.Word;
import org.graalvm.word.WordFactory;
public class HotSpotHashCodeSnippets extends IdentityHashCodeSnippets {
@Override
protected int computeIdentityHashCode(final Object x) {
Word mark = loadWordFromObject(x, markOffset(INJECTED_VMCONFIG));
// this code is independent from biased locking (although it does not look that way)
final Word biasedLock = mark.and(biasedLockMaskInPlace(INJECTED_VMCONFIG));
if (probability(FAST_PATH_PROBABILITY, biasedLock.equal(WordFactory.unsigned(unlockedMask(INJECTED_VMCONFIG))))) {
int hash = (int) mark.unsignedShiftRight(identityHashCodeShift(INJECTED_VMCONFIG)).rawValue();
if (probability(FAST_PATH_PROBABILITY, hash != uninitializedIdentityHashCodeValue(INJECTED_VMCONFIG))) {
return hash;
}
}
return identityHashCode(IDENTITY_HASHCODE, x);
}
}
| gpl-2.0 |
forax/kija | src/com/github/kija/parser/ast/UnaryExpr.java | 847 | package com.github.kija.parser.ast;
import java.util.Objects;
public class UnaryExpr extends Node implements Expr {
private final Expr expr;
private final Kind kind;
public enum Kind {
MINUS("-"), NOT("!"), COMPLEMENT("~");
private final String operator;
private Kind(String operator) {
this.operator = operator;
}
public String getOperator() {
return operator;
}
}
public UnaryExpr(Kind kind, Expr expr, int lineNumber) {
super(lineNumber);
this.kind = Objects.requireNonNull(kind);
this.expr = Objects.requireNonNull(expr);
}
public Kind getKind() {
return kind;
}
public Expr getExpr() {
return expr;
}
@Override
public <P,R> R accept(ExprVisitor<? super P, ? extends R> visitor, P param) {
return visitor.visitUnary(this, param);
}
}
| gpl-2.0 |
szb231053450/tourism | src/main/java/com/sunzb/tourism/dao/qrtz/QrtzSimpleTriggersMapper.java | 1632 | package com.sunzb.tourism.dao.qrtz;
import com.sunzb.tourism.pojo.base.Criteria;
import com.sunzb.tourism.pojo.qrtz.QrtzSimpleTriggers;
import com.sunzb.tourism.pojo.qrtz.QrtzSimpleTriggersKey;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface QrtzSimpleTriggersMapper {
/**
* 根据条件查询记录总数
*/
int countByExample(Criteria example);
/**
* 根据条件删除记录
*/
int deleteByExample(Criteria example);
/**
* 根据主键删除记录
*/
int deleteByPrimaryKey(QrtzSimpleTriggersKey key);
/**
* 保存记录,不管记录里面的属性是否为空
*/
int insert(QrtzSimpleTriggers record);
/**
* 保存属性不为空的记录
*/
int insertSelective(QrtzSimpleTriggers record);
/**
* 根据条件查询记录集
*/
List<QrtzSimpleTriggers> selectByExample(Criteria example);
/**
* 根据主键查询记录
*/
QrtzSimpleTriggers selectByPrimaryKey(QrtzSimpleTriggersKey key);
/**
* 根据条件更新属性不为空的记录
*/
int updateByExampleSelective(@Param("record") QrtzSimpleTriggers record, @Param("example") Criteria example);
/**
* 根据条件更新记录
*/
int updateByExample(@Param("record") QrtzSimpleTriggers record, @Param("example") Criteria example);
/**
* 根据主键更新属性不为空的记录
*/
int updateByPrimaryKeySelective(QrtzSimpleTriggers record);
/**
* 根据主键更新记录
*/
int updateByPrimaryKey(QrtzSimpleTriggers record);
} | gpl-2.0 |
alarulrajan/CodeFest | src/com/technoetic/xplanner/security/module/ntlm/NtlmLoginModule.java | 5067 | package com.technoetic.xplanner.security.module.ntlm;
import java.util.Map;
import javax.security.auth.Subject;
import javax.servlet.http.HttpServletRequest;
import jcifs.smb.SmbAuthException;
import jcifs.smb.SmbException;
import org.apache.log4j.Logger;
import com.technoetic.xplanner.security.AuthenticationException;
import com.technoetic.xplanner.security.LoginModule;
import com.technoetic.xplanner.security.module.LoginSupport;
import com.technoetic.xplanner.security.module.LoginSupportImpl;
/**
* The Class NtlmLoginModule.
*/
public class NtlmLoginModule implements LoginModule {
/** The domain controller. */
private String domainController;
/** The domain. */
private String domain;
/** The name. */
private String name;
/** The log. */
private transient Logger log = Logger.getLogger(this.getClass());
/** The support. */
transient LoginSupport support = new LoginSupportImpl();
/** The helper. */
transient NtlmLoginHelper helper = new NtlmLoginHelperImpl();
/** The Constant DOMAIN_KEY. */
public static final String DOMAIN_KEY = "domain";
/** The Constant CONTROLLER_KEY. */
public static final String CONTROLLER_KEY = "controller";
/**
* Instantiates a new ntlm login module.
*
* @param loginSupport
* the login support
* @param helper
* the helper
*/
public NtlmLoginModule(final LoginSupport loginSupport,
final NtlmLoginHelper helper) {
this.support = loginSupport;
this.helper = helper;
}
/* (non-Javadoc)
* @see com.technoetic.xplanner.security.LoginModule#setOptions(java.util.Map)
*/
@Override
public void setOptions(final Map options) {
this.domain = options.get(NtlmLoginModule.DOMAIN_KEY) != null ? (String) options
.get(NtlmLoginModule.DOMAIN_KEY) : "YANDEX";
this.domainController = options.get(NtlmLoginModule.CONTROLLER_KEY) != null ? (String) options
.get(NtlmLoginModule.CONTROLLER_KEY) : this.domain;
this.log.debug("initialized");
}
/* (non-Javadoc)
* @see com.technoetic.xplanner.security.LoginModule#authenticate(java.lang.String, java.lang.String)
*/
@Override
public Subject authenticate(final String userId, final String password)
throws AuthenticationException {
this.log.debug(LoginModule.ATTEMPTING_TO_AUTHENTICATE + this.getName()
+ " (" + userId + ")");
try {
this.helper.authenticate(userId, password, this.domainController,
this.domain);
} catch (final SmbAuthException sae) {
this.log.error("NT domain did not authenticate user " + userId);
throw new AuthenticationException(
LoginModule.MESSAGE_AUTHENTICATION_FAILED_KEY);
} catch (final SmbException se) {
this.log.error("SmbException while authenticating " + userId, se);
throw new AuthenticationException(
LoginModule.MESSAGE_SERVER_ERROR_KEY);
} catch (final java.net.UnknownHostException e) {
this.log.error("UnknownHostException while authenticating "
+ userId, e);
throw new AuthenticationException(
LoginModule.MESSAGE_SERVER_NOT_FOUND_KEY);
}
this.log.info("NT domain authenticated user " + userId);
final Subject subject = this.support.createSubject();
this.log.debug("looking for user: " + userId);
this.support.populateSubjectPrincipalFromDatabase(subject, userId);
this.log.debug(LoginModule.AUTHENTICATION_SUCCESFULL + this.getName());
return subject;
}
/* (non-Javadoc)
* @see com.technoetic.xplanner.security.LoginModule#isCapableOfChangingPasswords()
*/
@Override
public boolean isCapableOfChangingPasswords() {
return false;
}
/* (non-Javadoc)
* @see com.technoetic.xplanner.security.LoginModule#changePassword(java.lang.String, java.lang.String)
*/
@Override
public void changePassword(final String userId, final String password)
throws AuthenticationException {
throw new UnsupportedOperationException(
"change Password not implemented");
}
/* (non-Javadoc)
* @see com.technoetic.xplanner.security.LoginModule#logout(javax.servlet.http.HttpServletRequest)
*/
@Override
public void logout(final HttpServletRequest request)
throws AuthenticationException {
request.getSession().invalidate();
}
/* (non-Javadoc)
* @see com.technoetic.xplanner.security.LoginModule#getName()
*/
@Override
public String getName() {
return this.name;
}
/* (non-Javadoc)
* @see com.technoetic.xplanner.security.LoginModule#setName(java.lang.String)
*/
@Override
public void setName(final String name) {
this.name = name;
}
}
| gpl-2.0 |
bob7l/IPortal | src/me/minebuilders/portal/listeners/CommandListener.java | 1513 | package me.minebuilders.portal.listeners;
import java.util.ArrayList;
import java.util.List;
import me.minebuilders.portal.Util;
import me.minebuilders.portal.commands.*;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
public class CommandListener implements CommandExecutor {
private List<BaseCmd> cmds = new ArrayList<BaseCmd>();
public CommandListener() {
cmds.add(new WandCmd());
cmds.add(new CreateCmd());
cmds.add(new SetToCmd());
cmds.add(new RefreshCmd());
cmds.add(new DeleteCmd());
cmds.add(new ToggleCmd());
cmds.add(new ListCmd());
cmds.add(new TpCmd());
}
public boolean onCommand(CommandSender s, Command command, String label, String[] args) {
if (args.length == 0 || getCmdInstance(args[0]) == null) {
s.sendMessage(ChatColor.DARK_AQUA + "-------------(" + ChatColor.AQUA + ChatColor.BOLD + "Your IPortal Commands" + ChatColor.DARK_AQUA + ")-------------");
for (BaseCmd cmd : cmds) {
if (Util.hp(s, cmd.cmdName)) s.sendMessage(ChatColor.DARK_RED + " - " + cmd.sendHelpLine());
}
s.sendMessage(ChatColor.DARK_AQUA + "---------------------------------------------------");
} else getCmdInstance(args[0]).processCmd(s, args);
return true;
}
private BaseCmd getCmdInstance(String s) {
for (BaseCmd cmd : cmds) {
if (cmd.cmdName.equalsIgnoreCase(s)) {
return cmd;
}
}
return null;
}
} | gpl-2.0 |
EldadDor/AnnoRefPlugin | src/main/java/com/idi/intellij/plugin/query/annoref/common/AnnoRefClassPsiElement.java | 1019 | /*
* User: eldad.Dor
* Date: 28/06/2014 23:19
*
* Copyright (2005) IDI. All rights reserved.
* This software is a proprietary information of Israeli Direct Insurance.
* Created by IntelliJ IDEA.
*/
package com.idi.intellij.plugin.query.annoref.common;
import com.intellij.navigation.ItemPresentation;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
/**
* @author eldad
* @date 28/06/2014
*/
public class AnnoRefClassPsiElement extends AnnoRefPsiElement {
public AnnoRefClassPsiElement(PsiElement psiAnnotation) {
super(psiAnnotation);
}
@Override
public ItemPresentation getPresentation() {
return new ItemPresentation() {
@Nullable
@Override
public String getPresentableText() {
return psiElement.getText();
}
@Nullable
@Override
public String getLocationString() {
return psiElement.getParent().getText();
}
@Nullable
@Override
public Icon getIcon(boolean open) {
return null;
}
};
}
} | gpl-2.0 |
Adrian-AGM/fp | src/test/java/fp/CalculatorTest.java | 3456 | package fp;
import static fp.Calculator.checkMyBet;
import static fp.Calculator.divisors;
import static fp.Calculator.isLeapYear;
import static fp.Calculator.isValidDate;
import static fp.Calculator.sin;
import static fp.Calculator.speakToMe;
import static fp.Calculator.stepThisNumber;
import static org.junit.Assert.assertArrayEquals;
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;
import java.util.Arrays;
import org.junit.Test;
public class CalculatorTest {
@Test
public void testSin() {
assertNotNull(sin(0));
assertEquals(sin(30), Double.valueOf(0.5));
assertEquals(sin(90), Double.valueOf(1));
assertEquals(sin(270), Double.valueOf(-1));
assertEquals(sin(810), Double.valueOf(1));
System.out.println("1P");
}
@Test
public void testStepThisNumber() {
assertNotNull(stepThisNumber(0, 0));
assertArrayEquals(stepThisNumber(5, 1), new int[] { 4, 3, 2, 1 });
assertArrayEquals(stepThisNumber(5, 2), new int[] { 3, 1 });
assertArrayEquals(stepThisNumber(12, 3), new int[] { 9, 6, 3 });
System.out.println("1P");
}
@Test
public void testDivisors() {
assertNull(divisors(0));
assertArrayEquals(divisors(1), new int[] { 1 });
assertArrayEquals(divisors(12), new int[] { 12, 6, 4, 3, 2, 1 });
assertArrayEquals(divisors(20), new int[] { 20, 10, 5, 4, 2, 1 });
System.out.println("1P");
}
@Test
public void testCheckMyBet() {
assertNotNull(checkMyBet(null, null));
assertEquals(
checkMyBet(Arrays.asList(1, 2, 3, 4, 5, 6),
Arrays.asList(1, 2, 3, 4, 5, 6)), Integer.valueOf(6));
assertEquals(
checkMyBet(Arrays.asList(2, 1, 4, 3, 6, 5),
Arrays.asList(1, 2, 3, 4, 5, 6)), Integer.valueOf(0));
assertEquals(
checkMyBet(Arrays.asList(1, 2, 3, 4, 5, 6),
Arrays.asList(5, 5, 5, 5, 5, 5)), Integer.valueOf(1));
assertEquals(
checkMyBet(Arrays.asList(1, 2, 3, 4, 7, 6),
Arrays.asList(5, 5, 5, 5, 5, 5)), Integer.valueOf(0));
assertEquals(
checkMyBet(Arrays.asList(1, 1, 2, 2, 3, 3),
Arrays.asList(6, 6, 2, 5, 3, 5)), Integer.valueOf(2));
System.out.println("1P");
}
@Test
public void testSpeakToMe() {
assertNotNull(speakToMe(0));
assertEquals(speakToMe(0), "Cero");
assertEquals(speakToMe(10), "Diez");
assertEquals(speakToMe(20), "Veinte");
assertEquals(speakToMe(60), "Sesenta");
assertEquals(speakToMe(61), "Sesenta y uno");
assertEquals(speakToMe(90), "Noventa");
assertEquals(speakToMe(93), "Noventa y tres");
System.out.println("2P");
}
@Test
public void testIsLeapYear() {
assertNotNull(isLeapYear(""));
assertTrue(isLeapYear("01-01-1904"));
assertTrue(isLeapYear("01-01-1928"));
assertFalse(isLeapYear("01-01-2100"));
assertTrue(isLeapYear("01-01-2000"));
System.out.println("1P");
}
@Test
public void testIsValidDate() {
assertNotNull(isValidDate(""));
assertTrue(isValidDate("01-01-0001"));
assertTrue(isValidDate("31-12-2015"));
assertFalse(isValidDate(""));
assertFalse(isValidDate("asdasd"));
assertFalse(isValidDate("21-12"));
assertFalse(isValidDate("12-2000"));
assertFalse(isValidDate("00-12-2000"));
assertFalse(isValidDate("32-12-2000"));
assertFalse(isValidDate("31-13-2000"));
assertFalse(isValidDate("01-00-2000"));
assertFalse(isValidDate("01-01-0000"));
System.out.println("2P");
}
}
| gpl-2.0 |
klst-com/metasfresh | de.metas.document.archive/de.metas.document.archive.base/src/main/java/de/metas/document/archive/api/impl/DocOutboundProducerService.java | 3632 | package de.metas.document.archive.api.impl;
/*
* #%L
* de.metas.document.archive.base
* %%
* Copyright (C) 2015 metas GmbH
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.ReentrantLock;
import org.adempiere.util.Check;
import de.metas.document.archive.api.IDocOutboundProducer;
import de.metas.document.archive.api.IDocOutboundProducerService;
import de.metas.document.archive.model.I_C_Doc_Outbound_Config;
/**
* Default implementation of {@link IDocOutboundProducerService}
*
* @author tsa
*
*/
public class DocOutboundProducerService implements IDocOutboundProducerService
{
// private static final transient Logger logger = CLogMgt.getLogger(DocOutboundProducerService.class);
/**
* Map of Doc Outbound Producers (C_Doc_Outbound_Config_ID -> DocOutboundProducerValidator)
*/
private final Map<Integer, IDocOutboundProducer> outboundProducers = new HashMap<Integer, IDocOutboundProducer>();
private final ReentrantLock outboundProducersLock = new ReentrantLock();
public DocOutboundProducerService()
{
super();
}
@Override
public void registerProducer(final IDocOutboundProducer producer)
{
outboundProducersLock.lock();
try
{
registerProducer0(producer);
}
finally
{
outboundProducersLock.unlock();
}
}
private void registerProducer0(final IDocOutboundProducer producer)
{
Check.assumeNotNull(producer, "producer not null");
final I_C_Doc_Outbound_Config config = producer.getC_Doc_Outbound_Config();
Check.assumeNotNull(config, "Producer {} shall have a config", producer);
unregisterProducerByConfig0(config);
producer.init(this);
outboundProducers.put(config.getC_Doc_Outbound_Config_ID(), producer);
}
@Override
public void unregisterProducerByConfig(final I_C_Doc_Outbound_Config config)
{
outboundProducersLock.lock();
try
{
unregisterProducerByConfig0(config);
}
finally
{
outboundProducersLock.unlock();
}
}
private void unregisterProducerByConfig0(final I_C_Doc_Outbound_Config config)
{
Check.assumeNotNull(config, "config not null");
final int configId = config.getC_Doc_Outbound_Config_ID();
final IDocOutboundProducer producer = outboundProducers.get(configId);
if (producer == null)
{
// no producer was not registered for given config, nothing to unregister
return;
}
producer.destroy(this);
outboundProducers.remove(configId);
}
private List<IDocOutboundProducer> getProducersList()
{
final List<IDocOutboundProducer> producersList = new ArrayList<IDocOutboundProducer>(outboundProducers.values());
return producersList;
}
@Override
public void createDocOutbound(final Object model)
{
Check.assumeNotNull(model, "model not null");
for (final IDocOutboundProducer producer : getProducersList())
{
if (!producer.accept(model))
{
continue;
}
producer.createDocOutbound(model);
}
}
}
| gpl-2.0 |