Added: directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsException.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsException.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsException.java (added)
+++ directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsException.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,77 @@
+/*
+ * 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.safehaus.sms;
+
+
+/**
+ * An exception denoting a failure with the SMS system.
+ *
+ * @author <a href="mailto:akarasulu@safehaus.org">Alex Karasulu</a>
+ * @version $Rev$
+ */
+public class SmsException extends Exception
+{
+ private static final long serialVersionUID = 1L;
+ /** if an error code is unavailable we set it to -1 */
+ private static final int UNAVAILABLE = -1;
+ /** the error code associated with this exception or -1 if none */
+ private final int errorCode;
+
+
+ /**
+ * Creates an SmsException with an errorCode.
+ *
+ * @param errorCode the provider specific error code associated with this exception
+ */
+ public SmsException( int errorCode )
+ {
+ this.errorCode = errorCode;
+ }
+
+
+ /**
+ * Creates an SmsException without an error code.
+ */
+ public SmsException()
+ {
+ this.errorCode = UNAVAILABLE;
+ }
+
+
+ /**
+ * Creates an SmsException without an error code but with a message.
+ */
+ public SmsException( String msg )
+ {
+ super( msg );
+ this.errorCode = UNAVAILABLE;
+ }
+
+
+ /**
+ * Gets the error code associated with this exception or -1 if none is available.
+ *
+ * @return a non-negative error code or -1 if none is available
+ */
+ public int getErrorCode()
+ {
+ return errorCode;
+ }
+}
Added: directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsMessage.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsMessage.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsMessage.java (added)
+++ directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsMessage.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,70 @@
+/*
+ * 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.safehaus.sms;
+
+
+/**
+ * A simple SMS text message.
+ *
+ * @author <a href="mailto:akarasulu@safehaus.org">Alex Karasulu</a>
+ * @version $Rev$
+ */
+public class SmsMessage
+{
+ /** the text body of the SMS message */
+ private String text;
+ /** the destination phone number to send the message to */
+ private String destination;
+
+
+ /**
+ * Creates a simple SMS message with a destination and a text body.
+ *
+ * @param destination the cell phone number using the full international number
+ * @param text the message body to send
+ */
+ public SmsMessage( String destination, String text )
+ {
+ this.text = text;
+ this.destination = destination;
+ }
+
+
+ /**
+ * Gets the body of the SMS text.
+ *
+ * @return the body of the SMS text
+ */
+ public String getText()
+ {
+ return text;
+ }
+
+
+ /**
+ * Gets the destination phone number.
+ *
+ * @return the phone number to send the message to
+ */
+ public String getDestination()
+ {
+ return destination;
+ }
+}
Added: directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsSession.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsSession.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsSession.java (added)
+++ directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsSession.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,88 @@
+/*
+ * 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.safehaus.sms;
+
+
+import java.io.IOException;
+
+
+/**
+ * An SMS session interface is required to send SMS messages. Gateways require a
+ * an authenticated session to send SMS messages. A session can be used repeatedly
+ * to send SMS messages especially if they are keep alive enabled.
+ *
+ * @author <a href="mailto:akarasulu@safehaus.org">Alex Karasulu</a>
+ * @version $Rev$
+ */
+public interface SmsSession
+{
+ /**
+ * Sends an SMS message using this session.
+ *
+ * @param msg the SMS message to send
+ * @return the result of 0 for success or nonzero error code
+ * @throws SmsException
+ * @throws IOException
+ */
+ int sendMessage( SmsMessage msg ) throws SmsException, IOException;
+
+ /**
+ * Gets the unique session identifier associated with this SmsSession.
+ *
+ * @return the session identifier
+ */
+ String getSessionId();
+
+ /**
+ * Gets the transport type associated with this SmsMessage.
+ *
+ * @return the SMS message transport type
+ */
+ SmsTransportType getTransport();
+
+ /**
+ * Gets the name of the provider/gateway user account this session is associated with.
+ *
+ * @return the name of the user account
+ */
+ String getUser();
+
+ /**
+ * Gets the application identifier associated with this session. Multiple appss
+ * may be associated with the same user account.
+ *
+ * @return the application identifier associated with this session
+ */
+ String getApplicationId();
+
+ /**
+ * Checks to see if keep alives are enabled for this SMS session.
+ *
+ * @return true if keep alives are enabled for this session
+ */
+ boolean isKeepAliveEnabled();
+
+ /**
+ * Invalidates the session object.
+ *
+ * @return true if the session is invalidated, false otherwise
+ */
+ boolean invalidate();
+}
Added: directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsSessionFactory.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsSessionFactory.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsSessionFactory.java (added)
+++ directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsSessionFactory.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,231 @@
+/*
+ * 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.safehaus.sms;
+
+
+import java.io.IOException;
+
+
+/**
+ * An SMS session factory creates SmsSessions used to send SmsMessages.
+ *
+ * @author <a href="mailto:akarasulu@safehaus.org">Alex Karasulu</a>
+ * @version $Rev$
+ */
+public class SmsSessionFactory
+{
+ /** the name of the default concrete factory implementation to use */
+ private static final String DEFAULT_FACTORY = "org.safehaus.sms.smpp.SmppSmsSessionFactory";
+ /** a reusable instance of the default smss session factory */
+ private static SmsSessionFactory defaultInstance;
+
+
+ /**
+ * Gets a handle on an existing SmsSession using the session id.
+ *
+ * @param sessionId the unique identifier for the current session
+ * @return the SMS session object associated with the id
+ */
+ public SmsSession getSmsSession( String sessionId )
+ {
+ SmsSessionFactory overridden = getOverridenFactory();
+
+ if ( overridden == null )
+ {
+ return getDefaultInstance().getSmsSession( sessionId );
+ }
+
+ return getDefaultInstance().getSmsSession( sessionId );
+ }
+
+
+ /**
+ * Attempts to lookup the overrriden factory whose class name is supplied using
+ * the system property org.safehaus.sms.SmsSessionFactory. If the property is not
+ * specified then null is returned.
+ *
+ * @return the overriden factory or null if no override is specified
+ */
+ private SmsSessionFactory getOverridenFactory()
+ {
+ String override = System.getProperty( "org.safehaus.sms.SmsSessionFactory" );
+
+ if ( override != null )
+ {
+ try
+ {
+ return ( SmsSessionFactory ) Class.forName( override ).newInstance();
+ }
+ catch ( InstantiationException e )
+ {
+ e.printStackTrace();
+ }
+ catch ( IllegalAccessException e )
+ {
+ e.printStackTrace();
+ }
+ catch ( ClassNotFoundException e )
+ {
+ e.printStackTrace();
+ }
+ }
+
+ return null;
+ }
+
+
+ /**
+ * Gets the default instance creating it if need be.
+ *
+ * @return the default instance
+ */
+ private SmsSessionFactory getDefaultInstance()
+ {
+ if ( defaultInstance != null )
+ {
+ return defaultInstance;
+ }
+
+ try
+ {
+ defaultInstance = ( SmsSessionFactory ) Class.forName( DEFAULT_FACTORY ).newInstance();
+ }
+ catch ( InstantiationException e )
+ {
+ e.printStackTrace();
+ }
+ catch ( IllegalAccessException e )
+ {
+ e.printStackTrace();
+ }
+ catch ( ClassNotFoundException e )
+ {
+ e.printStackTrace();
+ }
+
+ return defaultInstance;
+ }
+
+
+ /**
+ * Gets an SMS session object for sending SMS messages. The transport used
+ * will be determined by the underlying SMS provider. The returned SmsSession
+ * may or may not have the keep alive feature enabled.
+ *
+ * @param user the username of the account the session is associated with
+ * @param password the password of the user
+ * @param applicationId the application identifier associated with the account
+ * @return an SMS session object for the specified parameters
+ */
+ public SmsSession getSmsSession( String user, String password, String applicationId )
+ throws SmsException, IOException
+ {
+ SmsSessionFactory overridden = getOverridenFactory();
+
+ if ( overridden == null )
+ {
+ return getDefaultInstance().getSmsSession( user, password, applicationId );
+ }
+
+ return getDefaultInstance().getSmsSession( user, password, applicationId );
+ }
+
+
+ /**
+ * Gets an SMS session object for sending SMS messages while requesting a
+ * specific transport type if it is available. There is no guarrantee the
+ * underlying provider supports the requested transport. No exception is thrown
+ * if the requested transport is unavailable. Instead some default transport is
+ * returned. Users should not presume their requests are satisfied.
+ *
+ * @param user the username of the account the session is associated with
+ * @param password the password of the user
+ * @param applicationId the application identifier associated with the account
+ * @param transport the SMS transport type requested
+ * @return an SMS session object for the specified parameters
+ */
+ public SmsSession getSmsSession( String user, String password, String applicationId,
+ SmsTransportType transport ) throws SmsException, IOException
+ {
+ SmsSessionFactory overridden = getOverridenFactory();
+
+ if ( overridden == null )
+ {
+ return getDefaultInstance().getSmsSession( user, password, applicationId, transport );
+ }
+
+ return getDefaultInstance().getSmsSession( user, password, applicationId, transport );
+ }
+
+
+ /**
+ * Gets an SMS session object for sending SMS messages with a transport type and
+ * keep alive request. If the underlying provider/gateway does not support the
+ * transport type or keep alives then these will not be set within the SmsSession
+ * object returned. Users should not presume their requests are satisfied.
+ *
+ * @param user the username of the account the session is associated with
+ * @param password the password of the user
+ * @param applicationId the application identifier associated with the account
+ * @param transport the SMS transport type requested
+ * @param enableKeepAlive if true requests the session be kept alive, false otherwise
+ * @return an SMS session object for the specified parameters
+ */
+ public SmsSession getSmsSession( String user, String password, String applicationId,
+ SmsTransportType transport, boolean enableKeepAlive )
+ throws SmsException, IOException
+ {
+ SmsSessionFactory overridden = getOverridenFactory();
+
+ if ( overridden == null )
+ {
+ return getDefaultInstance().getSmsSession( user, password, applicationId, transport, enableKeepAlive );
+ }
+
+ return getDefaultInstance().getSmsSession( user, password, applicationId, transport, enableKeepAlive );
+ }
+
+
+ /**
+ * Gets an SMS session object for sending SMS messages with the default transport
+ * type supported by the underlying provider while requesting keep alives to be
+ * enabled or disabled. If the underlying provider/gateway does not support the
+ * keep alives or the lack there of then these will not be set within the SmsSession
+ * object returned. Users should not presume their requests are satisfied.
+ *
+ * @param user the username of the account the session is associated with
+ * @param password the password of the user
+ * @param applicationId the application identifier associated with the account
+ * @param enableKeepAlive if true requests the session be kept alive, false otherwise
+ * @return an SMS session object for the specified parameters
+ */
+ public SmsSession getSmsSession( String user, String password, String applicationId,
+ boolean enableKeepAlive ) throws SmsException, IOException
+ {
+ SmsSessionFactory overridden = getOverridenFactory();
+
+ if ( overridden == null )
+ {
+ return getDefaultInstance().getSmsSession( user, password, applicationId, enableKeepAlive );
+ }
+
+ return getDefaultInstance().getSmsSession( user, password, applicationId, enableKeepAlive );
+ }
+}
Added: directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsTransportType.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsTransportType.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsTransportType.java (added)
+++ directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/SmsTransportType.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,77 @@
+/*
+ * 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.safehaus.sms;
+
+
+/**
+ * A type safe enumeration for SMS transport types.
+ *
+ * @author <a href="mailto:akarasulu@safehaus.org">Alex Karasulu</a>
+ * @version $Rev$
+ */
+public class SmsTransportType
+{
+ /** the HTTP transport type */
+ public final static SmsTransportType HTTP = new SmsTransportType( "http", 0 );
+ /** the HTTPS transport type */
+ public final static SmsTransportType HTTPS = new SmsTransportType( "https", 1 );
+ /** SMPP/TCP/IP Transport type */
+ public static final SmsTransportType SMPP = new SmsTransportType( "smpp", 2 );
+
+ /** the ordinal for this type safe enumeration */
+ private final int ordinal;
+ /** the scheme name for the transport protocol used */
+ private final String scheme;
+
+
+ /**
+ * Creates a type safe enumeration for SMS message transport types.
+ *
+ * @param scheme the scheme name for the transport protocol
+ * @param ordinal the ordinal for the type safe enumeration
+ */
+ private SmsTransportType( String scheme, int ordinal )
+ {
+ this.scheme = scheme;
+ this.ordinal = ordinal;
+ }
+
+
+ /**
+ * Gets the scheme name for the SMS message transport.
+ *
+ * @return the scheme name for the transport
+ */
+ public String getScheme()
+ {
+ return this.scheme;
+ }
+
+
+ /**
+ * Gets the ordinal for this type safe enumeration.
+ *
+ * @return the ordinal for this type safe enumeration
+ */
+ public int getOrdinal()
+ {
+ return this.ordinal;
+ }
+}
Added: directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/clickatell/ClickatellSmsSessionFactory.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/clickatell/ClickatellSmsSessionFactory.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/clickatell/ClickatellSmsSessionFactory.java (added)
+++ directory/trunks/triplesec/sms/src/main/java/org/safehaus/sms/clickatell/ClickatellSmsSessionFactory.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,238 @@
+/*
+ * 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.safehaus.sms.clickatell;
+
+
+import org.safehaus.sms.*;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.NameValuePair;
+import org.apache.commons.httpclient.methods.PostMethod;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.io.IOException;
+
+
+/**
+ * A session factory for the Clickatell gateway
+ *
+ * @author <a href="mailto:akarasulu@safehaus.org">Alex Karasulu</a>
+ * @version $Rev$
+ */
+public class ClickatellSmsSessionFactory extends SmsSessionFactory
+{
+ /** The default wrt keep alives */
+ private final static boolean KEEPALIVE_DEFAULT = true;
+ /** The default SMS transport type used by this SmsSessionFactory */
+ private final static SmsTransportType TRANSPORT_DEFAULT = SmsTransportType.HTTP;
+
+ /** A hash of session identifier strings to SmsSession instances */
+ private final HashMap map = new HashMap(3);
+
+
+ public SmsSession getSmsSession( String sessionId )
+ {
+ return ( SmsSession ) map.get( sessionId );
+ }
+
+
+ public SmsSession getSmsSession( String user, String password, String applicationId ) throws IOException
+ {
+ ClickatellSmsSession session = new ClickatellSmsSession();
+ session.setApplicationId( applicationId );
+ session.setUser( user );
+ session.setKeepAliveEnabled( KEEPALIVE_DEFAULT );
+ session.setTransport( TRANSPORT_DEFAULT );
+ session.setSessionId( authenticate( user, password, applicationId, TRANSPORT_DEFAULT ) );
+ return session;
+ }
+
+
+ public SmsSession getSmsSession( String user, String password, String applicationId,
+ SmsTransportType transport ) throws IOException
+ {
+ return getSmsSession( user, password, applicationId );
+ }
+
+
+ public SmsSession getSmsSession( String user, String password, String applicationId,
+ SmsTransportType transport, boolean enableKeepAlive ) throws IOException
+ {
+ return getSmsSession( user, password, applicationId );
+ }
+
+
+ public SmsSession getSmsSession( String user, String password, String applicationId,
+ boolean enableKeepAlive ) throws IOException
+ {
+ return getSmsSession( user, password, applicationId );
+ }
+
+
+ /**
+ * Authenticates the user and recovers a session identifier for SmsSession creation.
+ *
+ * @param user the user account for authenticating
+ * @param password the user credentials
+ * @param applicationId the applicationId associated with the SmsSession to be created
+ * @return the session identifier for the newly created session
+ * @throws IOException if there are failures connecting or getting a response
+ */
+ private String authenticate( String user, String password, String applicationId, SmsTransportType transport ) throws IOException
+ {
+ HttpClient client = new HttpClient();
+ PostMethod post = new PostMethod( transport.getScheme() + "://api.clickatell.com/"
+ + transport.getScheme() + "/auth" );
+ NameValuePair[] data =
+ {
+ new NameValuePair( "api_id", applicationId ),
+ new NameValuePair( "user", user ),
+ new NameValuePair( "password", password )
+ };
+ post.setRequestBody( data );
+ client.executeMethod( post );
+ return post.getResponseBodyAsString();
+ }
+
+
+ /**
+ * A Clickatell specific SmsSession.
+ */
+ class ClickatellSmsSession extends AbstractSmsSession
+ {
+ protected void setSessionId( String sessionId )
+ {
+ super.setSessionId( sessionId );
+ }
+
+
+ public boolean invalidate()
+ {
+ throw new RuntimeException( "Not implemented yet" );
+ }
+
+
+ protected void setTransport( SmsTransportType transport )
+ {
+ super.setTransport( transport );
+ }
+
+
+ protected void setUser( String user )
+ {
+ super.setUser( user );
+ }
+
+
+ protected void setApplicationId( String applicationId )
+ {
+ super.setApplicationId( applicationId );
+ }
+
+
+ protected void setKeepAliveEnabled( boolean isKeepAliveEnabled )
+ {
+ super.setKeepAliveEnabled( isKeepAliveEnabled );
+ }
+
+
+ public int sendMessage( SmsMessage msg ) throws SmsException, IOException
+ {
+ String scheme = getTransport().getScheme();
+ HttpClient client = new HttpClient();
+ PostMethod post = new PostMethod( scheme + "://api.clickatell.com/" + scheme + "/sendmsg" );
+
+ if ( ! isKeepAliveEnabled() )
+ {
+ throw new SmsException( "Without keep alive enabled you must use sendMessage() overload that requires the password" );
+ }
+ NameValuePair[] data =
+ {
+ new NameValuePair( "session_id", getSessionId() ),
+ new NameValuePair( "to", msg.getDestination() ),
+ new NameValuePair( "text", msg.getText() )
+ };
+ post.setRequestBody( data );
+ client.executeMethod( post );
+ String response = post.getResponseBodyAsString();
+
+ if ( response.indexOf( "ERR:" ) != -1 )
+ {
+ int errorCode = Integer.parseInt( response.split( "ERR: " )[1].split( "," )[0] );
+ throw new SmsException( errorCode );
+ }
+
+ return Integer.parseInt( response.split( "ID: " )[1] );
+ }
+ }
+
+
+ int ping( SmsSession session ) throws IOException
+ {
+ String scheme = session.getTransport().getScheme();
+ HttpClient client = new HttpClient();
+ PostMethod post = new PostMethod( scheme + "://api.clickatell.com/" + scheme + "/ping" );
+ NameValuePair[] data = { new NameValuePair( "session_id", session.getSessionId() ) };
+ post.setRequestBody( data );
+ client.executeMethod( post );
+ String response = post.getResponseBodyAsString();
+
+ if ( response.indexOf( "OK:" ) != -1 )
+ {
+ return 0;
+ }
+
+ return Integer.parseInt( response.split( "ERR: " )[1].split( "," )[0] );
+ }
+
+
+ class SessionKeepAlive implements Runnable
+ {
+ public void run()
+ {
+ try
+ {
+ System.out.println( "Waiting 10 minutes before keep alive ping" );
+ Thread.currentThread().wait( 600000 );
+ }
+ catch ( InterruptedException e )
+ {
+ e.printStackTrace();
+ }
+
+ Iterator list = map.values().iterator();
+ while ( list.hasNext() )
+ {
+ int errorCode = 0;
+ SmsSession session = ( SmsSession ) list.next();
+ try
+ {
+ errorCode = ping( session );
+ }
+ catch ( IOException e )
+ {
+ e.printStackTrace();
+ }
+
+ System.err.println( "Ping failed: encountered error code of " + errorCode );
+ }
+ }
+ }
+}
Added: directory/trunks/triplesec/sms/src/main/resources/log4j.properties
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/sms/src/main/resources/log4j.properties?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/sms/src/main/resources/log4j.properties (added)
+++ directory/trunks/triplesec/sms/src/main/resources/log4j.properties Tue Dec 12 07:23:31 2006
@@ -0,0 +1,14 @@
+log4j.rootLogger=ON, smppapiAppender
+
+log4j.appender.smppapiAppender=org.apache.log4j.ConsoleAppender
+log4j.appender.smppapiAppender.layout=org.apache.log4j.PatternLayout
+log4j.appender.smppapiAppender.layout.ConversionPattern=%d %-5p [%t] %c %m%n
+
+log4j.logger.ie.omk.smpp=ON
+log4j.logger.ie.omk.smpp=DEBUG
+
+log4j.logger.tests.ie.omk.smpp=ALL
+log4j.additivity.tests.ie.omk.smpp=true
+
+log4j.logger.ie.omk.smpp.examples=ALL, smppapiAppender
+log4j.additivity.ie.omk.smpp.examples=false
Added: directory/trunks/triplesec/sms/src/main/resources/smppapi.properties
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/sms/src/main/resources/smppapi.properties?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/sms/src/main/resources/smppapi.properties (added)
+++ directory/trunks/triplesec/sms/src/main/resources/smppapi.properties Tue Dec 12 07:23:31 2006
@@ -0,0 +1,45 @@
+#
+# Example properties file for the smppapi
+#
+
+#
+# Specify an 'in' buffer size of 6 kilobytes.
+#
+smppapi.net.buffersize_in = 6k
+
+#
+# Specify an 'out' buffer size of 8192 bytes (8 kilobytes)
+#
+smppapi.net.buffersize_out = 8192
+
+#
+# Flush the network link after every packet written out.
+#
+smppapi.net.autoflush = true
+
+#
+# Network link's read timeout, in milliseconds
+#
+smppapi.net.link_timeout = 120000
+
+#
+# Allow 3 i/o exceptions in the receiver thread before it gives up the ghost!
+#
+smppapi.connection.rcv_daemon.ioex_count = 3
+
+#
+# After sending a bind request, wait only this amount
+# of milliseconds for the response before giving up.
+# This setting is only valid in asynchronous mode.
+# Zero means wait forever.
+#
+smppapi.connection.bind_timeout = 180000
+
+#
+# Specify the event dispatcher to use in the API.
+#
+smppapi.event.dispatcher = ie.omk.smpp.event.ThreadedEventDispatcher
+
+smppapi.event.threaded_dispatcher.pool_size = 30
+
+smppapi.event.threaded_dispatcher.queue_size = 90
Added: directory/trunks/triplesec/sms/src/test/java/org/safehaus/sms/clickatell/ClickatellSmsSessionFactoryTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/sms/src/test/java/org/safehaus/sms/clickatell/ClickatellSmsSessionFactoryTest.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/sms/src/test/java/org/safehaus/sms/clickatell/ClickatellSmsSessionFactoryTest.java (added)
+++ directory/trunks/triplesec/sms/src/test/java/org/safehaus/sms/clickatell/ClickatellSmsSessionFactoryTest.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,52 @@
+/*
+ * 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.safehaus.sms.clickatell;
+
+
+import junit.framework.TestCase;
+
+import java.io.IOException;
+
+import org.safehaus.sms.SmsSession;
+import org.safehaus.sms.SmsMessage;
+import org.safehaus.sms.SmsException;
+
+
+/**
+ * Testcases for the ClickatellSmsSessionFactory.
+ *
+ * @author <a href="mailto:akarasulu@safehaus.org">Alex Karasulu</a>
+ * @version $Rev$
+ */
+public class ClickatellSmsSessionFactoryTest extends TestCase
+{
+ public void testPing() throws IOException, SmsException
+ {
+ ClickatellSmsSessionFactory factory = new ClickatellSmsSessionFactory();
+ SmsSession session = factory.getSmsSession( "akarasulu", "pointer123", "679294" );
+ assertNotNull( session );
+
+ int errorCode = -1;
+ //errorCode = factory.ping( session );
+ //assertTrue( errorCode == 0 );
+ errorCode = session.sendMessage( new SmsMessage( "19049826992", "Testing123" ) );
+ assertTrue( errorCode == 0 );
+ }
+}
Added: directory/trunks/triplesec/sms/unused/SmppSmsSessionFactory.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/sms/unused/SmppSmsSessionFactory.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/sms/unused/SmppSmsSessionFactory.java (added)
+++ directory/trunks/triplesec/sms/unused/SmppSmsSessionFactory.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,267 @@
+/*
+ * 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.safehaus.sms.smpp;
+
+
+import org.safehaus.sms.*;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.IOException;
+import java.net.UnknownHostException;
+import java.util.HashMap;
+
+import ie.omk.smpp.Connection;
+import ie.omk.smpp.Address;
+import ie.omk.smpp.BadCommandIDException;
+import ie.omk.smpp.message.SubmitSM;
+import ie.omk.smpp.message.SMPPPacket;
+import ie.omk.smpp.message.SubmitSMResp;
+import ie.omk.smpp.message.UnbindResp;
+
+
+/**
+ * A session factory that uses the Short Message Peer to Peer (SMPP) protocol
+ * to connect to a gateway and exchange SMS messages. These gateways are referred
+ * to as a Short Message Service Center (SMSC).
+ *
+ * @author <a href="mailto:akarasulu@safehaus.org">Alex Karasulu</a>
+ * @version $Rev$
+ */
+public class SmppSmsSessionFactory extends SmsSessionFactory
+{
+ private static final Log log = LogFactory.getLog( SmppSmsSessionFactory.class );
+ /** The default wrt keep alives */
+ private final static boolean KEEPALIVE_DEFAULT = true;
+ /** The default SMS transport type used by this SmsSessionFactory */
+ private final static SmsTransportType TRANSPORT_DEFAULT = SmsTransportType.SMPP;
+
+ /** A hash of session identifier strings to SmsSession instances */
+ private final HashMap map = new HashMap(3);
+
+
+ public SmsSession getSmsSession( String sessionId )
+ {
+ return ( SmsSession ) map.get( sessionId );
+ }
+
+
+ public SmsSession getSmsSession( String user, String password, String applicationId ) throws IOException
+ {
+ SmppSmsSession session = new SmppSmsSession( connect( user, password ) );
+ session.setApplicationId( applicationId );
+ session.setUser( user );
+ session.setKeepAliveEnabled( KEEPALIVE_DEFAULT );
+ session.setTransport( TRANSPORT_DEFAULT );
+ session.setSessionId( session.getConnection().toString() );
+ return session;
+ }
+
+
+ public SmsSession getSmsSession( String user, String password, String applicationId,
+ SmsTransportType transport ) throws IOException
+ {
+ return getSmsSession( user, password, applicationId );
+ }
+
+
+ public SmsSession getSmsSession( String user, String password, String applicationId,
+ SmsTransportType transport, boolean enableKeepAlive ) throws IOException
+ {
+ return getSmsSession( user, password, applicationId );
+ }
+
+
+ public SmsSession getSmsSession( String user, String password, String applicationId,
+ boolean enableKeepAlive ) throws IOException
+ {
+ return getSmsSession( user, password, applicationId );
+ }
+
+
+ private boolean disconnect( SmppSmsSession session )
+ {
+ Connection conn = session.getConnection();
+
+ if ( conn != null && conn.isBound() )
+ {
+ try
+ {
+ UnbindResp ubr = conn.unbind();
+
+ if ( ubr != null && ubr.getCommandStatus() == 0 )
+ {
+ log.info( "Successfully unbound from the SMSC" );
+ }
+ else if ( ubr != null )
+ {
+ log.warn( "There was an error unbinding." );
+ }
+ }
+ catch ( IOException e )
+ {
+ log.error( "failed to disconnect", e );
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+
+ private Connection connect( String username, String password )
+ {
+ Connection conn = null;
+ String host = System.getProperty( "org.safehaus.sms.smpp.host", "localhost" );
+ int port = Integer.parseInt( System.getProperty( "org.safehaus.sms.smpp.port", "2775" ) );
+
+ try
+ {
+ conn = new Connection( host, port, true );
+ }
+ catch ( UnknownHostException uhe )
+ {
+ log.fatal( "could not connect to host " + host + " on port " + port + " for SMPP connection", uhe );
+ System.exit(0);
+ }
+
+ boolean retry = false;
+
+ while ( ! retry )
+ {
+ try
+ {
+ conn.bind( Connection.TRANSMITTER, username, password, null );
+
+ while ( ! conn.isBound() )
+ {
+ try
+ {
+ Thread.sleep( 250 );
+ }
+ catch ( InterruptedException e )
+ {
+ e.printStackTrace();
+ }
+ }
+
+ retry = true;
+ }
+ catch ( IOException ioe )
+ {
+ try
+ {
+ Thread.currentThread().wait( 60 * 1000 );
+ }
+ catch ( InterruptedException ie )
+ {
+ log.error( "failed to wait on current thread", ie );
+ }
+ }
+ }
+
+ return conn;
+ }
+
+
+ /**
+ * A SmppSmsSessionFactory specific SmsSession.
+ */
+ class SmppSmsSession extends AbstractSmsSession
+ {
+ public final Connection conn;
+
+
+ SmppSmsSession( Connection conn )
+ {
+ this.conn = conn;
+ }
+
+
+ protected void setSessionId( String sessionId )
+ {
+ super.setSessionId( sessionId );
+ }
+
+
+ protected void setTransport( SmsTransportType transport )
+ {
+ super.setTransport( transport );
+ }
+
+
+ protected void setUser( String user )
+ {
+ super.setUser( user );
+ }
+
+
+ protected void setApplicationId( String applicationId )
+ {
+ super.setApplicationId( applicationId );
+ }
+
+
+ protected void setKeepAliveEnabled( boolean isKeepAliveEnabled )
+ {
+ super.setKeepAliveEnabled( isKeepAliveEnabled );
+ }
+
+
+ public int sendMessage( SmsMessage msg ) throws SmsException, IOException
+ {
+ // Submit a simple message
+ SubmitSM sm = null;
+ try
+ {
+ sm = ( SubmitSM ) conn.newInstance(SMPPPacket.SUBMIT_SM );
+ }
+ catch ( BadCommandIDException e )
+ {
+ log.error( "Submit command not recognized", e );
+ throw new SmsException( e.getMessage() );
+ }
+
+ sm.setDestination( new Address(0, 0, msg.getDestination() ) );
+ sm.setMessageText( msg.getText() );
+ SubmitSMResp smr = ( SubmitSMResp ) conn.sendRequest(sm);
+
+ if ( smr != null )
+ {
+ log.info( "Submitted message ID: " + smr.getMessageId() );
+ return smr.getCommandStatus();
+ }
+
+ return 0;
+ }
+
+
+ public Connection getConnection()
+ {
+ return conn;
+ }
+
+
+ public boolean invalidate()
+ {
+ return disconnect( this );
+ }
+ }
+}
Added: directory/trunks/triplesec/src/site/resources/images/big-picture.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/big-picture.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/big-picture.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/clear-pin.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/clear-pin.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/clear-pin.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/codehaus-small.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/codehaus-small.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/codehaus-small.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/create-otp.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/create-otp.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/create-otp.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/create-user.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/create-user.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/create-user.png
------------------------------------------------------------------------------
svn:executable =
Propchange: directory/trunks/triplesec/src/site/resources/images/create-user.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/file-db-server.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/file-db-server.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/file-db-server.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/gnome-db-indexes_16x16.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/gnome-db-indexes_16x16.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/gnome-db-indexes_16x16.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/gnome-mime-x-directory-smb-server.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/gnome-mime-x-directory-smb-server.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/gnome-mime-x-directory-smb-server.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/haus-keys.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/haus-keys.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/haus-keys.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/icon-applications.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/icon-applications.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/icon-applications.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/icon-server.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/icon-server.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/icon-server.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/icon-user-id.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/icon-user-id.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/icon-user-id.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/icon-user-keys.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/icon-user-keys.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/icon-user-keys.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/icon-user.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/icon-user.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/icon-user.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/inet-server.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/inet-server.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/inet-server.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/kpilot-db.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/kpilot-db.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/kpilot-db.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/legacy-network-server.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/legacy-network-server.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/legacy-network-server.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/linux.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/linux.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/linux.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/lock.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/lock.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/lock.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/lock2.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/lock2.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/lock2.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/mail-server.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/mail-server.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/mail-server.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/network-server.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/network-server.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/network-server.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/news-server.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/news-server.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/news-server.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/palm.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/palm.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/palm.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/pin-guard.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/pin-guard.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/pin-guard.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/pin-management.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/pin-management.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/pin-management.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/pin-reset.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/pin-reset.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/pin-reset.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/profile-create.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/profile-create.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/profile-create.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/profile-edit.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/profile-edit.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/profile-edit.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/profile-list.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/profile-list.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/profile-list.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/profile-ops.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/profile-ops.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/profile-ops.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/profile-view.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/profile-view.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/profile-view.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/safehaus-logo.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/safehaus-logo.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/safehaus-logo.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/safehaus.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/safehaus.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/safehaus.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/server.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/server.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/server.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/smb-server.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/smb-server.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/smb-server.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/sun-java.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/sun-java.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/sun-java.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/system-config-users.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/system-config-users.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/system-config-users.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/top-menu.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/top-menu.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/top-menu.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/unused-db-user.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/unused-db-user.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/unused-db-user.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/useage-patterns.dia
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/useage-patterns.dia?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/useage-patterns.dia
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/useage-patterns.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/useage-patterns.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/useage-patterns.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/user-id-db.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/user-id-db.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/user-id-db.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/images/web-server.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/images/web-server.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/resources/images/web-server.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/src/site/resources/js/dw_event.js
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/js/dw_event.js?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/src/site/resources/js/dw_event.js (added)
+++ directory/trunks/triplesec/src/site/resources/js/dw_event.js Tue Dec 12 07:23:31 2006
@@ -0,0 +1,34 @@
+/*************************************************************************
+ dw_event.js (version date Feb 2004)
+
+ This code is from Dynamic Web Coding at http://www.dyn-web.com/
+ See Terms of Use at http://www.dyn-web.com/bus/terms.html
+ regarding conditions under which you may use this code.
+ This notice must be retained in the code as is!
+*************************************************************************/
+
+var dw_event = {
+
+ add: function(obj, etype, fp, cap) {
+ cap = cap || false;
+ if (obj.addEventListener) obj.addEventListener(etype, fp, cap);
+ else if (obj.attachEvent) obj.attachEvent("on" + etype, fp);
+ },
+
+ remove: function(obj, etype, fp, cap) {
+ cap = cap || false;
+ if (obj.removeEventListener) obj.removeEventListener(etype, fp, cap);
+ else if (obj.detachEvent) obj.detachEvent("on" + etype, fp);
+ },
+
+ DOMit: function(e) {
+ e = e? e: window.event;
+ e.tgt = e.srcElement? e.srcElement: e.target;
+
+ if (!e.preventDefault) e.preventDefault = function () { return false; }
+ if (!e.stopPropagation) e.stopPropagation = function () { if (window.event) window.event.cancelBubble = true; }
+
+ return e;
+ }
+
+}
\ No newline at end of file
Added: directory/trunks/triplesec/src/site/resources/js/dw_tooltip.js
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/js/dw_tooltip.js?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/src/site/resources/js/dw_tooltip.js (added)
+++ directory/trunks/triplesec/src/site/resources/js/dw_tooltip.js Tue Dec 12 07:23:31 2006
@@ -0,0 +1,86 @@
+/*************************************************************************
+
+ dw_tooltip.js
+ version date: Nov 2003
+ requires: dw_event.js and dw_viewport.js
+
+ This code is from Dynamic Web Coding at http://www.dyn-web.com/
+ Copyright 2003 by Sharon Paine
+ See Terms of Use at http://www.dyn-web.com/bus/terms.html
+ regarding conditions under which you may use this code.
+ This notice must be retained in the code as is!
+
+*************************************************************************/
+
+var Tooltip = {
+ followMouse: true,
+ offX: 8,
+ offY: 12,
+
+ ready: false,
+ t1: null,
+ t2: null,
+ tipID: "tipDiv",
+ tip: null,
+
+ init: function() {
+ if ( document.createElement && document.body && typeof document.body.appendChild != "undefined" ) {
+ var el = document.createElement("DIV");
+ el.className = "tooltip";
+ el.id = this.tipID;
+ document.body.appendChild(el);
+ this.ready = true;
+ }
+ },
+
+ show: function(e, msg) {
+ if (this.t1) clearTimeout(this.t1);
+ if (this.t2) clearTimeout(this.t2);
+ this.tip = document.getElementById( this.tipID );
+ // set up mousemove
+ if (this.followMouse)
+ dw_event.add( document, "mousemove", this.trackMouse, true );
+ this.writeTip(""); // for mac ie
+ this.writeTip(msg);
+ viewport.getAll();
+ this.positionTip(e);
+ this.t1 = setTimeout("document.getElementById('" + Tooltip.tipID + "').style.visibility = 'visible'",200);
+ },
+
+ writeTip: function(msg) {
+ if ( this.tip && typeof this.tip.innerHTML != "undefined" ) this.tip.innerHTML = msg;
+ },
+
+ positionTip: function(e) {
+ var x = e.pageX? e.pageX: e.clientX + viewport.scrollX;
+ var y = e.pageY? e.pageY: e.clientY + viewport.scrollY;
+
+ if ( x + this.tip.offsetWidth + this.offX > viewport.width + viewport.scrollX )
+ x = x - this.tip.offsetWidth - this.offX;
+ else x = x + this.offX;
+
+ if ( y + this.tip.offsetHeight + this.offY > viewport.height + viewport.scrollY )
+ y = ( y - this.tip.offsetHeight - this.offY > viewport.scrollY )? y - this.tip.offsetHeight - this.offY : viewport.height + viewport.scrollY - this.tip.offsetHeight;
+ else y = y + this.offY;
+
+ this.tip.style.left = x + "px"; this.tip.style.top = y + "px";
+ },
+
+ hide: function() {
+ if (this.t1) clearTimeout(this.t1);
+ if (this.t2) clearTimeout(this.t2);
+ this.t2 = setTimeout("document.getElementById('" + this.tipID + "').style.visibility = 'hidden'",200);
+ // release mousemove
+ if (this.followMouse)
+ dw_event.remove( document, "mousemove", this.trackMouse, true );
+ this.tip = null;
+ },
+
+ trackMouse: function(e) {
+ e = dw_event.DOMit(e);
+ Tooltip.positionTip(e);
+ }
+
+}
+
+Tooltip.init();
\ No newline at end of file
Added: directory/trunks/triplesec/src/site/resources/js/dw_viewport.js
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/resources/js/dw_viewport.js?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/src/site/resources/js/dw_viewport.js (added)
+++ directory/trunks/triplesec/src/site/resources/js/dw_viewport.js Tue Dec 12 07:23:31 2006
@@ -0,0 +1,55 @@
+/*************************************************************************
+ dw_viewport.js version date Nov 2003
+
+ This code is from Dynamic Web Coding at http://www.dyn-web.com/
+ Copyright 2003 by Sharon Paine
+ See Terms of Use at http://www.dyn-web.com/bus/terms.html
+ regarding conditions under which you may use this code.
+ This notice must be retained in the code as is!
+*************************************************************************/
+
+viewport = {
+ getWinWidth: function () {
+ this.width = 0;
+ if (window.innerWidth) this.width = window.innerWidth - 18;
+ else if (document.documentElement && document.documentElement.clientWidth)
+ this.width = document.documentElement.clientWidth;
+ else if (document.body && document.body.clientWidth)
+ this.width = document.body.clientWidth;
+ },
+
+ getWinHeight: function () {
+ this.height = 0;
+ if (window.innerHeight) this.height = window.innerHeight - 18;
+ else if (document.documentElement && document.documentElement.clientHeight)
+ this.height = document.documentElement.clientHeight;
+ else if (document.body && document.body.clientHeight)
+ this.height = document.body.clientHeight;
+ },
+
+ getScrollX: function () {
+ this.scrollX = 0;
+ if (typeof window.pageXOffset == "number") this.scrollX = window.pageXOffset;
+ else if (document.documentElement && document.documentElement.scrollLeft)
+ this.scrollX = document.documentElement.scrollLeft;
+ else if (document.body && document.body.scrollLeft)
+ this.scrollX = document.body.scrollLeft;
+ else if (window.scrollX) this.scrollX = window.scrollX;
+ },
+
+ getScrollY: function () {
+ this.scrollY = 0;
+ if (typeof window.pageYOffset == "number") this.scrollY = window.pageYOffset;
+ else if (document.documentElement && document.documentElement.scrollTop)
+ this.scrollY = document.documentElement.scrollTop;
+ else if (document.body && document.body.scrollTop)
+ this.scrollY = document.body.scrollTop;
+ else if (window.scrollY) this.scrollY = window.scrollY;
+ },
+
+ getAll: function () {
+ this.getWinWidth(); this.getWinHeight();
+ this.getScrollX(); this.getScrollY();
+ }
+
+}
Added: directory/trunks/triplesec/src/site/site.xml
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/site.xml?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/src/site/site.xml (added)
+++ directory/trunks/triplesec/src/site/site.xml Tue Dec 12 07:23:31 2006
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <bannerRight>
+ <name>Safehaus</name>
+ <src>images/safehaus-logo.png</src>
+ <href>http://safehaus.org/</href>
+ </bannerRight>
+
+ <body>
+ <links>
+ <item name="Directory" href="http://directory.apache.org"/>
+ <item name="Codehaus" href="http://codehaus.org"/>
+ <item name="Safehaus" href="http://www.safehaus.org"/>
+ </links>
+
+ <menu name="Safehaus Triplesec">
+ <item name="Overview" href="/index.html"/>
+ <item name="Modules" href="/modules.html"/>
+ <item name="API Docs" href="/apidocs/index.html"/>
+ </menu>
+
+ ${reports}
+ </body>
+</project>
+
Added: directory/trunks/triplesec/src/site/xdoc/big-picture.dia
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/src/site/xdoc/big-picture.dia?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/src/site/xdoc/big-picture.dia
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
|